Forum Discussion

royd's avatar
royd
Regular Contributor
7 years ago

"WaitChild" ends up in error. Need help!

The test requires for the page in question to load within 5 seconds otherwise, the set should fail. I am using WaitChld to achieve that. Although the page is loading in a couple of seconds, the test stops with an error message "The object does not exist. See Additional Information for details."

 

 

  let browser = Sys.Browser("iexplore");
  let page = browser.Page("*transcripthcdev.lan/EngagementPlatform/iforms");
  let panelNavSteps = pageiForm.FindChild("idStr", "nav-steps", 15);


  if (panelNavSteps.WaitChild("Link(\"firstLink\")", 5000).Exists){
    Log.Picture(page, "Patient PPT forms page loaded.");
  }
  else{
    Log.Warning("PPT forms page did not load in 5 seconds.")
  }

 

 

Just discovered that both "Admission Acknowledgement and General Consent for Treatment" and the "PHI, Third-Party Payer Notice, Advance Directive" has the same name ("Link("firstLink")"). Moreover, "Form List",  "Selected Form Sectiion" and The "Selected Form Signatures" also have the same name ("Link(0)")! This may be the cause of my troubles?

 

I really appreciate any help.

 

Thanks.

6 Replies

    • royd's avatar
      royd
      Regular Contributor

      Hi Robert, good to hear from you! I have learned so much from you! Thank you. :)

       

      As per your advice, I have tried FinChildEx, here is my code:

       

        let formPanel = page.FindChild(["ObjectType", "idStr"], ["Form", "main-content"], 15);
        let sinatureArea = formPanel.FindChildEx(['tagName','idStr'],['CANVAS','signature-canvas*'], 20, true, 10000);
      
        if (sinatureArea.Exists){
          Log.Picture(page, "Patient PPT forms page loaded.");
        }
        else{
          Log.Warning("PPT forms page did not load in 5 seconds.")
        }
      
      

       

      I get an error, I even increased the time to 10 sec, no luck!

      "You are trying to call the "FindChildEx" method or property of an object that does not exist."

       

      Any idea?

       

      Thanks.

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Yup.. "FindChild" returned an empty object for formPanel.  So, since it couldn't find formPanel, any code after that which tries to use formPanel will fail.