Ignore run config and run everything

Class library usage, coding and language questions.
florian.mautendorfer
Posts: 5
Joined: Fri Dec 15, 2017 11:50 am

Ignore run config and run everything

Post by florian.mautendorfer » Mon Nov 19, 2018 3:13 pm

Hi everyone!

I was researching on how i can auto build and run my tests fromthe commandline and have almost everything set up.
What im missing is:
How can i execute the built ranorex solution exe but ignore the default run config? My goal is to always run every test case and smartfolder independent from the run config.

I have found the following but unstatisfying solutions:
1. Add an ALL run config to every rxtst file which needs to be maintained manually if folders change.
2. Code some python script or similar to check for all ids and make sure they are in the run config.

Im thinking there must be an easier solution but was unable to find something, but maybe someone on here has a solution for me?

Thanks in advance and BR
Flo

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

Re: Ignore run config and run everything

Post by odklizec » Mon Nov 19, 2018 3:43 pm

Hi,

Well, I think that RunAll configuration, is by far the easiest solution. But yes, it requires to be maintained ;) Luckily, there is also another solution. Just create a new code module in [Setup] section of test suite and put below code inside:
TestSuiteRoot
[Setup]
|_CheckAllTests.cs <-- here must be placed your code module.

Code: Select all

            var suite = (TestSuite) TestSuite.Current;
            IList<TestSuiteEntry> entries = suite.GetAllTestSuiteEntries();
            foreach(TestSuiteEntry entry in entries)
            {
            	var testcase = entry as TestCaseNode;
            	if (testcase!=null)
            	{
            		testcase.Checked = true;
            	}
            }
Basically, it enumerates and checks all test cases and smart folders of the test suite. Hope this helps? ;)
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

florian.mautendorfer
Posts: 5
Joined: Fri Dec 15, 2017 11:50 am

Re: Ignore run config and run everything

Post by florian.mautendorfer » Wed Dec 12, 2018 2:54 pm

Thx for the help i will deifnitely look into this and report back!

florian.mautendorfer
Posts: 5
Joined: Fri Dec 15, 2017 11:50 am

Re: Ignore run config and run everything

Post by florian.mautendorfer » Thu Dec 13, 2018 4:39 pm

Great answer this worked like a charm when i added it to the usercodecollection, thanks!
Only thing im missing now is, that the setup should only run when called from the commandline.

My approach is the following:
Add a global parameter to all testsuites (e.g. runAll) then call all tests via the commandline with /gp:runAll='1".
when calling the usercode hand over the bound parameter and then in the code check for it to be set to the right value.

Do you maybe know of a easier or cleaner way?

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

Re: Ignore run config and run everything

Post by odklizec » Tue Dec 18, 2018 9:13 am

Hi,

I think your approach is OK. I would do it the same way ;)
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