Hidden feature - complex "IF" in test suite

Ranorex Spy, Recorder, and Studio.
krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Hidden feature - complex "IF" in test suite

Post by krstcs » Tue Oct 10, 2017 5:50 pm

DISCLAIMER: This is probably NOT supported by the Ranorex Team! Use at your own risk! I claim no responsibility for any effects this might have!

SUGGESTION: Do NOT use it if you don't know EXACTLY what it does and the impacts it may have...

NOTE: This BREAKS the data connector/data binding/conditional execution dialog. IT WILL NOT OPEN AND IT WILL POP UP AN ERROR! This is not an exception, and the Studio UI does not crash, it's just a dialog. But, you won't be able to get into the specific Test Case's/Smart Folder's data configuration dialog screen.

YOU HAVE BEEN WARNED!! :D

Background:
OK, so as many of you long-timers know, I tend to have some complex data structures in my tests, and I like to manage the data in a database, generally. I've been working with the built-in "Simple Data Table" data connectors in my current project in order to get tests up and running quickly. However, I came across a situation where I needed to only run a specific Smart Folder (SF) when the EmailAddress in column 1 matched the EmailAddress column value in the parent Test Case's data connector (or when the SF email was blank, but that's easy).

The problem is that there was no easy way to do this in the test suite UI, because it is set up specifically for static string values (again?? :D ).

The trick:
If you look in the rxtst file's RAW structure, you can see your conditionals listed. If you find the ones you want, you can change the "rightvalue" section to use "datavaluesource" instead of the normal "simplevaluesource". See below, notice the first condition vs the second (normal) one:

Code: Select all

			<smartfoldernode
			datasource="ElectronicFormInfo"
			id="848835c2-606b-4e11-b476-5be2e84f9f64"
			name="SignElectronicForms">
				<conditiongroup
				comparison="OR"
				enabled="True">
					<condition
					comparison="IsEqual">
						<leftvalue>
							<datavaluesource>
								<databinding
								bindingtype="DataConnector"
								dataname="EmailAddress"
								id="c8ed60e8-c439-4a19-8057-2ebcf75cf19f">
								</databinding>
							</datavaluesource>
						</leftvalue>
						<rightvalue>
							<datavaluesource>
								<databinding
								bindingtype="DataConnector"
								dataname="EmailAddress"
								id="b0253616-367d-47c7-b840-a28cc95c9567">
								</databinding>
							</datavaluesource>
						</rightvalue>
					</condition>
					<condition
					comparison="IsEqual">
						<leftvalue>
							<datavaluesource>
								<databinding
								bindingtype="DataConnector"
								dataname="EmailAddress"
								id="c8ed60e8-c439-4a19-8057-2ebcf75cf19f">
								</databinding>
							</datavaluesource>
						</leftvalue>
						<rightvalue>
							<simplevaluesource
							value="">
							</simplevaluesource>
						</rightvalue>
					</condition>
				</conditiongroup>
			</smartfoldernode>
AGAIN: This is most likely NOT supported by Ranorex! Do not use it if you don't know EXACTLY what you're doing!!!


For the Ranorex team, it would be great if you went ahead and implemented this in the UI, since the background handlers already work correctly. This would be a huge improvement for those of us with more complex test sets.

If you like this feature, there is already a great uservoice request here: http://uservoice.ranorex.com/forums/150 ... -a-variabl
Shortcuts usually aren't...

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: Hidden feature - complex "IF" in test suite

Post by Vaughan.Douglas » Tue Oct 10, 2017 8:12 pm

I like it!!

My work around is a bit less elegant and requires code. I make my dynamic comparison in an if/then and set the parameter bound to the leftvalue to true/false. Your method all but proves the underlying functionality is in place and the UI just need to be made to accommodate it.
Doug Vaughan

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

Re: Hidden feature - complex "IF" in test suite

Post by krstcs » Tue Oct 10, 2017 8:15 pm

My thoughts, exactly!

The only real draw-back to it is that you basically have to wait till your completely done with your suite/data binding so you can use the UI, but otherwise it works well.

And you're right, all that really needs to be done is for the UI to be modified to fit this ability as well as static strings (which are still important), and it would be a much better way to handle complex data sets than what we have had to do in the past.
Shortcuts usually aren't...