How to click any element whose xpath changes every time, I visit that page

126 views
Skip to first unread message

Pulkit Garg

unread,
Jun 24, 2014, 2:52:03 AM6/24/14
to seleniu...@googlegroups.com
1. Go to Facebook. Com
2. Login and navigate to view profile link which is just above the edit profile link.
3. Try to click on friends link
4. The xpath changes every time I visit that page.

gati shah

unread,
Jun 24, 2014, 6:23:43 AM6/24/14
to seleniu...@googlegroups.com
You can use xpath with class name instead of id. 



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/4c167983-d3fa-4fc0-b336-bdf928555f5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oscar Rieken

unread,
Jun 26, 2014, 11:54:12 AM6/26/14
to seleniu...@googlegroups.com
Unless you work for facebook I would suggest not trying to automate their site you will get yourself blocked


Shadaab

unread,
Jun 27, 2014, 12:40:30 AM6/27/14
to seleniu...@googlegroups.com
If you record the script through selenium IDE you will find the "xpath position" in that use those xpath to do your usecases.


Reply all
Reply to author
Forward
0 new messages