Unable to click on a radio button in Selenium Webdriver

后端 未结 8 428
遥遥无期
遥遥无期 2021-01-23 21:11

I am learning Selenium Webdriver using Java. As a learning example, I tried to open MakeMyTrip, access International Flights page and click on One Way radio but

8条回答
  •  执念已碎
    2021-01-23 22:02

    Clicking on link sometimes might skip checking the radio button. Try clicking on the radio button (or input html tag) directly rather than clicking on the anchor tag. Here's an example -

    WebElement ele=driver.findElement(By.xpath("//input[@value='one_way']"));
    ele.click();
    

    Hope this helps.

提交回复
热议问题