aerokube / selenoid

Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
https://aerokube.com/selenoid/latest/
Apache License 2.0
2.61k stars 324 forks source link

How can I mount directory to node containers ? #23

Closed skeenerok closed 7 years ago

skeenerok commented 7 years ago

Hi, I have several tests with upload and download files. Usually, I mount directories with required files to the container with browser but it this case I did not find the way how to configure selenoid to start containers and mount directories to them. Also, It is nice to know how to set dns and dns-search for containers which were started by selenoid.

skeenerok commented 7 years ago

Example my current start command:

docker run -d -P --dns=192.168.64.1 --dns-search=intra --dns-search=example.com -e 'SCREEN_WIDTH=1220' -e 'SCREEN_HEIGHT=1000' -e DISPLAY=:99.0 -p 5903:5900 --link selenium-hub:hub -v /home/user/Downloads/:/home/seluser/Downloads/ -v /home/user/webdriver/uploads:/uploads selenium/node-firefox-debug:2.53.1

As a result, to check whether files are downloaded I use '/home/user/Downloads' path on the host, to specify the upload path in the browser - '/uploads/$file' of container file system.

vania-pooh commented 7 years ago

@skeenerok Selenium protocol allows to upload files using profiles. Regarding downloading files - how about downloading them using direct link? According to what I know - that's not a trivial task to download file because file dialog is native in each browser.

aandryashin commented 7 years ago

@skeenerok We did not plan to implement all docker client functionality in selenoid. In distributed environment users do not have access to individual seleniun nodes and cannot mount local filesystems. To download files or capture and manipulate traffic you can use this tool https://github.com/lightbody/browsermob-proxy.

vania-pooh commented 7 years ago

@skeenerok closing this question as answer was provided. Feel free to reopen if you have more questions.