Selenium Java Selection的使用

用于向具有drop-down的选择框中输入内容

new Select(new ChromeDriver().findElement(By.cssSelector(" 。。。"))).selectByIndex(。。。);

new Select(new ChromeDriver().findElement(By.cssSelector(" 。。。"))).selectByValue(。。。);

new Select(new ChromeDriver().findElement(By.cssSelector(" 。。。"))).selectByVisibleText(。。。);

new Select(element).selectByVisibleText(str);

posted @ 2017-03-08 14:25  留白*  阅读(528)  评论(0编辑  收藏  举报