Search code examples
webdriverjmeterjmeter-plugins

JMeter Webdriver Sampler it opens the browser but won't go to the URL


I am doing a load, performance test on our website & i have found I can use the webdriver sampler which will simulate the user experience of interacting with the website whilst the server is under load, hence measuring the real user's experience at the same time. Also I cannot use the record on one of our pages because it uses GWT-RPC calls. So i am using the Webdriver sampler.

I have made a start and written some code. When i run the test plan the browser will open and it will just stay there on a blank screen.

Do you know why it is not going to the URL?

My set up is

Test Plan
  Thread Group
    HTTP Cookie Manager
    jp@gc - Firefox Driver Config
    jp@gc - Web Driver Sampler

Webdriver sampler has the following code:

var pkg = JavaImporter(org.openqa.selenium)
var support_ui = JavaImporter(org.openqa.selenium.support.ui.WebDriverWait)
var wait = new support_ui.WebDriverWait(WDS.browser, 5000)

WDS.sampleResult.sampleStart()
WDS.browser.get('http://riaz-pc.infoshare.local:8080/clearcore')
var userNameTxtBox = WDS.browser.findElement(pkg.By.id('unid'))
userNameTextBox.click()

WDS.log.info(WDS.name + ' has logged an entry');
WDS.sampleResult.sampleEnd()

Solution

  • Do you see anything that looks like an error in jmeter.log file? More than often it is being caused by mismatch of Firefox browser and Selenium libraries versions (you use FirefoxDriver, aren't you?)

    As per The WebDriver Sampler: Your Top 10 Questions Answered guide, the latest Firefox version supported is:

    • For JMeter Plugins 1.2.1 - Firefox 33
    • For JMeter Plugins 1.2.0 - Firefox 26

    Try determining which plugins / firefox version combination you are currently using and what needs to be changed and I believe that the problem will go away.