runtime error while replay
m recording and replaying .net windows application... during replay i m getting the following exception
An exception occurred in the "Unit1" unit at line 23:
Microsoft VBScript runtime error
Wrong number of arguments or invalid property assignment: 'w1.Window'
the line of the script where exception occured is as follows
Set w1 = p1.WPFObject("HwndSource: Window")
Set w2 = w1.Window.WPFObject("LayoutRoot")//exception throwed here
if i change the w2 variable to w1. WPFObject("LayoutRoot")
the exception is not thrown instead m getting as "object does not exist" in my test log
Re: runtime error while replay
The problem occurs because you call the Window method without parameters, which is not allowed. You need to specify at least the window class:
<font class="small">Code:</font><hr /><pre>Set w2 = w1.Window("MyClass").WPFObject("LayoutRoot")</pre><hr />
You can determine needed parameters by inspecting the problematic object in the Object Browser.
If you have a WPF object named 'Window', you need to use the following code:
<font class="small">Code:</font><hr /><pre>Set w2 = w1.WPFObject("Window").WPFObject("LayoutRoot")</pre><hr />