Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to verify all elements present in application.

View previous topic View next topic Go down

How to verify all elements present in application.

Post by vidyasagar on 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

vidyasagar

Posts : 3
Join date : 2010-05-10

Back to top Go down

Re: How to verify all elements present in application.

Post by metman on 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.

metman
Amateur
Amateur

Posts : 58
Join date : 2010-04-02

Back to top Go down

A solution

Post by vidyasagar on 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']

vidyasagar

Posts : 3
Join date : 2010-05-10

Back to top Go down

Re: How to verify all elements present in application.

Post by Sponsored content Today at 3:13 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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