我想从下拉列表中选择元素,但在html中他们使用了 <img>
标记 . 我怎样才能实现目标?
这是我的代码中的东西:
public void country() {
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
Select country1 = new Select(country);
country1.selectByVisibleText("Canada");
}
运行testNg测试时出现此错误
org.openqa.selenium.support.ui.UnexpectedTagNameException:元素应该是“select”但是“img”
2 回答
如何找到下拉列表值.....使用此代码确定它的帮助你!
要么
使用以下代码: