Please post your Web Driver questions in official Web Driver forum

Monday, September 7, 2009

Retrieving dynanic HTML Objects from selenium

We often come across situations of dynamic html objects where in HTML id/name of a page is not constant and some time we don't even get to have any constant part if HTML identifier. Of late I came across a page which had lots of check boxes but no part oh HTML id/name was constant. To over come this we created custom functions for selenium using js evaluation capabilities of selenium. Function objectives are:

****** Retrieves all dropdown objects in a web page
****** Retrieves all multiline text box objects in a web page
****** Retrieves all radio button objects in a web page
****** Retrieves all check box objects in a web page
****** Retrieves all text box objects in a web page

Depending on the availability of HTML id or name these functions would retrieve either HTML id or name. These methods are as following -



Fork me on GitHub