Forum Discussion

Haiyangwhu's avatar
Haiyangwhu
Contributor
12 years ago

Test complete hangs when calling Exists property of an object

I have a test need to launch a installer, following a function to check whether the installer is successfully launched or not.



The WaitProperty doesn't work for me:

return Aliases.BISuiteServerInstaller.WaitProperty("Exists", true, 180000);



So i use while instead:


  var i = 0;


  while (!Aliases.BISuiteServerInstaller.Exists)


  {


    Log.Message(" ==> " + i);


    Delay(6000, "Delay 6 seconds to wait for installer being launched.");


    i++;


    if (i > 30)


    {


      break;


    }


  }


  Log.Message(" ==> Aliases.BISuiteServerInstaller.Exists = " + Aliases.BISuiteServerInstaller.Exists + " Visible = " + Aliases.BISuiteServerInstaller.Visible);


  return Aliases.BISuiteServerInstaller.Exists;



I have met twice with the situation below:

step into first loop and output " ==> 0" in log, then test complete hung at statement "while (!Aliases.BISuiteServerInstaller.Exists)" for 50 minutes, then the whole case timed out (50 minutes).



Also i have another try with below, and it also hung for 50 minutes:

return NameMapping.Sys.ToadBISuiteServerInstaller.WaitNamedChild("BISuiteServerInstaller", 120000).Exists && NameMapping.Sys.ToadBISuiteServerInstaller.WaitNamedChild("BISuiteServerInstaller", 120000).VisibleOnScreen;



Can someone show me what's going wrong here?

2 Replies

  • sbkeenan's avatar
    sbkeenan
    Frequent Contributor
    Hi Ocean



    I think you need to use the WaitAliasChild function here.  I don't normally ise JScript, but the general syntax should be something like:





    While !(Aliases.WaitAliasChild("BISuiteServerInstaller", 180000).Exists)

    {

       ....

    }





    If you search the index in Help for WaitAliasChild, you should find all the information you need there.



    Hopefully this is helpful.



    Regards

    Stephen.
  • Thanks Stephen for your reply.



    i'll have try a with it, but isn't it the same way as NameMapping.Sys.ToadBISuiteServerInstaller.WaitNamedChild(xxx, xxx)?



    Also any ideas on why test complete hanged at Aliases.BiSuiteInstaller.Exists?