Forum Discussion

sean_ng's avatar
sean_ng
Occasional Contributor
6 years ago
Solved

catch error then perform specific task

Hi,   during playback i get this error : There was an attempt to perform an action at point (X, Y) which is transparent or out of the window bounds.   i know what is causing this error : ...
  • AlexKaras's avatar
    6 years ago

    Hi,

     

    Try/catch will not work because there is no JScript runtime error. Thus there is nothing to catch. The error posted is a 'logical' error posted by TestComplete. This kind of errors can be handled using the OnLogError event handler in TestComplete.

    However, I would recommend to use the scrollIntoView() native web method to scroll the web object without interacting with scrollbars.

    E.g.:

    if (!obj.VisibleOnScreen)

    {

      obj.scrollIntoView(true); // small 's' because this is native name

      if (!obj.VisibleOnScreen)

        obj.scrollIntoView(false);

     }

    obj.Click(); // Capital C because this is TestComplete's method