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,490 points
1,136 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,500 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
41,654 views
0 votes
1 answer

How to run Selenium test cases in Headless Chrome browser?

@Afreen to run selenium test cases in ...READ MORE

answered May 17, 2019 in Selenium by Kushal
4,085 views
0 votes
0 answers

xpath search working on browser[firefox/Chrome] but not on Selenium python script.

Hi Team, I am getting below expception while ...READ MORE

Nov 14, 2019 in Selenium by ashutosh
• 120 points
2,254 views
0 votes
2 answers

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,500 points
13,436 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,006 views
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,910 points
7,121 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 30, 2018 in Selenium by sniffy_god
• 780 points
3,412 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 27, 2018 in Selenium by nsv999
• 5,500 points
7,876 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, 2019 in Selenium by Abha
• 28,140 points
1,913 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP