Sahi Robot Bridge
Robot bridge comes bundled with Sahi. Following must be completed before you can invoke test cases using the bridge:
- Python must be installed on the machine (This version was tested with v2.7 of Python). If you don't have Python already installed, you can get it from Python Website
- Robot framework must be installed and available in systems PATH variable. Generally you need to add the scripts folder of Python to your PATH variable. This will insure that we have pybot available for script execution.
your_sahi_home/plugins/robotto your PYTHONPATH.
A batch file called
runRobotTest.bat is present within the
plugins/robot folder which can be used to test the correct working of the bridge using a ready made script in Sahi.
- Sahi Open Browser
Opens a browser with given browser name and start URL. The browser names are defined in
- Sahi Close Browser
This will close the open browser.
- Sahi Load Script
Loads a script and executes the steps in it. The functions of the script are then available for individual execution. It takes the full script path as the parameter.eg.
load script D:/sahi/sahi_pro_g/userdata/scripts/sahitests/robot_sample.sah
- Sahi Execute Function
Executes a function from loaded script. Takes two parameters(second parameter is optional):
- Function name
- All the parameters separated by comma as the second parameter. If the function doesn't takes any arguments, leave blank.
execute function login "test","secret" execute function addBooks "3", "2", "1" execute function verifyTotal "1400"
- Sahi Execute Step
Executes a valid Sahi statement. Takes only one parameter as the complete Sahi statement. e.g
execute sahi step _navigateTo("http://sahi.co.in/");