Having problem with Verification - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Having problem with Verification (/Thread-Having-problem-with-Verification) |
Having problem with Verification - qapandit - 07-24-2013 Req: I need to search customer with first and last name. In return result will be (Last Name Coma Space FirstName). I wrote the follwoing code Code: If str_TestCaseId="TC007_PolicySearch_By_FirstAndLastName" Then As always I belive this forum is the best place to get the solution RE: Having problem with Verification - basanth27 - 07-25-2013 I probably will be able to modify the code to suit better but wouldnt guarantee that it will validate the functionality you are looking for. I would request you to elaborate more on what you intend to do? Code: If str_TestCaseId="TC007_PolicySearch_By_FirstAndLastName" Then RE: Having problem with Verification - qapandit - 07-25-2013 Awesome! It is like one click solution!! I have a silly question In If StrComp(Trim(GetReturnedName),Trim(ReturnedNameFormat))>0 I don't understand >0. =0 would make more sense to me. I tried with =0 but failed. Waiting for your help again. RE: Having problem with Verification - basanth27 - 07-26-2013 My mistake and a thousand apologies. It should be, Code: StrComp(Trim(GetReturnedName),Trim(ReturnedNameFormat))=0 The result is returned as such, -1 if Str1 is less than Str2, 1 if Str1 is greater than Str2 0 if the strings are the same. You may want to try the below to check what is happening with your code, Code: msgbox StrComp(Trim(GetReturnedName),Trim(ReturnedNameFormat))=0 |