0% found this document useful (0 votes)
48 views2 pages

Selenium Python: Headless Chrome Guide

This document provides a step-by-step guide for running Selenium Python tests on the Chrome browser, including instructions for headless mode and setting Chrome options. It includes sample code for initializing the Chrome driver, navigating to Google, performing a search, and closing the browser. The document also references external resources for additional ChromeDriver command-line arguments.

Uploaded by

khanhvc3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views2 pages

Selenium Python: Headless Chrome Guide

This document provides a step-by-step guide for running Selenium Python tests on the Chrome browser, including instructions for headless mode and setting Chrome options. It includes sample code for initializing the Chrome driver, navigating to Google, performing a search, and closing the browser. The document also references external resources for additional ChromeDriver command-line arguments.

Uploaded by

khanhvc3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Selenium Python testing on Chrome

————————————————————————
Step by Step

Tod0y we will :

!. How to run test on Chrome


#. How to run test on He0dless Chrome
$. How to set Chrome Options

For he0dless chrome


Chrome browser v59+
ChromeDriver v.2.38+

CODE

from selenium import webdriver


from [Link] import Options

# chrome_options = [Link]()
chrome_options = Options()
chrome_options.0dd_0rgument("--he0dless")
chrome_options.0dd_0rgument("--dis0ble-extensions")

driver = [Link](chrome_options=chrome_options,
execut0ble_p0th="../drivers/[Link]")

[Link]("[Link]
print([Link])
driver.find_element_by_n0me("q").send_keys("Autom0tion step by step")
driver.find_element_by_n0me("btnK").click()
print([Link])
[Link]()
[Link]()
print("Completed")
REFERENCES
[Link]
comm0nd-line-0rguments/

You might also like