Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
compare strings and perform action
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi Gump,
As per my understanding your query the below code will solve your problem.

(Before that you have to change settings in File ->Settings->Run->Check Run One Iteration Only)
Code:
'Count all rows in Global datatable
iCount = DataTable.GetRowCount
msgbox iCount

For i = 1 to iCount
    InvokeApplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
    cData = DataTable.Value("A","Global")
    msgbox cData
    If Strcomp(cData,"ABC") = 0 Then
        Dialog("Login").WinEdit("Agent Name:").Set "Suresh"
        Dialog("Login").WinButton("Cancel").Click
    else
        Dialog("Login").WinEdit("Password:").Setsecure "4e65b185ba904947d41d711097890e962b647446"
        Dialog("Login").WinButton("Cancel").Click
    End If
    DataTable.SetNextRow
Next
Reply


Messages In This Thread
RE: compare strings and perform action - by suresz449 - 09-06-2011, 11:28 AM
RE: compare strings and perform action - by Rohan - 09-06-2011, 11:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Compare WebTable Elements saraiado 1 2,559 06-11-2015, 06:54 PM
Last Post: venkatesh9032
  How to compare two binary values Naresh 0 2,349 09-09-2014, 05:06 PM
Last Post: Naresh
  Same command needs to be performed twice to actually perform it pistaa 2 2,923 04-25-2014, 01:26 PM
Last Post: pistaa
  Perform some functions whenever QTP Stop button is pressed smartkarthi 2 3,222 08-22-2013, 11:43 AM
Last Post: smartkarthi
  how to compare excel with datatatble diya 4 5,456 12-04-2012, 05:39 AM
Last Post: diya

Forum Jump:


Users browsing this thread: 2 Guest(s)