Mixing Selenium Into Your Load Scenario

Posted by Infocampus HR on July 9th, 2018

Selenium is an open source mechanized practical testing system, which gives numerous offices to web applications testing, crosswise over various programs and stages. Selenium isn't only a solitary apparatus yet a suite of programming. The two most critical parts of this suite are Selenium WebDriver and Selenium IDE. The first is an arrangement of dialect particular APIs for program computerization. The second is a Firefox addon that gives a "record and replay" highlight.

In this blog entry, when I will center around the Selenium WebDriver, which executes a cutting edge and stable way to deal with computerizing the program's activities. The WebDriver is intended to give an easier and compact programming interface. It was planned with the objective to supply an all around outlined protest arranged API, which gives enhanced help to cutting edge web-application testing issues.

This blog entry will demonstrate to improve a current situation with a Selenium WebDriver test content, to get another test content that blends distinctive test prerequisites. This is done when there is a need to recreate a portion of the customer side Selenium information streams under a heap. (When alluding to Selenium I mean the Selenium WebDriver).

What are the best test conditions for adding Selenium to your JMeter content?

  • When you have to recreate a program activity that is Selenium Training in Marathahalli Bangalore difficult to duplicate in JMeter. For instance, a bug identified with a javascript that is running a piece of the show.
  • When you can reuse an effectively created Selenium code (e.g. from the practical test stage)
  • When you don't have to track each HTTP ask for, since in the Selenium Sampler each progression displays just a single following record.

You may assume "I can execute Selenium and JMeter at same time by means of two charge interfaces without utilizing any module and accomplish a similar outcome".

The appropriate response is - yes, obviously you can yet you are executing two applications with no assurance of the time connection in the last report. The investigation of two last logs rather than one can be mistake inclined, in light of the fact that it is influenced by missing the time connection of the executed advances. What number of Selenium cycles were there? Furthermore, what number of HTTP Sampler ones?

How Does Selenium Integrate with JMeter?

JMeter has a module called "Selenium/WebDriver Support", which you can discover in the JMeter modules administrator. This module gives two segments to incorporating Selenium into a JMeter test content:

  • Driver Configs - an arrangement of JMeter setup segments, one for every Selenium upheld program (Firefox, Chrome, Internet Explorer and PhantomJS). Every design part requires that a particular Selenium WebDriver execution is given. The arrangement segment is executed just a single time in the extent of the string gathering, at setup, and free of the emphasess number. Toward the finish of its execution, a running case of the program is propelled under the control of the Selenium driver, through JMeter.
  • WebDriver Sampler - a JMeter sampler that executes activities on a program through the WebDriver. This sampler can  Best Selenium Institute in Marathahalli Bangalore incorporate a whole Selenium content, and therefore more client activities on the program can be performed. This sampler must be situated under a similar extent of the setup component that designates the Selenium WebDriver into JMeter, to determine the right one.

This is the test stream:

  • Two Thread Group parts begin together. One for a "general" JMeter content, the second one for the Selenium part of the test.
  • In the main cycle, "String Group Selenium" executes "jp@gc - Chrome Driver Config" (or some other program config) and the "WebDriver Sampler" part.
  • The "jp@gc - Chrome Driver Config" part begins a "Google Chrome" program occasion, noticeable on the work area.
  • The "WebDriver Sampler" part executes the code that alludes to the Selenium WebDriver. The Selenium WebDriver is settled in the Thread Group scope, so the code is executed in the Chrome program that was simply made.
  • After the "WebDriver Sampler's" first execution, Thread Group Selenium" begins a second emphasis (as per the test content) In the second cycle (and the accompanying ones) "jp@gc - Chrome Driver Config" does not perform anything, since Chrome still open and the "WebDriver Sampler" keeps on utilizing it.
  • Results can be seen in the Listeners

Keep in mind that, as asked for by Selenium, it's compulsory to give a total way to "chromedriver.exe", additionally called "WebDriver execution". The choice of "WebDriver execution" must be picked by the rendition of Google Chrome program introduced (e.g. 32bit or 64bit? running on Windows or Linux?...). For different programs, there are diverse compulsory Selenium necessities.

Now of the JMeter run, we ought to have a running program controlled by Selenium. Presently we will include the test rationale, by including the "WebDriver Sampler" into the string gathering:

Selenium in JMeter - Things to Consider

1. The WebDriver module is a Selenium wrapper. So a few highlights, particularly the WebDriver setup, are conceal. Vague circumstances/results ought to be broke down while considering this layered condition.

2. At the time this blog entry was composed, the main WebDriver Sample upheld dialect is Javascript. This confines the likelihood of reusing code and should be said something amid arranging.

3. The JMeter Webdriver module carries on the Selenium reliance jostle library of a more seasoned adaptation. This circumstance can possibly produce a similarity issue on more up to date programs with more established Selenium.

4. Assets utilization for a low rate of WebDriver tests can be contrasted and a huge number of HTTP tests.


Selenium is accepted the test computerization standard for web applications. The likelihood to blend it into a current JMeter content, increases the value of both your JMeter and Selenium tests. Notwithstanding, this meeting incorporates some disadvantage that ought to be assessed, to better characterize the exertion estimation and reachable objective.

Like it? Share it!

Infocampus HR

About the Author

Infocampus HR
Joined: December 10th, 2016
Articles Posted: 792

More by this author