This section includes how to write test cases in Ride :-
The Robot Framework IDE (RIDE) is the integrated development environment to implement automated tests and it is a generic test automation framework for acceptance testing.
Pre-requisite :- Ride should be installed.
To install ride steps are :-
1.install python in ur disk drive.(python-2.7.1)
2.Set these two env variables
PYTHONHOME = C:\Python27
PYTHONPATH = C:\Python27\Lib;C:\Python27\Scripts;C:\Python27\Lib\site-packages;C:\Python27\Lib\site-packages\Selenium2Library;C:\Python27\Lib\site-packages\robotide\;C:\Python27\Lib\site-packages\robot\;C:\Python27\Lib\site-packages\wx-2.8-msw-unicode;C:\Python27\Lib\site-packages\SampleLibrary
and also Add this to path
path =;%PYTHONHOME%;%PYTHONHOME%\Scripts
3. install setup tools (setuptools-0.6c11.win32-py2.7)
4. easy_install robotframework (robotframework-ride-0.49.win32)
5. easy_install robotframework-selenium2library(robotframework-seleniumlibrary-2.7.win32.exe)
6. install wxPython2.8-win64-unicode-2.8.12.1-py27(wxPython2.8-win32-unicode-2.8.11.0-py27)
7. install ride (robotide-0.31.win32.exe)
8. install pywin module(pywin32-214.win32-py2.7)
Verify the Installation
Open new command prompt and type ‘pybot --version’ and output like Robot Framework 2.7.5
Example :-
If a user want to login :-
step 1:- Given url is opened.
step 2:- when user enter his credentials.
step 3 :- and when user click on login
step 4 :-Then he should navigate to home page.
In this example user name and password are the mandotary, then he will be able to login.
Getting started with Ride :-
1. Make a New project in ride as follow say Test .it should be directory.
2.Add test suite as a file say test_suitte as follow.
Write the name of suite in popup as shown.
2. Add library selenium2 in test_suitte file by clicking on library as shown in bold in following image :-
Write name of library in popup Selenium2Library as shown.Library will be added
3. Right click on that file and click new test case say TC1.
give the name of test case in popup as :-
Test case will be added.
Generic fields for this testcase – for example documentation and tagging – can then be defined in the upper part of the editor. In the lower part the testcase is written in tabular format as a sequence of corresponding keyword calls. Thereby the keyword is written in the first column and all possible parameters in the other columns as shown in below figure.
Keywords are predefined and user can make his keywords with predefined keywords.
e.g. if a user want to login then following steps are necessary :-
1. Given url is opened.
2.When user enter credentials.
3.When click on login button.
4.Then home page should appear.
and all steps I have taken as my keywords.
Now next step is to define all user defined keywords.
Given url is opened :-
1. right click on test file and click on add new user keyword,named - Given url is opened.
Write the name of keyword Given url is opened ,it will be added.
1. right click on test file and click on add new user keyword,named - Given url is opened.
Write the name of keyword Given url is opened ,it will be added.
-To open that url,add predefined keywords in table and corresponding values
-as above "open browser" is predefined keyword in selenium library.
-Predefined keywords can be find by pressing f5 . Window will be open as :-
-Open browser has 2 parameters , url and browser in which url will be opened.
- here I defined url -www.gmail.com and browser - chrome
- here I defined url -www.gmail.com and browser - chrome
Similarly for another user defined keywords follow the same process right click on test_suitte file and add.
When user enter his credentials:-
Next step define when user enter credentials with the help of predefined keywords.
Next step define when user enter credentials with the help of predefined keywords.
-input text and input password are predefined keywords
Input text :- it has 2 arguments .one is locator and another is testdata that we'll enter
Input password:- it has 2 arguments .one is locator and another is testdata that we'll enter
To avoid testdata in hard code we can use list and scalar variable as follow :-
List varaible :- The varaiables that can have multiple values.
Scalar variables :- The variables that can have only single values
Click on new list variable and define variable on popup as below.
Input text :- it has 2 arguments .one is locator and another is testdata that we'll enter
Input password:- it has 2 arguments .one is locator and another is testdata that we'll enter
To avoid testdata in hard code we can use list and scalar variable as follow :-
List varaible :- The varaiables that can have multiple values.
Scalar variables :- The variables that can have only single values
Click on new list variable and define variable on popup as below.
Simlarly to avoid hardcode password define list variable.
Now we can use these list variable in "When user enter his credentials" as follow :-
Now we can use these list variable in "When user enter his credentials" as follow :-
-As shown in above figure i have user @{txt_username}[0] in place of user1. Here [0] means first index of @{txt_username} list variable.
when clicks on login button :-
Similarly define this keyword as other user defined keyword as follow:-
After adding the keyword define keword with the help of predefined keyword as follow.
Similarly define this keyword as other user defined keyword as follow:-
After adding the keyword define keword with the help of predefined keyword as follow.
- click button is predefined keyword.
- id = login is locator of login button.
- id = login is locator of login button.
Then home page should appear :-
Now follow the same process that define the keyword with predefined keywords .
Here I have used element should be visible and argument is its id (id=view_profile).If the element of that id is present then home page is opened
Now follow the same process that define the keyword with predefined keywords .
Here I have used element should be visible and argument is its id (id=view_profile).If the element of that id is present then home page is opened
Now to run test case , checked that test case and click on run button as follow :-
This is the process to write test cases in Ride.
Now Enjoy with Ride :-)
Very useful article. Thank you
ReplyDeletenot understanding
ReplyDeletehow could I enter the credential on the google home page ?
ReplyDeleteThanks for the detailed steps. Do you have any similar document for testing REST Calls through RIDE?
ReplyDeleteHi Jeffrey,
ReplyDeleteNo i don't have document for Rest calls. but i can give you an idea .
As RIDE is used from UI perspective .For REST calls we can check their response from UI .
e.g. On click of a button , hit the rest call , and validate its response , success or failure .
Thanks!!!
Let me know in case of any query .
Hi Gourav,
ReplyDeleteWhat you didn't understand ?
Let me know please .
nidhi , can i use the id locator for select checkbox keyword ,
Deleteex | Select Checkbox | id=chk1|
i tried something but it did not work , the test case could not locate the checbox with but it is the correct id of the checkbox
btw i was using phatomjs as the headless browser
DeleteVery usefull...Thanks for sharing :)
ReplyDeletecan u please help me with some links or page which has examples of using all or most of the selenium2 keywords , finding it little difficult to learn on own
ReplyDeleteThanks for this tutorial. It was quite helpful.
ReplyDeleteI tried your test but unfortunately it failed. Is this because I need a web driver for the firefox browser?
Can you help,as by doing step by step procedure my test get failed showing valueerror.
ReplyDeleteHi How do you locate a menu bar?
ReplyDeleteHow pass the argument variable value in RIDE UI like i used to pass in terminal. I want t pass the environment variable while running the test.
ReplyDeleterobot --variable env:eng1 Tests/test_login.robotrobot
Can i know how to execute the commands using the Telnet library...
ReplyDeleteNice Article very useful :)
ReplyDeleteHi Nidhi,
ReplyDeleteI follow all steps but showing below message after running code, can you please check and provide me solution for this?
--------------------------------------------------------
Starting test: Test2.TC1
20170416 00:53:01.120 : INFO : Opening browser 'chrome' to base url 'www.gamil.com'
20170416 00:53:01.134 : FAIL : No browser is open
20170416 00:53:01.135 : WARN : Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open
20170416 00:53:01.138 : FAIL :
WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
You need to install google driver from the provided link and copy the .exe file in C:\Python27\Scripts
DeleteThen, you are ready to go. Selenium needs webdriver to deal with webpages.
Hi Nidhi,
ReplyDeleteI'm getting list of test cases in suite using
for testcase in suite.testcase_table:
print testcase.name
But I'm intrested in list of test cases in suite which are selected by user to run.
Is there any way to get selected test cases for run in suite...?
new command promp
ReplyDelete-----------------
شركة مكافحة صراصير بالرياض
Not able to identify objects with class I don't have IDs for my project
ReplyDelete
ReplyDeletei was writing test suite on mobile automation. where i was checking streaming from one device to another device. i want to call to existing python code which is already written in python to go to some server and perform other action. i want to call my python script from ride IDE after certain steps. how can i call/execute my python script from the RIDE IDE.
Could you please help me out ?
regards,
Sanjeevsuman88@gmail.com
Extra ordinary material with screenshot. Thanks you so much for all your efforts. Really good post to start with.
ReplyDeleteIt helped me a lot & I created my 1st TC in Ride. Yippee!!
Very Helpful
ReplyDeleteWill be appreciated if you can provide the document for the same.
ReplyDeleteHi,
ReplyDeletehow to read the output one test case to another test case?
ReplyDeleteشركات عزل الاسطح بالمدينة المنورة
شركة عزل خزانات بالمدينة المنورة
شركة شراء اثاث مستعمل بالمدينة المنورة
فني تركيب غرف نوم بالمدينة المنورة
نجار بجدة
instagram takipçi satın al
ReplyDeleteinstagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
cloudkeeda
ReplyDeletewhat is microsoft azure
azure free tier account
azure adf
adf interview questions
azure certifications
mmorpg oyunlar
ReplyDeleteinstagram takipçi satın al
TİKTOK JETON HİLESİ
tiktok jeton hilesi
antalya saç ekimi
ınstagram takipci
instagram takipçi satın al
Mt2 Pvp Serverler
instagram takipci
pendik alarko carrier klima servisi
ReplyDeletependik daikin klima servisi
ataşehir lg klima servisi
pendik arçelik klima servisi
tuzla samsung klima servisi
tuzla mitsubishi klima servisi
çekmeköy vestel klima servisi
ataşehir vestel klima servisi
çekmeköy bosch klima servisi