1

As above. Encountered these two issues.

An element could not be located on the page using the given search parameters.

The element does not exist in DOM anymore

Prophet
  • 32,350
  • 22
  • 54
  • 79
Dummie1138
  • 61
  • 1
  • 7

1 Answers1

1

The first error

An element could not be located on the page using the given search parameters

Indicates that Selenium could not find element matching the given locator on the page.
While the second error

The element does not exist in DOM anymore

Indicates that the element was on the page, but no more existing there.
This is actually a Selenium Stale Element error.
Stale means old, decayed, no longer fresh. Stale Element means an old element or no longer available element. Assume there is an element that is found on a web page referenced as a WebElement in WebDriver. If the DOM changes then the WebElement goes stale. If we try to interact with an element which is staled then the StaleElementReferenceException is thrown.

Prophet
  • 32,350
  • 22
  • 54
  • 79
  • So, if the element doesn't exist in DOM, it means it was unable to find it but at some point it did. Aligns with my own issues right now, do you have any suggestions on fixing this when the element still exists on the page? – Dummie1138 Jul 22 '21 at 12:37
  • It means that this element WAS on the page but no more there or was changed. It means Selenium / Appium got that element, but now this pointer (Selenium web element object) points to nothing. – Prophet Jul 22 '21 at 12:57
  • To say what YOU should do to fix your problem I need to see your test flow running. If you say the element is still there I can guess the element looks like it still there, but actually the element was changed so now it is a new, other element there, so as the previous pointer (Selenium web element object) does not point on this new element. – Prophet Jul 22 '21 at 13:00
  • This is an important subject. You should learn more about the Stale Element in Selenium. – Prophet Jul 22 '21 at 13:02