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

user3538483

Here is my HTML code

<div class="selectCard_left">
<input id="26110162" class="default_shipping_address" type="radio" name="address" checked="true">
<span>Seleccionar como tarjeta predeterminada</span> 

I am trying with driver.findElement(By.id("17390233")).isSelected();, but I am not getting any value.

HemaSundar
driver.findElement(By.id("26110162")).isSelected();

or

String str = driver.findElement(By.id("26110162")).getAttribute("checked");
if (str.equalsIgnoreCase("true"))
{
    System.out.println("Checkbox selected");
}

if the ID is changing... use the following XPATH:

//input[span='Seleccionar como tarjeta predeterminada']

or

//input[@name='address' and @type='radio']

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

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

From Dev

Cannot check the radio button in selenium webdriver

From Dev

How to select radio button in selenium webdriver?

From Dev

Check for selected radio button

From Dev

Check if a radio button is selected

From Dev

How to check if radio buttons are selected on button click?

From Dev

How to select radio button using Selenium WebDriver with Java?

From Dev

how to select radio button in twitter by selenium webdriver with python?

From Dev

jQuery Check if a Radio Button is Selected or not

From Dev

How to check which radio button is selected if they're all runat server?

From Dev

How to check which radio button is selected if they're all runat server?

From Dev

Select a PrimeFaces radio button with Selenium Webdriver

From Dev

Unable to click on a radio button in Selenium Webdriver

From Dev

Selenium Webdriver: Click on radio button not working

From Dev

Unable to click on a radio button in Selenium Webdriver

From Dev

How to check a Favorite button, if it is clicked before? Selenium-Webdriver

From Dev

How to check radio button with radio button value

From Dev

How to style selected radio button

From Dev

JavaScript validation to check if a radio button is selected?

From Dev

Is there a way to check if the nth radio button is selected in jQuery?

From Dev

Check if Radio Button is clicked (Selected) - Smarty Template

From Dev

How do I check which radio button is selected when there are multiple radio buttons with the same name? (using jquery)

From Dev

check all radio list radio button has been selected or not on gridview

From Java

How to check a radio button with jQuery?

From Dev

How to check if a radio button is clicked?

From Dev

Select Radio Button in a group using Selenium WebDriver with Java

From Dev

how to check if input field has filled out and radio button has been selected

From Dev

How can I get selected values from radio button list and check box list?

From Java

How to get value of selected radio button?

Related Related

  1. 1

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

  2. 2

    Cannot check the radio button in selenium webdriver

  3. 3

    How to select radio button in selenium webdriver?

  4. 4

    Check for selected radio button

  5. 5

    Check if a radio button is selected

  6. 6

    How to check if radio buttons are selected on button click?

  7. 7

    How to select radio button using Selenium WebDriver with Java?

  8. 8

    how to select radio button in twitter by selenium webdriver with python?

  9. 9

    jQuery Check if a Radio Button is Selected or not

  10. 10

    How to check which radio button is selected if they're all runat server?

  11. 11

    How to check which radio button is selected if they're all runat server?

  12. 12

    Select a PrimeFaces radio button with Selenium Webdriver

  13. 13

    Unable to click on a radio button in Selenium Webdriver

  14. 14

    Selenium Webdriver: Click on radio button not working

  15. 15

    Unable to click on a radio button in Selenium Webdriver

  16. 16

    How to check a Favorite button, if it is clicked before? Selenium-Webdriver

  17. 17

    How to check radio button with radio button value

  18. 18

    How to style selected radio button

  19. 19

    JavaScript validation to check if a radio button is selected?

  20. 20

    Is there a way to check if the nth radio button is selected in jQuery?

  21. 21

    Check if Radio Button is clicked (Selected) - Smarty Template

  22. 22

    How do I check which radio button is selected when there are multiple radio buttons with the same name? (using jquery)

  23. 23

    check all radio list radio button has been selected or not on gridview

  24. 24

    How to check a radio button with jQuery?

  25. 25

    How to check if a radio button is clicked?

  26. 26

    Select Radio Button in a group using Selenium WebDriver with Java

  27. 27

    how to check if input field has filled out and radio button has been selected

  28. 28

    How can I get selected values from radio button list and check box list?

  29. 29

    How to get value of selected radio button?

HotTag

Archive