How to build Ranorex project in command line

Ranorex Spy, Recorder, and Studio.
VijayG
Posts: 5
Joined: Fri Jun 07, 2019 11:58 am

How to build Ranorex project in command line

Post by VijayG » Fri Jun 07, 2019 12:29 pm

I am using Ranorex 9.1. When I build Ranorex project using MSBuild, code is not generatedfor rxrec & repo files. Means if I do any changes for recording file or repo file and do not build using Ranorex studio, code is not getting generated. How to generate this code through command line?


Also, I am planning to change our source control to Git. In this case do we need to add this auto generated code to source control?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4967
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to build Ranorex project in command line

Post by odklizec » Sun Jun 09, 2019 9:44 am

Hi,

MSBuild does not generate cs files for rxrec a repo files. It simply builds exe/dll files from provided solution. And no, as far as I know, there is currently no command line option for auto generating cs files from rxrec or rxrepo files. So basically, you must store all files generated by Ranorex in source control of your choice.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

VijayG
Posts: 5
Joined: Fri Jun 07, 2019 11:58 am

Re: How to build Ranorex project in command line

Post by VijayG » Mon Jun 10, 2019 6:32 am

Hello..,
Thank you for the response.
Unfortunately we have some challenges with this options. Recently there were some merge issues with the rxrep files. But when I build project using command line, it is working proper. Because , the code is not generated again and there are no merge conflicts with .cs files auto generated. This is making us to identify the issues bit late in the system.

Wish, Ranorex team provides a solution to auto generate the code using command line.

User avatar
Stub
Posts: 257
Joined: Fri Jul 15, 2016 1:35 pm

Re: How to build Ranorex project in command line

Post by Stub » Mon Jun 10, 2019 7:57 am

I include the Ranorex Studio generated repository .CS code files in our source control. This lets me use MSBuild to build the Ranorex solution on a testing machine, which in turn lets us neatly integrate Ranorex testing into our automated build system. But because we've had ... experiences ... with XML merging in the past, I took some additional steps:

I split our UI into multiple Ranorex repositories. So hopefully one developer working over 'here' won't trample over another developer working over 'there'.
Secondly, we use Subversion, so I put some locks on the Ranorex repository files .rxrep and rximg. So the repositories are R/O in Ranorex Studio until you acquire a lock on them.

We've found this strategy greatly helps limit merge issues with XML.

However, we don't really use Ranorex recordings so I've not had to deal with these generated files, which I imagine would be far more numerous than our small set of Repositories, but less likely to see conflicting edits.
Last edited by Stub on Wed Jun 12, 2019 7:58 am, edited 1 time in total.

VijayG
Posts: 5
Joined: Fri Jun 07, 2019 11:58 am

Re: How to build Ranorex project in command line

Post by VijayG » Wed Jun 12, 2019 5:45 am

Thank you..
You have a good point of making multiple repositories. I am also analyzing in the same direction. Couple of challenges in multiple Repo's and hope you can help me there.
One recording module cannot use more than one Repository. With this, if any recording module needs data from multiple Repo's (generally not the case, because the recording module has to be designed considering SRP) might end up in duplicating the Repo Item. Any idea why such restriction of only one repository for a recording module.
Another big challenge is, each Repo has its own variables. In this case mostly we might end up into duplicate variables in multiple Repo's. And also if there is a default value for a variable and because of the limitation if the variables are duplicated, I need to have default values for all of them. If the default value has to be changed, need to update the value in all duplicated Repo's. Any suggestions from your side.
As of now bad situation is more than 10 developers are working and we have only one repo file. I am trying to come up with the strategies for a best solution.

User avatar
Stub
Posts: 257
Joined: Fri Jul 15, 2016 1:35 pm

Re: How to build Ranorex project in command line

Post by Stub » Wed Jun 12, 2019 7:57 am

We don't use Recording Modules here. Yet. But I just recently started looking into them following a discussion, and discovered the same limitation with multiple repositories. I was thinking I might be able to exploit user code to cover any cases where I need access to additional repositories, but I've not had to go down that route yet.

I've kept our per-repository variables to a minimum and generally just use them as placeholders that I prime from test case parameters e.g. to select a named item in a list. We don't really have any constants as such. Where there are common values across repositories, I have primed all of the repositories early in a test run via a code module that can figure out what needs to go into each repository.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4967
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to build Ranorex project in command line

Post by odklizec » Wed Jun 12, 2019 8:32 am

Hi guys,

Don't forget to check Ranorex Magic Merger, which should help with solving merge conflicts in rxrep, rxtst and csproj files.
https://www.ranorex.com/help/latest/int ... ic-merger/
Of course, it may not help with everything, but it definitely makes merging process easier.

Also, in case of multiple developers working on the same solution, I'm relative successfully using strategy "divide and conquer" where individual developers, if possible, working on different parts on UI. Then the number of marge conflicts should be relative low.

Another strategy could be appointing one of the developers with task or creating all necessary repo elements for all developers. So then developers should use only the already available repo elements, and eventually, request missing ones from responsible dev. guy. The downside of this strategy is, that one developer might be flooded with work, while the other devs would have to wait a bit ;) And of course, Recording actions is out of questions in such case and all actions in recording modules must be added manually (by drag&drop of pre-made repo elements to recording table).
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

BellaDavis
Posts: 1
Joined: Mon Jul 08, 2019 12:23 pm
Contact:

Re: How to build Ranorex project in command line

Post by BellaDavis » Mon Jul 08, 2019 12:37 pm

Thank you for the information