Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有一个奇怪的问题,在 firefox 16 和 selenuim webdriver 2.26.0 中,单选按钮没有被点击,之后:
driver.findElement(By.xpath("path_to_radio_button")).click();
没有例外,但也没有结果。在 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();