I am trying to locate Ajax control (mouse over) on Amazon home page for sign in.
WebElement element = driver.findElement(By.xpath("//*[@id='nav-link-yourAccount']"));
however this element locator works for some time and other times its not finding element and script is failing.
I have noticed that Xpath of this element is changing sometimes to //*[@id='nav-link-yourAccount']/span[1]
, there is no any other unique identifier which can be used to locate this element.
Could you please let me know how to resolve this variable xpath issue.