Page 1 of 1

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

Posted: Fri Oct 25, 2019 4:35 pm
by qa-auto
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

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

Posted: Fri Oct 25, 2019 6:08 pm
by odklizec
Hi,

Any chance you could share the problematic solution? Or can you reproduce the issue with freshly created project?

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

Posted: Wed Feb 19, 2020 10:31 pm
by qa-auto
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

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

Posted: Thu Feb 20, 2020 8:31 am
by odklizec
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.

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

Posted: Thu Feb 20, 2020 3:44 pm
by qa-auto
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

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

Posted: Thu Feb 20, 2020 7:43 pm
by Support Team
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