Cannot remove unused variable in rec module test case - Studio 9.2

Ask general questions here.
qa-auto
Posts: 86
Joined: Mon Aug 05, 2019 10:46 pm

Cannot remove unused variable in rec module test case - Studio 9.2

Post by qa-auto » Fri Oct 25, 2019 4:35 pm

Hi,

I defined a test case variable in a recording module; used it, then realized I don't need it. It shows it is in use....and won't delete.
I double checked that it is not in use in the repository variables and not in user code. I've build cleaned > build rebuilded. Restarted.
I deleted the recording module, rebuilt. Added my actions -- STILL won't show not in use.

Thoughts? Seems this occurs too often.

Thanks for the help.
Lorinda

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

Re: Cannot remove unused variable in rec module test case - Studio 9.2

Post by odklizec » Fri Oct 25, 2019 6:08 pm

Hi,

Any chance you could share the problematic solution? Or can you reproduce the issue with freshly created project?
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

qa-auto
Posts: 86
Joined: Mon Aug 05, 2019 10:46 pm

Re: Cannot remove unused variable in rec module test case - Studio 9.2

Post by qa-auto » Wed Feb 19, 2020 10:31 pm

Hello!

I hit this issue again today, went searching for a solution...then, found my own post about it.

Here's how to reproduce this...and by this I mean where variables show as "In Use" even though they are not in User Code AND they are not visually showing on the action line anywhere in a recording module:

1. In a recording module, add new Action with these values:
"Validate", "AttributeEqual", Value or Innertext (doesn't matter), create new variable "newVarA", any webelement
2. Build solution, then click "Variables" and see "newVarA" is shown "In Use"
3. Go back to 1 and change the Validation action to "Exists" (note that the parameters have changed for Exists so it shows nothing)
4. Repeat Step 2

This is very confusing (and super annoying) because one would expect that the variable created for AttributeEqual would not STILL be generated.

After a lengthy hunt through everything :evil: , and recreating the rec module to make the code generated go away...here's the workaround:

- Go to Step 1 above, change the Exists BACK to AttributeEqual and note the variable still exists on the action line. Click Droplist and select null or yourvalue......then rebuild.

Now, I realize there's going to be a camp with the opinion of "but you left the variable in there without unmapping it, so of course :roll: it is still there...", but I am not in that camp.

What is displayed in the action item line is what I know exists (especially! especially! after I rebuild and the code is regenerated!).

(Back when I initially reported this, I was on 9.2.0 and now I am on 9.2.1)

This is a silly thing to waste a few hours on.....very frustrating.

Lorinda

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

Re: Cannot remove unused variable in rec module test case - Studio 9.2

Post by odklizec » Thu Feb 20, 2020 8:31 am

Hi Lorinda,

Good find! This is definitely a bug and something that should not happen! Once the Validate action (any action with assigned variable ) is changed to action without assigned variable, the variable should be unassigned as well. I can confirm that your steps are indeed reproducible.

I would suggest to create a new bug (referring to this post) in bug section of this forum. Or even better, contact Ranorex folks directly via their support form available here...
https://www.ranorex.com/support-query/
So there will be created an official support ticket.
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

qa-auto
Posts: 86
Joined: Mon Aug 05, 2019 10:46 pm

Re: Cannot remove unused variable in rec module test case - Studio 9.2

Post by qa-auto » Thu Feb 20, 2020 3:44 pm

Hi, Pavel!

I appreciate your checking this out; I'm glad we are in the same opinion camp on it being a BUG! :D

I submitted a support case directly with the details.

Take care,
Lorinda

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

Re: Cannot remove unused variable in rec module test case - Studio 9.2

Post by Support Team » Thu Feb 20, 2020 7:43 pm

Adding my reply to qa-auto's support ticket here for others:
I have also duplicated the behavior and can confirm this is not the expected behavior. I have since escalated this to our developers to further investigate.

Currently, we do not know if and when this issue will be fixed as this depends on various factors. Nevertheless, all-new features, updates, and bug fixes are documented in the release notes with every new version release of Ranorex.

https://www.ranorex.com/release-notes/
Regards,
Ned