Running Selenium tests in JMeter

19 Feb

To use Selenium Webdriver with JMeter install webdriver plugins

  • Add “Thread Group”
  • Add “Config Element” -> “HTTP Cookie Manager”, “Config Element” -> “jp@gc – Firefox Driver Config”
  • Add “Sampler” -> “jp@gc – Web Driver Sampler”
  • Add “Listener” -> “View Results Tree”
  • add "Thread Group" to your "Test Plan"
  • In Web Driver Sampler(2)  add the following code
var pkg = JavaImporter(org.openqa.selenium)
var support_ui = JavaImporter(
var conditions =
var wait=new support_ui.WebDriverWait(WDS.browser, 10)

wait.until(conditions.presenceOfElementLocated(pkg.By.linkText('More information...')))
var element=WDS.browser.findElement(pkg.By.linkText("More information..."))
  • Run the test

Note: if you find any issue with browser connection. Downgrade the firefox and try.( i tried with 25.0). Also by increasing the thread you can run multiple browser instance.


One Response to “Running Selenium tests in JMeter”

  1. glinius 06/28/2015 at 6:50 pm #

    Thanks for the information. In my turn I would recommend getting familiar with The WebDriver Sampler: Your Top 10 Questions Answered guide as WebDriver Sampler uses JavaScript as a language and even common things like wait for element, take screenshot or determine which browser versions are supported are not obvious and information on it is missing.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: