selenium webdriver headless chrome

      1 Comment on selenium webdriver headless chrome

Why Headless Chrome?


A headless browser is a great tool for automated testing and server environments where you don’t need a visible UI shell. This can be achieved by using Selenium Java Class org.openqa.selenium.chrome.ChromeOptions.

Refer to the Google Chrome Capabilities Link

Pre-requisites:



Exception 1: unknown error: Chrome failed to start: was killed
Resolution:

Remove the following options from the code while running in windows.
options.addArguments(“–print-to-pdf”);
options.addArguments(“–screenshot”);

Exception 2: “unknown error: call function result missing ‘value'”
Resolution:
Download the latest version of chromedriver.exe solves this Issue.
Link for downloading the latest version: https://chromedriver.storage.googleapis.com/index.html?path=2.36/

Refer to the below Links for Practise

Selenium Wiki
Selenium Quiz
Selenium Advanced Quiz
Java Quiz
Java OOPS Quiz
Selenium WebDriver Tester Resume

1 comment on “selenium webdriver headless chrome

  1. Ram Natarajan

    Hello,
    I have a test which opens a pdf page. Testing in Selenium with Chrome driver i am able to check for document type of pdf. But the same code does not work with Headless Chrome. I use the following options:
    ChromeOptions options = new ChromeOptions();
    options.addArguments(“headless”);
    options.addArguments(“window-size=1200×600”);
    WebDriver driver = new ChromeDriver(options);
    What can be done to make headless chrome recognize the pdf page that opens during testing?

    Thanks
    Ram

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *