1

JMeter can be used for load testing etc. Also, it's possible to do functional testing as well. I know selenium scripts can be run in JMeter.

Why use selenium if most of the work can be done using JMeter?

Please note that I'm expecting an answer relating to such as advantages of selenium over JMeter, unique actions/tests can be performed in selenium and use of both tools other than one tool(JMeter)

3

According to JMeter project main page:

JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).

So you will not be able to assess client-side performance using JMeter and will not be able to conduct high loads using Selenium (or at least you will need many machines in order to kick off many real browsers)

The truth is somewhere in-between, i.e.

  1. Create main load on HTTP protocol level using JMeter (make sure to configure it to behave like a real browser in terms of

  2. At the same time you can run a Selenium test and measure page rendering speed, scripts execution speed, track page loading events, etc. JMeter can be integrated with Selenium using WebDriver Sampler plugin.
2

Why use selenium if most of the work can be done using jmeter?

It can't. Even if you run selenium script from JMeter you're using Selenium obviously (under the hood). Personally I find using selenium from Jmeter quite arguable. You get some value from parallelization and reporting framework that Jmeter provides, but you miss the comfort of general-purpose IDE when you develop your Selenium script using programming language you prefer.

  • Actually script is written inside jmeter not using selenium. Highly appreciate if you could change or update your answer depending on the previous sentence. – Joe Oct 25 '18 at 14:33
  • 1
    Hi Joe! I won't change my answer. Despite you write the script inside Jmeter, it then invokes selenium to perform the actions. – Alexey R. Oct 25 '18 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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