2

Im Using Selenium with JMeter's WebDriver Sampler and I want to test my app in Internet Exoplorer buy when I run it I got this error:

java.lang.IllegalStateException: The driver executable does not exist: C:\Users\PNB01\Desktop\JMETER\apache-jmeter-3.3\bin

And this is my script in WebDriver Sampler:

System.setProperty("webdriver.ie.driver", "C:/IEDriverServer.exe");
WDS.sampleResult.sampleStart()
WDS.browser.get('http://www.google.com')
WDS.sampleResult.sampleEnd()
Mr.Aw
  • 216
  • 3
  • 16
  • I think you can figure this out by just searching SO with "selenium" plus your error message. – Tim Biegeleisen Oct 09 '17 at 02:03
  • bro I need to set system property to JMeter not in java – Mr.Aw Oct 09 '17 at 02:05
  • Are you using the Jmeter Gui, if so try adding the Internet Explorer Driver Config to your thread group, and then set the path to the IE Driver. Assume that you are using the Selenium/Webdriver support plugin – smit9234 Oct 09 '17 at 16:08

2 Answers2

3

You have at least 3 ways of setting a JMeter Property:

  1. Add the relevant line to system.property file (lives in the "bin" folder of your JMeter installation)

    webdriver.ie.driver=C:/IEDriverServer.exe
    

    JMeter restart will be required to pick the property up

  2. Pass it to JMeter startup script via '-D command-line argument` like:

    jmeter -Dwebdriver.ie.driver=C:/IEDriverServer.exe -n -t ....
    
  3. If you want to run JavaScript in Java you need to provide the full package name of System class like:

    java.lang.System.setProperty('webdriver.ie.driver', 'C:/IEDriverServer.exe')
    

References:

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

Some encoding issue. I guess you have copy pasted the code from google.

Tip:

  1. Copy the code to some text editor and then copy paste the code to eclipse.
  2. If you are using eclipse use this command to change the encoding/format and it will work fine.

    command 1: crtl+a (to select all)

    command 2: ctrl+shift+f (to change the format to uft8 encoding)

Hope this helps. thanks.

santhosh kumar
  • 1,981
  • 1
  • 9
  • 28
  • bro i want to set system property in jmeter not in elicpse – Mr.Aw Oct 09 '17 at 02:56
  • Ok.. If the code that you have given in question, needs to be set in jmeter.., then the shortcut commands i have given might not work. I suggest you to delete your lines and try typing and executing it. – santhosh kumar Oct 09 '17 at 03:33