Interview Questions

Selenium WebDriver - How to get element attribute using Selenium 2.0?

Selenium WebDriver Interview question and Answers


(Continued from previous question...)

Selenium WebDriver - How to get element attribute using Selenium 2.0?

WebElement el = driver.findElement(By.id("ElementID"));
//get test from element and stored in text variable
String attributeValue = el. getAttribute("AttributeName") ;

(Continued on next question...)

Other Interview Questions