Parallel Execution Using Robot Framework

 In this blog, you will learn how to execute two different robot classes parallelly. With the help of parallel execution, you can save test execution time. In this example, I am demonstrating how to run two different robot classes in parallel.

Task: Execute 02 different Robot Classes/All classes in a directory parallelly

  1. First, you need to install Pabot.

For installing Pabot you need to follow the following steps:

  • a) Open the command prompt.
  • b) Type>pip install -U robotframework-pabot

U robotframework pabot

2. Open the editor (e.g., PyCharm) you are using for the robot framework and add a library in all classes which you want to run parallelly.

library robot framework

Note: Here I am using PyCharm as an editor.

  1. Here are the following ways to execute the suites parallelly.
    • a) If you want to run two different robot classes parallelly then type the following command in PyCharm and press enter:

pabottestcases/FirstRobotClassName.robottestcases/SecondRobotClassName.robot

Note: Here are test cases in the directory where I have kept my robot classes and AdvancedFilter and BulkImport are the names of two different robot classes which I want to run parallelly.

local terminal Advance case

  • b) If you want to run all the test cases of a particular directory in parallel then type “pabot testcases/” command in PyCharm and press enter.

testcases of pabot framework

Result: You can see the total time of execution and time you saved while running the robot class parallelly once the execution will finish. Elapsed Time is the amount of time that passes from the start of an event to its finish. So here we have saved around 2 mins from the expected execution time.

Elapsed Time, Testing time

FAQs

  • Robot framework tasks vs test cases?

The names and the fact that tests are created in a tests section (for example, *** Test Cases ***) and tasks are created in a tasks section (for example, *** Tasks ***) are the only differences. They are the same in every other way.

  • How to run multiple test cases robot framework?

Add a Suite Setup to the robot file so that you can use the Add Test Matrix keyword to build a test case for each possible combination of test scenarios and nations. In this manner, each country-test scenario pair will have a unique test case, and everything will be contained in a single file.

  • How can I run a Robot Framework program?

Using the Robot Framework to Run Your Selenium Tests

Type robot path/to/tests into your prompt to run robot tests. To create cross-platform tests, the name of the suite file or directory.d should be ‘path/to/tests. This means that a web application that works on Firefox, Chrome, and Safari can be tested using the same test that is used to test iOS and Android apps.

  • Can we use Robot Framework for iOS testing?

Writing cross-platform tests is made possible by the Robot framework, which offers an abstraction layer on top of the actual physical implementation of the system being tested. This means that a web application that works on Firefox, Chrome, and Safari can be tested using the same test that is used to test iOS and Android apps.

Recommended to Read

If you are interested in even more Robot Framework-related articles and information from us here at Devstringx, then we have a lot to choose from for you.

Original Source:- Click Here

Comments

Popular posts from this blog

Fetch Text from Image & PDF Using Selenium Java