How to check if the radio button is selected or not in Selenium WebDriver?

后端 未结 3 930
别跟我提以往
别跟我提以往 2021-01-05 04:55

Here is my HTML code

3条回答
  •  萌比男神i
    2021-01-05 05:33

    .isSelected() function will returns you a boolean value "True" or "False" ,depending on that you can check the condition and enable or leave the radio button selected. driver.findElement(By.cssSelector("input[id='26110162']")).isSelected().

    Declare a boolean value and store the result then provide an if condiiton to validate

提交回复
热议问题