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