Run Selenium Headless Using Chrome Driver

Published: 28 May 2021
on channel: automateNow
2,271
21

Learn how to run your Selenium WebDriver tests in headless mode using chrome driver.

If you need your Selenium tests to consume less resources, you may want to consider using Chrome Driver's headless mode. You may even notice your tests running a little faster.

What is headless mode?
Headless mode allows you to run your automated tests without the need to open a web browser.

When using Chrome Driver, we use the ChromeOptions class along with the addArguments method to run our tests in headless mode.

Note:
In addition to using this code to run in headless mode,
options.addArguments("--headless");
you may also use
options.setHeadless(true);

You can find the source code for this project on automateNow's GitHub page.
https://github.com/automatenow/Interm...

😀 Subscribe for weekly videos! 👍

📑 CHAPTERS

0:00 ~ What is headless mode and the benefits?
0:30 ~ Using ChromeOptions to run headless
1:40 ~ Running the test
2:09 ~ How does headless mode work?
2:23 ~ How to change screenshot size in headless mode
3:14 ~ Rerunning the test
3:26 ~ ChromeOptions arguments
3:41 ~ Additional resources

👩‍🎓 COURSES

☕ Java For Absolute Beginners https://bit.ly/learn-java2022

⏯ PLAYLISTS

☑️ Automation Fundamentals https://bit.ly/2QbN7qm
☑️ Automation Tools https://bit.ly/2OFj4qO
☑️ General WebDriver https://bit.ly/2Z3tG7y
☑️ Intro to WebDriver https://bit.ly/3gb5Jlx
☑️ Intermediate WebDriver https://bit.ly/2OBTR0r
☑️ Java https://bit.ly/3sBuI7M
☑️ Selenium 4 https://bit.ly/2VQ1lA9
☑️ Version Control https://bit.ly/3CvHplU
☑️ Web Element Locators https://bit.ly/2QfDGpK

📫 LET'S CONNECT!

☑️ https://linktr.ee/automateNow

🔗 REFERENCES

☑️ Chrome Options https://bit.ly/3hI79V6
☑️ List of Commands https://bit.ly/3bGbNiC
☑️ Blog Article https://bit.ly/3f6Kv7f


On this page of the site you can watch the video online Run Selenium Headless Using Chrome Driver with a duration of hours minute second in good quality, which was uploaded by the user automateNow 28 May 2021, share the link with friends and acquaintances, this video has already been watched 2,271 times on youtube and it was liked by 21 viewers. Enjoy your viewing!