Forum Discussion

joffre's avatar
joffre
Regular Contributor
13 years ago

out of the window bounds


TestComplete is returning the error below:



  There was an attempt to perform an action at point (0, 0), which is out of the window bounds.



I'm trying to treat it and avoid the error log, but it isn't working as expected. My code is this:



function Create_Tipo_Beneficios()

{

  Log.Message("Verify if the button exists");

  if (btnNew.Exists && btnNew.Visible)

  {

    Log.Message("Click on the button");

    btnNew.Click();

  } else {

    Log.Error("Button not found.");

  }



  if (!txtCode.Exists) {

    Log.Error("Something went wrong. Check logs for info. Restart the function.");

    Create_Tipo_Beneficios();

  }

  Log.Message("Set a Code");

  txtCode.SetText("01234");

  Log.Message("Set a Description");

  txtDescription.SetText("descrição do beneficio");

  Log.Message("Click on Save Button");

  btnSave.Click();

}


3 Replies

  • Hi Joffre,



    Only suggestions from what I have experienced when this error occured for me:



    1. Is the btnNew VisibleOnScreen (TestComplete can only click what you as a user can see)



    2. Are you attempting to click the object that you actually expect? (for example the application I was testing had two "All" radio buttons and my script had been attempting to select the one I hadn't intended it too)



    Hope this helps!

    Grant
  • ananddave123's avatar
    ananddave123
    Occasional Contributor
    btnNew not defined

    txtCode not defined

    Where is the line ( Set btnNew = .... ) ?