ChromeOS
Stay organized with collections
Save and categorize content based on your preferences.
ChromeDriver Binary
All ChromeOS test images have ChromeDriver binary installed in /usr/local/chromedriver/
. The binary is updated to the same version of Chrome in that test image. That is, you will always be using the latest build of ChromeDriver.
If your test expects to run against a "stable" build of ChromeDriver binary,
you need to write your own code in your test to download the desired binary and
replace the binary in /usr/local/chromedriver/
.
How to use ChromeDriver in an Autotest test
Writing a test that uses ChromeDriver to interact with Chrome is quick. There is
a wrapper class to use ChromeDriver available in ChromeOS/Autotest. The wrapper class, as a context manager type, and handles the following tasks for you:
- Signs into ChromeOS using Telemetry.
- Starts ChromeDriver with Remote mode on the Device under Test (DUT) and connects to the remote debug port of the Chrome instance after sign in.
- Exposes a driver instance for you to make any ChromeDriver calls.
- Shutdowns ChromeDriver process, and logs out of ChromeOS.
To write a test, you can follow the example of test desktopui_UrlFetchWithChromeDriver
.
To get started:
Import the wrapper class
from autotest_lib.client.common_lib.cros import chromedriver
Create an instance of the ChromeDriver, and make calls.
with chromedriver.chromedriver() as chromedriver_instance:
driver = chromedriver_instance.driver
# Here you can make standard ChromeDriver calls through the driver instance.
# For example, browse a given url with |driver.get(url)|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-23 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-04-23 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-23 UTC."],[],[]]