04-23-2015, 03:00 PM
Hi All,
I was able to resolve the issue. Below is the implementation.
script marked in italic and bold played very crucial role to come over the roadblock.
I was able to resolve the issue. Below is the implementation.
Code:
[i]From external location I brought the data to Action1 local datatable.[/i]
Datatable.ImportSheet "C:\mercury1.xlsx","Sheet1","Action1"
[i]I took the Count of Action1 datatable using[/i]
numRows=Datatable.GetSheet("Action1").GetRowCount
[i]I used for loop, so that I can execute the test case based on the RowCount[/i]
For i = 1 To numRows
DataTable.GetSheet("Action1").SetCurrentRow i
[b]var_U=DataTable.GetSheet("Action1").GetParameter("Username").Value
var_P=DataTable.GetSheet("Action1").GetParameter("Password").Value[/b]
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe"
dialog("Login").WinEdit("Agent Name:").Set var_U
dialog("Login").WinEdit("Password:").Set var_P
dialog("Login").WinButton("OK").Click
If window("Flight Reservation").Exist(5) Then
window("Flight Reservation").Close
msgbox"1st User logged in"
elseif dialog("Login").Dialog("Flight Reservations").Static("Err1").GetROProperty("Text")="Please enter agent name" Then
dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click
'dialog("Login").Dialog("Flight Reservations").Close
dialog("Login").Close
msgbox "User unable to login due to blank username field"
else
dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click
dialog("Login").Dialog("Flight Reservations").Close
msgbox"SOmething BIG is WRONG"
End If
Next
Set var_U=nothing
Set var_P=nothing
script marked in italic and bold played very crucial role to come over the roadblock.