Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.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 如何在SeleniumWebDriver中单击剑道下拉列表?_Javascript_Html_Selenium - Fatal编程技术网

Javascript 如何在SeleniumWebDriver中单击剑道下拉列表?

Javascript 如何在SeleniumWebDriver中单击剑道下拉列表?,javascript,html,selenium,Javascript,Html,Selenium,我是SeleniumWebDriver的初学者,我无法单击某个特定的下拉列表,以便从下拉列表中选择值。以下是我的webdriver代码: driver.findElement( By.xpath("/html/body/div[16]/div[2]/div/div/div/div[1]/div[2]/span/span/span[1]")) .click(); 以下是我的HTML代码: 选择 点击下拉菜单,导入WebDriverWait()和elementtobelickable

我是SeleniumWebDriver的初学者,我无法单击某个特定的下拉列表,以便从下拉列表中选择值。以下是我的webdriver代码:

driver.findElement(
  By.xpath("/html/body/div[16]/div[2]/div/div/div/div[1]/div[2]/span/span/span[1]"))
    .click();
以下是我的HTML代码:


选择

点击下拉菜单,导入
WebDriverWait
()和
elementtobelickable
()并跟随
Xpath

new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.xpath("//span[text()='select']"))).click();