RE: dropdown functionality not working in selenium webdriver
I asked a similar question the other day, but have now got stuck at a later stage…..
I have an issue when attempting to click on an element from a drop-down menu, when running a test in Selenium. So, as per the below screenshot, I am hovering over ‘Reports’, then ‘Asset Management’, then ‘Terminated Report: Pending’. Clicking on the ‘Terminated Report: Pending’ option should take me to the appropriate page (screenshot below)
I’ve written the following code in WebDriver to do this:
I didn’t see any issues with this, given that I had used similar code in order to access the ‘Terminated Report: Pending’ page. However, for some reason when I run the test, whilst the browser initially focuses on the element I want, it then loses focus and drops down to the ‘Collections’ drop down and selects a page with a completely different href to the one I selected in the code. Can anyone help as to what the reason might be? Many thanks
See answer above for details as to how this was resolved

This is how you close the answer ANdy 🙂
http://forumsqa.com/selenium-webdriver/how-to-choose-best-answer-insert-code-vote-up-an-answer/
ankit ramola
Hi
Might Possible That Collections ‘s Href Contains the same Keyword as it is Clicking Some Other Element
tilston1001
Hi ANkit, thanks for the response. I thought the same but even when I change the xpath to ‘GetTerminatedPending’ instead of ‘GetTerminatedPendingReport’, it still jumps to the ‘GetBreachPendingReport’ page