Categories

1 Answer

Aug 22, 2019
By using getAttribute(value);

It returns the value of the attribute passed as a parameter.

HTML:

<input name="nameSelenium" value="valueSelenium">SoftwareTestingMaterial</input>

1

<input name="nameSelenium" value="valueSelenium">SoftwareTestingMaterial</input>

Selenium Code:

String attributeValue = driver.findElement(By.name("nameSelenium")).getAttribute("value");

System.out.println("Available attribute value is :"+attributeValue);

Output: valueSelenium

1

2

3

String attributeValue = driver.findElement(By.name("nameSelenium")).getAttribute("value");

System.out.println("Available attribute value is :"+attributeValue);

Output: valueSelenium
Click here to read more about Selenium
Click here to read more about Insurance

Related questions

Madanswer
Aug 22, 2019 in Selenium
Aug 22, 2019 in Selenium
Aug 22, 2019 in Selenium
...