>I was in this situation when i needed to get the value of an html attribute and i found the selenium.getattribute very handy …..
Okay the scenario was such that there was an element which is collapsible on the page and the only attibute for that element that indictated the status of the collapsible element was the ‘Class’. when the element was collapsed, the value of the class attribute was ‘asleep’ and when the element was expanded, the value of the class atttribute was ‘awake’.
The script used to determine the status of this element is
so if the id of my element is FundingClass and the attribute we are interested in is the 'Class'
The selenium code will be
Hope this helps someone .....