I'm working on utility tool which should to test GWT-App. I wanna use Chrome headless browser, but that doesn't work.

0 votes

Following is my code:

DesiredCapabilities cap = DesiredCapabilities.chrome();
    ChromeOptions options = new ChromeOptions();
    options.setExperimentalOption("useAutomationExtension", false);
    options.addArguments("--headless");
    cap.setCapability(ChromeOptions.CAPABILITY, options);

    driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub/"), cap);

    wait = new WebDriverWait(driver, 10);

If I go to google.com using driver.get(url) & take a screenshot, I can see the Google Page, but as soon as I try to open the GWT app, i only get a white page and the following source printed with System.out.println(driver.getPageSource());

<html xmlns="http://www.w3.org/1999/xhtml"><head>
    <title>Secure Login Service</title>
</head>
<body>

But the monent I remove the headless flag, chrome starts and the GWT app loads normally

I'm running Chrome-Version 63.0.3239.84, selenium-server-standalone-3.5.3, chromedriver 2.33 & Windows 7 Enterprise 64bit.

I'm unable to update Chrome, but I can try different versions of selenium-driver and chromedriver (I tried other versions but they wouldn't run - but thats another topic) - Is there another good headless-Browser which needs no installation (i.e. awesomeHeadlessBrowser.jar?)

Any suggestion would be appreciated.

Mar 30, 2018 in Selenium by Shubham
• 13,300 points
58 views

1 answer to this question.

0 votes
Along with the --headless option, you should also pass --disable-gpu flag.
However, instead of passing these options explicitly, just call driver.set_headless() (which will take care of setting both for you).
answered Mar 30, 2018 by nsv999
• 5,090 points

Related Questions In Selenium

0 votes
1 answer
+2 votes
1 answer

I want the console.log output from Chrome. I'm working with selenium on Python

So this is how you do it ...READ MORE

answered May 3, 2018 in Selenium by sniffy_god
• 780 points
11,307 views
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
769 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,012 views
0 votes
1 answer

How to enable WebGL if i'm using headless chrome on Ubuntu?

Use this on Chrome for using osmesa sudo ...READ MORE

answered May 29, 2018 in Selenium by sniffy_god
• 780 points
636 views
0 votes
1 answer

Selenium ChromeDriver issue - Want to run it in background, but not as headless browser

This is a flaw with ChromeDriver. Tried ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,090 points
1,093 views
0 votes
2 answers

Can anyone help me that how to run Selenium WebDriver test cases in Chrome?

You first need to download chrome driver ...READ MORE

answered Aug 26 in Selenium by Abha
• 24,980 points
282 views