Giter Club home page Giter Club logo

chromedriver's Introduction

ChromeDriver

This file contains high-level info about how ChromeDriver works and how to contribute. If you are looking for information on how to use ChromeDriver, please see the ChromeDriver user site.

ChromeDriver is an implementation of the WebDriver standard, which allows users to automate testing of their website across browsers.

Getting Started

ChromeDriver source code is located in the Chromium source repository, and shares the same build tools as Chromium. To build ChromeDriver, please first follow the instructions to download and build Chromium.

Once you have set up the build environment, build ChromeDriver by building the chromedriver target, e.g.,

autoninja -C out/Default chromedriver

This will create an executable binary in the build folder named chromedriver[.exe].

Once built, ChromeDriver can be used with various third-party libraries that support WebDriver protocol, including language bindings provided by Selenium.

Note that if your build target OS is Android (i.e., you have target_os = "android" in your args.gn file), you will need to use the following command to build ChromeDriver targeting the host system:

autoninja -C out/Default clang_x64/chromedriver

Verifying the Build

For testing purposes, ChromeDriver can be used interactively with python. The following is an example on Linux. It assumes that you downloaded Chromium repository at ~/chromium/src, and you used out/Default as the build location. You may need to adjust the paths if you used different locations. The following code uses our own testing API, not the commonly used Python binding provided by Selenium.

$ cd ~/chromium/src/chrome/test/chromedriver
$ export PYTHONPATH=$PWD:$PWD/server:$PWD/client
$ python3
>>> import server
>>> import chromedriver
>>> cd_server = server.Server('../../../out/Default/chromedriver')
>>> driver = chromedriver.ChromeDriver(cd_server.GetUrl(), cd_server.GetPid())
>>> driver.Load('http://www.google.com')
>>> driver.Quit()
>>> cd_server.Kill()

By default, ChromeDriver will look in its own directory for Chrome to use. If Chrome is not found there, it will use the system installed Chrome.

To use ChromeDriver with Chrome on Android pass the Android package name in the chromeOptions.androidPackage capability when creating the driver. You also need to have Android SDK's Android Debug Bridge (adb) server running. For more detailed instructions see the user site.

Architecture

ChromeDriver is shipped separately from Chrome. It controls Chrome out of process through DevTools. ChromeDriver is a standalone server which communicates with the WebDriver client via the WebDriver wire protocol, which is essentially synchronous JSON commands over HTTP. WebDriver clients are available in many languages, and many are available from the open source Selenium WebDriver project. ChromeDriver uses the webserver from net/server.

Additional information is available on the following pages:

Code structure (relative to this file)

  • (this directory): Implements chromedriver commands.

  • chrome/: A basic interface for controlling Chrome. Should not depend on or reference WebDriver-related code or concepts.

  • js/: Javascript helper scripts.

  • net/: Code to deal with network communication, such as connection to DevTools.

  • client/: Code for a python client.

  • server/: Code for the chromedriver server. A python wrapper to the chromedriver server.

  • test/: Integration tests.

Testing

There are several test suites for verifying ChromeDriver's correctness. For details, see the testing page.

Releasing

As of M115, ChromeDriver is fully integrated into the Chrome release process. Across all release channels (Stable, Beta, Dev, Canary), every Chrome release that gets pushed to users automatically gets a correspondingly-versioned ChromeDriver release, available for download via Chrome for Testing infrastructure.

Contributing

Find an open issue and submit a patch for review by an individual listed in the OWNERS file in this directory. Issues are tracked in ChromeDriver issue tracker.

chromedriver's People

Contributors

agrieve avatar ayuishii avatar bwalderman avatar calebrouleau avatar carlscabgro avatar cbiesinger avatar chikamune-cr avatar dpranke avatar gmanikpure avatar jbudorick avatar jdoerrie avatar johnchen0 avatar k7z45 avatar kereliuk avatar lanwei22 avatar leizleiz avatar nechaev-chromium avatar nsatragno avatar pkasting avatar sadym-chromium avatar samuong avatar song-fangzhen avatar srawlins avatar stephenmcgruer avatar tanderson-google avatar thiagowfx avatar triciacrichton avatar tsepez avatar tzik avatar zetafunction avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.