Forum Discussion

chibiyi's avatar
chibiyi
Occasional Contributor
13 years ago

Problem with cannot use the method of object return

I'm using TC v8.72, is trying to use TC to test WPF application and using Jscript.

I need to use the method of object return, but TC keeps coming back with an error as below:-





----There was an attempt to perform an action at a point, which is beyond the screen. -----




function checkFunc()

{

  var instrC = Aliases.TestedApps;

  var IdCheck = findId();

  IdCheck.Click();

}



function findId()

{

  var instrC = Aliases.TestedApps;    

  var FindObj = instrC.Find("Id","1990",20000);

  return FindObj;

}



is there anything wrong in my script or? thanks with your help... 

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    The problem is this:  You don't have any checks to determine if the FindID call actually found an object.  You should check, before you attempt to use the object, to see if it "Exists".