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
vidyasagar
Posts : 3
Join date : 2010-05-10

How to verify all elements present in application. Empty How to verify all elements present in application.

Fri May 14, 2010 1:39 pm
I know the procedure if all elements in a page have ids associated with..but what if they don't have ids...in that case how can i verify all the elements present in page/application..can i find the xpaths of all elements{buttons,inputs,fields etc..}..can anyone please explain in detail


Thanks in advance,,
Regards,
Vidyasagar
Beginner in selenium
avatar
metman
Amateur
Amateur
Posts : 58
Join date : 2010-04-02

How to verify all elements present in application. Empty Re: How to verify all elements present in application.

Fri May 14, 2010 11:19 pm
Yup, you can use xpaths. You can also use xpaths relative to id. Also, you can identify elements by other attributes than ID, if they have them. In general, follow the pattern foo[@bar='baz']/xpath where foo is the element type, bar is the name of an attribute, and baz is the value for the attribute you are trying to target. Xpath is of course the relative xpath from that targeted element. If you have multiple elements that have the same attribute, you can use the standard square bracket formatting to index whichever element with that attribute value you want.
avatar
vidyasagar
Posts : 3
Join date : 2010-05-10

How to verify all elements present in application. Empty A solution

Sat May 15, 2010 11:28 am
@metman ..thanx for ur reply..but it wont work if i want to store all anchor elements with //a...but having different ancestors...
finally i find a way to solve this issue...here it is...
1.find the no. elements using xpathcount (here we are trying to find all anchor elements...i.e."//a"
2.now try to click the anchor element by
/descendant::a[1]
/descendant::a[2]
/descendant::a[3]
/descendant::a[4]
...........................



/descendant::a[last()] or /descendant::a['xpathcount']
Sponsored content

How to verify all elements present in application. Empty Re: How to verify all elements present in application.

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