JMeter does not have a built-in browser, unlike many functional-test tools, But it can run the browser and execute the steps.
We can automate the user actions in Jmeter by using sampler named as 'WebDriver Sampler'. Its the addon feature of Jmeter, you need to add jar to Jmeter library.
On adding you will see these new elements in Jmeter:
To add this Sampler, you need to add Jmeter plugin 'WebDriver' to your Jmeter.
You can download plugin from here:
This plugin also add some config elements, that will help in launching the browser session for your script.
Lets make a simple script and run it using Jmeter.
Open Jmeter and add following elements to it:
1) Thread Group
2) Config Element>> Firefox Driver Config.
3) Sampler>> WebDriver Sampler
4) Listener>> View Result Tree
Like this:
You don't need to configure 'Firefox Driver Config' for this test, will go with its default settings.
Now click 'WebDriver Sampler' and paste below code in it.
Like this:
Your simple script is ready, it will launch firefox and opens google in it.
We can automate the user actions in Jmeter by using sampler named as 'WebDriver Sampler'. Its the addon feature of Jmeter, you need to add jar to Jmeter library.
On adding you will see these new elements in Jmeter:
To add this Sampler, you need to add Jmeter plugin 'WebDriver' to your Jmeter.
You can download plugin from here:
This plugin also add some config elements, that will help in launching the browser session for your script.
Lets make a simple script and run it using Jmeter.
Open Jmeter and add following elements to it:
1) Thread Group
2) Config Element>> Firefox Driver Config.
3) Sampler>> WebDriver Sampler
4) Listener>> View Result Tree
Like this:
You don't need to configure 'Firefox Driver Config' for this test, will go with its default settings.
Now click 'WebDriver Sampler' and paste below code in it.
WDS.sampleResult.sampleStart()
WDS.browser.get('http://google.com')
WDS.sampleResult.sampleEnd()
WDS.browser.get('http://google.com')
WDS.sampleResult.sampleEnd()
Like this:
Your simple script is ready, it will launch firefox and opens google in it.
No comments:
Post a Comment