Page 1 of 1

Validation 'AreEqual' - user code

Posted: Mon Jan 30, 2017 12:43 pm
by martin_n
Hello,

could you please explain me, how to modify the parameter, which an object form repository is compared to? I am trying to validate a KeePass version using user code:

Code: Select all

string strKeePassVersion = "2.34";

Validate.AreEqual(MyRepo.AboutForm.KeePassVersion, strKeePassVersion);
When the test case is running, this validation fails, giving the following report:

Module execution was aborted because a validation step has failed. Objects are not equal (actual='{Cell:2.34}', expected='2.34').

I believe there must be something smarter than assigning the exact value {Cell:2.34} to that string variable. Is there a method, which would return the text value of that cell only? Or should I modify the Xpath of that element?

I am using Ranorex 6.2.0 on Win7 Prof, SP1, 64bit


Best regards,

Martin

Re: Validation 'AreEqual' - user code

Posted: Wed Feb 01, 2017 8:42 am
by odklizec
Nazdar ;)

Just use Validate.Attribute instead of Validate.AreEqual, like this...

Code: Select all

Validate.Attribute(MyRepo.AboutForm.KeePassVersion, "Text", strKeePassVersion);
Hope this helps?