Data Driven Script.:
In MonkeyTalk you can use/create the Data Driven Script. by using RunWith action and three files are required for Data Driven Script.
1. Main file- Its extension is .mt.In this main script. is written.
datadriven.mt
Vars * Define user pass
Input username tap
Input username EnterText ${user}
Input password EnterText ${pass}
Button LOGIN Verify LOGIN %thinktime=1000
Button LOGIN tap
Label * Verify “Welcome, ${user}!” %thinktime=3000
Button LOGOUT VerifyNot LOGIN
Button LOGOUT tap %thinktime=5000
you can view tabular form. of Tabular form datadriven.mt script.:
2. Driver script.: Its extension is .mt. This script. is use to run the main file.
Script. datdriven.mt RunWith credentials.csv
you can view tabular form. of Tabular form Driver script.:
3. CSV File:Its extension is .csv.
You can create csv file in your MonkeyTalk project by following below mentioned steps :
Right click on project folder
new >>other >>Click on General >>choose file >> give a name with extension .csv
Now in this file give values for variables which you are defined in main file/script. In first row of this file mention variables name separated by space which you have define in main file.
user pass
joew,sword1
jyoti,password1
charlie,test