ferrum icon indicating copy to clipboard operation
ferrum copied to clipboard

Fix timing issue where a disconnected node is being requested & returned

Open stevschmid opened this issue 1 year ago • 1 comments

This PR fixes the issue outlined in https://github.com/rubycdp/cuprite/issues/239.

I fixed this initially by adding a node.isConnected check to Cuprite.isVisible, but after digging a bit deeper, it seems that the node get disconnected between the call for _cuprite.find and its handle_response. In this case we request a node via DOM.requestNode which is not connected to the document anymore and does not seem to get obsolete (subsequent commands such as #visible? never raise NodeNotFoundError).

I'm not sure this is the right place, maybe adding a disconnected check in Cuprite Node might be a bit less invasive. Please tell me what you think.

stevschmid avatar Jun 21 '23 13:06 stevschmid

I am facing a similar issue in my tests. It will occasionally fail. However never when I do a puts page.body before interacting with the node.

While I only did very minimal testing I was not able to reproduce this bug with this patch.

espen avatar Nov 10 '23 13:11 espen