How to share project with a windows application in it.

Ask general questions here.
Fowler23
Posts: 5
Joined: Fri Sep 23, 2016 9:13 am

How to share project with a windows application in it.

Post by Fowler23 » Fri Sep 23, 2016 10:24 am

Hi all,
I have a project to share with my colleagues, that runs tests on a WinForms application.
I have placed the application executable in the project folder on my c drive.

The path to it is something like
C:\Ranorex\RanorexStudio Projects\ProjectName\ProjectName\Folder\aplicationName.exe

I have substituted the actual project name for project name in the above path and folder for a folder that holds test cases in my test suite.

When I share with my colleagues they cant run the modules that run/open the application because of the path it seems.
Im assuming when they extract the project folder I have sent they will save it in a slightly different path on their machine to mine.
Has anyone any suggestions of how I can solve this.

Regards
James

PS I am running Ranorex 5.4.6 and using Windows 7

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to share project with a windows application in it.

Post by krstcs » Fri Sep 23, 2016 1:55 pm

First, are you sure they are not trying to run the executable from the share? This is not supported by Ranorex. All tests must be run from a local disk. In addition, all files (except report files, '*.rxlog'/'*.rxlog.data') in the output directory (usually '<project dir>\bin\debug') should be copied over to the new location, not just the exe file.

Second, are you sure you don't have the directory hard-coded in your test somewhere?

Third, does the other user have Ranorex installed on their system?

What error messages are being produced (please copy them completely)?
Shortcuts usually aren't...

Fowler23
Posts: 5
Joined: Fri Sep 23, 2016 9:13 am

Re: How to share project with a windows application in it.

Post by Fowler23 » Fri Sep 23, 2016 2:30 pm

Hi krscts, thanks for the reply.

Point 3: Yes they have ranorex 6.0 on their systems I am running version 5.4.6.

Point 2: I do have the path to the application hard coded into my tests.
I have a run application action to open the application.
Is there an alternative to this?
I have looked at the code and it also uses the path to the application on my machine.

Point 1: To share the project I zipped the entire project file and sent it via slack. The tests work on their machines if the application is open, it just wont open the applications using my module to open the application.

The error message produced is
Failed to run application 'C:\Ranorex\RanorexStudio Projects\ProjectName\ProjectName\Folder 2\ApplicationName.exe'.
The system cannot find the file specified

Thanks
James

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to share project with a windows application in it.

Post by krstcs » Fri Sep 23, 2016 2:58 pm

They must have the SAME VERSION of Ranorex installed on their system as the test was built with. If you are building with version 5.4.6, then they need to have 5.4.6 installed.

You should keep ALL instances of Ranorex at the same version level as library changes in different versions can cause unintended side-effects such as what you are seeing.



You can change the path to a global parameter and pass it in at runtime using the '/param:MyPath="C:\X\Y\Z.exe"' notation, then bind a module variable to that parameter. See the user guide for more information. http://www.ranorex.com/support/user-guide-20.html
Shortcuts usually aren't...

Fowler23
Posts: 5
Joined: Fri Sep 23, 2016 9:13 am

Re: How to share project with a windows application in it.

Post by Fowler23 » Mon Sep 26, 2016 11:36 am

Hi, Thanks for that information,there are just a few things I want to check with you,

Do you mean I should set up a global parameter as shown in lesson 3 and then bind it to a module variable in the code module and then pass it as a parameter to the run application method?
I have done this and it works on my machine.
I haven't tried sharing with others.

I am a little confused by this line "'/param:MyPath="C:\X\Y\Z.exe"' notation "
Are you just saying here to create a parameter with name like MyPath and give it the path to the application?

Will this not mean I am still using the path to the application that is set on my machine?
And still cause trouble when I share it with others?
Sorry for the question but Id just like to understand you fully.

Regards
James

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to share project with a windows application in it.

Post by krstcs » Mon Sep 26, 2016 1:34 pm

1. Yes, set up a global parameter and bind it in the test suite.

2. That notation is the command-line parameter notation. You should use it on the command-line when running your test, but give it the correct path to the application-under-test for the system you are running on. The terms I gave are examples, you should put in the correct values in for your situation.

3. No, if you set the value correctly it will be the location on the local system. As I said, you will have to adapt it for your needs.
4. No.
Shortcuts usually aren't...

Fowler23
Posts: 5
Joined: Fri Sep 23, 2016 9:13 am

Re: How to share project with a windows application in it.

Post by Fowler23 » Mon Sep 26, 2016 2:59 pm

Thanks I will try that.