Forum Discussion

jawed's avatar
jawed
Occasional Contributor
6 years ago

How to resolve object does not exit when keyword script is run.

I have recorded keyword script and run it but while running it is showing fieldname does not exist. After recording i have also highlight the object it is ok but while running it does not find the object.How to resolve this please help me.

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Keep in mind that automation tests always attempt to run at as fast a speed as possible.  When you, as a human, are recording, you're making conscious decisions to wait for something to happen before you proceed... you need to tell TestComplete to do the same.

     

    There are several ways to do this.

     

    1) Increase the Auto-wait Timeout -  You can do this on a global level in Tools | Current Project Properties | Playback or you can do it on an individual level by right clicking on the operation in your keyword test and select "Set Auto-wait timeout" and entering an override value.  For keyword tests, this is probably the easiest and most reliable way.

    2) Delay operation - You can add a "Delay" operation before your check to add a hardcoded delay to your test.  While this may work, I would not do so as you will be adding a delay in that is set at a particular value that may or may not always be enough and, in those situations when it returns sooner, you'll be adding time to your tests.

     

  • Duess's avatar
    Duess
    Occasional Contributor

    I have ran into this issue many, many times.  tristaanogre has given the correct approach to fix the issue. 

     

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Duess wrote:

      I have ran into this issue many, many times.  tristaanogre has given the correct approach to fix the issue. 

       

       


      LEarning from experience. :) That's how I figured this out myself...