Forum Discussion

jsc's avatar
jsc
Regular Contributor
13 years ago

WaitProperty method always waiting auto-timeout instead of wait time parameter

Hi all,



upon login in into my application, I have to wait in the scripts until a specific field exists.



I use the following code:



MyObject.WaitProperty("Exists", true, 5000);



The problem is, that no matter what timeout time I enter, waiting time is always 10 seconds as defined as auto-timeout in the project.



Am I using this function incorrectly? What do I have to change to make the application wait 2 min or so?



Kind regards,

Joachim

4 Replies

  • jsc's avatar
    jsc
    Regular Contributor
    Hi Tanya,



    i tried different ways, but neither was satisfying.



    The best until now was like this:



    var DBFieldExists = false;

    var i = 1000;



    while ((DBFieldExists == false) && (i>0))

    {

      if (Aliases.FContainerFormLogin.TWCAxSession.PanelBody.cbDatabaseInstance.Exists == true)

        DBFieldExists = true;

          

      i--;

      delay(500, "waiting until database field exists...");

    }



    When I run this with TestExecute I get an error posted to the log for every loop if "Aliases.FContainerFormLogin.TWCAxSession.PanelBody.cbDatabaseInstance.Exists == true" fails!



    I think it is wrong to write an error to the log when I am checking if the object exists and it does not exist.



    What can I do?



    Joachim


  • Hi Joachim,


     


    As you are using Name Mapping in your test, you need to use the WaitAliasChild method to get the object that is appearing when executing a test. Here is the example:


    if (Aliases.FContainerFormLogin.TWCAxSession.PanelBody.WaitAliasChild("cbDatabaseInstance", 3000).Exists)


    {


      //the cbDatabaseInstance object is available for testing


    }


     

  • jsc's avatar
    jsc
    Regular Contributor
    Thanks a lot.

    I got another solution but this was not as good as yours!