I have tried out a couple of events as the trigger of automation and found only the "Loaded" event of the web page that contains the "<input type=file>" control works as expected.
The other events like "Started" event of the adpter, "Created" event of browse button, "Click" event of widnows form button, are all blocked at the point of file selection modal dialog displays and the automation steps follows the label "select File" never gets executed. (See attached screenshot for more details)
Can anyone explain the reason for this odd behavior?
To wait for an event, drag the event from the Object Explorer. So, to wait for the created event drag the Created event to the pallet. Now right click on the Created event and you will be able to choose to Wait for this event.
The difference between a WaitForCreate and WaitForEvent Created is subtle but important. A WaitForEvent has a link called Setup. On the yellow line from Setup you perform the steps that are needed to cause the event you are waiting on.
A WaitForCreate will fire True if the control is created before the WaitForCreate is encountered or within the timeout period. The WaitForEvent actually waits for a new instance of the event caused by the Setup code. It will not fire if the control is already created but will wait until a new control is created.
There is a problem with this particular page. When you interrogate it, the next time the page is shown the controls are not matched. Is this your actual page or just a sample that you are using? I am looking into what can be done to resolve this issue.
Here is my solution. I needed to adjust the adapter a little but if your is working it should be fine. The automation is started here by a button click on a form, but if you want to trigger it on page created use the Created event for webPage1. Here is the automation:
I now understand the difference between using the method "WaitForCreate" and using "Wait for this event" on the event "Created"; however I implemented my solution before reading this article without being aware of these options and just used the event "Created" without selecting "Wait for this event" - it appears to work.
Can I assume using the event "Created" (without "Wait for this event") as the starting point in an animation is functionally the same as using the method "WaitForCreate"? Is there a difference and if so what?