I want to run my test case with multiple test data (for different countries). Can this be achieved in the Robot framework? I have been working on RIDE IDE.
Below is sample code:
*** Settings ***
Suite Setup Login to Application
Suite TearDown Logout and Close The Browser
Resource import all required resource files
***Test Cases ***
Sample Test Case To Create Data for Multiple countries
Select Country USA #here am hard coding the country value, instead I want to pass it in run time
Enter all required data
Click Submit
#sample resource file that has the keyword for selecting Country Drop down and fill other details
*** Keywords ***
Select Country
[Arguments] ${value}
Select From List By Label ${locator} ${value}
Input Text locator text value
I tried to pass the arguments in test case but it says sanity check fails. Reset changes in the RIDE IDE the moment I add arguments at the Test case level.
I am using Python 2.7.14, RIDE 2.0a1.
To pass a dictionary to a keyword, you do it like any other argument. In your case, if you have a dictionary named ${Participants} , you would pass it as ${Participants} . As for iterating over the dictionary, you need to replace $ with @ , and use FOR/IN.
You can add any number of commands using 'Execute Command' keyword in script and run. Below am listing few of SSHLibrary Keywords in Robot framework and their usage: Open connection - Opens connection to Remote machine. Close Connection - Closes the existing active remote connection.
In the Robot Framework Userguide there is an entire chapter on Configuring the Execution of Robot Framework. In this chapter there is a section on passing variables via the command line.
An example:
robot --variable OS:Linux --variable IP:10.0.0.42 my_test_suite_file.robot
and then you can use the variables ${OS}
and ${IP}
at any point in your scripts as they are Global variables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With