Question RE: Waitforexists().

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
QATest879
Posts: 32
Joined: Fri Jul 02, 2021 2:35 pm

Question RE: Waitforexists().

Post by QATest879 » Fri Jul 02, 2021 2:55 pm

Hello. I would like to make a test that can wait until a particular window process has finished starting-up before proceeding. The window has inconsistent load times and so I wanted to use WaitForExists on an element within the window because if the element from the process exists then that should mean the process has finished starting-up and loading.

So I am currently just using:

"repo.Example.ElementInfo.WaitForExists(30000);"

And I have tried using different elements on the screen and what happens is this. Whenever I run the code and the window is already open before running it, the test completes immediately and it instantly finds the element. But if I run the code when the window is not open, and then I open the process while the code is running, it will hang there and never notice that the element exists, even after the element is created on the process.

I would appreciate any help regarding this purpose, and if there are any alternate ways to tell if a window has fully-loaded that would be appreciated too. In summary, I need to wait for an application to fully load before continuing with the test, and my attempt at doing this is using waitforexists on an element that only exists after the application has loaded. But waitforexists is only working if I run it when the window has already been loaded, which defeats my purpose and otherwise it's not working. Any help regarding this situation would be appreciated. And this is my first post on the Ranorex forums so I hope I'm posting this in the right discussion, based on what I've read this appears to be the right place for this question. Thank you.

JasonY
Posts: 9
Joined: Fri May 28, 2021 3:51 pm
Contact:

Re: Question RE: Waitforexists().

Post by JasonY » Fri Jul 02, 2021 10:45 pm

Howdy QATest879,

Thank you for reaching out in the forum! You can use the following in your user code:

repo.Example.ElementInfo.WaitForAttributeEqual(5000, "Visible", "True");

This will ensure that Ranorex will not continue the test until the specific element you are targeting is visible in the desktop window.

Best Regards
Jason
Image