Selenium Htmlunit org.openqa.selenium.ElementNotVi

2019-09-19 16:42发布

问题:

enter image description here

Need support on issue selecting radio button, tried with javascript but not working.

WebElement Select4 = driver.findElement(By.name("IsGoldMember"));
Select4.click();

回答1:

Try driver.findElement(By.xpath("//input[@id='IsGoldMemberTrue']"));. It maybe the case that the name IsGoldMember is not unique on the web page.