我正在尝试在JMeter中执行简单的testplan
TestPlan
-jp@gc - HtmlUnit Driver Config
Thread Group
-jp@gc - WebDriver Sampler
-View Results Tree
当有默认的jp @ gc - WebDriver Sampler(url是http://jmeter-plugins.org)时执行正常但是当我更改url时它会给出以下问题
org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function addEventListener in object [object HTMLDocument]. (http://rcsp.infoaxon.com/reliance-sign-theme/js/jquery-2.1.4.js#3451)
Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
System info: host: 'IAPC83', ip: '169.254.146.29', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_111'
Driver info: driver.version: HtmlUnitDriver
at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:554)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:530)
at jdk.nashorn.internal.scripts.Script$1$\^eval\_.:program(<eval>:2)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:446)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:403)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:399)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
at javax.script.AbstractScriptEngine.eval(Unknown Source)
at com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:86)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250)
at java.lang.Thread.run(Unknown Source)
请帮助!
答案 0 :(得分:0)
它可能是HtmlUnit驱动程序中的bug,您可以尝试更新到HtmlUnit的更新版本(截至目前为止的2.30,而JMeter随HtmlUnit 2.18一起提供,已有3年历史)。您可以下载最新版本的HtmlUnit并替换&#34; lib&#34;中的以下文件。 JMeter安装的文件夹:
有了他们的新版本。
如果它解决了您的问题,您可以将新的HtmlUnit与WebDriver Sampler一起使用,或者直接从JSR223 Sampler
使用HtmlUnit驱动程序API