Here is some context
I was asked to work on a robotframework project that runs on GitHub/docker and connects to SauceLabs (as a selenium grid) and I need to find a way to persist data/files/folders from one test run to another.
- I cannot use other libraries that are not SeleniumLibrary or AppiumLibrary (it will be difficult to get the approval of any custom library).
- SauceLabs has a Storage service and easy-to-use API to upload and download files.
- SauceLabs has a
pre-runfunction that allows the execution of a file to prepare the VM/Node before the test case starts.
- I need to find a way to send files from my local to the selenium remote node
- I need to find a way to execute either a python script / shell script on the remote node, the script will zip a folder in the remote and later upload it to sauce labs storage.
Questions you might have so far.
Why don’t you use
choose filefrom SeleniumLibrary? Because
Choose fileis waiting for a locator and a file. I couldn’t find a way to use this keyword without the locator. So
pre-runsolution seems the way from local->remote I need to figure out the remote->local.
Use a daemon, Ummm I thought about it, but in order to start the test case ( or open the browser) the pre-run step must finish, so either I end with a daemon that stops before the test case start or an orphan one (which I have no idea how to deal with).
Now Where I’m stuck
How can I:
- Execute a python file on the remote node file system? (I put the script there with the
pre-run, and it is just a small script that will zip a directory and use saucelabs API to send it to saucestorage)
- if the above is not possible, can I use the
PS. no pressure, I will be fired if I cannot find the way to do this, no pressure …