Page 1 of 1

How do you validate text in an element is equal to text in another element

Posted: Wed May 15, 2019 8:28 pm
by Aracknid
Hi,

Using 9.0.1.

I'm learning how to use the Studio and the simple way to automate for our new mobile app (I've been hand coding using Ranorex for 10 years in Visual Studio :) ). This is probably really stupid, but I cannot figure out how to do it...

I've broken my code up into small modules as per Webinars I've seen. So in my Test Suite, when I finish my Setup, I'm on the landing page of my mobile app. I made a recording module which gets the value of the landing page title (one of 3) and I store it in a variable, call this Z. Then I have another recording module which navigates to the settings for the app. Then I have a final recording module that gets the setting value that is the landing page name (one of 3 possible page titles), call this X. How do I validate that X = Z without using code?

I tried to add a validation on the setting value that is a text element that has the name, to validate Z = X... but I couldn't choose X because it wasn't in the list. I think this is because that variable was defined in another recording module.

I was able to put all the code from the 3 recording modules into 1 new module and get it to work, but that defeats the purpose of having all the small modules and duplicates code.

How to solve this more efficiently?

Thanks,

Aracknid.

Re: How do you validate text in an element is equal to text in another element

Posted: Wed May 15, 2019 9:40 pm
by odklizec
Hi Aracknid,

What you are probably looking for, is this blog post...
https://www.ranorex.com/blog/sharing-da ... o-another/
This should nicely explain how to share data between modules. Basically, you must store the variable you obtained in module ‘A’ in a test case/smart folder parameter and then apply that parameter (via variable binding) in module ‘B’. That’s all. Hope this helps?

Re: How do you validate text in an element is equal to text in another element

Posted: Wed May 15, 2019 10:02 pm
by Aracknid
Yes, that was it exactly. I just needed that last extra step to do the data binding.

Thanks,
Aracknid.