When using selenium-java, I encountered an issue where after switching to a new frame, a new DOM was appended on top of the existing one. However, when I tried to locate elements within the appended DOM using the findelement method with the xpath, it threw a staleelementnoreference exception.
Is there a way in selenium/java/javascript to identify if a new DOM has been appended or not? I tried using explicit wait to handle the staleelementexception, but it didn't work in IntelliJ (2018.3) while it did work in Eclipse.