Flex Component Loaded

Class library usage, coding and language questions.
Jonathan
Posts: 8
Joined: Wed Nov 10, 2010 9:36 pm
Location: Minnesota, USA

Flex Component Loaded

Post by Jonathan » Tue Dec 14, 2010 10:28 pm

I'm wondering if anyone has found a good way to recognize if a flex component has finished loading. We have a mixed html/flex page where the flex component can take a while to load. When I was just dealing with the html aspects I was using a WaitForDocumentLoaded() from WebDocument which was fine. Now that I need the flex components though this isn't enough.

I'm trying to avoid a System.Threading.Thread.Sleep and would prefer to use a more intelligent method, preferably one that doesn't require me explicitly stating which flex component I'm waiting for (so that I can use a single method for our various mixed pages).

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Flex Component Loaded

Post by Support Team » Wed Dec 15, 2010 10:56 am

Hi,

You can use an element of your Flex component and wait till the item exists. Therefore you can use the Validate class or use the repository item to check if the item exists.

Repository item:
Ranorex.Form form = "/form[@processname='RanorexStudio']";
while(form.Active == false)
      Delay.Seconds(1);
Validate.Exists:
http://www.ranorex.com/Documentation/Ra ... ists_7.htm

Regards,
Peter
Ranorex Team
.
Image