Search code examples
jmeterjmeter-plugins

JMeter WebDriver Sampler Error for Java


By default, jp@gc - WebDriver Sampler has javascript as a Script Language.
As soon as I switch to java, I get this error message.

ReferenceError: "ImportPackage" is not defined in at line number 2.

I use JMeter 3.2 and Java 1.8.


Solution

  • There is a bug in the WebDriver Sampler plugin, you can report it via JMeter Plugins support forum. For the time being there is no fix so currently you have the following options:

    1. Ignore. This message can be annoying however it isn't critical and you can continue working.
    2. Switch to JavaScript language
    3. Downgrade to JMeter 3.1 and JDK 7 as Rhino JavaScript Engine used in JDK 6 and 7 has this ImportPackage function while Nashorn JavaScript Engine which comes with JDK8 doesn't.