Page 1 of 1

Program works in Studio not via exe

Posted: Wed Jan 05, 2011 6:53 pm
by SeanP
Hi,

I have developed a project that is doing some mouse movements and clicking. When I run the program in Studio via the run icon the program executes with out fail. When I just run the exe that was built via Windows Explorer, a get an error about a button could not be found. I have attached the error.

Please help.

Sean

Ranorex v2.3.6

Re: Program works in Studio not via exe

Posted: Fri Jan 07, 2011 12:30 pm
by Support Team
SeanP wrote:When I run the program in Studio via the run icon the program executes with out fail.
By "Run" icon you do not mean the Recorder "Play" button inside Ranorex Studio, but the "Run compiled exe" button in the main toolbar (see below screenshot), right?
RanorexStudio_Toolbar.PNG
If so, this is really a strange error. Because all the button does is compiling the executable and running it with the debugger attached. This should not differ from running the compiled executable except that the execution is a little bit slower when the debugger is attached. It might be a timing issue, so you can try to add a delay before the action that fails.

Could you also try to start the executable from within Ranorex Studio without attached debugger by clicking on the black play button right next to the green one?

Regards,
Alex
Ranorex Team

Re: Program works in Studio not via exe

Posted: Fri Jan 07, 2011 6:44 pm
by SeanP
Yes I run the program via the green "Play" button. I will try using the black "Play" button and report back. This for sure does not work when I run the exe in the bin folder. Even after I do a "Rebuild Solution" and "Clean Solution" followed by a "Build Solution".

Re: Program works in Studio not via exe

Posted: Fri Jan 07, 2011 7:42 pm
by SeanP
Well I have tried it using the black "Play" button and it still plays properly. The exe does not.

Note: I have also tried adding the delays and this does not help either. When I make a new project and redo my work for that part... everything is fine.


What to do next?

Sean

Re: Program works in Studio not via exe

Posted: Fri Jan 07, 2011 8:45 pm
by Ciege
Shot in the dark question...
Are both of these test (from RX Studio and from the .EXE) on the same machine or on different machines?

Re: Program works in Studio not via exe

Posted: Sat Jan 08, 2011 12:07 am
by SeanP
Both on the same machine. The test is for a MFC application.

Like I said, a re-record in a fresh project fixes this but I am not sure why it is not working in this scenario.

Sean

Re: Program works in Studio not via exe

Posted: Mon Jan 10, 2011 7:11 pm
by Support Team
A security issue could also be possible. Do you start Ranorex Studio as Administrator? The automating process must have at least the same security rights as the automated application.

My last and rather wild guess is that the Windows Explorer form interferes with your automation, i.e. a RanoreXPath only works if Windows Explorer is not visible/opened.
SeanP wrote:Like I said, a re-record in a fresh project fixes this but I am not sure why it is not working in this scenario.
Could you identify any differences between the old project and the newly created one, with which the automation from Windows Explorer finally works?

Regards,
Alex
Ranorex Team

Re: Program works in Studio not via exe

Posted: Tue Jan 11, 2011 6:03 pm
by SeanP
Support Team wrote:A security issue could also be possible. Do you start Ranorex Studio as Administrator? The automating process must have at least the same security rights as the automated application.

My last and rather wild guess is that the Windows Explorer form interferes with your automation, i.e. a RanoreXPath only works if Windows Explorer is not visible/opened.
SeanP wrote:Like I said, a re-record in a fresh project fixes this but I am not sure why it is not working in this scenario.
Could you identify any differences between the old project and the newly created one, with which the automation from Windows Explorer finally works?

Regards,
Alex
Ranorex Team

Well I found something interesting out. We tried running it on an older version, 2.3.4.9270, and the exe runs without any issues. The project built in 2.3.7.

There were no differences between the environment of the two projects and how they were created.

I have attached a file to show where the control fails to register. It is basically the pull down box that is selected.

Re: Program works in Studio not via exe

Posted: Wed Jan 12, 2011 7:15 pm
by Support Team
Hi,

We tried again to reproduce this issue, but Ranorex is working as expected. It makes no difference if you start the exe by clicking the play button of studio or if you start the exe via Windows Explorer. Would it be possible to provide us your application and your project to reproduce the problem? Maybe it is some special case where you need the exact same parameters.

Thanks in advance.

Regards,
Peter
Ranorex Team

Re: Program works in Studio not via exe

Posted: Thu Jan 13, 2011 6:03 pm
by SeanP
I can look into sending you our Ranorex project... but our application wont work on a normal PC... it interacts with a large number of hardware devices and well... just wont work. Besides that I cant release our software outside the building. I dont have the authority. Ill try to get you the Ranorex project though.

Sean

Update... I have attached the failing project. I think the repository item name is "somebutton3"

Re: Program works in Studio not via exe

Posted: Fri Jan 14, 2011 1:30 pm
by Support Team
Hi,

Depending on your log files it seems the parent folders are not uniquely enough. Please make sure that all of its parent folders have a unique path. You can also try to disable caching for the parent folders. Therefore please take a look to following link
http://www.ranorex.com/support/user-gui ... html#c2076

Regards,
Peter
Ranorex Team

Re: Program works in Studio not via exe

Posted: Fri Jan 14, 2011 10:20 pm
by SeanP
We have decided to just re-record the project in question and move on. However it is noted that caching should be disabled for other items in the project we build which have issues detecting elements.

Thanks for the help... will post if we run across another issue.

Sean

Re: Program works in Studio not via exe

Posted: Wed Feb 02, 2011 12:47 am
by SeanP
Support Team wrote:Hi,

Depending on your log files it seems the parent folders are not uniquely enough. Please make sure that all of its parent folders have a unique path. You can also try to disable caching for the parent folders. Therefore please take a look to following link
http://www.ranorex.com/support/user-gui ... html#c2076

Regards,
Peter
Ranorex Team

Is there a downside to disabling caching? Basically, what does disabling it do? What issues can I expect to have to possibly deal with?

Re: Program works in Studio not via exe

Posted: Wed Feb 02, 2011 2:25 pm
by Support Team
Hi,

have a look at following post which will answer your questions:
http://www.ranorex.com/forum/disable-ca ... html#p3461

Regards,
Tobias
Support Team