Question
Datacom group
NZ
Last activity: 6 Nov 2018 20:02 EST
WaitForCreate
Hey,
I was using waitForCreate component to click a link in Mycrosoft Dynamics.Though the waitforcreate returns true, the click component is not performing the click.If I place a sleep or Visible component in between waitforcreate and the click, it works fine.I want to know what is the exact behavior of waitforcreat and why its not working here.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
WaitForCreate returns true when the control is matched and false if it reaches the timeout or iterates through all the controls and does not find a match.
In your case, you need to consider that controls can create before they finish loading. Since code is executed very quickly, as soon as OpenSpan detects that the control is created, it attempts to do a PerformClick. This can be problematic for controls that have JavaScript or Ajax dynamically loading event handlers or actively changing the html. It is most likely that something has not finished loading and it is simply going too fast, causing the action to navigate to fail.