RelationDigest

Wednesday, 31 May 2023

[New post] How to run parameterized Robot Framework tests in Jenkins

Site logo image vibssingh posted: " HOME When running your Jenkins automation jobs, you may need to pass some parameters to your scripts. These parameters can be a URL, a browser name, or even the test user's credentials. This tutorial will walk you through the process of creati" QA Automation Expert

How to run parameterized Robot Framework tests in Jenkins

vibssingh

May 31

HOME

When running your Jenkins automation jobs, you may need to pass some parameters to your scripts. These parameters can be a URL, a browser name, or even the test user's credentials. This tutorial will walk you through the process of creating a parameterized Jenkins job for Robot Framework.

It is recommended to go through these tutorials, before creating a parameterized Jenkins job:-

Download and install Jenkins on Windows10

Configure JAVA_HOME and MAVEN_HOME

Types of parameters

Jenkins supports several parameter types. Below is a list of the most common ones, but keep in mind that different plugins may add new parameter types:

  • String: any combination of characters and numbers
  • Choice: a pre-defined set of strings from which a user can pick a value
  • Credentials: a pre-defined Jenkins credential
  • File: the full path to a file on the filesystem
  • Multi-line String: same as String, but allows newline characters
  • Password: similar to the Credentials type, but allows us to pass a plain text parameter specific to the job or pipeline
  • Run: an absolute URL to a single run of another job

Implementation Steps

Step 1: Create a new FreeStyle project

  1. Give the Name of the project - RobotFramework_Demo.
  2. Click on the FreeStyle project. 
  3. Click on the OK button.

Step 2: Description of the project

In the General section, enter the project description in the Description box.

Check the option - This project is parameterized.

Click on Add Parameter, and we can select any option as shown in the above image.

Step 3: Select the Choice Parameter

Choice Parameter

As I want to run my tests on different browsers, I have selected Choice Parameter.

  1. Give the Name of the Parameter.
  2. Give the Choices of the Parameter - Chrome, Firefox, IE
  3. Give the Description of the Parameter - Select any browser to run the tests (optional).

Step 4: Select a custom workspace

Mention the full path of the project in the Use custom workspace.

Step 5: Source Code Management

In the Source Code Management section, select None.

Step 6: Build Management

Go to the Build section of the new job. Select "Execute Windows batch command".

Mention the command needed to execute the tests. In this case, I have to execute all the tests, so used the below command:

 robot --variable browser_name:"%browserName%" --include "%Tags%" . 

Step 7: Select "HTML Reports" from "Post Build Actions"

Scroll down to "Post Build Actions" and click on the "Add Post Build Actions" drop-down list.

Select "Publish HTML Reports". 

Enter the HTML directory to archive - Empty, Index page[s] - report.html, and Report title - HTML Report.

Click on the Apply and Save buttons.

If you want to see where the report is saved in Jenkins, go to the Dashboard -> RobotFramework_Demo -> Workspace -> report.html.

We have created a new project "RobotFramework_Demo".

Step 8: Execute the tests

Let's execute it now by clicking on the "Build with Parameters" button.

This screen contains the parameters which we have to select. The browser was a choice parameter and selecting a parameter from it and Tags was also a Choice parameter, so mention the tags in it and click on the "Build" button.

Right-click on Build Number (here in my case it is #11).

Click on Console Output to see the result.

Step 9: View the HTML Report

Once the execution is completed, click on go "Back to Project", and we could see a link to view the "HTML Report".

Click on the HTML Report. It displays the summary of the tests.

Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!

Additional Tutorials

How to Install Python on Windows 11
How to install and setup Robot Framework for Python
How to rerun failed tests in Robot Framework
Page Object Model in the Robot Framework
 How to set variable values from Runtime command in Robot Framework
How to load data from CSV files in the Robot Framework?
Comment
Like
Tip icon image You can also reply to this email to leave a comment.

Unsubscribe to no longer receive posts from QA Automation Expert.
Change your email settings at manage subscriptions.

Trouble clicking? Copy and paste this URL into your browser:
http://qaautomation.expert/2023/05/31/how-to-run-parameterized-robot-framework-tests-in-jenkins/

WordPress.com and Jetpack Logos

Get the Jetpack app to use Reader anywhere, anytime

Follow your favorite sites, save posts to read later, and get real-time notifications for likes and comments.

Download Jetpack on Google Play Download Jetpack from the App Store
WordPress.com on Twitter WordPress.com on Facebook WordPress.com on Instagram WordPress.com on YouTube
WordPress.com Logo and Wordmark title=

Learn how to build your website with our video tutorials on YouTube.


Automattic, Inc. - 60 29th St. #343, San Francisco, CA 94110  

at May 31, 2023
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Kropotkin, the Anarchist International and the Assassination of Czar Alexander II and President McKinley

Forwarded this email? Subscribe here for more Kropotkin, the Anarchist International and the Assassination of Czar Alexander II and Preside...

  • [New post] Wiggle Kingdom: April Earnings on Spring Savings!
    Betsi...
  • [New post] L’amour est-il suffisant dans un couple pour ĂȘtre heureux ?
    Lavine Les Mots posted: " Oui c'est le cas. Vous ne pouvez pas payer les factures mais vous avez de l'amour pour vo...
  • [New post] Balancing the ‘E’ and ‘S’ in Environment, Social and Governance (ESG) crucial to sustaining liquidity and resilience in the African loan market (By Miranda Abraham)
    APO p...

Search This Blog

  • Home

About Me

RelationDigest
View my complete profile

Report Abuse

Blog Archive

  • August 2025 (32)
  • July 2025 (59)
  • June 2025 (53)
  • May 2025 (47)
  • April 2025 (42)
  • March 2025 (30)
  • February 2025 (27)
  • January 2025 (30)
  • December 2024 (37)
  • November 2024 (31)
  • October 2024 (28)
  • September 2024 (28)
  • August 2024 (2729)
  • July 2024 (3249)
  • June 2024 (3152)
  • May 2024 (3259)
  • April 2024 (3151)
  • March 2024 (3258)
  • February 2024 (3046)
  • January 2024 (3258)
  • December 2023 (3270)
  • November 2023 (3183)
  • October 2023 (3243)
  • September 2023 (3151)
  • August 2023 (3241)
  • July 2023 (3237)
  • June 2023 (3135)
  • May 2023 (3212)
  • April 2023 (3093)
  • March 2023 (3187)
  • February 2023 (2865)
  • January 2023 (3209)
  • December 2022 (3229)
  • November 2022 (3079)
  • October 2022 (3086)
  • September 2022 (2791)
  • August 2022 (2964)
  • July 2022 (3157)
  • June 2022 (2925)
  • May 2022 (2893)
  • April 2022 (3049)
  • March 2022 (2919)
  • February 2022 (2104)
  • January 2022 (2284)
  • December 2021 (2481)
  • November 2021 (3146)
  • October 2021 (1048)
Powered by Blogger.