Search This Blog

Showing posts with label Selenium IDE. Show all posts
Showing posts with label Selenium IDE. Show all posts

Tuesday, May 27, 2014

Selenium IDE Recipe-RollUp Rules

RollUp rules are nothing but set of commands which are used to reduces repeatation of few set of commands.

For Eg: -

There are 2  testcases : -

1. Login to IRCTC and Check seat availability and Logout
2. Login to IRCTC and Check refund status of cancelled ticket and Logout

In the above two testcases, "LOGIN TO IRCTC" is common which is a combination of following steps : -

-Navigate to IRCTC url
-Type Login user name
-Type Login password
-Hit Login

Hence this set of teststeps/commands can ben grouped in to a single rollup rule.


Lets Start The Recipe

Here i have recorded the whole script of logging into to irctc and logging out of irctc.it looks something like below : -





 Now Till the 4th command i.e clickAndWait,a roll up can be formed.




 In order to form a rollup we have to import an userextension file which is available for download here.

Now once it has been downloaded we have edit the file to put command.I have did the same job and you can see the modified version of it here : -
 
 Now  Once it has been created, you can import it into IDE from Options>Options > Selenium Core Extensions

Now lets look at out modified IDE script below : -




 Again, If we want to explore what commands it has, We can highlight the rollup command and look at rollup tab.





 Thanks.I hope you enjoyed the post :)

Saturday, May 24, 2014

Data Driven Testing Using XML & Selenium IDE

This is is small demonstration about how to perform data driven testing using XML in Selenium IDE.

Initially we need to configure an user extension using Selenium IDE which would be giving us commands like 'loadTestData','nextTestdata' etc.

Download user extension : - http://seleniumrecipes.com/sites/default/files/datadriven.js.txt

After we download and configure the user extension,We would be able to see the commands associated like below : -




Now we are all set, lets start with our first test :-

(1). Our test is about wrting multiple username and password to IRCTC login box
(2). We'll have to define our testdata in a xml file like below :-

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<testdata>
    <test uname="user1"  pswd="pswd1"/>
    <test uname="user2"  pswd="pswd1"/>
    <test uname="user3"  pswd="pswd1"/>
</testdata>








Say it has been specified in a file and stored a file location of : - file://c:/Users/krushnas/Desktop/GoogleTest/searchString.xml

(3) Lets model our tests in selenium IDE, you'll find a similar test as below: -





All the steps have been summarized and the activities involved are explained below: -

-Store the loopCounter value which would be used trigger while loop


-Load testdata from teh target location


-Continue the while loop till it reaches end of testdata







-Everytime move to the next data and fetch the value specified as the attribute of 'test' tag as specified in xml file.


Thats all about Data Driven using xml file.I hope you enjoyed :)