Using getAttribute in Selenium 2 Webdriver

In this example I will tell you how you can use selenium command getAttribute in Selenium 2 Webdriver. I had to use this as selenium.getAttribute was not working on Webdriver when I was using HtmlUnitDriver. It was working when I was using FirefoxDriver. I had to convert the selenium.getAttribute to make it work on both HtmlUnitDriver and FirefoxDriver.

Here is the HTML code I that I want to check:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>