【发布时间】:2019-01-18 00:16:54
【问题描述】:
我正在尝试测试是否选择了 ROUND TRIP。我可以看到 ROUND TRIP 被选中,但我仍然得到输出为 false 为什么?
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class IsSelected {
public static void main(String[] args) {
WebDriver f= new FirefoxDriver();
f.get("http://www.makemytrip.com/");
WebElement e = f.findElement(By.id("round_trip_button1"));
System.out.println(e.isSelected());
System.out.println(e.getText());
System.out.println(e.isDisplayed());
System.out.println(e.isEnabled());
}
}
【问题讨论】:
标签: java selenium selenium-webdriver