有一个奇怪的问题,在firefox 16和selenuim webdriver 2.26.0中,单选按钮没有被单击,之后:
driver.findElement(By.xpath("path_to_radio_button")).click();
没有异常(exception),但也没有结果。 在 Chrome 中,它已被点击。
什么可以帮助解决这个问题?
最佳答案
尝试使用这个
IWebElement radio = driver.FindElement(By.ID(//radiobutton id));
if(radio.Selected)
{
//do something here.
}
或
driver.findElement(By.xpath("//input[@type='radio' and @value='Radio2']")).isSelected();
关于java - Firefox 驱动程序无法单击单选按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13791262/