Dynamic Grid Docker and binding volume to upload document

287 views
Skip to first unread message

Jeremie

unread,
Aug 4, 2022, 2:58:52 AM8/4/22
to Selenium Users
Hi All,

In selenium dynamic grid docker, i am looking for a way to upload document in the container created by the hub

I am using the configuration provided by the documentation on a local window computer:

how can i bind volume to those container created?
How can i use config.toml to set those container when created?
Or may be the setting should be in the docker compose file?

Thanks for your help

⇜Krishnan Mahadevan⇝

unread,
Oct 28, 2022, 3:02:01 AM10/28/22
to seleniu...@googlegroups.com
Jereme,

I believe that for an upload merely using the Selenium API should work (even in the Grid). Please see the javadocs of org.openqa.selenium.remote.RemoteWebDriver#setFileDetector

In this case you would need to use LocalFileDetector and that should do the trick.

Alternatively you can set this via org.openqa.selenium.remote.RemoteWebElement#setFileDetector

A RemoteWebELement is an implementation of WebElement interface and so you should be able to cast it safely I believe.

Usually a volume is required ONLY when trying to download something from a browser onto the node which then needs to be accessible to the test.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/8fdd7878-7ef4-4f17-84e9-81c13087e2ebn%40googlegroups.com.

Damian Minkov

unread,
Oct 28, 2022, 11:09:03 PM10/28/22
to seleniu...@googlegroups.com
Hi Krishnan,

What about if we need some files to be available for the chrome instance to be able to use "use-file-for-fake-video-capture=" and "use-file-for-fake-audio-capture=" chrome parameters and pass those files there?

We use webrtc and we need to pass those for real audio and video feeds.

Thank you 
Damian 

⇜Krishnan Mahadevan⇝

unread,
Oct 28, 2022, 11:35:19 PM10/28/22
to seleniu...@googlegroups.com
Damien,

You can first map a network drive as a volume to your docker container as explained in here.
After that, you could pass in the required parameters via ChromeOptions exposed API (addArguments() for e.g., ?) wherein you refer to the path of the volume in docker container.

That should do.

Note: I have never tried this by myself since I haven't had a use case to handle this. 

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

Damian Minkov

unread,
Oct 29, 2022, 10:53:04 AM10/29/22
to seleniu...@googlegroups.com
Hi again,

But if I create that volume and add it to the container this will be
the hub container in a dynamic grid. So Selenium will attach it and to
all nodes that it dynamically spins?
https://github.com/SeleniumHQ/docker-selenium#dynamic-grid

Thank you
> To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmypOikOcJL3YrM8kC3xY_s75kD4PSjcA93%3DJ_m6mF2ww%40mail.gmail.com.

⇜Krishnan Mahadevan⇝

unread,
Nov 1, 2022, 3:44:26 AM11/1/22
to seleniu...@googlegroups.com
I didn't quite understand what you meant Damian.

The network drive can be mounted to each of the nodes as well, so that all the containers will now start sharing the same common shared lib.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

Damian Minkov

unread,
Nov 1, 2022, 8:17:19 AM11/1/22
to seleniu...@googlegroups.com
Hi again, 

When I was setting up the dynamic docker grid I saw you can just point which images to use and didn't see a way to pass settings like this.

Thank you




⇜Krishnan Mahadevan⇝

unread,
Nov 2, 2022, 1:25:15 AM11/2/22
to seleniu...@googlegroups.com
Those are Selenium related settings and I was sharing Docker related settings. These are two different things. I am not sure if Selenium provides for a way to pass through docker settings via its own settings.

Maybe you can try this and see if it works


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

Damian Minkov

unread,
Nov 2, 2022, 7:39:00 AM11/2/22
to seleniu...@googlegroups.com
Thank you for your answer, I think this will work! 

Damian Minkov

unread,
May 19, 2023, 6:27:44 PM5/19/23
to Selenium Users
Reply all
Reply to author
Forward
0 new messages