Skip to content

Commit 475ec74

Browse files
committed
docs(Edge): Document setup for Chromium-based Edge
In a comment from April 2020 [1], the Selenium maintainers said that they would not support Chromium-based Edge in Selenium 3. They instead suggested waiting for a stable version of Selenium 4. However, as of December 2020, there is no release date in sight for Selenium 4, Chromium-based Edge is the only version of Edge actively supported by Microsoft since August 2020, and legacy Edge will reach end-of-life status in March 2021 [2]. Thankfully, Generic WebDriver Server is generic enough to handle this case. We can use it to configure Selenium 3 to respond to Edge and use Microsoft's `msedgedriver.exe` as a backend executable. See also SeleniumHQ/selenium#8993 [1]: SeleniumHQ/selenium#8237 (comment) [2]: https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666
1 parent 191157a commit 475ec74

File tree

3 files changed

+111
-0
lines changed

3 files changed

+111
-0
lines changed

Edgium.md

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Generic WebDriver Setup for Chromium-based Edge
2+
3+
In a [comment from April
4+
2020](https://github.com/SeleniumHQ/selenium/issues/8237#issuecomment-629851734),
5+
the Selenium maintainers said that they would not support Chromium-based Edge in
6+
Selenium 3. They instead suggested waiting for a stable version of Selenium 4.
7+
However, as of December 2020, there is no release date in sight for Selenium 4,
8+
Chromium-based Edge is the only version of Edge actively supported by Microsoft
9+
since August 2020, and [legacy Edge will reach end-of-life status in March 2021.](https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666)
10+
11+
Thankfully, Generic WebDriver Server is generic enough to handle this case. We
12+
can use it to configure Selenium 3 to respond to Edge and use Microsoft's
13+
`msedgedriver.exe` as a backend executable.
14+
15+
If you haven't read
16+
[setup.md](https://github.com/google/generic-webdriver-server/blob/main/setup.md)
17+
yet, that is where you will find general information on setting up Generic
18+
WebDriver Server. This document will focus on specific setup instructions for
19+
Chromium-based Edge.
20+
21+
## Setup
22+
23+
*NOTE: Though our custom backends can be configured to respond to arbitrary
24+
browser names, `msedgedriver.exe` responds only to the browser name `msedge` as
25+
far as we can tell. So it is important not to change the browser name in the
26+
configs below to anything else!*
27+
28+
1. Make sure you have the correct version of `msedgedriver.exe` for your version
29+
of Edge. See [Microsoft's instructions to check Edge version and download
30+
the right driver](https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/?tabs=javascript#install-microsoft-edge-chromium).
31+
You should have Edge version 75 or later.
32+
33+
34+
2. Install GenericWebDriverServer:
35+
36+
```sh
37+
npm install -g generic-webdriver-server
38+
```
39+
40+
41+
3. Create a node config file like this one as `node_edge.json`:
42+
43+
```json
44+
{
45+
"capabilities": [
46+
{
47+
"browserName": "msedge",
48+
"seleniumProtocol": "WebDriver",
49+
"maxInstances": 2
50+
}
51+
],
52+
"host": "127.0.0.1",
53+
"port": 5555,
54+
"hub": "http://localhost:4444"
55+
}
56+
```
57+
58+
You **must** set the `browserName` field to `"msedge"` exactly. You may
59+
customize `maxInstances`, `host`, `port`, and `hub` to your grid setup, and you
60+
may add additional Selenium node configurations as you see fit.
61+
62+
63+
4. Create the following batch file as `start_edge_node.bat`:
64+
65+
```bat
66+
set NODE_MODULES_PATH="%APPDATA%\npm\node_modules"
67+
68+
java ^
69+
-cp "%NODE_MODULES_PATH%"\generic-webdriver-server\GenericWebDriverProvider.jar;"%NODE_MODULES_PATH%"\generic-webdriver-server\selenium-server-standalone-3.141.59.jar ^
70+
org.openqa.grid.selenium.GridLauncherV3 ^
71+
-role node ^
72+
-nodeConfig node_edge.json
73+
```
74+
75+
You may replace the jar file paths with whatever is appropriate for your system,
76+
but this should be the right path for many installations of NPM on Windows.
77+
78+
79+
5. Launch `start_edge_node.bat` to start the Selenium node for Chromium-based
80+
Edge, or configure Windows to launch it automatically on startup. If you have
81+
some existing system for starting and managing your Selenium nodes, you may run
82+
the command lines from `start_edge_node.bat` in your own way.

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ Out of the box, we provide backends for:
3939
In addition, you'll need JAR files from the package [`generic-webdriver-server`](https://www.npmjs.com/package/generic-webdriver-server).
4040

4141

42+
## Chromium-based Edge
43+
44+
In addition to the backends we provide, you can also use this generic backend to
45+
support Chromium-based Edge in Selenium 3, in spite of [Selenium's recent
46+
decision not to support it directly.](https://github.com/SeleniumHQ/selenium/issues/8237#issuecomment-629851734)
47+
For details on setup for Chromium-based Edge, see [Edgium.md](https://github.com/google/generic-webdriver-server/blob/main/Edgium.md)
48+
49+
4250
## How it works
4351

4452
See [how-it-works.md](https://github.com/google/generic-webdriver-server/blob/main/how-it-works.md)

setup.md

+21
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,27 @@ the name of the application entry point for Selenium, which we would not have to
3030
specify when running the typical `java -jar selenium-server-...` command for
3131
Selenium, but it required when using `-cp`.
3232

33+
*NOTE: On Windows, the classpath separator is a semicolon (`;`), not a colon
34+
(`:`).* So on Windows, you would use something like this in bash:
35+
36+
```sh
37+
java \
38+
-cp node_modules/generic-webdriver-server/GenericWebDriverProvider.jar\;node_modules/generic-webdriver-server/selenium-server-standalone-3.141.59.jar \
39+
org.openqa.grid.selenium.GridLauncherV3 \
40+
-role node \
41+
-nodeConfig foo.json
42+
```
43+
44+
Or this in a batch file:
45+
46+
```bat
47+
java ^
48+
-cp node_modules\generic-webdriver-server\GenericWebDriverProvider.jar;node_modules\generic-webdriver-server\selenium-server-standalone-3.141.59.jar ^
49+
org.openqa.grid.selenium.GridLauncherV3 ^
50+
-role node ^
51+
-nodeConfig foo.json
52+
```
53+
3354
You also need to configure `GenericWebDriverProvider.jar` with Java system
3455
properties so it knows which backend to start. This is done with `-D` arguments
3556
before the class path and entry point. For example:

0 commit comments

Comments
 (0)