Web driver fails performing click operation



  • I am automating Peoplesoft through Selenium. Web driver is able to locate the web element: System.println.out(driver.findElements(By.id("Element_id").getAttribute("name")); Web driver prints the name attribute of that element, but when I am trying to click it fails: driver.findElements(By.id("Element_id").click(); although it does not throw error message, and the web driver remain in running status, without terminating itself. Please help.



  • There are a couple of explanations. The most common one is that the element that is identified is actually a different element than you expected to identify. It's less common with id's which should be unique, but it can happen still if a dev accidentally gives multiple elements on a page the same ID, or if there is something duplicating an element and the logic doesn't exist to update the ID for each duplicate element. Another explanation could be that the element you found is not the element that is expected to be clicked. Maybe it is a child (or in rarer cases a parent or sibling) of the element that is actually receiving the click events. Try clicking on the parent or ancestor element. Another explanation could be that Selenium is performing the click, but the element is actually expecting some event to be fired that Selenium's "click" doesn't trigger. Maybe you have to hover over the element first and then click? Maybe it's something more cryptic like expecting a non-standard event? Hopefully it's one of these explanations, if not let me know and maybe we can troubleshoot further.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2