Catch chrome browser close event using chrome driver

I am doing in-app automation for some web pages in vb.net using the chrome driver.

During the operation of the application, there is a chance that chrome may close before the completion of the automation process (the user may close or chrome may fail).

Now my requirement is that if chrome is closed by the user during automation, the application should know that the user is closing the close event in chrome, and the application requires a Yes / No message with user text to confirm the user’s actions.

I searched this online for a while and found nothing. Provide a way to capture the Chrome browser close event on vb.net using the chrome driver.

+6
source share
2 answers

Not sure if I fully understand the question, but can you use the window.onbeforeunload approach?

eg. See W3Schools

0
source
 $(document).ready(function () { window.onbeforeunload = function () { //your code here }; }); 
0
source

Source: https://habr.com/ru/post/1013279/


All Articles