Forum Discussion
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.
Any suggestion how to address that?
Just checked, formPanel is 10 level deep on that page. Do I changed it to -
let formPanel = page.FindChild(["ObjectType", "idStr"], ["Form", "main-content"], 30);
Still no go!
Thanks.
Dave
- tristaanogre7 years agoEsteemed Contributor
Well, the "30" says to check 30 levels deep. So, if it didn't find it at 15, it won't find it at 30. The problem is either in the properties you're using for searching or, perhaps, another timing issue where something prior to trying to find formPanel isn't complete yet and so formPanel is not available to be found.
It might be helpful to see the full code including the steps and actions leading up to "let formPanel =". We might be able to determine a bit better as to what other checks you might need to do. It all comes down to a) proper object identification and b) proper code to wait for those objects.- shankar_r7 years agoCommunity Hero
Can you try using Find?
let formPanel = page.Find(["ObjectType", "idStr"], ["Form", "main-content"], 30);
Also, you may want to check only the idStr is enough to find your object, if not find more reliable properties and use Array get your object.
I always use Exists before trying it is Methods like below,
let formPanel = page.FindChild(["ObjectType", "idStr"], ["Form", "main-content"], 15);
if(formPanel.Exists){ 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.") }
}
Related Content
Recent Discussions
- 2 days agoGane195