- syamrajk
- Posts : 1
Join date : 2011-10-25
How can we locate the id of a dynamic element using selenium IDE.
Tue Oct 25, 2011 10:31 pm
Hello,
I would like to test the adchoice button that are coming along with websites that has the ads from adservers. but as you all know the id of the adchoice button is dynamic and so i can't get the id when i am playing back the saved test suite.
Its giving me an error " [error] Element css=#te-0720-anch-mo > span > img not found "
I tried -
//input[starts-with(@id, 'span')]
//input[starts-with(@xpath, 'span')]
//span[container(@id,'span')]
//span[container(@csspath,'span')]
but i was not able to give any stable id. so all the above steps failed.
any help would be appreciated.
I would like to test the adchoice button that are coming along with websites that has the ads from adservers. but as you all know the id of the adchoice button is dynamic and so i can't get the id when i am playing back the saved test suite.
Its giving me an error " [error] Element css=#te-0720-anch-mo > span > img not found "
I tried -
//input[starts-with(@id, 'span')]
//input[starts-with(@xpath, 'span')]
//span[container(@id,'span')]
//span[container(@csspath,'span')]
but i was not able to give any stable id. so all the above steps failed.
any help would be appreciated.
- sujit_37
- Posts : 2
Join date : 2011-11-01
Re: How can we locate the id of a dynamic element using selenium IDE.
Tue Nov 01, 2011 3:16 am
I guess u should try using Assignid() command.
With this we can assign id to any element and can call the element with a user given id.
I dint try this..but it may work
With this we can assign id to any element and can call the element with a user given id.
I dint try this..but it may work
- sujit_37
- Posts : 2
Join date : 2011-11-01
Re: How can we locate the id of a dynamic element using selenium IDE.
Tue Nov 01, 2011 3:21 am
assignId ( locator,identifier )
Temporarily sets the "id" attribute of the specified element, so you can locate it in the future using its ID rather than a slow/complicated XPath. This ID will disappear once the page is reloaded.
Arguments:
locator - an element locator pointing to an element
identifier - a string to be used as the ID of the specified element
Temporarily sets the "id" attribute of the specified element, so you can locate it in the future using its ID rather than a slow/complicated XPath. This ID will disappear once the page is reloaded.
Arguments:
locator - an element locator pointing to an element
identifier - a string to be used as the ID of the specified element
Permissions in this forum:
You cannot reply to topics in this forum
|
|