Wait for webpage to dynamically fetch data after filling textbox

I have a text field where I enter an account number, and then the webpage dynamically fetches the data from the database to fill other field on the page, like account name.

I cannot proceed before the data is fetched and the fields related to the account are filled. Whatever data I enter on other fields before the data is filled will get removed from all and any fields on the page.

I need an event that detects when the data is fetched and filled to continue working on other fields (not shown) because other fields get refreshed the moment the data is filled.

@KhaledA7 Have you tried the TextChanged event? You might also check to see if you get any destroyed then created events on the controls. Another option is to use a loop to check each field and if they are empty, pause for a short period before returning to the loop to test again.

One thing that I prefer to do is have events write out to a ListBox on a Windows form. I use the Items property’s Insert method to write each event I’m interested in out to Index 0. This makes it easy to see when each event happens and the order.

@ThomasSasnett Ah, the created and destroyed events could be what I am looking for. Is there a way to test if these two events happen during interrogation or do I have to test it by running an automation with a WaitForEvent on my controls?

Thanks!

@KhaledA7 I am not sure you’d see it during interrogation since you’d be testing the methods to fill out the text box where the events usually show up. It is probably best to check this at Runtime though.