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.
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.
Comments