Forum Discussion
HKosova
Alumni
14 years agoHi Manoj,
VBScript's InStr and StrComp both support Unicode, so there shouldn't be any problems with Greek and Korean characters.
I'm quite sure the problem is related to something else, for example, some extra spaces that make the difference. But without seeing your tested app, Excel file and complete script at first hand, it's just guesswork.
If you could send your tested application, test project and Excel file to our Support Team (under an NDA if needed), they would take a closer look and pin down the exact problem.
Otherwise there's not much I can suggest, I'm afraid.
You could try TestComplete's case-insensitive property checkpoint instead of InStr to see if it makes a difference:
VBScript's InStr and StrComp both support Unicode, so there shouldn't be any problems with Greek and Korean characters.
I'm quite sure the problem is related to something else, for example, some extra spaces that make the difference. But without seeing your tested app, Excel file and complete script at first hand, it's just guesswork.
If you could send your tested application, test project and Excel file to our Support Team (under an NDA if needed), they would take a closer look and pin down the exact problem.
Otherwise there's not much I can suggest, I'm afraid.
You could try TestComplete's case-insensitive property checkpoint instead of InStr to see if it makes a difference:
Or you could debug your script and watch variable values to figure out how and where exactly the actual and expected values differ. For example, you can calculate character codes for each character in the expected and actual values, post them to the test log and then compare them to see if there's a difference:Sub Main
...
Log.Message "Actual value length: " & Len(ActualResult)
Log.Message "Actual value character codes:"
Log.Message GetCharCodeStr(ActualResult)
Log.Message "Expected value length: " & Len(ExpectedResult)
Log.Message "Expected value character codes:"
Log.Message GetCharCodeStr(ExpectedResult)
...
End Sub
Function GetCharCodeStr(Str)
Dim i, res, chr, code
res = ""
For i = 1 To Len(Str)
chr = Mid(Str, i, 1)
code = AscW(chr) : If code < 0 Then code = code + 65536
res = res & code & "(" & chr & ") "
Next
GetCharCodeStr = res
End Function
Good luck!