<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: RegisterUserFuncX: Register Methods To All QTP Objects Automatically</title>
	<atom:link href="http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/feed/" rel="self" type="application/rss+xml" />
	<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/</link>
	<description>A Resource for Test Automation Development</description>
	<lastBuildDate>Fri, 18 May 2012 07:21:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: ravi</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-60488</link>
		<dc:creator>ravi</dc:creator>
		<pubDate>Mon, 07 May 2012 10:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-60488</guid>
		<description>Thanks a lot Anshoo...</description>
		<content:encoded><![CDATA[<p>Thanks a lot Anshoo&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anshoo Arora</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-60338</link>
		<dc:creator>Anshoo Arora</dc:creator>
		<pubDate>Wed, 02 May 2012 19:08:36 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-60338</guid>
		<description>Ravi, just quoting the help-file:

&lt;blockquote&gt;Enables you to add new methods to test object classes or change the behavior of an existing test object method during a run session.&lt;/blockquote&gt;

&lt;pre&gt;
Sub Copy (edit) 
    Edit.Click 3, 3 
    Edit.SetSelection 0, Len(Edit.GetROProperty(&quot;text&quot;)) 
    Edit.Type micCtrlDwn + &quot;c&quot; + micCtrlUp 
End Sub 
&lt;/pre&gt;

One way to call the code above:

&lt;pre&gt;
Call Copy(Dialog(&quot;Login&quot;).WinEdit(&quot;Agent Name:&quot;))
&lt;/pre&gt;

Using RegisterUserFunc:

&lt;pre&gt;
RegisterUserFunc &quot;WinEdit&quot;, &quot;Copy&quot;, &quot;Copy&quot; 

Dialog(&quot;Login&quot;).WinEdit(&quot;Agent Name:&quot;).Copy
&lt;/pre&gt;

You&#039;re simply adding a new static method to the test object class.</description>
		<content:encoded><![CDATA[<p>Ravi, just quoting the help-file:</p>
<blockquote><p>Enables you to add new methods to test object classes or change the behavior of an existing test object method during a run session.</p></blockquote>
<pre>
Sub Copy (edit)
    Edit.Click 3, 3
    Edit.SetSelection 0, Len(Edit.GetROProperty("text"))
    Edit.Type micCtrlDwn + "c" + micCtrlUp
End Sub
</pre>
<p>One way to call the code above:</p>
<pre>
Call Copy(Dialog("Login").WinEdit("Agent Name:"))
</pre>
<p>Using RegisterUserFunc:</p>
<pre>
RegisterUserFunc "WinEdit", "Copy", "Copy" 

Dialog("Login").WinEdit("Agent Name:").Copy
</pre>
<p>You&#8217;re simply adding a new static method to the test object class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ravi</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-60322</link>
		<dc:creator>ravi</dc:creator>
		<pubDate>Wed, 02 May 2012 11:15:07 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-60322</guid>
		<description>i just wanted to know when to use this registerUserFunc . at what situations the usage will come in to picture. can u pls help me out.
Thanks in Advance.</description>
		<content:encoded><![CDATA[<p>i just wanted to know when to use this registerUserFunc . at what situations the usage will come in to picture. can u pls help me out.<br />
Thanks in Advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sonal</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-16033</link>
		<dc:creator>sonal</dc:creator>
		<pubDate>Sun, 06 Mar 2011 17:29:06 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-16033</guid>
		<description>Hi,

i have one basic question. Why do we register? What is the need for registerin? When should we register?

Thx,
sonal</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>i have one basic question. Why do we register? What is the need for registerin? When should we register?</p>
<p>Thx,<br />
sonal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anshoo Arora</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-12257</link>
		<dc:creator>Anshoo Arora</dc:creator>
		<pubDate>Mon, 06 Dec 2010 02:43:08 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-12257</guid>
		<description>Anand, 

Your observation is correct.  But, it is to be noted that RegisterUserFunc only works for test object classes.  Once you add .Object to any test object class, the class is no longer recognized as a QTP test object class.  This can be tested by added &quot;.Object&quot; to any test object and trying to retrieve its original test class - won&#039;t work.</description>
		<content:encoded><![CDATA[<p>Anand, </p>
<p>Your observation is correct.  But, it is to be noted that RegisterUserFunc only works for test object classes.  Once you add .Object to any test object class, the class is no longer recognized as a QTP test object class.  This can be tested by added &#8220;.Object&#8221; to any test object and trying to retrieve its original test class &#8211; won&#8217;t work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anand Tambey</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-11927</link>
		<dc:creator>Anand Tambey</dc:creator>
		<pubDate>Mon, 15 Nov 2010 07:34:16 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-11927</guid>
		<description>Hi Anshoo,

Yes Anshoo, DOM object/methods could be used inside overriden function body. However DOM object itself can not call overridden function defined for that test object. Have you came across such scenario and found it working. If not,is there any workaround for such limitation?

Here is the example code where DOM object can not call overridden function:- 
 
‘Needs OR for Google page
Function MySet (obj, sVal) 

                Dim sPrev
                
                sPrev  = obj.GetROProperty(&quot;value&quot;) 
                
                Reporter.ReportEvent micDone, &quot;Previous Value was &quot; &amp; sPrev, sPrev 
                
                MySet=obj.Set(sVal) 

                Reporter.ReportEvent micDone, &quot;Set Value is &quot; &amp; sVal, sVal 

End Function 

&#039;Without using overriden function - Calling default SET
Browser(&quot;Google&quot;).Page(&quot;Google&quot;).WebEdit(&quot;q&quot;).Set &quot;QTP&quot;

set pgObj = Browser(&quot;Google&quot;).Page(&quot;Google&quot;)
set txtObj = pgObj.Object.all.namedItem(&quot;q&quot;)

&#039;Defined overridden function
RegisterUserFunc &quot;WebEdit&quot;, &quot;Set&quot;, &quot;MySet&quot; 

&#039;With using overridden function - Calling MySet - This will not work with DOM object - Error 
txtObj.Set &quot;Inception - Dreaming now...&quot;

&#039;With using overridden function - Calling MySet - This will work with test object
Browser(&quot;Google&quot;).Page(&quot;Google&quot;).WebEdit(&quot;q&quot;).Set &quot;Inception - In Real World...&quot;

&#039;Undefined overridden function
UnRegisterUserFunc &quot;WebEdit&quot;, &quot;Set&quot; 

Browser(&quot;Google&quot;).CloseAllTabs</description>
		<content:encoded><![CDATA[<p>Hi Anshoo,</p>
<p>Yes Anshoo, DOM object/methods could be used inside overriden function body. However DOM object itself can not call overridden function defined for that test object. Have you came across such scenario and found it working. If not,is there any workaround for such limitation?</p>
<p>Here is the example code where DOM object can not call overridden function:- </p>
<p>‘Needs OR for Google page<br />
Function MySet (obj, sVal) </p>
<p>                Dim sPrev</p>
<p>                sPrev  = obj.GetROProperty(&#8220;value&#8221;) </p>
<p>                Reporter.ReportEvent micDone, &#8220;Previous Value was &#8221; &amp; sPrev, sPrev </p>
<p>                MySet=obj.Set(sVal) </p>
<p>                Reporter.ReportEvent micDone, &#8220;Set Value is &#8221; &amp; sVal, sVal </p>
<p>End Function </p>
<p>&#8216;Without using overriden function &#8211; Calling default SET<br />
Browser(&#8220;Google&#8221;).Page(&#8220;Google&#8221;).WebEdit(&#8220;q&#8221;).Set &#8220;QTP&#8221;</p>
<p>set pgObj = Browser(&#8220;Google&#8221;).Page(&#8220;Google&#8221;)<br />
set txtObj = pgObj.Object.all.namedItem(&#8220;q&#8221;)</p>
<p>&#8216;Defined overridden function<br />
RegisterUserFunc &#8220;WebEdit&#8221;, &#8220;Set&#8221;, &#8220;MySet&#8221; </p>
<p>&#8216;With using overridden function &#8211; Calling MySet &#8211; This will not work with DOM object &#8211; Error<br />
txtObj.Set &#8220;Inception &#8211; Dreaming now&#8230;&#8221;</p>
<p>&#8216;With using overridden function &#8211; Calling MySet &#8211; This will work with test object<br />
Browser(&#8220;Google&#8221;).Page(&#8220;Google&#8221;).WebEdit(&#8220;q&#8221;).Set &#8220;Inception &#8211; In Real World&#8230;&#8221;</p>
<p>&#8216;Undefined overridden function<br />
UnRegisterUserFunc &#8220;WebEdit&#8221;, &#8220;Set&#8221; </p>
<p>Browser(&#8220;Google&#8221;).CloseAllTabs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anshoo Arora</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-11910</link>
		<dc:creator>Anshoo Arora</dc:creator>
		<pubDate>Sun, 14 Nov 2010 22:22:10 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-11910</guid>
		<description>Hmm.. I have used DOM methods with RegisterUserFunc.  Also have a few methods written on this site that use DOM methods with RegisterUserFunc.  Would you like to share the method that you have written?</description>
		<content:encoded><![CDATA[<p>Hmm.. I have used DOM methods with RegisterUserFunc.  Also have a few methods written on this site that use DOM methods with RegisterUserFunc.  Would you like to share the method that you have written?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tarun Lalwani</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-11511</link>
		<dc:creator>Tarun Lalwani</dc:creator>
		<pubDate>Thu, 28 Oct 2010 03:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-11511</guid>
		<description>@Anand, RegisterUserFunc is only for methjods available with QTP Test Object. When you use HTML DOM you have already left the QTP world and there are no overriden functions that exists</description>
		<content:encoded><![CDATA[<p>@Anand, RegisterUserFunc is only for methjods available with QTP Test Object. When you use HTML DOM you have already left the QTP world and there are no overriden functions that exists</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anand Tambey</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-11496</link>
		<dc:creator>Anand Tambey</dc:creator>
		<pubDate>Wed, 27 Oct 2010 10:39:07 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-11496</guid>
		<description>One of my colleague tried to use HTML DOM with QTP and he found that overridden function (via registeruserfunc) is not working.

For example a link object is formed by DOM and click method executed. It would not call overriden function. The reason thought by him seems appropriate - As we use micclass in registeruserfunc and micclass is not used in DOM, it will not work.

Do you know such limitations of registeruserfunc and is there any workaround?</description>
		<content:encoded><![CDATA[<p>One of my colleague tried to use HTML DOM with QTP and he found that overridden function (via registeruserfunc) is not working.</p>
<p>For example a link object is formed by DOM and click method executed. It would not call overriden function. The reason thought by him seems appropriate &#8211; As we use micclass in registeruserfunc and micclass is not used in DOM, it will not work.</p>
<p>Do you know such limitations of registeruserfunc and is there any workaround?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://relevantcodes.com/registeruserfuncx-register-methods-to-all-qtp-objects-automatically/#comment-8626</link>
		<dc:creator>Dennis</dc:creator>
		<pubDate>Tue, 08 Jun 2010 05:47:27 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=2246#comment-8626</guid>
		<description>Anshoo,

Thank you very much for your kindness.</description>
		<content:encoded><![CDATA[<p>Anshoo,</p>
<p>Thank you very much for your kindness.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 11/14 queries in 0.003 seconds using disk: basic
Object Caching 379/379 objects using disk: basic
Content Delivery Network via N/A

Served from: relevantcodes.com @ 2012-05-19 11:52:04 -->
