Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
syamrajk
Posts : 1
Join date : 2011-10-25

How can we locate the id of a dynamic element using selenium IDE. Empty 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.
avatar
sujit_37
Posts : 2
Join date : 2011-11-01

How can we locate the id of a dynamic element using selenium IDE. Empty 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
avatar
sujit_37
Posts : 2
Join date : 2011-11-01

How can we locate the id of a dynamic element using selenium IDE. Empty 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
Sponsored content

How can we locate the id of a dynamic element using selenium IDE. Empty Re: How can we locate the id of a dynamic element using selenium IDE.

Back to top
Permissions in this forum:
You cannot reply to topics in this forum