Page 1 of 1

ElementRepository.CreateAdapterForPath - timeout not working

Posted: Wed Nov 12, 2008 5:54 pm
by taralex
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.");
                }
            }
        }

Posted: Thu Nov 13, 2008 9:26 am
by Support Team
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