0

Sorry if this has been answered already, i tried to search but could get the exact information i am after.

The issue: I am using JMeter to run some tests on a web application, as part of one of the flow, I under a first and surname in 2 input fields and i have link (Get userid) on clicking on the link the system will generate a user name. The user name is made up of first 4 letters from surname and first letter from the firsname and number at the end example: firstname is Test and surname is Environment, on clicking the get user id link the username will be generated as 'envit1' if 'envit1' is already existing then it would generated 'envirt2'

How do I simulate the click which generates the userid using jMeter.

Apologies but I am fairly new with JMeter, please ask if you need more infomratmation.

Many thanks in advance, Kay

3 Answers3

1

If you're new to JMeter the best way to get things done is recording your user ID generation steps using one of the following approaches:

You can see what requests are being sent and HTML responses using handy View Results Tree listener.

However if clicking on link isn't being recorded, it's being handled by client-side Javascript. JMeter is not a browser and isn't capable of executing Javascript so you'll have to use WebDriver Sampler as Releasematic suggests.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

You can use WebDriver Sampler but in each iteration it opens browser which may increase RAM usage. There is another option is to generate user id by running JS code in "JSR223 Sampler". With JSR223 Sampler you can run JS code but can't get access to DOM, so such JS code won't work:

function () {document.getElementById("edit-buttons-cleanup").click();};
Community
  • 1
  • 1
Bob Meliev
  • 1,198
  • 12
  • 17
0

You can install the plugin pack for the JMeter WebDriver sampler. Then, using some Javascript commands, you can start either a Firefox or a headless HTMLUnit and operate upon a webpage in a Jmeter step.

djangofan
  • 28,471
  • 61
  • 196
  • 289