Headless Browser | Headless execution of automation test | Pros and Cons of Headless execution

Published: 12 April 2021
on channel: Maximum Automation
604
2

In this video we will discuss about headless execution and will see that how can we execute our script on headless browser.


Headless browser is basically a web browser without a GUI. There are some pros and cons of headless browser testing.


Pros:
Execution Speed

Avoid Setup
Website scraping



Cons:
Can not mimic real users
Difficult to debug code


Below are some popular headless browsers:

Google Chrome

Google Puppeteer

HtmlUnit

PhantomJS
Firefox


Now lets see that how can we run our automation test on headless browser.

To run the headless execution on chrome, please use below code.
ChromeOptions options = new ChromeOptions();
options.addArguments("headless");
driver = new ChromeDriver(options);

To run the headless execution through HtmlUnit, please use below code.

WebDriver driver = new HtmlUnitDriver();

To run the headless execution through HtmlUnit, please use below code.
First, download phantomjs diver from https://phantomjs.org/download.html . Then use below code.

System.setProperty("phantomjs.binary.path", "file path of phantom js driver");
WebDriver driver = new PhantomJSDriver();
*********Please comment in case of any query************


Also please watch other videos as well.

Add Java properties configuration file in framework - Selenium Java -    • Configuration file in automation fram...  

How to setup selenium grid in docker :    • How to setup Selenium Grid in Docker ...  

Log4J2 - Logging in Java Framework :    • Video  

Selenium with Java - Create Junit Cucumber Project :    • Video  

Selenium - Debug/Run Script on Existing Browser :    • Selenium | Debug/Run Script on Existi...  

Selenium with Java - Extent Report - Part1 :    • Selenium with Java | Extent Report 5 ...  

Selenium - WebDriver Manager :    • Selenium | WebDriver Manager | Stop d...  

Parallel Execution - Cucumber - Junit :    • Parallel Execution | Cucumber | Junit  

Selenium with Java - Cucumber Html Report :    • Selenium with Java | Cucumber Html Re...  

Selenium with Java - Integrate TestNG with Cucumber -    • Video  

Selenium with C# - Klov Report :    • Selenium with C# | Klov Report Server  

Selenium with C# - Extent Report :    • Selenium with C# | Extent Report  

Selenium with C# - Create Project to automate test (Selenium + Specflow ) :    • Video  

Selenium with C# - Parallel Execution and Screenshot :    • Video  

Selenium with C# - All about feature files :    • Video  

Selenium with C# - Specflow - External Bindings :    • Selenium C# | Specflow | External Bin...  

Selenium with C# Working with Excel - Part 1 :    • Video  

Selenium C# - Visual Studio Code :    • Selenium C# | Visual Studio Code | No...  
n

How to execute cucumber feature file in Parallel using TestNG | Selenium Java | TestNG -    • How to execute cucumber feature file ...  


Watch video Headless Browser | Headless execution of automation test | Pros and Cons of Headless execution online without registration, duration hours minute second in high quality. This video was added by user Maximum Automation 12 April 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 604 once and liked it 2 people.