Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/422.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jp@gc-JMeter中的WebDriver采样器_Javascript_Selenium Webdriver_Jmeter - Fatal编程技术网

Javascript jp@gc-JMeter中的WebDriver采样器

Javascript jp@gc-JMeter中的WebDriver采样器,javascript,selenium-webdriver,jmeter,Javascript,Selenium Webdriver,Jmeter,我只需要使用Jmeter中的webdriver采样器从网页的“智能搜索选择列表”(下拉列表)中选择一个值。我已经尝试使用它的一个picklist值的xpath&id,但它不起作用 “智能搜索选择列表”字段的xpath值为 “智能搜索选择列表”字段的xpath值是 .//*[@id='ui-id-21'] 如果我使用sendKeys方法,输入值只出现在文本框中,而不选择下面的值。并且,不会执行剩余脚本来填充网页中的剩余字段。您能否给出从“智能搜索选择列表”中选择值的解决方案 提前感谢为了与“下拉

我只需要使用Jmeter中的webdriver采样器从网页的“智能搜索选择列表”(下拉列表)中选择一个值。我已经尝试使用它的一个picklist值的xpath&id,但它不起作用

“智能搜索选择列表”字段的xpath值为

“智能搜索选择列表”字段的xpath值是

.//*[@id='ui-id-21']
如果我使用sendKeys方法,输入值只出现在文本框中,而不选择下面的值。并且,不会执行剩余脚本来填充网页中的剩余字段。您能否给出从“智能搜索选择列表”中选择值的解决方案

提前感谢

为了与“下拉列表”交互,人们通常会使用相关的WebDriver采样器代码:

var select = new org.openqa.selenium.support.ui.Select(WDS.browser.findElement(org.openqa.selenium.By.xpath(".//*[@id='j_id0:frm:searchDiagnosisId']")))
select.selectByValue("....")
有关更多WebDriver采样器提示和技巧,请参阅文章

var select = new org.openqa.selenium.support.ui.Select(WDS.browser.findElement(org.openqa.selenium.By.xpath(".//*[@id='j_id0:frm:searchDiagnosisId']")))
select.selectByValue("....")