DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Automating the Migration From JS to TS for the ZK Framework
  • 5 Key Concepts for MQTT Broker in Sparkplug Specification
  • Writing a Vector Database in a Week in Rust
  • What Is React? A Complete Guide

Trending

  • Automating the Migration From JS to TS for the ZK Framework
  • 5 Key Concepts for MQTT Broker in Sparkplug Specification
  • Writing a Vector Database in a Week in Rust
  • What Is React? A Complete Guide
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Run Headless Selenium Tests From Jenkins

Run Headless Selenium Tests From Jenkins

This tutorial shows you how to run headless Selenium tests via Jenkins using a centOS machine in a continuous integration environment.

Marco Corona user avatar by
Marco Corona
·
May. 26, 17 · Tutorial
Like (6)
Save
Tweet
Share
9.98K Views

Join the DZone community and get the full member experience.

Join For Free

In a previous blog, I went over how to set up headless tests on a centOS machine; in this blog, I will be going over how to introduce this machine into a continuous integration environment via Jenkins.

The first thing that we need to do is install the Xvfb plugin on the Jenkins instance, which is installed through "Manage Jenkins" --> "Mange Plugins":

Image title

Now that the plugin is installed, we must tell Jenkins where our Xvfb installation is located. This is done through "Manage Jenkins" --> "Configure System" --> "Xvfb Installation". On my centOS machine, Xvfb is located at /usr/bin as seen below:

Image title

The next step in getting our headless tests to run is to go to the job(s) that will be running the headless tests to configure the plugin. For this first and simplest example, it will be assumed only one instance of this test job will be run on the slave that can run headless tests.

Image title

In the above picture, you will see the configuration block for the Xvfb plugin. The first thing we want is to check the box "Start Xvfb before the build, and shut it down after."

The next configuration option to pay attention to is which Xvfb installation you would like to use for this specific job. If you have set it up like above, it will be the "Default" installation.

For the next option, the value "10" is inserted into the "Timeout in seconds" box. This option tells the job to give Xvfb 10 seconds to start up before the job continues. You may want to increase or decrease the timeout depending on how your slave that this job is running on performs.

Next, it is important is to keep the "Xvfb display name offset" at 0. This option is used when you do not explicitly set the display name for Xvfb to run on.

Image title

Finally, before your tests run, it is important to set your DISPLAY variable to the display that Xvfb is started on, so Firefox knows where to look; In this case, it is :99, as seen above.

Testing Jenkins (software)

Published at DZone with permission of Marco Corona, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Automating the Migration From JS to TS for the ZK Framework
  • 5 Key Concepts for MQTT Broker in Sparkplug Specification
  • Writing a Vector Database in a Week in Rust
  • What Is React? A Complete Guide

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: