#browser-automation #cross-browser-testing
## WebDriver standard
- WebDriver is an interface to control a supported browser (it has no notion of what testing is)
- "Selenium WebDriver drives a browser natively..." (quoted from [the docs](https://www.selenium.dev/projects/)) "... as if a real user is operating the browser" (quoted from [the docs](https://www.selenium.dev/documentation/en/getting_started/quick/))
- It is a [W3C Recommendation](https://www.w3.org/TR/webdriver1/) (a.k.a. [a web standard](https://www.w3.org/standards/faq#std)). All major browser vendors collaborated on its implementation and they constantly evolve it. They provide WebDriver implementations for their specific browser (Chromedriver, Geckodriver, Safaridriver, ...)
- So, WebDriver can control Chromium/Chrome, Firefox, Safari, Edge (and IE) and Opera
- To a certain extent it is possible to control older versions or beta versions of a supported browser
- [[Appium]] extends the WebDriver protocol, so it can control supported mobile browsers with the same WebDriver code
## Involved components
The following diagram (open it in a new tab for best readability) shows the involved components when using Selenium Grid. Note that you can control desktop browsers with WebDriver, but also mobile browsers by adding [[Appium]] to the mix.
![[selenium-webdriver-architecture.png]]
-- [Lucidchart edit view](https://lucid.app/lucidchart/f85feb4a-465d-4d1b-895d-b5ee60b57fb8/edit?page=HWEp-vi-RSFO#)
## Involved components for visual testing
In two additional diagrams I sketched out how the visual testing tools [Applitools](https://applitools.com/) and [Percy](https://percy.io/) fit into there respectively.
![[selenium-webdriver-applitools.png]]
![[selenium-webdriver-percy.png]]
## What is the Selenium Server for?
The Selenium Server is only needed to automate a browser on a remote host. It is not needed for the local use case.
To use it, start it on the machine where the browser and browser driver are running. From the WebDriver client (the machine where the test code is running), you can set the Selenium Server URL, just as you do with a Selenium Grid (the URL looks similar to `https://yourhost:4444/wd/hub`).
## Chrome DevTools Protocol in WebDriver
[[Chrome DevTools Protocol (CDP) in WebDriver]]
## WebDriver BiDi
[[WebDriver BiDi]]