Radio button does not get clicked in Selenium / Python

前端 未结 2 526
悲哀的现实
悲哀的现实 2021-01-15 05:56

Folks, this is driving me crazy. I have snippets like the following

相关标签:
2条回答
  • 2021-01-15 06:29

    Try using following Css selector:

            Actions action = new Actions(drive);
    
            action.moveToElement(drive.findElement( By.cssSelector("label > input[id^='M37_Q_']"))).build().perform();
    
            drive.findElement( By.cssSelector("label > input[id^='M37_Q_']")).click();
    
    0 讨论(0)
  • 2021-01-15 06:31

    Try this,

    driver.execute_script("arguments[0].checked = true;",element)
    

    You can also try by sending ENTER Key to the element.

    0 讨论(0)
提交回复
热议问题