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

Ask general questions here.
User avatar
Aracknid
Posts: 365
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

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

Post by Aracknid » Wed May 15, 2019 8:28 pm

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.

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

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

Post by odklizec » Wed May 15, 2019 9:40 pm

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?
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

User avatar
Aracknid
Posts: 365
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

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

Post by Aracknid » Wed May 15, 2019 10:02 pm

Yes, that was it exactly. I just needed that last extra step to do the data binding.

Thanks,
Aracknid.