Selecting dropdown in WebDriverJs

后端 未结 15 931
星月不相逢
星月不相逢 2020-12-29 07:48

I have a dropdown box that I would like to select a value using WebDriverJS. I\'ve looked at the user guide below and could not find out how to do it

15条回答
  •  隐瞒了意图╮
    2020-12-29 08:08

    This should achieved by

    selectElem = driver.findElement(webdriver.By.id("vote"))
    selectElem.click()
    selectElem.findElement(webdriver.By.css("option[value='5']")).click()
    

提交回复
热议问题