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 :)
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 :)
No comments:
Post a Comment