docker-selenium
docker-selenium copied to clipboard
[🚀 Feature]: Allows to configure volume mappings for dynamically generated containers of Dynamic Grid
Feature and motivation
I want volume mapping to upload files and deliver camera video streams
Usage example
[docker]
configs = [
"selenium/standalone-firefox:4.3.0-20220726", "{\"browserName\": \"firefox\",\"volumes\":[\"/data:/data\"]}",
]
options.add_argument('--allow-file-access-from-files')
options.add_argument('--use-fake-ui-for-media-stream')
options.add_argument('--use-fake-device-for-media-stream')
options.add_argument('--use-file-for-fake-video-capture=/data/test.y4m')
options.add_argument('--use-file-for-fake-audio-capture=/data/test.wav')
We won't take the path of having volume mappings but probably we should add a command to download a file in the Node for these type of things. However, this needs to bring more interest from the community and probably that someone wants to work on it.
selenium/node-chrome:latest Is it suitable for dynamic grids?
This would be very useful. In my case, mapping chrome download folder to windows folder:
config.toml [docker] configs = [ "selenium/standalone-chrome:latest", "{"browserName": "chrome"}" ] devices = [ 'c:/seleniumData:/mnt/profiles' ]
var downloadDir = "/mnt/profiles"; chrome_options.AddUserProfilePreference("download.default_directory", downloadDir);
Thank you.
good thankyou
Can this be achieved via --docker-devices ?
https://github.com/SeleniumHQ/selenium/blob/184a83575e0f8985297e7d2dee49e27f14b14fe0/java/src/org/openqa/selenium/grid/node/docker/DockerFlags.java#LL73C1-L73C1
That is meant to mount kvm but might work. I have not tried it.
Hey all, Looking for capability to upload a file temporarily and use it with selenium automation. Can this issue be prioritised?
Some Background - Zalenium has this capability which allows user to upload a file to a mount temporarily and use it with selenium. As we are thinking of moving to docker-grid4, we are facing this issue of not having capability to upload file in docker.
If you need to upload a file, you can already do it with https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/#uploads
The Image we are trying to upload is in aws s3 and quite large. This method, won't suffice for that. We will be having a remote docker server and test would be run through jenkins. So, we are looking for an option to upload the file first to docker server and then upload. This way it would work.
Is the file always the same one? If so, why don't you build your own docker image based on the official ones and add the file to it?
No. The file would be different every other time. It's dynamic upgrade images, which we would upload. Each time a new one.
In any case, you are uploading the file to the website you are testing. If the file is enormous, you are still transferring it over the network. Is that the only way to test your feature? I cannot imagine how long those tests take.
Yes. Since, the test is about uploading image and upgrading the system via UI. We have to follow these steps to check all the UI elements and steps. It does take sometime but that's not an issue.
@rajat-garg-del, can you read through this example to see if it helps? https://github.com/SeleniumHQ/docker-selenium/issues/2143#issuecomment-2051282667