Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
compare strings and perform action
#2
Solved: 10 Years, 9 Months, 4 Weeks ago
Hi Gump,

As per my understanding of the explantion u have given, i must say its better for you to compare the each cell value..

Ur code shld be something like this...
Code:
a=datatable("A", dtGlobalSheet)
if a="ABC" Then
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set "ABC"
Dialog("Login").WinButton("Cancel").Click
ElseIf a="DEF" Then
Dialog("Login").Activate
Dialog("Login").WinEdit("Password:").SetSecure "4e6224718ae0eaf92a4e26655f509650a67f9999"
Dialog("Login").WinButton("Cancel").Click
End If

i hope this will work. Smile

The problem with ur code is that it is not checking for a specific value, it is comparing two strings instead. So whatever the values are in the datatable, if the two rows values are equal, it will enter the userID always.

Do let me know if u need further informaton.

Regards,
Ankesh
Reply


Messages In This Thread
RE: compare strings and perform action - by Ankesh - 09-05-2011, 07:52 PM
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,464 06-11-2015, 06:54 PM
Last Post: venkatesh9032
  How to compare two binary values Naresh 0 2,205 09-09-2014, 05:06 PM
Last Post: Naresh
  Same command needs to be performed twice to actually perform it pistaa 2 2,663 04-25-2014, 01:26 PM
Last Post: pistaa
  Perform some functions whenever QTP Stop button is pressed smartkarthi 2 2,961 08-22-2013, 11:43 AM
Last Post: smartkarthi
  how to compare excel with datatatble diya 4 5,264 12-04-2012, 05:39 AM
Last Post: diya

Forum Jump:


Users browsing this thread: 2 Guest(s)