I have a window for which I need to verify that the caption .the value is "Report: C:\Program Files (x86)\Report2Web Client Tools\BursterWatch\PQ5.mfd Profile: PQ5.mfdProfile - Report2Web Burster" .
The variable "b" returns substring as 'C:\Program Files (x86)\ReportWeb2Client Tools\BursterWatch\PQ5.mfd'.I tried to use aqstring.Find,aqstring.Compare but soemhow it is not able to compare correctly as it should return true.Instead it returns false.In the below code I simply used the comparison operator but still it returns with an error .Why are these methods not working for this string . Please tell me the correct way to do it.Most of my scripts have compare string operation and all have the same problem.For some it works,for some it doesn't.
the "b" variable's value is equal to "C:\Program Files (x86)\Report2Web Client Tools\BursterWatch\PQ5.mfd " (an extra space at the end) instead of "C:\Program Files (x86)\ReportWeb2Client Tools\BursterWatch\PQ5.mfd".
In any case, as you are using JScript, I suggest that you implement the verification by using the indexOf method. Here is an example: