我正在使用以下代码:
ArrayList<String> tabs2 = new ArrayList<String> (WDS.browser.getWindowHandles());
WDS.browser.switchTo().window(tabs2.get(1));
它在WebDriver中使用驱动程序变量,但在WebDriver采样器中产生错误:
javax.script.ScriptException: In file: inline evaluation of: ``import org.openqa.selenium.*; import org.openqa.selenium.support.ui.*; import ja . . . '' Encountered "=" at line 24, column 25.
in inline evaluation of: ``import org.openqa.selenium.*; import org.openqa.selenium.support.ui.*; import ja . . . '' at line number 24
at bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:81)
at bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
at com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:76)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
at java.lang.Thread.run(Thread.java:745)
请帮忙。
答案 0 :(得分:0)
您正在使用一个非常过时的脚本引擎,该引擎不支持diamond operators,而{7}在{1}}和beanshell
处于Java 5语言级别时会引入Java 7,因此您不会能够使用现代语言功能。
您有以下选择:
删除钻石运营商,例如:
bsh