Waiting for a form to be visible
Posted: Thu Jun 18, 2009 4:07 pm
In the application we are testing, sometimes it takes a little while for a form to be visible.
Lets say I click the MenuBar to load FormA. I then do a FindSingle<Ranorex.Form>("myRxPath"); to find the form. It does find the form almost right away (i'm guessing it's in memory, but not visible yet).
The problem here is if I want to click buttons on the form, currently it will perform the click() actions even if the form is not visible.
I tried using something like:
form.EnsureVisible();
form.button.EnsureVisible();
form.button.click();
but the same thing happens (looks like .EnsureVisible() is not actually checking Element.Visible to see if it's true)
Now I have somewhat of a workaround for this, which works good (obviously would need to add some limits to the time we are waiting...):
while(!form.Visible)
{
Ranorex.Core.Delay.Milliseconds(100);
}
form.button.click();
Is there any functionality for this built into Ranorex? I've seen "RxElementIgnoreInvisible(TRUE);" mentioned in the forum (old post from 2007), but can't find it in the documentation.
Lets say I click the MenuBar to load FormA. I then do a FindSingle<Ranorex.Form>("myRxPath"); to find the form. It does find the form almost right away (i'm guessing it's in memory, but not visible yet).
The problem here is if I want to click buttons on the form, currently it will perform the click() actions even if the form is not visible.
I tried using something like:
form.EnsureVisible();
form.button.EnsureVisible();
form.button.click();
but the same thing happens (looks like .EnsureVisible() is not actually checking Element.Visible to see if it's true)
Now I have somewhat of a workaround for this, which works good (obviously would need to add some limits to the time we are waiting...):
while(!form.Visible)
{
Ranorex.Core.Delay.Milliseconds(100);
}
form.button.click();
Is there any functionality for this built into Ranorex? I've seen "RxElementIgnoreInvisible(TRUE);" mentioned in the forum (old post from 2007), but can't find it in the documentation.