I use a User32 API call to find the window
- Code: Select all
FindWindow(String lpClassName, String lpWindowName)
- Code: Select all
ElementRepository.CreateAdapterForPath<Element>(Path, timeout)
to wait until the application is fully loaded, passing there the path of an element that is displayed in the application only after it is fully loaded (ribbon control), and specifying a 60 seconds timeout.
4 times out of 5 this works fine, but one time the application just stops to load and the splash screen is displayed forever until you kill the process.
I'm sure this is caused by Ranorex, because I just tried substituting the Ranorex code by simple Thread.Sleep (10000), and it worked 100 times out of 100 tries.