How to execute Selenium2Library tests in a Docker container on Windows?

2,196 views
Skip to first unread message

Wladislaw Wagner

unread,
Nov 21, 2015, 2:39:47 PM11/21/15
to robotframework-users
Hey guys,

is anybody here using Docker[1] to execute tests with Robot Framework + Selenium2Library and could give advise how to set up that beast on a Windows machine? Most examples I have found are for Linux :-/

[1] https://www.docker.com

Cheers
Tset

David

unread,
Nov 21, 2015, 9:30:47 PM11/21/15
to robotframework-users
Well this begs the question, are you looking into Docker in terms of managing the Selenium grid nodes? Or Docker to encapsulate the RobotFramework setup? Or both?

They are different topics but related. Doing a search online, there appears to be an option for the latter, but I don't see any examples, tutorials to help you out, you're on your own for the most part, what is supplied is the Dockerfile to help you build the image:


and if you wanted to then use Docker to run Selenium grid (or remote browser instances of RemoteWebDriver) with (Dockerized or not) Robot Framework, that's yet another topic to connect RF tests to Selenium nodes running in Docker:


As for the setup for Windows part, you should know the Docker image at present is Linux based, but the images can be run on Windows (although support is not good compared to Linux as host or even Mac). You should just search online for Docker Windows to learn about that. With this in mind, that likely does mean that Docker version of RobotFramework will not support Windows specific testing features like AutoItLibrary, ActiveX/COM, etc. unless you use those libraries via the remote library interface, which means running them on Windows natively (often with a Windows install of Robot Framework) which kind of defeats the purpose of Dockerizing Robot Framework to begin with.

Tset Noitamotua

unread,
Nov 23, 2015, 11:00:27 AM11/23/15
to robotframework-users
Hi David,

thank you for taking time to reply.

Actually I just want to have an execution environment which our Dev Team can use within their Continuous Integration (CI) process with Jenkins. Initially we started this journey with Robot Framework standalone JAR[1] following this example[2] of Markus Bernhardt. But soon we noticed that there was a difference to what the QA Team used to develop automated test locally (namely Python + RF + 'original' Selenium2Library). Markus´s example uses the Java port[4] of 'original' Selenium2Library[5] -  this is not 100% identical to the original S2L e.g. some keywords have slightly different names so that locally developed tests fail when Dev team executes them with Markus´s approach. Further because of the incompatibility of Selenium2Library and Jython it is not possible to extend the Robot Framework standalone JAR with all dependencies and hand it over to the Dev team which actually would be the easiest solution ever - if it worked. QA team does not intend to develop and maintain a custom Selenium2Library like the Java port instead we want to got with the original and common Python S2L. Thats why I started to search for other options. Docker seems to be one of the options I came across so far. Another option seems to be Vagrant[3]. Docker seems a little complicated to me because I am missing the necessary Linux skills. From the production environment´s point of view Vagrant would be a better option, but I did not examined it deeper, yet.

I definitely will further research on both options but if anybody have any other suggestions please share.

Cheers
Tset

[1] http://search.maven.org/#search|ga|1|a%3Arobotframework
[2] https://github.com/MarkusBernhardt/robotframework-archetype-selenium2library
[3] https://www.vagrantup.com/
[4] https://github.com/MarkusBernhardt/robotframework-selenium2library-java
[5] https://github.com/robotframework/Selenium2Library

David

unread,
Nov 24, 2015, 12:51:54 AM11/24/15
to robotframework-users
Is the plan then to just use the packaging & deployment technology for CI/dev, and QA keeps the environment they have or all groups will move to this new common infrastructure based on what QA currently has/uses?

If the former, it's easier to choose tech & deal with, but you may have to monitor changes from QA and keep your stack in sync with the toolset QA uses. The latter is a better long term solution, but you then have to account for expertise with the infrastructure tools between QA and devs as users of it. Frankly Docker is relatively new and isn't fully robust for production use, harder to use if on Windows & Mac, Vagrant may be easier to deal with. I believe you can use vagrant & docker together too. So just be aware of the user support you may need to provide if going the latter route.

Dhiraj Hadkar

unread,
Oct 18, 2016, 1:25:15 AM10/18/16
to robotframework-users
Guys,

Has anyone tried to execute commands to restart services inside docker container by using atdd scripts.

For instance docker exec -it containerid /etc/init.d mysqld stop
Reply all
Reply to author
Forward
0 new messages