Hello,
I'm new to ranorex and got a certain problem with variables.
For a testcase, I try to extract the version of our software from the titlebar, save it as variable and use it with further tests.
My first try was a simple module which extract the title (String), search for the Version-Number (via Regex) and convert it to integer for further usage.
This method works, but only inside of the module. It would be a lot better to have access to the version-variable on a higher level.
So I went on and searched for a method, so I extract the variable and make it possible to access it from another module - no success here. How can I do this?
Another thing I wondered: Via the Action GetValue in a module it is possible to extract some certain value and bind it to a variable. In my case the Item is the
TitleBar, but I only need the first number in the titlebar bound to the variable. Like I described it above, I used usercode to bind this to the variable - but is
there a faster way? Directly with Regex on the Element?
And if I code a method with a resulttype (so not void), how can I bind this result to a variable?
Thanks for the help.
Regards from Karlsruhe
Operating System: Local, Win7 64bit
Ranorex 5.3.1-22939
Problems with Variables
Re: Problems with Variables
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
-
- Posts: 8
- Joined: Wed Apr 08, 2015 12:26 pm
Re: Problems with Variables
Thanks, that helps with variables in other modules.
And how do I bind the result of a variable in a usercode-Action to a variable in the module?
And how do I bind the result of a variable in a usercode-Action to a variable in the module?
Re: Problems with Variables
Hi,
To bind user code variable to module variable, simply assign the module variable with user code variable, like this...
Where moduleVar is your Module variable. Once you start typing the module variable name (in module usercode), it should get listed in the code-completion list of available methods, variables, parameters, etc...
To bind user code variable to module variable, simply assign the module variable with user code variable, like this...
Code: Select all
moduleVar = userCodeVar;
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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