Selenium Python : How to click on first occurrence of an element?
50 views
Skip to first unread message
Satish
unread,
Nov 18, 2018, 9:08:43 PM11/18/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Selenium Users
Hello,
I have a close button with same title appearing 10 times on the same page. I want to click on it's first occurrence. I tried storing it in the list but it did not work.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Selenium Users
Hi you can use (driver.findelements) will fetch you all the child objects then you can close the first child
or
you can use style to identify the element, for example say all the close button were hidden only one is showing then the style will be unique for the one which is shown.