Robot Framework Built-in Library

The built-in library in the robot framework contains the standard library that provides generic keywords that are used often.

Most of these keywords are related to the run keywords.

Some of the Built-in Library Keywords are:

Run Keyword if:

Runs the given keyword with the given arguments if the if condition is True. The parameters are

Condition, name and *args

Run Keyword Unless:

Runs the keyword with the given arguments if the if condition is false. The parameters are

condition, name and *args

Run Keyword:

Executes the given keyword with the given arguments, because, the name of the keyword to execute is given as argument, it can be a variable and thus set dynamically.

The parameters are:

name and *args

Run Keyword and Continue on Failure:

Runs the given keyword with the given arguments even the failure occurs. This keyword returns two values, the first one is either Pass or Fail depending on the status of the executed keyword. The second value is either the return value of the keyword or the received error message.

The parameters are:

name and *args

Run Keyword and Return:

Runs the specified keyword and returns from the enclosing user keyword.

The parameters are:

name and *args

Run Keyword and Return Status:

Runs the given keyword with given arguments and returns the status as a Boolean value.

The parameters are:

name and *args

TimeOut

The TimeOut keyword specifies how long is the maximum time to wait when reading the output. The default value is 5 seconds.

All these elements are related to wait and the keywords which are related to alerts specify how long these keywords should wait for certain events or actions.

We can change the default timeout in two ways such as

  • Globally either by using set selenium Timeout Keyword
  • Using the Timeout argument when importing library

We can also set the Timeout implicitly by using the below keywords:

  • Set Selenium implicit wait keyword
  • implicity_wait argument when importing the selenium library

And by explicitly, we can set the selenium Timeout as wait for a certain condition to occur before proceeding further in the code by using the Sleep keyword

The parameter is: Seconds 

Selenium Speed:

Selenium speed keyword is used to slow down globally for the complete test case. The Selenium speed keyword is only used for debugging purposes.

The Time format which we will use in the Timeout as 0.5 seconds/ 2 seconds/2.5 seconds



Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions