Search found 5 matches

by nas
Wed May 17, 2017 3:38 pm
Forum: General Questions
Topic: How to do a Validation based on a Local Variable in Code
Replies: 2
Views: 1846

How to do a Validation based on a Local Variable in Code

How do I do a validation action based on a variable I created in the UserCode.cs section. For example,

I want to see if my local int variable is greater than 0, and if it is then pass the step. Else, fail it.

if (int myDefinedVar) > 0
Pass
Else
Fail
by nas
Tue May 16, 2017 10:34 pm
Forum: Automation Tools
Topic: Cannot take difference of Strings; looking for Conversion.
Replies: 1
Views: 1682

Cannot take difference of Strings; looking for Conversion.

How do I get the difference of two strings that contain numbers, for example

myDefinedVar = myVar1 - myVar2

is there a convert to number function. I believe when Ranorex variables are defined they are setup as strings. I did get an error stating cannot subtract strings with my UserCode.cs chnages.
by nas
Mon May 15, 2017 8:43 pm
Forum: General Questions
Topic: Calculate Difference of two Variables and validate
Replies: 5
Views: 2406

Re: Calculate Difference of two Variables and validate

I created a new module and added the two variables I needed via the 'data binding' mechanics as specified in the post, however when I went to the usercode of my new module, and typed in the variable names to do the difference calculation as mentioned, it errored saying: myVariable name does not exis...
by nas
Fri May 12, 2017 7:13 pm
Forum: General Questions
Topic: Calculate Difference of two Variables and validate
Replies: 5
Views: 2406

Calculate Difference of two Variables and validate

I have two variables in my Ranorex view, that have been 'GetValued' from two different Ranorex recordings in the same Project. How do I calculate the difference of the two and validate that they are greater than 0. For example Validate True if: ($myValue1 - $myValue2) > 0 I created a new UserCodeMod...
by nas
Wed Mar 08, 2017 7:07 pm
Forum: Automation Tools
Topic: Modular Design Calling a common Test/Function
Replies: 3
Views: 1731

Modular Design Calling a common Test/Function

I have multiple Tests (Test 1, Test 2, ... etc) that are in their own Ranorex Project/Solution. I realized that there are some inconsistencies so want to create common modules that are called by each of the Ranorex Projects/solutions. Is there anyway for me to create a common module (call it Test-Co...