Page 1 of 1

Objects only identified if solution is run from Studio

Posted: Thu Feb 01, 2018 12:05 pm
by jebner
Since Windows Update to Version 1709 object recognitions only works if I run the solution from Ranorex Studio.
If I manually run the executable (for example with Windows task scheduler) something like

- start explorer.exe with D:\
- wait for item to exist: /form[@title~'D']/?//?//listitem/text[@text='Foldername']

does not find the folder.
It does not seem to be a rights issue because it is still not working if I run it as administrator.

Any ideas?

Regards, Jakob
(using Ranorex 8.0)

Re: Objects only identified if solution is run from Studio

Posted: Thu Feb 01, 2018 1:51 pm
by odklizec
Hi,

Please upload a Ranorex snapshot of the problematic element, both from the app started from Ranorex Studio and from executable. Without, at very least, Ranorex snapshot, there is not much anyone here can do or suggest. Ideally, post also a small sample project.

Because you are a new forum member, you will have to use a 3rd party file sharing service (like dropbox or one drive) and post here a link.

Re: Objects only identified if solution is run from Studio

Posted: Thu Feb 01, 2018 3:17 pm
by jebner
Thanks for the reply.
A small sample project and the corresponding snapshot can be found here:
https://alicona-my.sharepoint.com/:f:/p ... 43NXjJOJ_Q

(For it to work you'll need a folder called Ranorex on your D drive)

Re: Objects only identified if solution is run from Studio

Posted: Thu Feb 01, 2018 3:54 pm
by odklizec
Hi,

The xpath you are using is extremely unstable and pretty short, which means it may take much longer to find the element than is the EffectiveTimeout value (30s) of given element. You need to make the xpath somewhat more precise, to make it faster to find e.g. like this:
/form[@title~'(D:)' and @processname='explorer']/element[@class='ShellTabWindowClass']//container/listitem[@text='Ranorex']/text[@name='Name']

Re: Objects only identified if solution is run from Studio

Posted: Mon Feb 05, 2018 5:50 pm
by jebner
Hi,
thank you for the tips about more xpath options, fairly new to Ranorex :).

But in our test solution we have higher timeouts and as I said, it only happens when starting the executable directly. The example was to show that it does not only affect our AUT but windows explorer as well.
Also tried a reinstall of Ranorex, but that did not help.

Re: Objects only identified if solution is run from Studio

Posted: Tue Feb 06, 2018 8:32 am
by odklizec
Hi,

Well, your sample project (after I modified the xpaths) seems works as expected to me? So I can only guess what's wrong in your case? Are you sure you running tests as administrator (when started from command line)? Could you please post an ACTUAL snapshot and EXACT error message from your failing test? Without (at very least) these details, it's impossible to tell what's wrong or suggest something meaningful.