Validation Image not found by code module

Best practices, code snippets for common functionality, examples, and guidelines.
B Schele
Posts: 3
Joined: Thu Aug 01, 2019 3:08 pm

Validation Image not found by code module

Post by B Schele » Thu Feb 27, 2020 4:10 pm

We have Ranorex 9.1.1 in use and are working with two solutions.
The first solution contains the repositories and some elements contain a validation image.
In the same solution we have some code modules which are calling RepoItemInfo::GetImage() for example.

In the second solution we have a reference to the first solution.
Then the problem is, that the function RepoItemInfo::GetImage() does not find the *.rximgres from the first solution.
Ranorex is looking in bin\Debug\RepositoryImages folder of second solution.

Do you have a suggestion how to solve this problem?

McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Validation Image not found by code module

Post by McTurtle » Mon Mar 02, 2020 2:58 pm

Hey B Schele,

Is the project in the solution which contain the images built as a dll and then added as a reference to a project in another solution or are you talking about multiple projects added to the same solution? Please explain how you added "solution" to "solution", which is not exactly possible :) You need to be very specific on this terminology, else the issue is just too confusing.

Also, you are on Ranorex 9.1.1. I think you should first upgrade to Ranorex 9.3.0 in order to make sure people are not trying to analyze an issue that was already resolved with a bug-fix in a newer version of Ranorex. Does the same problem appear with Ranorex 9.3.0?

Regards,
McTurtle

B Schele
Posts: 3
Joined: Thu Aug 01, 2019 3:08 pm

Re: Validation Image not found by code module

Post by B Schele » Tue Mar 03, 2020 11:12 am

Hi McTurtle,

This issue exists is Ranorex 9.3 as well.

OK, I try to explain it in more detail:
The First solution has the project RxAT_Lib, which has the repositories (and also with validation images) and code modules
See attached Solution1.PNG

The second solution has the testcases and uses the project of first solution as refrenced dll.
See attached Solution2.PNG

And the test cases in this second solution uses the code modules of the referenced dll
See attached Solution3.PNG

The problem is, that the generated code of the repository has a relative path to current working directory and not relative to referenced dll.

Code: Select all

        public BacksStage93() 
            : base("BacksStage93", "/", null, 0, false, "1d528e29-c1bc-4788-ae8c-b2b4ac95d657", ".\\RepositoryImages\\BacksStage931d528e29.rximgres")
        {
            _wac3mainwindowview = new BacksStage93Folders.Wac3MainWindowViewAppFolder(this);
        }
Is there a posiblity to adjust this path to the RepositoryImages for example in a setting file?

Best regards
You do not have the required permissions to view the files attached to this post.