Can I Edit Ranorex Object Code Reference Code

Best practices, code snippets for common functionality, examples, and guidelines.
thrups6
Posts: 1
Joined: Tue Mar 22, 2016 7:07 am

Can I Edit Ranorex Object Code Reference Code

Post by thrups6 » Tue Mar 22, 2016 7:28 am

Hi,
Can we override the repository element RepoItemInfo from the Repository.cs file
Why i wanted to edit is, I am currently running my automation scripts on two versions of the same application . And I see some of the objects change from one version to other . I don't want to create two different repositories for different versions. So trying to handle the changes from the repository code itself. When i edit something in Repository.cs file and when i build everything gets reset . So thought of inheriting and overriding the code. Please help me with this :roll:

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

Re: Can I Edit Ranorex Object Code Reference Code

Post by Support Team » Wed Mar 23, 2016 10:53 am

Hello thrups6,

what exactly changed in your application. If there are just a few elements with a different RanoreXPath you could adapt the RanoreXPath in the repository in order to find the elements in both versions. I think this would be easier than overriding the code.
Additionally, maintaining the repository will be more complicated for other people when overriding the repository.
I would suggest working on a copy of your solution for each version if the application changed a lot in the newer version.

Regards,
Bernhard

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: Can I Edit Ranorex Object Code Reference Code

Post by Martin » Wed Mar 23, 2016 2:55 pm

A good informative reference point to overcome your issue could be find here http://www.ranorex.com/support/user-gui ... xpath.html (especially the RanoreXPath with Regular Expressions part).

I have multiple test environments where most of the repository object match between them but there are some odd ones out.