RE: dropdown functionality not working in selenium webdriver

Answered

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)

RE: dropdown functionality not working in selenium webdriver

I’ve written the following code in WebDriver to do this:

RE: dropdown functionality not working in selenium webdriver

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

tilston1001 Train Asked on November 27, 2014 in Selenium WebDriver.

Hi
Might Possible That Collections ‘s Href Contains the same Keyword  as  it is Clicking Some Other Element

on November 27, 2014.

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

on November 27, 2014.
Add Comment
2 Answers

See answer above for details as to how this was resolved

Train Answered on December 2, 2014.

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.