0

I have a requirement in which i have to run Selenium Ui test using docker images for .Net Core in azure pipelines.Is there any way in which this can be accomplished.I did not find any official or verified Docker images.

Any help is appreciated.

0

2 Answers 2

2

If you tried the tutorial @Infern0 mentioned. You can then try adding a Docker task in your azure pipelines.

First you may need to create a docker service connection in your azure devops. Check here for more details. Then you can add a docker task in your pipeline. check here for docker task.

I also found a tutorial here that might be helpful, it describes how to run selenium UI test within docker images.

The author pointed out in the tutorial below command to run a Selenium Grid. And Then connect the selenium scripts with the selenium hub with driver = RemoteWebDriver(host,caps)

$ docker run -d -p 4444:4444 --name selenium-hub selenium/hub:3.4.0
$ docker run -d --link selenium-hub:hub selenium/node-chrome:3.4.0

If docker is installed in the agent, you can add a powershell or bash task in your pipeline to run docker command.

To conclude, beside using container as 2Infern0 mentioned, you can aslo use script tasks to run docker command or to use docker task.

Hope you find above helpful!

Sign up to request clarification or add additional context in comments.

1 Comment

I was able to run the test using your solution.Thanks for your help
-1

For running e2e tests on browser, there is already build images provided by selenium. More info can be found here: https://github.com/SeleniumHQ/docker-selenium

About building your test framework to image, there is plenty of tutorials in the net, how to produce docker file and put everything required inside. Example: https://logcorner.com/setup-selenium-web-browser-automation-using-asp-net-core-and-docker/

At the end you can just create compose file to run the images.

4 Comments

I did try it out but i was not able to run the test through azure pipelines
There is pipeline guide for running containers.
I was not able to view pipeline guide for running containers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.