简体   繁体   中英

radio button can't be clicked by firefox driver

There is strange problem, in firefox 16, and selenuim webdriver 2.26.0, radio button not had been clicked, after:

driver.findElement(By.xpath("path_to_radio_button")).click();

There are no exceptions, but not result too. In Chrome it been clicked.

What can help to solve this problem?

Try to use this

IWebElement radio = driver.FindElement(By.ID(//radiobutton id));
  if(radio.Selected)
 {
    //do something here.
  }

or

   driver.findElement(By.xpath("//input[@type='radio' and @value='Radio2']")).isSelected();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM