2

Can anyone help me out how to implement the following scenario using Jmeter, in this scenario N number of users should be able to log in at once and implement the same scenario at the same time?

I have already tried using recording option but it is not updating in the database.

To some HTTP requests, it is showing SSO issue.

Steps to reproduce:

  1. Login to the web application.
  2. A landing page is displayed.
  3. Two options displayed.
  4. Selecting one option, which will redirect to the specific landing page.
  5. From home page, we will search for the products.
  6. Selecting one product and it redirects to the customization page.
  7. In the customization page, we are inputting the values, updating the changes to the order.
  8. Finally completing the order with update changes in it.

Where the customize order will ask us to move into the cart or it will ask us to submit for approval.

2
  • Can you give the structure of your Jmeter test plan to understand the issue. To avoid the SSO issue, need to do parameterization of cookies in the http requests. In the test plan, HTTP cookie manager, cache manager should be added.
    – Bhavani
    Aug 6, 2017 at 9:17
  • This seems a 'typical' flow. But the recorder won't help as you would need to customize per customer, assuming the cookie and other parameters are different every time you run it. But you do need to provide a bit more information. Also remember that 'displaying' is a browser capability. Jmeter doesn't 'show' anything... look for tools as Fiddler to understand the actual message stream.
    – Ray Oei
    Dec 1, 2017 at 15:54

1 Answer 1

1

so, to achieve a particular number of users you first have to add a Thread Group or, better, a Concurrency Thread Group where you can specify your desired concurrency, say how many users you want JMeter to be simulating at the same time. You can also configure some ramp-up params there, check the component's reference for more details.

To implement the described flow, then, remember this one thing, as @Ray Oei said in his comment: if you're trying to simulate interaction between user and a website (which typically happens through a browser), then keep in mind that JMeter is not aware of what's displayed on the web page. The only thing you can do with JMeter is reproduce some HTTP requests (samplers in JMeter's jargon) that can simulate the interaction above described by your steps. Unless you create http requests for web pages and go through their content looking for what you want, scraping, doing regex extraction.

So first thing to do if you want to go with that is to figure out all the HTTP Requests that are needed and add them to the Thread Group, e.g.:

  • Login to the web application. -> create an HTTP Sampler for a POST request to some login endpoint (probably need to create some users first or store credentials somewhere). You will probably need to add some kind of post-processor to get a session-token or something that allows you to make subsequent requests as a logged-in user.
  • A landing page is displayed. -> You won't know that from Jmeter. You'll only be able to know if login was successful.
  • Two options displayed. -> You won't know that from Jmeter. The only thing you can do is make a request (another HTTP Sampler) to some url that should render the expected page and scrape its content with some POST Processor (like Regex Extractor).
  • Selecting one option, which will redirect to the specific landing page. -> You cannot "select" one option; once again, you need to figure out which url is called by selecting/clicking on that option, then create an HTTP Request sampler for that url.

And you go on like that. So you'll have a thread group to simulate how many users. Then you'll have multiple HTTP Requests/samplers to simulate the user's behaviour.

Once you're confident with that structure you can start grouping actions/samplers into controllers and control the flow with If Controllers or other components.

Here's an example: login, check balance; if balance low add money; then start getting data and posting data from / to the server.

enter image description here

Hope I cleared it out a bit. Have fun :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.