ElementRepository.CreateAdapterForPath - timeout not working

Ask general questions here.
taralex
Posts: 57
Joined: Tue Nov 04, 2008 3:50 pm
Location: Michigan
Contact:

ElementRepository.CreateAdapterForPath - timeout not working

Post by taralex » Wed Nov 12, 2008 5:54 pm

Guys, what do I do wrong?
I need some time to load the application before accessing it's element, so I was expecting the _timeout setting to do the waiting job, but it throws an exception immediately after it hasn't found the element.

maybe there's any other way to wait until the application to be automated is loaded, or the element to be automated is created?
i'm trying to use Ranorex 2.0, but I'm really new in it and there's documentation...

Code: Select all

public static Ranorex.Element myElement
        {
            get
            {
                try
                {
                 
                 return ElementRepository.CreateAdapterForPath<Ranorex.Element>("/element[@controlname='myElement']", 5000);

                }
                catch
                {
                    throw new RanorexException("The item named 'myElement' in repository 'myRepository' was not found.");
                }
            }
        }

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

Post by Support Team » Thu Nov 13, 2008 9:26 am

That's right, the timeout parameter may be used to wait for an element to be created. Can you please post the exception that is thrown, i.e. exception message and stacktrace (e.g. by calling Exception.ToString())!

Regards,
Alex
Ranorex Support Team