javascript - 错误 : Jmeter: Typed variable declarati

我已经使用标准程序在 Windows 10 上安装了 J-meters,但是当我运行底部给出的代码时,它无法识别下面第一段中的行代码,并抛出下面第二段中给出的错误。 注意:另请参阅粘贴在底部的其他观察结果

Code of lines which the Jmeter is not recognizing:
//## Initaite the Packages
var pkg = JavaImporter(org.openqa.selenium, org.openqa.selenium.support.ui); //WebDriver classes- for Form Fillup
var support_ui = JavaImporter(org.openqa.selenium.support.ui.WebDriverWait); //WebDriver classes
var wait = new support_ui.WebDriverWait(WDS.browser, 20000);
Errors:
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect
1603175425470,10,jp@gc - WebDriver Sampler,500,"Sourced file: inline evaluation of: ``WDS.sampleResult.sampleStart();  //## Initaite the Packages var pkg = JavaImport . . . '' : Typed variable declaration : Class or variable not found: org.openqa.selenium : at Line: 4 : in file: inline evaluation of: ``WDS.sampleResult.sampleStart();  //## Initaite the Packages var pkg = JavaImport . . . '' : org .openqa .selenium 
 in inline evaluation of: ``WDS.sampleResult.sampleStart();  //## Initaite the Packages var pkg = JavaImport . . . '' at line number 4",For Each User Test 1-1,text,false,,1214,0,1,1,null,0,0,0
1603175425498,1,Debug Sampler,200,OK,For Each User Test 1-1,text,true,,386,0,1,1,null,0,0,0
Full Code/Script: 
WDS.sampleResult.sampleStart();

//## Initaite the Packages
var pkg = JavaImporter(org.openqa.selenium, org.openqa.selenium.support.ui); //WebDriver classes- for Form Fillup
var support_ui = JavaImporter(org.openqa.selenium.support.ui.WebDriverWait); //WebDriver classes
var wait = new support_ui.WebDriverWait(WDS.browser, 20000);

//WDS.sampleResult.sampleStart();
WDS.log.info("Test Script started");
WDS.browser.get("https://capacitytracker-dev.necsu.nhs.uk/");

var login_url = WDS.args[0];

// increase browser size, strangely this is required when running in headless mode 
WDS.browser.manage().window().setSize(new org.openqa.selenium.Dimension(1920, 1080));

WDS.log.info(login_url);
WDS.browser.get(login_url);

var homeurl= WDS.browser.geturl();

wait.until(pkg.ExpectedConditions.presenceOfElementLocated(pkg.By.id('Username')));

WDS.log.info(homeurl);
WDS.sampleResult.sampleEnd();

其他观察结果: 1.在用于语言的 Selenium Webdriver 脚本中,我没有看到 Java Script 选项。我 只有 Java 选项。(附上屏幕截图):[Language:Javascript not available] 2.当我运行 J-meter Webdriver 脚本时,出现以下错误:Window Defender 正在阻止 JDK 的某些功能。

最佳答案

我看到一些额外的空间替换了第一行

var pkg = JavaImporter(org.openqa.selenium, org.openqa.selenium.support.ui);

var pkg = JavaImporter(org.openqa.selenium,org.openqa.selenium.support.ui);

看看是否可行。

关于javascript - 错误 : Jmeter: Typed variable declaration : Class or variable not found: org. openqa.selenium:在第 4 行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64442579/

相关文章:

android - x + 宽度必须 <= bitmap.width()

reactjs - typescript 错误对象的类型为 'unknown'

python - 'google-api-python-client' distribution 在

reactjs - Chrome,Edge - 禁用字段的自动填充/自动完成

javascript - 在输入焦点上移动/动画占位符

css - 使用 Inset 的 React Native Complex Shadow

angular - 如何限制 NgSelect 下拉面板中显示的项目数?

python - 在 matplotlib 中分段更改 x 轴刻度

vue.js - 使用 vue 的故事书 - SassError : Undefined varia

html - 使一个 div 填充具有未指定尺寸的表格单元格的整个宽度和高度