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
you can view tabular form of Tabular form csv file:
Nice initiative..
Keep posting…informative
very helpful..thanks for sharing..
How can I enter numerical values,can you help me pls
i created driver script and csv file.After that if i click on run..Its not showing any thisng.Just showing run configuration.So help me wat to do for run this script
helpful thx
Hi All –
Please give me the elaborated steps for the Data driven scripts.
Thanks in advance
Regards,
Vj
Hi
I created driver script and csv file using variables(user,pwd).Also run on device; it runs properly 🙂 but it didnt take values from csv file.(it shown ‘$user’,etc) 😦
-Uma
Can u plz send me the screenshot of ur script and CSV file?
I followed the mentioned steps but it takes only first value of csv file, it don’t run for all the values in csv file