Contributions
Re: TC 12.3, WinFormsObject(name).Exists raises run-time error instead of false
Thanks for the best practice suggestion. What is strange is that this old code has worked for the better part of the last 10 years I think ... andonly started to not work when we tested with 12.3. This also goes against what I understand from the documentation:https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/window-and-process/winformsobject-method.html#result-value I narrowed down the number of cases that where .Exist was used without the WaitWinForms to a more manageable list of about 27. I do like thatnot only doesthis work in 12.3 but also (when I run in 11.2) it is more performant when the object doesn't exist. The .exist would return false after 2-3 seconds. The WaitWinForms returns false after the specified timeout (I generally use 100).1.6KViews0likes2CommentsTC 12.3, WinFormsObject(name).Exists raises run-time error instead of false
Anyone else come across this? I don't know if this happens all the time, but in our automation tool that leverages TC for screen interactions,WinFormsObject(name).Exists nowraises a run-time error -2072187182 with message: Unable to find the object WinFormsObject("myTestObjectName"). See additional Information for Details. The object with the specified attributes does not exists. Possible causes of the error: aqa-help://2202 This was not a problem in earlier versions (11.2 and before). The .Exists would simply return a false value and would allow my automation to proceed according to the specified logic. I have over 250 instances of this, rewriting all the code to trap this correctly is not a pleasant prospect. The WaitWinFormsObject(""myTestObjectName", 100).Exists seems to work as expected.Solved1.6KViews0likes4CommentsRe: Aqstring.find cannot find the string
For everyone that tried to help, I had a look and there was nothing wrong with the code per se. It was a data issue. arySub(iCounter) there was an extra linefeed character at the end that didn't get stripped out. So while it appeared that arySub(iCounter) = "daybookvoucherinvoicedateduedateropenamount(tc)openamount(bc)withinterms" when I compared the lengths, i got this: len(arySub(iCounter) = 73 len("daybookvoucherinvoicedateduedateropenamount(tc)openamount(bc)withinterms") = 72 So I knew something was up. Stripping out the linefeed character gave the expected value.2.7KViews2likes0Comments