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:
Depending on the availability of HTML id or name these functions would retrieve either HTML id or name. These methods are as following -
****** 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 -