Example:
This is an example when the validation is expected to succeed. This is working how I would expect it.
PS C:\Users\jared>
Code: Select all
[Ranorex.Validate]::AreEqual(1,1)
[2013/07/18 09:19:00.346][Success][Validation]: Objects are equal (actual='1', expected='1').
This is an example when I force it to fail:
PS C:\Users\jared>
Code: Select all
[Ranorex.Validate]::AreEqual(2,1)
[2013/07/18 09:19:04.086][Failure][Validation]: Objects are not equal (actual='2', expected='1').
Exception calling "AreEqual" with "2" argument(s): "Objects are not equal (actual='2', expected='1')."
At line:1 char:29
+ [Ranorex.Validate]::AreEqual <<<< (2,1)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I am running these examples from powershell which is why I am using the syntax [Ranorex.Validate]::AreEqual(). Why is this throwing a MethodInvocationException rather than a validation exception? I am using this simple example with comparing two numbers but it behaves this way on any validation I do with actual elements.
System Info:
[2013/07/18 09:25:58.773][Info ][SystemSummary]: Host: computer.test
Ranorex version: 4.0.3.22982
OS version: Windows 7 Service Pack 1 64bit
OS default locale: en-US
.NET Runtime version: 4.0.30319.18052
Number of logical CPUs: 4
Number of displays: 2
Screen dimension: 3840x1200
Memory: 60% load, phy 3219mb free/8181mb total, virt 1732mb free/2047mb total.
Thanks,
Jared