Unable to click on a radio button in Selenium Webdriver

后端 未结 8 415
遥遥无期
遥遥无期 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 21:56

    As per my check, the specific radio button has following structure:

    
    
        
            
         ONE WAY
    
    
    

    So what you are gonna to click is not the tag a which contains 'ONE WAY' but the span inside. You may have a try to locate the span by using xpath

    "//a[text()='ONE WAY']/span[@class='radio_state']"
    

提交回复
热议问题