plugin for Selenium Grid to support accessing downloaded files.
- Download the latest version from releases.
- Launch Selenium Grid Hub like as follows.
- add
hub-rest-*-jar-with-dependencies.jar
to classpath. - specify custom servlet for Hub by
-servlet
option.
java -cp hub-rest-1.0.0-jar-with-dependencies.jar:selenium-server-standalone-3.141.59.jar org.openqa.grid.selenium.GridLauncherV3 -role hub -servlet com.github.old_horizon.selenium.hub.Downloads
- add
- Launch Selenium Grid Node like as follows.
- add
node-rest-*-jar-with-dependencies.jar
to classpath. - specify custom servlet for Node by
-servlet
option.
java -cp node-rest-1.0.0-jar-with-dependencies.jar:selenium-server-standalone-3.141.59.jar org.openqa.grid.selenium.GridLauncherV3 -role node -hub http://{Selenium Grid Hub}/grid/register -servlet com.github.old_horizon.selenium.node.Downloads
- add
returns all files in Downloads directory.
$ curl http://{Selenium Grid Hub}/grid/admin/Downloads/{Driver Session ID}
{
"files": [
{
"name": "file1.txt"
},
{
"name": "file2.txt"
},
{
"name": "file3.txt"
}
]
}
returns content of specified file.
$ echo 'first' > ~/Downloads/file1.txt
$ curl http://{Selenium Grid Hub}/grid/admin/Downloads/{Driver Session ID}/file1.txt
first
deletes specified file.
$ curl -XDELETE http://{Selenium Grid Hub}/grid/admin/Downloads/{Driver Session ID}/file1.txt
$ curl http://{Selenium Grid Hub}/grid/admin/Downloads/{Driver Session ID}
{
"files": [
{
"name": "file2.txt"
},
{
"name": "file3.txt"
}
]
}
deletes all files in Downloads directory.
$ curl -XDELETE http://{Selenium Grid Hub}/grid/admin/Downloads/{Driver Session ID}
$ curl http://{Selenium Grid Hub}/grid/admin/Downloads/{Driver Session ID}
{
"files": [
]
}
MIT