简体   繁体   中英

jp@gc - WebDriver Sampler in JMeter

I just need to select a value from “smart search pick-list” (drop down list) from a web page using webdriver sampler in Jmeter. I already tried using one of it's pick-list value's xpath & id and it doesn't work.

xpath value for "smart search pick-list" field is

.//*[@id='j_id0:frm:searchDiagnosisId']

xpath value for "smart search pick-list" field's one of the value is

.//*[@id='ui-id-21']

If I use sendKeys method, input value just appearing in the text box and not selecting values below. And also remaining script are not executed to fill remaining fields in the webpage. Can you give a solution to select a value from “smart search pick-list”.

Thanks in advance

People mostly use Select class in order to interact with the "dropdown lists", the relevant WebDriver Sampler code will look somehow like:

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

See The WebDriver Sampler: Your Top 10 Questions Answered article for more WebDriver sampler tips and tricks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM