Java app

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
SirMisiek
Posts: 2
Joined: Wed Mar 06, 2013 9:48 am

Java app

Post by SirMisiek » Wed Mar 06, 2013 9:59 am

Hi,
Just started to use Ranorex and facing some problem.
My java app gets connection string to database from a file. When i add new action to recording (Run Application) and specify .exe file, it cannot see this file, but when i record the same operation, it is ok. Do i need to specify some folders in repository?

My recording.cs file below:

Code: Select all

            Report.Log(ReportLevel.Info, "Application", "Run application 'D:\\Folder\\app.exe' with arguments '' in normal mode.", new RecordItemIndex(0));
            Host.Local.RunApplication("D:\\Folder\\app.exe", "", "", false);
            Delay.Milliseconds(0);
            
            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left DoubleClick item 'TotalCommander801.AppExe3781952201303011602A' at 32;12.", repo.TotalCommander801.AppExe3781952201303011602AInfo, new RecordItemIndex(1));
            repo.TotalCommander801.AppExe3781952201303011602A.DoubleClick("32;12");
            Delay.Milliseconds(930);

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Java app

Post by Support Team » Thu Mar 07, 2013 8:03 am

Hello,

It is not necessary to specify a folder within the Repository in order to start an application.
Could you please give us more information about your test? How did you define the "Run Application" action?
Do you get any error messages?
Thank you!

Regards,
Bernhard

SirMisiek
Posts: 2
Joined: Wed Mar 06, 2013 9:48 am

Re: Java app

Post by SirMisiek » Fri Mar 08, 2013 2:19 pm

On the beginning of recording, i choose "Add new Action" -> "Run Aplication" and then specify exe file with my app. I posted result in code above. I do not get any error from Ranorex. What else should i post?

Application is a java app, which connects to database. Connectionstring is taken from .properties file and app gets connection string only when i record mouse click on app, for example from total commander. With "Run Application" event there is only application start and it acts like there is no file .properties.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Java app

Post by Support Team » Mon Mar 11, 2013 8:25 pm

I think you need to set the working directory for the application to ensure it finds the ".properties" file. In the call to the RunApplication method, pass the directory the application resides in as the third argument, in your case "D:\Folder".

Or if using the recorder, set the "Working directory" property for the "Run Application" action.

See the API documentation for more information:
http://www.ranorex.com/Documentation/Ra ... tion_3.htm

Regards,
Alex
Ranorex Team