DEV Community

bubuybawang
bubuybawang

Posted on

Inspecting Disappearing WebElement

Inspecting the source of a particular web element is sometimes tricky especially if the element in question disappears once the focus is removed from it, or sometimes even just moving the mouse pointer outside its borders.

The easiest way to capture these elements is to trigger the debugger of the browser to pause execution after a specified timeout - presumably with enough time have the disappearing element appear.

Just paste the snippet in to the browser's console. Just increase the timeout if 5 seconds is not enough.

setTimeout(() => { debugger; }, 5000)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)