"chrome.window.onRemoved.addListener()" does not executes when webdriver.quit() in Python

  • I want to perform logic on chrome.window.onRemoved.addListener(), it works exactly in chrome browser development environment and in selenium when performed with browser UI of selenium test, but when I execute driver.quit(); in python shell the onRemoved event is not performed.

    How can I trigger chrome browsers window.onRemoved/(any event before window close to get handled in the extension) event in selenium test while applying Webdrive.quit();?

  • Refer to this question:


    chrome.window.onRemoved.addListener(), works only when a chrome process is running. The `driver.quit()` closes all the  chrome processes.

    Use driver.close()


    Could you try this :

    // Initializing instance of Firefox WebDriver
        driver = new ChromeDriver();
        wait = new WebDriverWait(driver, waitTime);
    // Initializing EventFiringWebDriver using Firefox WebDriver instance
        e_driver = new EventFiringWebDriver(driver);
    //create object of EventListerHandler to registeritwithEventFiringWebDriver
            eventListener = new WebEventListener();

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2