Skip to content

old-horizon/selenium-grid-file-download-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

selenium-grid-file-download-plugin

plugin for Selenium Grid to support accessing downloaded files.

Install

  • 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
  • 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

Usage

GET /grid/admin/Downloads/{Driver Session ID}

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"
    }
  ]
}

GET /grid/admin/Downloads/{Driver Session ID}/{File Name}

returns content of specified file.

$ echo 'first' > ~/Downloads/file1.txt

$ curl http://{Selenium Grid Hub}/grid/admin/Downloads/{Driver Session ID}/file1.txt
first

DELETE /grid/admin/Downloads/{Driver Session ID}/{File Name}

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"
    }
  ]
}

DELETE /grid/admin/Downloads/{Driver Session ID}

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": [
  ]
}

License

MIT

About

plugin for Selenium Grid to support accessing downloaded files.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages