How to get an attribute value using selenium webdriver?



How to get an attribute value using selenium webdriver?..

Answer / Ramesh Singh Brijwal

You can get an attribute value of an element in Selenium WebDriver by calling the `getAttribute()` method on the WebElement instance. For example: `String attrValue = driver.findElement(By.id("element_id")).getAttribute("attribute_name");`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

Explain how to iterate through options in test script?

1 Answers  


Using selenium ide is it possible to get data from a particular html table cell?

1 Answers  


How does one submit a form in selenium?

1 Answers  


What is listeners in selenium webdriver?

1 Answers  


What can cause a selenium ide test to fail?

1 Answers  


What are the steps to run automation using selenium?

1 Answers  


Is QC and Jira used by both automation and as well as manual test engg or both tools are used by only manual test engg .

1 Answers   Thomson Reuters,


What are the testing kinds that can be supported by selenium?

1 Answers  


How can we check if an element is enabled for interaction on a web page?

1 Answers  


Mention why to choose python over java in selenium?

1 Answers  


What is the automation test?

1 Answers  


How colors could be handled in selenium webdriver?

1 Answers  


Categories