01-07-2010, 02:06 AM
Hi-
For Excel:
To load the table at runtime do this:
Datatable.AddSheet "NameYouGiveToARuntimeTable" ***Adds the Runtimetable with the given name
Datatable.ImportSheet "c:\YOURUSERNAMESANDPASSWORDS.xls", 1,"NameYouGiveToARuntimeTable" ****Imports the values of your spreadsheet into QTP at runtime. Be sure that you have a column Name for each Column (Email Address, Password)
To enter the value into the application you'll need either a loop or a conditional statement. QTP will attempt to use every row. So if the login is successful it moves forward, completes the test then reruns it with the second username and password.
A way to enter the data from the runtime datatable is this in a browser. For a windows application I am sure it's very similar:
For Excel:
To load the table at runtime do this:
Datatable.AddSheet "NameYouGiveToARuntimeTable" ***Adds the Runtimetable with the given name
Datatable.ImportSheet "c:\YOURUSERNAMESANDPASSWORDS.xls", 1,"NameYouGiveToARuntimeTable" ****Imports the values of your spreadsheet into QTP at runtime. Be sure that you have a column Name for each Column (Email Address, Password)
To enter the value into the application you'll need either a loop or a conditional statement. QTP will attempt to use every row. So if the login is successful it moves forward, completes the test then reruns it with the second username and password.
A way to enter the data from the runtime datatable is this in a browser. For a windows application I am sure it's very similar:
Code:
Browser("NAME").Page("SomePage").WebEdit("TextBoxName").Set DataTable("Username", "NameYouGiveToARuntimeTable")
Browser("NAME").Page("SomePage").WebEdit("TextBoxName").Set DataTable("Password", "NameYouGiveToARuntimeTable")