Skip to main content


Showing posts from October, 2010

Selenium - Regular Expressions, Dynamic Objects

Hi Guys,

I am using selenium RC with Visual Studio 2010 IDE  and created tests.
Also i am using Selenium RC with Eclipse...

Here i am listed out some ideas in identifying dynamic objects.
Take your Object id looks like "ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl12_AreaNameFooterTextBox"
Here ctl12 is the part which is changing part based on which row / session...But you want to enter the value irrespective of row position..

Here you have to use regular expressions

//input[Contains(@id,'ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl') and Contains(@id,'_AreaNameFooterTextBox')] //input[@id,RegExp:'ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl??_AreaNameFooterTextBox'] //input[@id,glob:'ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl*_AreaNameFooterTextBox'] //*@id,glob:'ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl*_AreaNameFooterTextBox']
If all the above methods are not working for you, then try these...