Forum Discussion
- Hassan_BallanFrequent Contributor
Hi, When you evaluate and decide to fail, throw a message in the log as an error, and than stop execution as described in this article
- JDR2500Frequent Contributor
You can accomplish this with one line of code provided you already have the values in variables. I don't do JavaScript so I can only offer an example in VBScript. The method you'll be using is aqObject.CompareProperty
aqObject.CompareProperty Method | TestComplete Documentation (smartbear.com)Call aqObject.CompareProperty(String1, cmpEqual, String2, true, lmError)
That will log an error if the strings do not match.
- MW_DidataRegular Contributor
You could always just post an error to the logs if it doesn't match like this:
EDIT:
You can then also add the value of the strings you wish to compare into the logs
- EkremMese1Contributor
But this just giving a result as -1, 0 or 1 I need my test to fail at that point and see a failure log in Script Test Log
just like aqObject.CheckProperty or OCR.Recognize.CheckTest methods..- rraghvaniChampion Level 3
Check the result, and output the appropriate message using either Log.Error(), Log.Warning() or Log.Message(). Or use https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqobject/compareproperty.html
- EkremMese1Contributor
Thanks for your time and valuable inputs.
Related Content
- 4 years ago
- 11 years ago
Recent Discussions
- 8 hours ago
- 7 days ago
- 10 days ago