org.openqa.selenium.StaleElementReferenceException: Cached elements do not exist in DOM anymore

The problem

I am getting errors whenever I am running my test cases. I never get a similar issue before but now I am getting this error across a project.

Environment

  • Appium version: 1.20
  • Last Appium version that did not exhibit the issue (if applicable): I didn’t get this issue before with the same version
  • Desktop OS/version used to run Appium: Windows 10
  • Node.js version (unless using Appium.app|exe): 14.15.5
  • Npm: 6.14.11
  • Mobile platform/version under test: Android 10
  • Real device or emulator/simulator: Real
  • Appium CLI or Appium.app|exe: Appium CLI

Link to Appium logs

GIST: https://gist.github.com/chetanJTH/2b6db2fa123c3100d807a94067adf9a6

Code To Reproduce Issue

project repo: https://github.com/chetanJTH/Hybrid
run Suite_ParentalControl file and error will generate while execution of test class: Check_Device_SocialHistory

I’m experiencing the same issue. It’s making my suites progressively more flaky. :frowning:

Did you manage to find a fix? For me it’s happening seemingly at random, which is making it even more frustrating and harder to fix.

@chetan_thummar you absent page init. Example: PageFactory PageObjectModel issues

1 Like

@Aleksei : tried finding element before getting list and it’s working in some cases