aerokube / selenoid

Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
https://aerokube.com/selenoid/latest/
Apache License 2.0
2.6k stars 323 forks source link

Chrome in docker cannot transform large xml #675

Closed dr29bart closed 8 months ago

dr29bart commented 5 years ago

docker images: aerokube/selenoid:1.9.0 selenoid/vnc_chrome:72.0

config:

{
    "chrome": {
        "default": "72.0",
        "versions": {
            "72.0": {
                "image": "selenoid/vnc_chrome:72.0",
                "port": "4444",
                "path": "/",
                "env": [
                    "ENABLE_WINDOW_MANAGER=true"
                ],
                "tmpfs": {"/tmp": "size=1024m", "/var": "size=512m"},
                "shmSize" : 968435456
            }
        }
    }
}
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import java.net.MalformedURLException;
import java.net.URL;

public class T {

    private static RemoteWebDriver iniDriver() throws MalformedURLException {
        ChromeOptions capabilities = new ChromeOptions();
        capabilities.setCapability("screenResolution", "1920x1080");
        capabilities.setCapability("enableVNC", true);
        return new RemoteWebDriver(new URL("http://selenoidhost.com:4444/wd/hub"), capabilities);
    }

    public static void main(String[] args) throws MalformedURLException {
        RemoteWebDriver remoteWebDriver = iniDriver();
        try {
            remoteWebDriver.get("https://dr29bart.github.io/");
            remoteWebDriver.findElement(By.cssSelector("input")).click();
            Alert alert = new WebDriverWait(remoteWebDriver, 20)
                    .until(ExpectedConditions.alertIsPresent());
            System.out.println(alert.getText());
            alert.dismiss();
        } finally {
            remoteWebDriver.quit();
        }
    }
}

Actual console output: TypeError: Cannot read property 'firstChild' of null

Expected output: [object Text]

The same code works fine with local chrome driver instance. chrome_container.log selenoid.log

BorisOsipov commented 5 years ago

@dr29bart It will be nice if you describe\add stacktrace what happened when you ran this test against selenoid.

dr29bart commented 5 years ago

There is only one issue, which is a failure of js snippet in dockerized Chrome :

var p = new XSLTProcessor;
p.importStylesheet(xsl);
var c = p.transformToFragment(xml, document)

transformToFragment returns null if xml is very large.

I was not able to reproduce this issue on Mac/Win 10/(Ubuntu in Virtual VM) Also tuning tmpfs or shmSize parameters didn't allow me to work around the issue.

vania-pooh commented 5 years ago

@dr29bart what is XSLTProcessor (which library provides it)?

dr29bart commented 5 years ago

I think it is Blink implementation of the WEB API: XSLTProcessor.

Unfortunately, I cannot debug it, because it happens only on docker container.

vania-pooh commented 5 years ago

@dr29bart ah ok, an internal JS API.

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.