Forum Discussion

mdh's avatar
mdh
Contributor
11 years ago

handling 'Unable to Find the Object'

For a specific browser object i do NOT want TC to create a errror in the Log.

How can I supress a "Unable to Find the Object' error ? 



The Error is raises when below page do not exist:



If Sys.WaitBrowser(browser, 2000).WaitPage(HostName & "*",1000).Panel("main").Panel("product*").Exists 



But it's not an actual error, so I will just check if next page exist (this is part of a larger error handling procedure)

1 Reply

  • Hi Morten,

    Have a look at information about error handling.



    Your issue should be easily solved.

    If you are using VBScript your code may look something like:



    On Error Resume Next



    If Sys.WaitBrowser()...

        ' Do stuff

    end if.



    if Err.Number <> 0 then

        ' Check if next page exists

    end if



    On Error goto 0