Getting XPath of Disappearing Element (chrome)

Getting XPath of Disappearing Element (chrome)

On some pages it is necessary to locate an element that disappears soon after it is rendered. This could be an alert, toast message or some other notification indicating some change has occurred.

If you have come across this while testing, you may have noticed that it is very hard to create an XPath as the information required disappears as quickly as the element. This leads to reloading the page many times until you have completed the XPath, assuming the element is even present for that long.

To prevent this issue, while developer tools are open in chrome, navigate to the sources tab. Perform the action that creates the disappearing element and then click the pause button. This will freeze the elements on the page and allow you to create an XPath without a time limit.

Leave a reply

Your email address will not be published. Required fields are marked*

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.