How to compare return values of my methods?

Ask general questions here.
dugovic.milan
Posts: 68
Joined: Wed Jun 29, 2016 1:19 pm
Location: Frankfurt, Germany
Contact:

How to compare return values of my methods?

Post by dugovic.milan » Tue Nov 13, 2018 3:19 pm

Hey guys. Simple task for many of you, hard task for my brain. I'd like to structure, respectively instantiate both methods, in order to be able to assign their values into the variables. I can get going pretty much anything in Ranorex, but is giving me strong headaches :cry:

Note: All of my methods are public in a single .cs-File and inhereted in respective recording modules.

Code: Select all

public string methodOne(arguments)
{
	return stringResult;
}

Code: Select all

public string methodTwo(arguments)
{
	return stringResult;
}
I'd like to do something like this...

Code: Select all

	var value1 = methodOne();
	var value2 = methodTwo();
	if (value1 == value2)
	{
		Report.Info("Sucess!");
	}
Ranorex Explorer @DVAG
Support my Ranorex Ideas & Improvements
My current approach: Ranorex 9.2.0

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

Re: How to compare return values of my methods?

Post by odklizec » Tue Nov 13, 2018 3:46 pm

Hi,

And what exactly is the problem? Because from my point of view, it looks like your dummy code is OK? Just make sure the variable stringResult returns string.
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