Disabled tests cases, folders, and recordings

Best practices, code snippets for common functionality, examples, and guidelines.
HansSchl
Posts: 125
Joined: Wed Sep 19, 2018 10:05 am

Disabled tests cases, folders, and recordings

Post by HansSchl » Tue Dec 07, 2021 4:11 pm

Dear community,

I would like to draw from your experience regarding the following problem. During test development, we often disable test cases, smart folders, or single recordings, so that the work on the test itself can be faster. When we commit the finished test to source control, it happens more often than not that we forget to re-enable everything, or that some items simply escape our attention.

How do you deal with this issue, other than being careful?

Best regards
Hans

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

Re: Disabled tests cases, folders, and recordings

Post by odklizec » Tue Dec 07, 2021 4:15 pm

Hi,

You are not alone in this ;) Sadly, it's the problem or pretty limited "Run Configurations", which does not remember enabled/disabled state of recording and code modules.

The solution for TestCases and SmartFolder is to use a 'Test' run config and always run your tests with 'All' run config. But as mentioned, this will not solve the problem of disabled recordings/code modules.
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

HansSchl
Posts: 125
Joined: Wed Sep 19, 2018 10:05 am

Re: Disabled tests cases, folders, and recordings

Post by HansSchl » Tue Dec 07, 2021 4:43 pm

Hi Pavel,

thanks for pointing me at "run configurations". I'll think that over, also considering that, as you wrote, "this will not solve the problem of disabled recordings/code modules."

Best
Hans

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

Re: Disabled tests cases, folders, and recordings

Post by Stub » Wed Dec 08, 2021 11:05 am

That happens a lot here too. I tend not to use run configurations to disable tests because inevitably I forget why I toggled a particular test case OFF, or I'll accidentally re-enable it by toggling the entire tree structure back on again e.g. when I add new tests that then require adding to all of the run configurations.

So when I want to DISable a test case I use a code module that uses the Ranorex API to turn sub-folders OFF at runtime. I'll then organise the test so that the stuff I want to optionally disable is in a smart-folder:

Code: Select all

TestSuite.CurrentTestContainer.Checked = false;
I have various code modules with different conditions baked into them. My simplest is just "SkipTest" - if I add that into a test then it's always DISabled e.g. when something is broken but I don't want it failing the tests. Others might only trigger for particular platforms (x64 vs x86), OS (Win10? Good to go), or look to see if some dependent application is installed or not.

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

Re: Disabled tests cases, folders, and recordings

Post by Fergal » Thu Dec 09, 2021 11:15 am

I also use Run Configurations and usually have one called "Temp" for test runs that exclude some TCs and / or smart folders.

Another thing I do is start working on a solution with all Smart Folders and TCs collapsed. When I work on a particular Smart Folder or Test Case I expand it in the test suite. I collapse all smart folders and TCs before doing a commit. I have a rule, that I check for any disabled modules before collapsing anything. This has helped to stop committing disabled modules, but unfortunately it still happens occasionally.