· projects · 1 min read
OpenShift Templates for Selenium
I’ve recently started using OpenShift and thought I’d write about my findings on how to use OpenShift with Selenium. For those of you who do not know what OpenShift does, the excerpt from OpenShift’s website says
OpenShift is Red Hat’s Platform-as-a-Service (PaaS) that allows developers to quickly develop, host, and scale applications in a cloud environment
Where OpenShift shines, is its ability to take Docker containers, and deploy them in any configuration you could imagine.
The way this post pertains to Selenium, is the fact that you are able to leverage OpenShift, and the existing Selenium Docker containers, to create a scalable Selenium infrastructure.
Templates
openshift selenium
Tutorial
Download the Templates
Clone the repository, or download the templates directly from GitHub
Login to OpenShift
Login to your OpenShift instance using the oc
CLI
Create the Selenium Hub Template
Create the Selenium Hub template by using oc create -f selenium-hub.yaml
Create the Selenium Node Chrome Template
Create the Selenium Node Chrome template by using oc create -f selenium-node-chrome.yaml
Add the Selenium Hub Template
From the OpenShift WebApp, switch to your desired project, and click "Add to Project"
Add the Selenium Node Chrome Template
Search for "selenium" and add the "selenium-hub" template to the project
Create the Selenium Hub
Click "Create"
Add the Selenium Node Chrome Template
Search for "selenium" and add the "selenium-node-chrome" template to the project
Configure Selenium Node Chrome
Upon configuration of the Selenium Node, change the HUB_PORT_4444_TCP_ADDR
and HUB_PORT_4444_TCP_PORT
to the route defined here
Create
Click Create
You now have a scalable infrastructure with one hub, and any amount of nodes that are ready to run tests in the Chrome browser.
You may also oc create -f selenium-node-chrome.yaml
and follow steps 5-9 in the context of “firefox” instead of chrome.
Links
GitHub: https://github.com/ddavison/selenium-openshift-templates