question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Headless Chrome WebDriverException "...page crash from unknown error"

See original GitHub issue

🐛 Bug Report

Created a simple “Login” test on Yandex email website. After I login successfully any command to the driver will throw the WebDriverException, any further command will throw an exception stating the sessionId no longer exists (probably driver is closing/crashing) after the WebDriverException. This happens when executing my test on chrome headless! Works fine on regular chrome and on firefox/headless-firefox.

Expected behavior

Expecting the driver to keep responding to commands.

Test script or set of commands reproducing this issue

public static void main(String[] args) {

        WebDriverManager.chromedriver().setup();

        // Start Selenium
        StandaloneConfiguration configuration = new StandaloneConfiguration();
        SeleniumServer server = new SeleniumServer(configuration);
        server.boot();

        ChromeOptions options = new ChromeOptions();
        options.setHeadless(true);

        ChromeDriver driver = new ChromeDriver(options);
        driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
        try {
            // Do some actions with the driver...
            driver.navigate().to("https://mail.yandex.com");
            driver.findElementByXPath("//div[4]/a[. = 'Log in']").click();
            WebElement login = driver.findElementByXPath("//button[. = 'Log in']");
            login.click();
            TimeUnit.SECONDS.sleep(2);
            driver.findElementByCssSelector("#passp-field-login").sendKeys("YOUR_USER_NAME");
            login.click();
            TimeUnit.SECONDS.sleep(2);
            WebElement password = driver.findElementByCssSelector("#passp-field-passwd");
            password.sendKeys("YOUR_PASSWORD");
            WebElement login2 = driver.findElementByXPath("//*[@id=\"root\"]/div/div/div[2]/div/div/div[2]/div[3]/div/div/div/form/div[3]/button");
            login2.click();
            // AFTER THIS LINE - on chrome headless any command to the driver will reveal the bug.
            password.sendKeys("zaq123edc");
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            driver.quit();
        }
        server.stop();
        System.exit(0);
    }

Environment

OS: Windows 10 Browser: Chrome Browser version: 86.0.4240.111 Browser Driver version: 86.0.4240.22 Language Bindings version: 3.141.59

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
diemolcommented, Nov 21, 2020

I don’t really understand what you are trying to achieve, the element won’t be present since the app will move to a different page. If it is about the precise error message, why do you need that? Are you parsing the error message for some purpose?

In the end, if it is about the headless behaviour, then please submit Chrome/ChromeDriver issues to the Chromium team, either at https://bugs.chromium.org/p/chromium or https://bugs.chromium.org/p/chromedriver. Additionally, we cannot have the same env you have to reproduce the issue, but it all points out it is not Selenium related.

If you think this is Selenium related, please provide a concise reproducible test case, that includes the page required to execute the scenario (a sample page or a public site that works in the same way for everyone).

0reactions
tzah4748commented, Nov 22, 2020

I am pretty sure myself it is a chromedriver related issue and I already submitted a bug report to them as well but I thought you guys at Selenium might be able to give me more insight on the issue.

https://bugs.chromium.org/p/chromedriver/issues/detail?id=3639

Read more comments on GitHub >

github_iconTop Results From Across the Web

session deleted because of page crash from unknown error ...
Solution. Chrome seem to crash in Docker containers on certain pages due to too small /dev/shm . So you may have to fix...
Read more >
Fix "session deleted because of page crash" when using ...
Recently I created a CI pipeline that stands up a local selenium grid and then pipeline jobs run WebdriverIO tests against that selenium...
Read more >
unknown error: session deleted because of page crash : Forums
The error says that Chrome is crashing when it tries to load the page, or perhaps when Selenium is getting information from it...
Read more >
unknown error: session deleted because of page crash
The error indicates that a part of Chrome has crashed. There are various reasons that Chrome might crash, and unfortunately it's not always...
Read more >
Regarding the page crash issue in Webdriver - Google Groups
WebDriverException: unknown error: session deleted because of page crash ... from tab crashed (Session info: headless chrome=87.0.4280.141).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found