How to use select list in selenium?

前端 未结 4 1969
说谎
说谎 2020-12-20 12:58

I\'m trying to select an element from a select list in selenium using java with WebDriver - based syntax.

I\'ve got the select list by

    elements =         


        
4条回答
  •  有刺的猬
    2020-12-20 13:56

    element = driver.findElements(By.xpath("//form[@action='inquiry/']/p/select[@name='myselect']/option[*** your criteria ***]"));
    if (element != null) {
        element.click();
    }
    

    find the option, and then click it

提交回复
热议问题