New Ranorex Solution has Build Errors?

Ask general questions here.
Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

New Ranorex Solution has Build Errors?

Post by Fergal » Mon Feb 27, 2017 11:58 am

[Ranorex 6.2.1, Windows 7]

Steps
  1. Created a new Ranorex solution
  2. Deleted the default "Recording1" module
  3. Added a new recording module called "Delay"
  4. Added a 500ms delay step to the "Delay" module
  5. Ran the "Delay" module, which resulted in the error messages shown below.
Image

Link to full image

I've gone through the steps above a few times and the errors occur sometimes but not every time.

Are there any known issues that could be causing this?

Thanks.

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

Re: New Ranorex Solution has Build Errors?

Post by odklizec » Mon Feb 27, 2017 12:03 pm

Hi,

Change the name of "Delay" module to something else. You should not use a module name equal to name of an existing method.
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

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: New Ranorex Solution has Build Errors?

Post by Fergal » Mon Feb 27, 2017 12:14 pm

Thanks odklizec, well spotted, that resolves the issue :oops:

Ranorex displays an error if you try to create a module called "Validate", perhaps they could display a similar error for other invalid module names.

Image

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

Re: New Ranorex Solution has Build Errors?

Post by krstcs » Mon Feb 27, 2017 3:29 pm

You cannot name modules the same as any of the Ranorex class names. So, Validate, Delay, TestCase, etc., are all forbidden, and you will get errors if you try to compile with it.

You should be naming your modules better anyway. For example, what are you validating, what are you delaying?

ValidateOKButtonDisplayed or ValidateProductPrices
Delay500ms or DelayUntilOKButtonAvailable

This will make it easier for people in the future to understand what the module does without having to open it.

Naming things is the hardest thing any programmer does, by far. You need to take time and think about what to name things, it will make a big difference later on when you have to come back and reuse modules.

This is also true in other development projects besides Ranorex tests.
Shortcuts usually aren't...

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: New Ranorex Solution has Build Errors?

Post by Fergal » Mon Feb 27, 2017 5:39 pm

krstcs wrote:...You should be naming your modules better anyway. For example, what are you validating, what are you delaying?..
Thanks for the advice krstcs, I agree fully and do use specific names for modules. In this instance I was setting up a quick solution to experiment with the use of custom reports - it wasn't actually going to test anything. All I wanted was a single module with a small delay so that I could run it in a couple of seconds and view the Ranorex reports. :)

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

Re: New Ranorex Solution has Build Errors?

Post by Support Team » Tue Feb 28, 2017 2:22 pm

Hello everyone,

Thank you for this feedback. I was able to reproduce the issue on my machine. I added an entry to our internal bug tracking system. It would indeed make sense to prevent using module names which are already in use by Ranorex.

Sincerely,
Tomaž