Working with Built-In Library


Advertisements

In this chapter, we will cover some of the important built-in keywords, which come with the Robot Framework. We can use these keywords along with External libraries for writing test case. We also have the built-in library available with Robot framework by default. It is mostly used for verifications (for example – Should Be Equal, Should Contain), conversions (convert to integer, log to console, etc.).

We will work on a simple test case and will make use of built-in library in that.

We have created project in Ride and Test case as shown below −

Built In Keywords

We have created 2 scalar variables – number and name as shown below −

Scalar Keywords

Here are the test cases used for comparing number, string, concatenate, etc. We have used simple keywords in the test cases below. The keywords are shown in tabular format here −

Comparing Number

Following is the test code for above test cases from text edit −

Test Cases Edit

Now, we will execute the test case to see the results −

Test Cases Results

When you write your keywords in tabular format, press ctrl + spacebar. It gives the list of built-in keywords available with Robot Framework.

Tabular Format

It gives the details of each keyword with example in the corresponding window. When we click on the corresponding window, it will open separately as shown below −

corresponding window

Conclusion

We have seen keywords related to string, numbers, log messages, which are available with robot framework by default. The same can be used along with external library and also can be used to create user-defined keyword to work with test-cases.

Advertisements