The ride is a test editor for the robot framework. Going further, we will write test cases in the ride. To open the Ride editor, we have to run the below command
In this section, we are going to discuss the Options and Features which are available in the Ride editor. These Options and Features will help us to test our projects.
Go to File and click on the New project as shown in the below image
Once you click on the New Project, the following dialog box will appear
Enter the name of the project, and the created path is the path where the file is getting saved. If required, you can change the location of the file. The project can be saved either in File or Directory format. We can also save the project file like ROBOT, TXT, TSV, or HTML format.
I am creating a project by the name called Demo in my robot framework directory
Click on the Ok button to create the project.
The Name of the project has shown on the left side, and on the right side, we can see the three tabs Edit, Text Edit, and Run.
The Edit has a lot of options on UI as shown in the below image, in this section we can add data required to run our test cases and also we can import the Library, Resources, and Variables and also we can add scalar, List and Dict.
The details added in the Edit tab can be seen in the Text Edit tab, we can also write the code here.
If there is any change added in the Text edit, it will be seen in the edit section, and hence any changes done will be seen on both as shown above.
Once the test cases are ready, we can use the third Tab
Run. The Run UI is as shown below and it will come with options like Start, Stop, Pause, Debug, Continue, and Next, step over. You can also create a Report, Log for the test cases.
I have successfully created the new project Demo if you right-click on the Demo, you will get different options, we have to create New Suite to create test cases
Create a New Suite, demo1 and click
Right-click on the Demo1 test suite and select the New Test Case
The New Test Case will appear as shown below, I am creating the new test case by the name First Test Case and click on ok.
Once the test case is saved, the test case page will appear as shown below
The Test case has options like Documentation, Setup, Teardown, Tags, Timeout, and Template. There is an Edit button across each option, by clicking on it, a screen will appear, wherein you can enter the details for each option.
The Robot framework test cases are keyword-based, and we can write the test cases by using the built-in keywords or by importing from the library. We can also create user-defined keywords, variables, etc.
The Search keyword option can be used to search keywords
To get the list of all the keywords which are available, enter
Ctrl+Alt+Space in the tabular column, you will get the possible keyword suggestions.
The following example demonstrates creating a simple test case
First, open the command prompt and then type below command to open the Ride editor
And the next step is to create a new directory, I have already created a test case by the name first test case, now open the test case and enter the keywords.
Search for the Should Be Equal keyword by pressing
Ctrl+Alt+Space button simultaneously
And pass the two integer values
4 and 4in the next column
Whenever we write the test case in the script format, the same thing will be reflected in the text editor as well.
Now go to the Run tab and select the First Test Case, on the left side corner and then click on the
As soon as you press the
start button, the editor will ask to save the changes and run the test cases, press yes.
The output of the test case will be displayed as shown below
You can see that the above test case, 1 passed and 0 failed, and the robot framework also provides the detailed log and the detailed report under log option
The complete log report is as shown below
If you click on the + SUITE Demo1 option in the below, you will see the complete details of the Demo1
In the same way, if you click on the
+ TEST, you will see the details of the First Test Case
Consider another test case which contains wrong arguments for
Should Be Equal keyword
If we run the above test case, if the test case is wrong, then the output is highlighted and showed as one failed.
And if you open the log report
And the Test Execution log is, therefore, when the test case fails, then the log color will be changed to red.
Advantages of using Robot Framework (RF)
The test library provides the actual testing capabilities to the robot framework by providing the keywords. There are several standard libraries that are bundled with the framework, they are Internal library and External library.
The libraries are mainly used externally in test data, but they can also be used in custom test libraries if there is a need. Especially the built-in library is often useful when there is a need to interact with the framework.
We can import the external libraries such as Selenium Library, Excel library, and Database library into the robot framework either by
We can also execute the test cases through the command line. Open the
command prompt and open the
ride editor next, open the project and then open the test suite, in the test suite page, you will find the address path of the project saved.
Copy the address link and open the command prompt and directed to the project directory and then pass the command as the
robot name of the test suite
Once you press Enter the test case will be displayed on the command prompt
If we do not want to run the complete test suite, you can also run the particular test case by using the following command
robot -t testname
And the below link provided you with the various command-line options