Issue
I have some already working selenium scripts written in python. But, my current use case is to run them through jmeter.
I know I can add webdriver sampler in jmeter to integrate selenium with jmeter. But what if the scripts are written in python?
Is it possible or I need to convert my scripts to java?
Solution
It depends on what you are trying to achieve:
- If you need to simply "run" tests as they are, you can:
Download Jython jar
Put it under "lib" folder of your JMeter installation
Restart JMeter
See "jython/python" scripting option under JSR223 Test Elements
If you want your Selenium tests to be executed in parallel with existing JMeter test the easiest option would be using Taurus tool for executing both JMeter and Selenium at the same time.
If you need to use your Python Selenium tests for creating the load, converting them to JMeter format will be a much better idea as using real browsers memory footprint is huge therefore you won't be able to conduct more or less immense load.
set Selenium to use JMeter as a proxy
run JMeter's HTTP(S) Test Script Recorder
run your Selenium tests
perform correlation and parameterization if required
You can also check out How to Convert Selenium Scripts into the JMX article for an alternative approach assuming automated correlation.
Answered By - Dmitri T
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.