<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Relevant Codes (by Anshoo Arora) &#187; QTP/Siebel</title>
	<atom:link href="http://relevantcodes.com/category/qtpsiebel/feed/" rel="self" type="application/rss+xml" />
	<link>http://relevantcodes.com</link>
	<description>A Test Development Resource for HP QuickTest Professional.</description>
	<lastBuildDate>Fri, 30 Dec 2011 07:07:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>QTP: Working With SiebList (Revised)</title>
		<link>http://relevantcodes.com/qtp-working-with-sieblist-revised/</link>
		<comments>http://relevantcodes.com/qtp-working-with-sieblist-revised/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 02:29:44 +0000</pubDate>
		<dc:creator>Anshoo Arora</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[QTP/Siebel]]></category>
		<category><![CDATA[Automate SiebList]]></category>
		<category><![CDATA[Find Rows SiebList]]></category>
		<category><![CDATA[Get SiebList Row Count]]></category>
		<category><![CDATA[QTP Siebel]]></category>
		<category><![CDATA[QTP Siebel List]]></category>
		<category><![CDATA[QTP SiebList]]></category>
		<category><![CDATA[Sieb List Rows]]></category>
		<category><![CDATA[Siebel List]]></category>
		<category><![CDATA[SiebList]]></category>

		<guid isPermaLink="false">http://relevantcodes.com/?p=3322</guid>
		<description><![CDATA[The previous articles written for the <a href="http://relevantcodes.com/articles/qtpsiebel/">Siebel category</a> were written from a perspective of version 7.7 and 7.8. I know of many of you have already have upgrades Siebel to 8.1, and so have we! This gave me a chance to update my <a href="http://relevantcodes.com/qtp-working-with-sieblist/">old article</a> on the SiebList object. Not much has changed, actually, but the code here has been optimized for better performance and compatibility with the latest version. Information regarding its limitations has also been included.]]></description>
			<content:encoded><![CDATA[<p></p><p>
The previous articles written for the <a href="http://relevantcodes.com/articles/qtpsiebel/">Siebel category</a> were written from a perspective of version 7.7 and 7.8. I know of many of you have already have upgrades Siebel to 8.1, and so have we! This gave me a chance to update my <a href="http://relevantcodes.com/qtp-working-with-sieblist/">old article</a> on the SiebList object. Not much has changed, actually, but the code here has been optimized for better performance and compatibility with the latest version. Information regarding its limitations has also been included.
</p>
<p class="alert">
Instead of using the code from this article directly in your libraries, please use the download link instead, as the download files include documentation.
</p>
<p class="note">The techniques in this article have been tested on QTP 9.5 and Siebel 8.1. I do not guarantee that the techniques will be supported in older versions of Siebel, but if they aren&#8217;t, I believe with a few minor tweaks, they should become workable.
</p>
<h2>Limitations</h2>
<ol>
<li>As present, descriptive programming is not the recommended technique for automating a Siebel List. This is a limitation which is caused by the CAS API which exposes the object during replay as a SiebList, although in record some internal objects are exposed. Therefore the spy and highlight will show us the SiebList, and also the child object will return 0, since only the table is exposed<sup><a href="http://www.advancedqtp.com/forums/index.php/topic,4132.msg15522.html#msg15522">1</a></sup>.</li>
<li>Any column not visible on the screen will not be accessed by QTP. This includes the column that are brought into picture using the horizontal scroll-bar.</li>
<li>There are certain operations that do not perform well, and my personal recommendation would be to explore if usage of native methods are possible on the target objects.</li>
<li>Document ID KM204700 in HP&#8217;s KB lists a limitation which states a limitation in accessing cell items of a SiebList.</li>
</ol>
<p><h2>Find the Total Number of Records (Rows) in a SiebList</h2>
</p>
<p>
In the previous version of this article, the only possible way demonstrated to retrieve the row count from a Siebel List was through the RecordCounter. However, there is another (faster) way which is through the use of the shortcut keys to retrieve the number of rows. The shortcut keys that can be used to retrieve the total rows are: <code>CTRL+SHIFT+3</code>.
</p>
<div class="wp-caption aligncenter" style="width: 215px">
	<img alt="Record Count ShortCut" src="http://relevantcodes.com/Articles/SiebList/RecordCount.png" title="Record Count ShortCut" width="215" height="273" />
	<p class="wp-caption-text">Record Count ShortCut</p>
</div>
<p>
When using the shortcut, a will appear containing the record count:
</p>
<div class="wp-caption aligncenter" style="width: 284px">
	<img alt="Record Count" src="http://relevantcodes.com/Articles/SiebList/RecordCount_ShortCut.png" title="Record Count" width="284" height="53" />
	<p class="wp-caption-text">Record Count</p>
</div>
<p>
The following function shows the entire process of using the shortcut keys and retrieving the count from the window above:
</p>
<h5>Using Short-Cut Keys: CTRL+SHIFT+3</h5>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'--------------------------------------------------------
</span><span style="color: #008000;">' Name: Function GetSiebListRecords
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Remarks: N/A
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Purpose: Retrieve the number of records (rows) from a Siebel List
</span><span style="color: #008000;">'    using short-cut keys ctrl+shift+3
</span><span style="color: #008000;">'    
</span><span style="color: #008000;">' Arguments:
</span><span style="color: #008000;">'    sBrowserTitle: Title of the Siebel Browser
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Return: Integer
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Author: Anshoo Arora, Relevant Codes
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Date: 03/17/2010
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' References: N/A
</span><span style="color: #008000;">'--------------------------------------------------------
</span><span style="color: #0000A6;">Function</span> GetSiebListRecords(sBrowserTitle)
    <span style="color: #0000A6;">Dim</span> oWScript, oRegExp, oMatches, sText
&nbsp;
    GetSiebListRecords = -1
&nbsp;
    Window(<span style="color: #800000;">&quot;hwnd:=&quot;</span> &amp; Browser(<span style="color: #800000;">&quot;title:=&quot;</span> &amp; sBrowserTitle).<span style="color: #0000A6;">Object</span>.HWND).Activate
&nbsp;
    <span style="color: #0000A6;">Set</span> oWScript = <span style="color: #0000A6;">CreateObject</span>(<span style="color: #800000;">&quot;WScript.Shell&quot;</span>)
    oWScript.SendKeys <span style="color: #800000;">&quot;^+3&quot;</span>
&nbsp;
    <span style="color: #0000A6;">With</span> Browser(<span style="color: #800000;">&quot;opentitle:=SiebWebPopupWindow&quot;</span>)
        <span style="color: #0000A6;">While</span> <span style="color: #0000A6;">Not</span> .Exist(0)
            Wait(2)
        Wend
&nbsp;
        sText = .WebElement(<span style="color: #800000;">&quot;innertext:=.*records.*&quot;</span>, <span style="color: #800000;">&quot;index:=1&quot;</span>).GetROProperty(<span style="color: #800000;">&quot;innertext&quot;</span>)
&nbsp;
        Window(<span style="color: #800000;">&quot;hwnd:=&quot;</span> &amp; .<span style="color: #0000A6;">Object</span>.HWND).<span style="color: #0000A6;">Close</span>
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">With</span>
&nbsp;
    <span style="color: #0000A6;">Set</span> oRegExp = <span style="color: #0000A6;">New</span> RegExp
    oRegExp.Global = <span style="color: #0000A6;">False</span>
    oRegExp.Pattern = <span style="color: #800000;">&quot;\d+&quot;</span>
&nbsp;
    <span style="color: #0000A6;">Set</span> oMatches = oRegExp.Execute(sText)
&nbsp;
    <span style="color: #0000A6;">If</span> oMatches.Count &gt; 0 <span style="color: #0000A6;">Then</span> GetSiebListRecords = CInt(oMatches(0))
&nbsp;
    <span style="color: #0000A6;">Set</span> oWScript = <span style="color: #0000A6;">Nothing</span>
    <span style="color: #0000A6;">Set</span> oRegExp = <span style="color: #0000A6;">Nothing</span>
    <span style="color: #0000A6;">Set</span> oMatches = <span style="color: #0000A6;">Nothing</span>
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span></pre></div></div>

<p><h4 style="text-align: center; margin-left: auto; margin-right: auto;"><a class="downloadlink" href="http://relevantcodes.com/wp-content/plugins/download-monitor/download.php?id=8" title=" downloaded 149 times" >Download: GetSiebListRecords Using ShortCut (149)</a></h4>
<p>&nbsp;
</p>
<p>
When there are many rows present in SiebList, it may not show the exact number. Instead it shows 1-10+ rows, 11-20+ rows, 21-30+ rows and so on. To get the correct number of rows from the List object, we use an the RecordCounter property of SiebApplet. RecordCounter indicates the visible text of the record counter string (for example: 1-10 or 10+). This is also the traditional (and <span class="emphasis_u">slower</span>) approach.
</p>
<h5>Traditional Method: RecordCounter</h5>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'--------------------------------------------------------
</span><span style="color: #008000;">' Name: Function GetSiebListRecords
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Remarks: N/A
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Purpose: Retrieve the number of records (rows) from a Siebel List
</span><span style="color: #008000;">'    using RecordCounter
</span><span style="color: #008000;">'    
</span><span style="color: #008000;">' Arguments:
</span><span style="color: #008000;">'    oSiebApplet: Reference to the SiebApplet Hierarchy
</span><span style="color: #008000;">'    sUINameSiebList: UIName of SiebList
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Return: Integer
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Author: Anshoo Arora, Relevant Codes
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Date: 03/17/2010
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' References: N/A
</span><span style="color: #008000;">'--------------------------------------------------------
</span><span style="color: #0000A6;">Function</span> GetSiebListRecords(oSiebApplet, sUINameSiebList)
    <span style="color: #0000A6;">Dim</span> iCnt
&nbsp;
    <span style="color: #0000A6;">If</span> InStr(1, sUINameSiebList, <span style="color: #800000;">&quot;uiname&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
        sUINameSiebList = Trim(Split(sUINameSiebList, <span style="color: #800000;">&quot;:=&quot;</span>)(1))
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
    iCnt = oSiebApplet.RecordCounter
&nbsp;
    <span style="color: #0000A6;">Do</span>
        <span style="color: #0000A6;">If</span> <span style="color: #0000A6;">Not</span> InStr(1, iCnt, <span style="color: #800000;">&quot;+&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
            <span style="color: #0000A6;">Exit</span> <span style="color: #0000A6;">Do</span>
        <span style="color: #0000A6;">Else</span>
            oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; sUINameSiebList).NextRowSet
            iCnt = oSiebApplet.RecordCounter
        <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
    <span style="color: #0000A6;">Loop</span>
&nbsp;
    <span style="color: #0000A6;">If</span> InStr(1, iCnt, <span style="color: #800000;">&quot;of&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
        iCnt = CInt(Trim(Split(iCnt, <span style="color: #800000;">&quot;of&quot;</span>)(1)))
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
    GetSiebListRecords = iCnt
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span></pre></div></div>

<h4 style="text-align: center; margin-left: auto; margin-right: auto;"><a class="downloadlink" href="http://relevantcodes.com/wp-content/plugins/download-monitor/download.php?id=7" title="Version1.0 downloaded 129 times" >Download: GetSiebListRecords Using RecordCounter (129)</a></h4>
<h2>Find a text string in the SiebList&#8217;s column</h2>
<p>
If the requirement is to find some text in one of the columns of the SiebList, we can loop over all the rows until we find the value that we’re looking for. <span class="emphasis_u">Note</span> that the column name may be different as it appears to the human eye. You will have to find the correct column name for this to work correctly. For example, in our environment, we have a column named <code>Application Number</code>. However, <code>Application Number</code> is what appears to us, but in reality, QuickTest identifies that column by <code>Application ID</code>.
</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'--------------------------------------------------------
</span><span style="color: #008000;">' Name: Function FindSiebListRow
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Remarks: N/A
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Purpose: Find the Row from the provided Column (sColumnName) where
</span><span style="color: #008000;">'    the given String (sText) exists.
</span><span style="color: #008000;">'    
</span><span style="color: #008000;">' Arguments:
</span><span style="color: #008000;">'    oSiebApplet: Reference to the SiebApplet Hierarchy
</span><span style="color: #008000;">'    sUINameSiebList: UIName of SiebList
</span><span style="color: #008000;">'    sBrowserTitle: Title of the Siebel Browser
</span><span style="color: #008000;">'    sColumnName: Name of the SiebList Column
</span><span style="color: #008000;">'    sText: String to be searched
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Return: Integer
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Dependencies: Function GetSiebListRecords()
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Author: Anshoo Arora, Relevant Codes
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' Date: 03/17/2010
</span><span style="color: #008000;">'
</span><span style="color: #008000;">' References: N/A
</span><span style="color: #008000;">'--------------------------------------------------------
</span><span style="color: #0000A6;">Function</span> FindSiebListRow(oSiebApplet, sUINameSiebList, sBrowserTitle, sColumnName, sText)
    <span style="color: #0000A6;">Dim</span> iRows, iRow, sData
&nbsp;
    <span style="color: #0000A6;">If</span> InStr(1, sUINameSiebList, <span style="color: #800000;">&quot;uiname&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
        sUINameSiebList = Trim(Split(sUINameSiebList, <span style="color: #800000;">&quot;:=&quot;</span>)(1))
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
    <span style="color: #008000;">'DEPENDANCY: GetSiebListRecords
</span>    iRows = GetSiebListRecords(sBrowserTitle)
&nbsp;
    <span style="color: #0000A6;">With</span> oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; sUINameSiebList)
        .FirstRowSet
&nbsp;
        <span style="color: #0000A6;">For</span> iRow = 0 <span style="color: #0000A6;">to</span> iRows - 1
            .ActivateRow iRow
&nbsp;
            sData = Trim(.GetCellText(sColumnName, iRow))
&nbsp;
            <span style="color: #0000A6;">If</span> CStr(sData) = CStr(sText) <span style="color: #0000A6;">Then</span>
                FindSiebListRow = iRow
                <span style="color: #0000A6;">Exit</span> <span style="color: #0000A6;">Function</span>
            <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
        <span style="color: #0000A6;">Next</span>
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">With</span>
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span></pre></div></div>

<p><h4 style="text-align: center; margin-left: auto; margin-right: auto;"><a class="downloadlink" href="http://relevantcodes.com/wp-content/plugins/download-monitor/download.php?id=6" title="Version1.0 downloaded 138 times" >Download: FindSiebListRow (138)</a></h4>
<p> &nbsp;
</p>
<p class="alert">If you have any questions, please ask them in the comments section. If your query is confidential, please use the <a href="http://relevantcodes.com/contact/">Contact Form</a> to send me an e-mail instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://relevantcodes.com/qtp-working-with-sieblist-revised/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>QTP Siebel Error: Test Execution halts when a SiebButton is clicked</title>
		<link>http://relevantcodes.com/qtp-siebel-error-test-execution-halts-when-a-siebbutton-is-clicked/</link>
		<comments>http://relevantcodes.com/qtp-siebel-error-test-execution-halts-when-a-siebbutton-is-clicked/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 00:02:25 +0000</pubDate>
		<dc:creator>Anshoo Arora</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[QTP/Siebel]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[QTP Siebel Dialog]]></category>
		<category><![CDATA[QTP Siebel Error]]></category>
		<category><![CDATA[Siebel]]></category>
		<category><![CDATA[Test Execution Halts]]></category>

		<guid isPermaLink="false">http://relevantcodes.com/?p=1560</guid>
		<description><![CDATA[We had an issue with one of the SiebButton objects' in our environment. When we executed a statement to click on this particular SiebButton, the next statement would not execute. What happens is, as we click this particular SiebButton, a Dialog box pops up immediately. For some reason that we have not been able to figure out, the execution marker from the <i>SiebButton("").Click</i> statement will not move to the next line. ]]></description>
			<content:encoded><![CDATA[<p></p><p>
We had an issue with one of the SiebButton objects&#8217; in our environment. When we executed a statement to click on this particular SiebButton, the next statement would not execute. What happens is, as we click this particular SiebButton, a Dialog box pops up immediately. For some reason that we have not been able to figure out, the execution marker from the <i>SiebButton(&#8220;&#8221;).Click</i> statement will not move to the next line. Instead, it just got stuck there, and stood there, forever.
</p>
<p>
We suspected that it may be because of a Modal Dialog that appears in the application preventing QTP from accessing the button. Another reason could be the poor performance of QTP &#038; Siebel working together.
</p>
<p>
Below, you will see a rough demonstration of what happens:
</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'Click Sieb Button
</span>SiebApplication(<span style="color: #800000;">&quot;myApp&quot;</span>).SiebScreen(<span style="color: #800000;">&quot;myScreen&quot;</span>).SiebView(<span style="color: #800000;">&quot;myView&quot;</span>)_
    .SiebApplet(<span style="color: #800000;">&quot;myApplet&quot;</span>).SiebButton(<span style="color: #800000;">&quot;myButton&quot;</span>).Click  <span style="color: #008000;">'Dialog Opens and test halts here
</span>
<span style="color: #008000;">'Execution marker never proceeds to the next statement:
</span>Dialog(<span style="color: #800000;">&quot;micclass:=Dialog&quot;</span>).WinButton(<span style="color: #800000;">&quot;text:=OK&quot;</span>).Click</pre></div></div>

<p>
We were not able to figure out why the execution marker would not move on to the next line. We still haven&#8217;t figured it out. However, we found a workaround!
</p>
<p>
Instead of using one of the Siebel methods/descriptions to click the SiebButton, we used the Web framework (UI) event to click the SiebButton instead, which is viewed as a WebElement with just the Web-Addin loaded:
</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;">Browser(<span style="color: #800000;">&quot;title:=Siebel.*&quot;</span>).WebElement(<span style="color: #800000;">&quot;text:=myButton&quot;</span>, <span style="color: #800000;">&quot;index:=0&quot;</span>).Click</pre></div></div>

<p>
This made the execution marker jump to the next execution line immediately, solved the issue that we were having and our script has been working brilliantly so far! If you have encountered an issue like this, please try this solution and even though I cannot guarantee that it will work, but chances are excellent that it might. :)
</p>
<p class="alert">
Credits go to Todd Mescher for working together with me to come to this fantastic resolution for an issue as strange as this. Thank you, Todd.</p>
]]></content:encoded>
			<wfw:commentRss>http://relevantcodes.com/qtp-siebel-error-test-execution-halts-when-a-siebbutton-is-clicked/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>QTP: Working with Large Object Hierarchies (Siebel Objects)</title>
		<link>http://relevantcodes.com/qtp-working-with-large-object-hierarchies-siebel-objects/</link>
		<comments>http://relevantcodes.com/qtp-working-with-large-object-hierarchies-siebel-objects/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 23:59:20 +0000</pubDate>
		<dc:creator>Anshoo Arora</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[QTP/Siebel]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[Object Hierarchies]]></category>
		<category><![CDATA[QTP Hierarchies]]></category>
		<category><![CDATA[QTP Large Hierarchy]]></category>
		<category><![CDATA[QTP Siebel]]></category>
		<category><![CDATA[QTP Siebel Classes]]></category>
		<category><![CDATA[Siebel]]></category>

		<guid isPermaLink="false">http://relevantcodes.com/?p=1290</guid>
		<description><![CDATA[This article demonstrates how working with large object hierarchies (like Siebel's) can be greatly simplified in QTP by using one of the 4 techniques mentioned here.]]></description>
			<content:encoded><![CDATA[<p></p><p>I received an e-mail from Suni Reddy, who asked me to share with her an easy way of working with Siebel objects &#8211; primarily because of their large object hierarchy. I have thought about it several times, but because our work on Siebel goes on a temporary basis, I was never able to come up with something. Until now. This article will describe how you can create a single library with all the <i>parent</i> objects and call those objects on demand.</p>
<p>Normally, if you would like to select an item from a SiebList, you would do something like:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;">SiebApplication(<span style="color: #800000;">&quot;MyApplication&quot;</span>).SiebScreen(<span style="color: #800000;">&quot;MyScreen&quot;</span>).SiebView(<span style="color: #800000;">&quot;MyView&quot;</span>)_
	.SiebApplet(<span style="color: #800000;">&quot;MyApplet&quot;</span>).SiebList(<span style="color: #800000;">&quot;MyList&quot;</span>).<span style="color: #0000A6;">Select</span> <span style="color: #800000;">&quot;Open&quot;</span></pre></div></div>

<p>The above hierarchy can be greatly simplified &#8211; and this article will show a few ways how it can be achieved. Also, the way we&#8217;re going to structure our hierarchy, changing one object in a single place will account for an overall change. In other words, instead of changing a single object multiple times (because something changed in the application) we&#8217;ll change it only once.</p>
<h3>With Statements</h3>
<p>
This is by far the most common approach used when dealing with large hierarchies, and quite simple too. However, as the parent objects change, we end up creating more and more blocks of such statements. An example of <i>With..End With</i> statement in use:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #0000A6;">With</span> SiebApplication(<span style="color: #800000;">&quot;MyApp&quot;</span>).SiebScreen(<span style="color: #800000;">&quot;MyScreen1&quot;</span>).SiebView(<span style="color: #800000;">&quot;MyView&quot;</span>).SiebApplet(<span style="color: #800000;">&quot;MyApplet&quot;</span>)
	.SiebList(<span style="color: #800000;">&quot;MyList&quot;</span>).<span style="color: #0000A6;">Select</span> <span style="color: #800000;">&quot;Open&quot;</span>
	.SiebButton(<span style="color: #800000;">&quot;MyButton&quot;</span>).Click
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">With</span>
&nbsp;
<span style="color: #008000;">'SibScreen changes from MyScreen1 to MyScreen99: re-write.
</span><span style="color: #0000A6;">With</span> SiebApplication(<span style="color: #800000;">&quot;MyApp&quot;</span>).SiebScreen(<span style="color: #800000;">&quot;MyScreen99&quot;</span>).SiebView(<span style="color: #800000;">&quot;MyView&quot;</span>).SiebApplet(<span style="color: #800000;">&quot;MyApplet&quot;</span>)
	<span style="color: #008000;">'your code
</span><span style="color: #0000A6;">End</span> <span style="color: #0000A6;">With</span></pre></div></div>

<h3>Using Functions to Build Sieb Hierarchy</h3>
<p>
This technique uses <i>several</i> functions to build a complete hierarchy, but the result is a good one. Moreover, it also simplifies how events are performed on objects. Let&#8217;s start by building our first function for the base object (SiebApplication):</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'Base Object: SiebApplication
</span><span style="color: #0000A6;">Function</span> oSiebApplication
	<span style="color: #0000A6;">Set</span> oSiebApplication = SiebApplication(<span style="color: #800000;">&quot;MyApp&quot;</span>)
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">function</span></pre></div></div>

<p>Let&#8217;s create instances for our <i>Child</i> objects:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'oSiebScreen retrieves its parent (oSiebApplication) from the function above
</span><span style="color: #0000A6;">Function</span> oSiebScreen
	<span style="color: #0000A6;">Set</span> oSiebScreen = oSiebApplication.SiebScreen(<span style="color: #800000;">&quot;MyScreen&quot;</span>)
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span>
&nbsp;
<span style="color: #008000;">'oSiebView_ retrieves its parent (oSiebScreen) from the function above
</span><span style="color: #0000A6;">Function</span> oSiebView
	<span style="color: #0000A6;">Set</span> oSiebView = oSiebScreen.SiebView(<span style="color: #800000;">&quot;MyView&quot;</span>)
<span style="color: #0000A6;">End</span> Functions
&nbsp;
<span style="color: #008000;">'oSiebApplet retrieves its parent (oSiebView) from the function above
</span><span style="color: #0000A6;">Function</span> oSiebApplet
	<span style="color: #0000A6;">Set</span> oSiebApplet = oSiebView.SiebApplet(<span style="color: #800000;">&quot;MyApplet&quot;</span>)
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span></pre></div></div>

<p>To demonstrate, if we want to set a value in the &#8220;lstApplication1&#8243; SiebList, we can simply do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;">oSiebApplet.SiebList(<span style="color: #800000;">&quot;lstApplication1&quot;</span>).<span style="color: #0000A6;">Select</span> <span style="color: #800000;">&quot;Urgent&quot;</span></pre></div></div>

<p>I hope the above concept is quite easy to follow, because its used in an OO-methodology below, but with the help of properties.</p>
<h3>Using Classes</h3>
<p>
This is <i>my favorite</i>, and quite similar to what we have above, but, the advantage of using this technique is that we can have multiple classes for multiple Parents, or a single class to group them all together. Assume we have the following hierarchy with an event:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;">SiebApplication(<span style="color: #800000;">&quot;MyApp&quot;</span>).SiebScreen(<span style="color: #800000;">&quot;MyScreen&quot;</span>).SiebView(<span style="color: #800000;">&quot;MyView&quot;</span>)_
	.SiebApplet(<span style="color: #800000;">&quot;MyApplet&quot;</span>).SiebList(<span style="color: #800000;">&quot;lstApplication1&quot;</span>).Highlight</pre></div></div>

<p>First, let&#8217;s create a sample class for the Base object(s) that will be common for all classes.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'Demo class for the top-most object (Parent Class)
</span><span style="color: #0000A6;">Class</span> clsSiebApplication
	<span style="color: #0000A6;">Public</span> <span style="color: #0000A6;">Property</span> <span style="color: #0000A6;">Get</span> oSiebApplication
		<span style="color: #0000A6;">Set</span> oSiebApplication = SiebApplication(<span style="color: #800000;">&quot;MyApp&quot;</span>)
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Property</span>
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Class</span></pre></div></div>

<p>Now, let&#8217;s build the child classes, that will use the base class to complete object hierarchies:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'Child Class: Derives its Base Object from clsSiebApplication (Parent Class)
</span><span style="color: #0000A6;">Class</span> clsSiebObjects
	<span style="color: #0000A6;">Private</span> oShared
&nbsp;
	<span style="color: #008000;">'We will reuse the Base class to retrieve some common objects
</span>	<span style="color: #008000;">'An instance of the base class will be initialized as the class loads
</span>	<span style="color: #0000A6;">Private</span> <span style="color: #0000A6;">Sub</span> Class_Initialize		
		<span style="color: #0000A6;">Set</span> oShared = <span style="color: #0000A6;">new</span> clsSiebApplication
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Sub</span>
&nbsp;
	<span style="color: #008000;">'Terminate the instance while exiting.
</span>	<span style="color: #0000A6;">Private</span> <span style="color: #0000A6;">Sub</span> Class_Terminate		
		<span style="color: #0000A6;">Set</span> oShared = <span style="color: #0000A6;">Nothing</span>
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Sub</span>	
&nbsp;
	<span style="color: #008000;">'oSiebScreen Property will retrieve its parent from oSiebApplication
</span>	<span style="color: #0000A6;">Public</span> <span style="color: #0000A6;">Property</span> <span style="color: #0000A6;">Get</span> oSiebScreen
		<span style="color: #0000A6;">Set</span> oSiebScreen = oShared.oSiebApplication.SiebScreen(<span style="color: #800000;">&quot;MyScreen&quot;</span>)
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Property</span>
&nbsp;
	<span style="color: #008000;">'oSiebView Property will retrieve its parent from oSiebScreen (above)
</span>	<span style="color: #0000A6;">Public</span> <span style="color: #0000A6;">Property</span> <span style="color: #0000A6;">Get</span> oSiebView
		<span style="color: #0000A6;">Set</span> oSiebView = oSiebScreen.SiebView(<span style="color: #800000;">&quot;MyView&quot;</span>)
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Property</span>
&nbsp;
	<span style="color: #008000;">'oSiebApplet Property will retrieve its parent from oSiebView (above)
</span>	<span style="color: #0000A6;">Public</span> <span style="color: #0000A6;">Property</span> <span style="color: #0000A6;">Get</span> oSiebApplet
		<span style="color: #0000A6;">Set</span> oSiebView = oSiebView.SiebApplet(<span style="color: #800000;">&quot;MyApplet&quot;</span>)
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Property</span>
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Class</span></pre></div></div>

<p>This can be used in a fashion that makes it very easy for the reader to comprehend with which objects the script is working with. Let&#8217;s use the same example we used above with the &#8220;lstApplication1&#8243; SiebList:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #0000A6;">Dim</span> oSieb
&nbsp;
<span style="color: #008000;">'Create an instance of clsSiebObjects
</span><span style="color: #0000A6;">Set</span> oSieb = <span style="color: #0000A6;">New</span> clsSiebObjects
&nbsp;
<span style="color: #008000;">'Performing an event on the SiebList Object
</span>oSieb.SiebApplet.SiebList(<span style="color: #800000;">&quot;lstApplication1&quot;</span>).Highlight</pre></div></div>

<h3>Using an Object Dictionary</h3>
<p>
This technique is based on Meir&#8217;s article, <a href="http://www.advancedqtp.com/knowledge-base/articles/qtp-tricks4/descriptive-programming/implementing-a-gui-layer-with-classes/">Implementing a GUI Layer with Classes.</a> I would recommend you to read the article to better understand this approach. I have used a high-level approach to this concept, and to better utilize this process, the article must be carefully read. This technique can be used in the following manner to simplify a large object hierarchy:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #0000A6;">Class</span> clsSiebObjects
	<span style="color: #0000A6;">Private</span> m_htContext
&nbsp;
	<span style="color: #008000;">'Loads the Object Dictionary
</span>	<span style="color: #0000A6;">Public</span> <span style="color: #0000A6;">Function</span> Load
		LoadContext
		<span style="color: #0000A6;">Set</span> Load = m_htContext
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span>
&nbsp;
	<span style="color: #008000;">'Represents the Object Context
</span>	<span style="color: #0000A6;">Private</span> <span style="color: #0000A6;">Function</span> LoadContext
		m_Context = <span style="color: #0000A6;">CreateObject</span>(<span style="color: #800000;">&quot;Scripting.Dictionary&quot;</span>)
&nbsp;
		<span style="color: #008000;">'Loading objects in the dictionary.
</span>		<span style="color: #0000A6;">With</span> m_Context
			<span style="color: #008000;">'SiebApplication
</span>			.Add <span style="color: #800000;">&quot;SiebApplication&quot;</span>, SiebApplication(<span style="color: #800000;">&quot;MyApp&quot;</span>)
			<span style="color: #008000;">'SiebScreen (Parent: SiebApplication)
</span>			.Add <span style="color: #800000;">&quot;SiebScreen&quot;</span>, .Item(<span style="color: #800000;">&quot;SiebApplication&quot;</span>).SiebScreen(<span style="color: #800000;">&quot;MyScreen&quot;</span>)
			<span style="color: #008000;">'SiebView (Parent: SiebScreen)
</span>			.Add <span style="color: #800000;">&quot;SiebView&quot;</span>, .Item(<span style="color: #800000;">&quot;SiebScreen&quot;</span>).SiebView(<span style="color: #800000;">&quot;MySiebView&quot;</span>)
			<span style="color: #008000;">'SiebApplet (Parent: SiebView)
</span>			.Add <span style="color: #800000;">&quot;SiebApplet&quot;</span>, .Item(<span style="color: #800000;">&quot;SiebView&quot;</span>).SiebApplet(<span style="color: #800000;">&quot;MySiebApplet&quot;</span>)
		<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">With</span>
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span>
&nbsp;
	<span style="color: #008000;">'Property Get/Let m_Context
</span>	<span style="color: #0000A6;">Private</span> <span style="color: #0000A6;">Property</span> <span style="color: #0000A6;">Let</span> m_Context(<span style="color: #0000A6;">ByVal</span> Val)
		<span style="color: #0000A6;">Set</span> m_htContext = Val
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Property</span>
	<span style="color: #0000A6;">Private</span> <span style="color: #0000A6;">Property</span> <span style="color: #0000A6;">Get</span> m_Context()
		<span style="color: #0000A6;">Set</span> m_Context = m_htContext
	<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Property</span>
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Class</span></pre></div></div>

<p>The snippet below shows usage of the above class to simplify Siebel Hierarchy:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #0000A6;">Dim</span> oSieb
&nbsp;
<span style="color: #008000;">'Instance of the Class
</span><span style="color: #0000A6;">Set</span> oSieb = <span style="color: #0000A6;">New</span> clsSiebObjects
<span style="color: #0000A6;">Set</span> oSieb = oSieb.Load
&nbsp;
oSieb.Item(<span style="color: #800000;">&quot;SiebApplet&quot;</span>).SiebPickList(<span style="color: #800000;">&quot;lstApplication1&quot;</span>).<span style="color: #0000A6;">Select</span> <span style="color: #800000;">&quot;Open&quot;</span></pre></div></div>

<h3>Summary</h3>
<p>
In the examples above, you may notice why only the top 4 objects (Application, Screen, View, Applet) of the hierarchy have been included. This is because, including all the objects will really flood your libraries and make spotting the right object quite a cumbersome task. Thus, by including only the top 4 hierarchies, we can simplify our work on a great scale. If the hierarchy changes, we would simply need to modify the elements at one place, only.</p>
<p>For developers wanting to use Descriptive Programming with Siebel Applications, please note that, you will have to write descriptions for your Parent objects only once. When these descriptions change, updating them in a single place will be the only required maintenance. I am using 100% Descriptive Programming with our Siebel application, and the techniques in this article have really simplified a lot of my work by just taking care of the Parent objects.</p>
<p>I hope Automation Developers using Siebel with QTP find this article useful. Thanks for visiting Relevant Codes.</p>
<p><strong>References</strong></p>
<ol>
<li><a href="http://www.advancedqtp.com/knowledge-base/articles/qtp-tricks4/descriptive-programming/implementing-a-gui-layer-with-classes/">Implementing a GUI Layer with Classes</a> by Meir Bar-Tal (AdvancedQTP, SolmarKN).</li>
</ol>
<p class="alert">If you have any questions, please ask them in the comments section. If your information is to be treated as confidential, please use the <a href="http://relevantcodes.com/contact/">Contact Form</a> to send me an e-mail instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://relevantcodes.com/qtp-working-with-large-object-hierarchies-siebel-objects/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>QTP: Working with SiebCalculator</title>
		<link>http://relevantcodes.com/qtp-working-with-siebcalculator/</link>
		<comments>http://relevantcodes.com/qtp-working-with-siebcalculator/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 21:38:43 +0000</pubDate>
		<dc:creator>Anshoo Arora</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[QTP/Siebel]]></category>
		<category><![CDATA[QTP SiebCalculator]]></category>
		<category><![CDATA[QTP Siebel Automation]]></category>
		<category><![CDATA[SiebCalculator]]></category>
		<category><![CDATA[Siebel]]></category>
		<category><![CDATA[Siebel Automation]]></category>

		<guid isPermaLink="false">http://relevantcodes.com/?p=72</guid>
		<description><![CDATA[This is the 4th article in the Siebel series. In this article, we will detail an effective way to work with the Siebalculator Object using QTP. Examples included.]]></description>
			<content:encoded><![CDATA[<p></p><p>This is the 4th article in the Siebel series. In this article, we will detail an effective way to work with the Siebel Calculator Object.</p>
<p>By default, a Siebel Calculator has a small set of input keys to work with. The idea is to verify that each input key is valid before processing the output through the calculator. The method IsKeyLoaded verifies if the key really exists in the calculator object (all possible keys are hard-coded in the array &#8216;arrFixedKeys&#8217;) whereas the method SiebCalculatorClickKeys presses the keys in an array one after the other.</p>
<p><span class="postheading">Usage:</span></p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #0000A6;">Set</span> oCalc = SiebApplication( <span style="color: #800000;">&quot;uiname:=MyApp&quot;</span> ).SiebScreen( <span style="color: #800000;">&quot;uiname:=MyScreen&quot;</span> )_
            .SiebView( <span style="color: #800000;">&quot;uiname:=MyView&quot;</span> ).SiebApplet( <span style="color: #800000;">&quot;uiname:=MyApplet&quot;</span> )_
            .SiebCalculator( <span style="color: #800000;">&quot;uiname:=MyCalculator&quot;</span> )
&nbsp;
SiebCalculatorClickKeys oCalc, Array( <span style="color: #800000;">&quot;1&quot;</span>, <span style="color: #800000;">&quot;+&quot;</span>, <span style="color: #800000;">&quot;2&quot;</span>, <span style="color: #800000;">&quot;-&quot;</span>, <span style="color: #800000;">&quot;3&quot;</span>, <span style="color: #800000;">&quot;*&quot;</span>, <span style="color: #800000;">&quot;99&quot;</span> )</pre></div></div>

<p>The above will simulate (1+2-3*99) in the SiebCalculator object.</p>
<p><span class="postheading">How its done:</span></p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'————————————————————————————————————————————— 
</span><span style="color: #008000;">' Name: Function IsKeyLoaded
</span><span style="color: #008000;">' Purpose: Checks if array of keys to be input to Calculator is valid
</span><span style="color: #008000;">' Input:
</span><span style="color: #008000;">'    arrKeys
</span><span style="color: #008000;">' Output: 
</span><span style="color: #008000;">'    Boolean
</span><span style="color: #008000;">' Date:
</span><span style="color: #008000;">' Author: 
</span><span style="color: #008000;">' Remarks: 
</span><span style="color: #008000;">'————————————————————————————————————————————— 
</span><span style="color: #0000A6;">Private</span> <span style="color: #0000A6;">Function</span> IsKeyLoaded( arrKeys )
<span style="color: #008000;">'————————————————————————————————————————————— 
</span>
    <span style="color: #0000A6;">Dim</span> arrFixedKeys
    <span style="color: #0000A6;">Dim</span> blnExists
    <span style="color: #0000A6;">Dim</span> inKey, fixKey
&nbsp;
    arrFixedKeys = Array( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, <span style="color: #800000;">&quot;/&quot;</span>, <span style="color: #800000;">&quot;CE&quot;</span>, <span style="color: #800000;">&quot;*&quot;</span>, <span style="color: #800000;">&quot;C&quot;</span>, <span style="color: #800000;">&quot;-&quot;</span>, <span style="color: #800000;">&quot;%&quot;</span>, &amp;_
                     <span style="color: #800000;">&quot;±&quot;</span>, <span style="color: #800000;">&quot;.&quot;</span>, <span style="color: #800000;">&quot;+&quot;</span>, <span style="color: #800000;">&quot;=&quot;</span> )
&nbsp;
    <span style="color: #0000A6;">For</span> <span style="color: #0000A6;">Each</span> inKey <span style="color: #0000A6;">in</span> arrKeys
        blnExists = <span style="color: #0000A6;">False</span>
        <span style="color: #0000A6;">For</span> <span style="color: #0000A6;">Each</span> fixKey <span style="color: #0000A6;">in</span> arrFixedKeys
            <span style="color: #0000A6;">If</span> Trim(LCase(CStr(inKey))) = Trim(LCase(CStr(fixKey))) <span style="color: #0000A6;">Then</span>
                blnExists = <span style="color: #0000A6;">True</span>
                <span style="color: #0000A6;">Exit</span> <span style="color: #0000A6;">For</span>
            <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
        <span style="color: #0000A6;">Next</span>
        <span style="color: #0000A6;">If</span> <span style="color: #0000A6;">Not</span> blnExists <span style="color: #0000A6;">Then</span>
            IsKeyLoaded = blnExists
            <span style="color: #0000A6;">Exit</span> <span style="color: #0000A6;">Function</span>
        <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
    <span style="color: #0000A6;">Next</span>
&nbsp;
    IsKeyLoaded = blnExists
&nbsp;
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span>
&nbsp;
<span style="color: #008000;">'————————————————————————————————————————————— 
</span><span style="color: #008000;">' Name: Sub SiebCalculatorClickKeys
</span><span style="color: #008000;">' Purpose: 
</span><span style="color: #008000;">' Input:
</span><span style="color: #008000;">'    oCalculator - object reference to the Calculator hierarchy
</span><span style="color: #008000;">'    arrKeys - Keys to be pressed on the calculator object
</span><span style="color: #008000;">' Output: 
</span><span style="color: #008000;">'    Integer
</span><span style="color: #008000;">'Dependancy: IsKeyLoaded
</span><span style="color: #008000;">' Date:
</span><span style="color: #008000;">' Author: 
</span><span style="color: #008000;">' Comments: 
</span><span style="color: #008000;">'————————————————————————————————————————————— 
</span><span style="color: #0000A6;">Public</span> <span style="color: #0000A6;">Sub</span> SiebCalculatorClickKeys( <span style="color: #0000A6;">ByVal</span> oCalculator, <span style="color: #0000A6;">ByVal</span> arrKeys )
<span style="color: #008000;">'————————————————————————————————————————————— 
</span>
    <span style="color: #0000A6;">Dim</span> i
&nbsp;
    <span style="color: #008000;">' Check if the keys entered by the user are valid and exist as keys on the 
</span>    <span style="color: #008000;">'_ SiebCalculator object.
</span>    isValid = IsKeyLoaded(arrKeys)
&nbsp;
    <span style="color: #008000;">' The following component can be modified to also work with 'ClickKeys':
</span>    <span style="color: #008000;">'_ enter an array with multiple values in each element and use clickKeys if the length
</span>    <span style="color: #008000;">'_ is greater than 1, unless if it is the key &quot;CE&quot;
</span>    <span style="color: #0000A6;">If</span> <span style="color: #0000A6;">Not</span> isValid <span style="color: #0000A6;">Then</span>
        Reporter.ReportEvent micWarning, <span style="color: #800000;">&quot;Invalid Key(s)&quot;</span>, <span style="color: #800000;">&quot;Array: &quot;</span> &amp; Join(arrKeys, <span style="color: #800000;">&quot;,&quot;</span>)
    <span style="color: #0000A6;">Else</span>
        <span style="color: #008000;">'object.OpenPopup
</span>        <span style="color: #0000A6;">For</span> i = <span style="color: #0000A6;">LBound</span>(arrKeys) <span style="color: #0000A6;">to</span> <span style="color: #0000A6;">UBound</span>(arrKeys)
            oCalc.ClickKey arrKeys(i)
        <span style="color: #0000A6;">Next</span>
        <span style="color: #008000;">'object.ClosePopup
</span>    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Sub</span></pre></div></div>

<p><a href="http://relevantcodes.com/Articles/SiebCalculator/SiebCalculator.txt">Download this code</a></p>
<p>When the procedure ends, the output will be visible in the calculator&#8217;s output field.</p>
<p class="alert">If you have any questions, please ask them in the comments section. If your query is confidential, please use the <a href="http://relevantcodes.com/contact/">Contact Form</a> to send me an e-mail instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://relevantcodes.com/qtp-working-with-siebcalculator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QTP: Working with SiebList</title>
		<link>http://relevantcodes.com/qtp-working-with-sieblist/</link>
		<comments>http://relevantcodes.com/qtp-working-with-sieblist/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 21:38:21 +0000</pubDate>
		<dc:creator>Anshoo Arora</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[QTP/Siebel]]></category>
		<category><![CDATA[QTP Siebel Automation]]></category>
		<category><![CDATA[QTP SiebList]]></category>
		<category><![CDATA[Siebel]]></category>
		<category><![CDATA[Siebel Automation]]></category>
		<category><![CDATA[Siebel List]]></category>
		<category><![CDATA[SiebList]]></category>

		<guid isPermaLink="false">http://relevantcodes.com/?p=70</guid>
		<description><![CDATA[This article introduces the SiebList object in a QTP and Siebel Environment, and demonstrates some methods that can help in working with a SiebList like an expert. ]]></description>
			<content:encoded><![CDATA[<p></p><p class="note">This article has been revised for Siebel Version 8.1. It can be found <a href="http://relevantcodes.com/qtp-working-with-sieblist-revised">here</a></p>
<p>According to <a href="http://download.oracle.com/docs/cd/B31104_02/books/TestGuide/TestGuide_FuncTestObjRef38.html#wp1004410">Testing Siebel Business Applications at Oracle</a>, &#8220;A SiebList object is a singleton container object that is one of the Complex Control Objects. Due to the complex nature of this object, it is also a collection object&#8221;. This object can be quite complex to work with, especially when you take into consideration some of the current limitations (I am using Sieb v7.7) found at the KB. Two more limitations can be found in <a href="http://www.advancedqtp.com/forums/index.php/topic,2787.0.html">this thread</a> at <a href="http://www.advancedqtp.com/forums/index.php">AdvancedQTP Forums</a>.</p>
<p>Also, when there are many rows present in this object, it may not show the exact number, but instead it shows 1-10+ rows, 11-20+ rows, 21-30+ rows and so on. To get the correct number of rows from the List object, we use an interesting property known as a RecordCounter. A SiebList&#8217;s RecordCounter indicates the visible text of the record counter string (for example: 1-10 or 10+).</p>
<p>The idea is to stay in a loop until the &#8220;+&#8221; sign stops to appear.</p>
<p>
<span class="postheading">Finding the Row Count for SiebList</span>
</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #0000A6;">Option</span> <span style="color: #0000A6;">Explicit</span> <span style="color: #008000;">'On
</span>
<span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #008000;">' Name: GetSiebListRows
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Purpose: Get the total number of rows of the List Object without the 
</span><span style="color: #008000;">' 1 of 10+, '11 of 20+' and so on..
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Input:
</span><span style="color: #008000;">'  oSiebApplet - object reference to the SiebApplet hierarchy
</span><span style="color: #008000;">'  pValUINameSiebList - uiname of the SiebList object
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Output: 
</span><span style="color: #008000;">'  Integer - number of rows
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Date: 
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Author: 
</span><span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #0000A6;">Function</span> GetSiebListRows( <span style="color: #0000A6;">byRef</span> oSiebApplet, pValUINameSiebList )
<span style="color: #008000;">'—————————————————————————————————————————
</span>  <span style="color: #008000;">'SiebList is a list object in a Siebel test automation environment
</span>
  <span style="color: #0000A6;">Dim</span> vCounter
  <span style="color: #0000A6;">If</span> InStr(1, pValUINameSiebList, <span style="color: #800000;">&quot;uiname&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
    pValUINameSiebList = Trim(Split(pValUINameSiebList, <span style="color: #800000;">&quot;:=&quot;</span>)(1))
  <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
  <span style="color: #008000;">'From QTP Ref:
</span>  <span style="color: #008000;">'_ The RecordCounter indicates the visible text of the record counter 
</span>  <span style="color: #008000;">'_ string (for example: 1 - 7 or 7+)
</span>  vCounter = oSiebApplet.RecordCounter
&nbsp;
  <span style="color: #0000A6;">Do</span>
    <span style="color: #0000A6;">If</span> InStr(1, vCounter, <span style="color: #800000;">&quot;+&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
      oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebList).NextRowSet
      vCounter = oSiebApplet.RecordCounter
    <span style="color: #0000A6;">Else</span>
      vCounter = oSiebApplet.RecordCounter
      <span style="color: #0000A6;">Exit</span> <span style="color: #0000A6;">Do</span>
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
  <span style="color: #0000A6;">Loop</span>
&nbsp;
  <span style="color: #0000A6;">If</span> InStr(1, vCounter, <span style="color: #800000;">&quot;of&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
    vCounter = CInt(Trim(Split(CStr(vCounter), <span style="color: #800000;">&quot;of&quot;</span>)(1)))
  <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
  GetSiebListRows = vCounter
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span>
&nbsp;
<span style="color: #008000;">'* Usage:
</span><span style="color: #008000;">' Dim oSiebApplet, intRows
</span><span style="color: #008000;">' Set oSiebApplet = SiebApplication(&quot;&quot;).SiebScreen(&quot;&quot;).SiebView(&quot;&quot;).SiebApplet(&quot;&quot;)
</span><span style="color: #008000;">'
</span>' intRows = GetSiebListRows(oSiebApplet, <span style="color: #800000;">&quot;uiname:=mySiebList&quot;</span>)</pre></div></div>

<p>As I mentioned above, SiebList is quite a complex object. Suppose you have to find some text in one of the columns of the SiebList. Considering the workaround above to find the correct number of rows for the object, we can loop over all the rows until we find the value that we&#8217;re looking for.</p>
<p>Note that the column name may be different as it appears to the human eye. You will have to find the correct column name for this to work correctly. For example, in our environment, we have a column named &#8216;Application Number&#8217;. However, &#8216;Application Number&#8217; is what appears to us, but in reality, QuickTest identifies that column by &#8216;Application ID&#8217;. So, please be a little careful when working with column headings in SiebList.</p>
<p>
<span class="postheading">Finding a text string in a SiebList column</span></p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #008000;">' Name: Function SiebListFindValRow
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Purpose: Find a row from a column in which a given value (sVal) is located
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Input:
</span><span style="color: #008000;">'  oSiebApplet - object reference to the SiebApplet hierarchy
</span><span style="color: #008000;">'  pValUINameSiebList - uiname property's value for the SiebList object
</span><span style="color: #008000;">'  sColumnName - name of the column where the value is to be found
</span><span style="color: #008000;">'  sVal - value that is to be found
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Output: 
</span><span style="color: #008000;">'  Integer
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">'Dependancy: 
</span><span style="color: #008000;">'  SiebListRows
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Date:
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Author: 
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Remarks: Make sure the columns name is correct - sometimes the header name
</span><span style="color: #008000;">' is not the actual name.
</span><span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #0000A6;">Function</span> SiebListFindValRow( <span style="color: #0000A6;">byRef</span> oSiebApplet, pValUINameSiebList, sColumnName, sVal )
<span style="color: #008000;">'—————————————————————————————————————————
</span>  <span style="color: #008000;">'SiebList is a list object in a Siebel test automation environment
</span>
  <span style="color: #0000A6;">Dim</span> iRows, r, sData, sMsg
&nbsp;
  <span style="color: #0000A6;">If</span> InStr(1, pValUINameSiebList, <span style="color: #800000;">&quot;uiname&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
    pValUINameSiebList = Trim(Split(pValUINameSiebList, <span style="color: #800000;">&quot;:=&quot;</span>)(1))
  <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
  <span style="color: #008000;">'* Uses GetSiebListRows
</span>  iRows = GetSiebListRows( oSiebApplet, pValUINameSiebList )
&nbsp;
  oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebList).FirstRowSet
&nbsp;
  <span style="color: #0000A6;">For</span> r = 0 <span style="color: #0000A6;">to</span> iRows - 1
&nbsp;
    oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebList).ActivateRow r
    sData = Trim(oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebList)_
          .GetCellText(sColumnName, r))
&nbsp;
    <span style="color: #0000A6;">If</span> sData = sVal <span style="color: #0000A6;">Then</span>
      SiebListFindValRow = r
      sMsg = <span style="color: #800000;">&quot;The following string: [&quot;</span> &amp; sVal &amp; <span style="color: #800000;">&quot;] was found in the &quot;</span> &amp; _
            sColumnName &amp; <span style="color: #800000;">&quot; column of the Siebel List&quot;</span>
      Reporter.ReportEvent micDone, <span style="color: #800000;">&quot;Siebel List Value found&quot;</span>, sMsg
      <span style="color: #0000A6;">Exit</span> <span style="color: #0000A6;">Function</span>
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
  <span style="color: #0000A6;">Next</span>
&nbsp;
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span>
&nbsp;
<span style="color: #008000;">'* Usage:
</span><span style="color: #008000;">' Dim oSiebApplet, intRow
</span><span style="color: #008000;">' Set oSiebApplet = SiebApplication(&quot;&quot;).SiebScreen(&quot;&quot;).SiebView(&quot;&quot;).SiebApplet(&quot;&quot;)
</span><span style="color: #008000;">'
</span>' intRow = SiebListFindValRow(oSiebApplet, <span style="color: #800000;">&quot;uiname:=mySiebList&quot;</span>, <span style="color: #800000;">&quot;Application ID&quot;</span>, <span style="color: #800000;">&quot;Text&quot;</span>)</pre></div></div>

<p><span class="postheading">Finding all rows in a column where a text string is found</span><br />
Now, similar to the requirement above, we may have to find all the rows that carry the text we&#8217;re looking for. This can be from 1 to 2 or more rows. This method returns a collection object:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #008000;">' Name: Function SiebListFindValAllRows
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Purpose: Find all rows from a given column where a given value exists
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Input:
</span><span style="color: #008000;">'  oSiebApplet - object reference to the SiebApplet hierarchy
</span><span style="color: #008000;">'  pValUINameSiebList - uiname property's value for the SiebList object
</span><span style="color: #008000;">'  sColumnName - name of the column where the value is to be found
</span><span style="color: #008000;">'  sVal - value that is to be found
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Output: 
</span><span style="color: #008000;">'  Object
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">'Dependancy: 
</span><span style="color: #008000;">'  SiebListRows
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Date:
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Author: 
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Remarks: Make sure the columns name is correct - sometimes the header name is not the actual name.
</span><span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #0000A6;">Function</span> SiebListFindValAllRows( <span style="color: #0000A6;">byRef</span> oSiebApplet, pValUINameSiebList, sColumnName, sVal )
<span style="color: #008000;">'—————————————————————————————————————————
</span>  <span style="color: #008000;">'SiebList is a list object in a Siebel test automation environment
</span>  
  <span style="color: #0000A6;">Dim</span> iRowsTotal, iRowsRef
  <span style="color: #0000A6;">Dim</span> r, i, n, sData, arrArray
&nbsp;
  <span style="color: #0000A6;">Dim</span> oDict: <span style="color: #0000A6;">Set</span> oDict = <span style="color: #0000A6;">CreateObject</span>( <span style="color: #800000;">&quot;Scripting.Dictionary&quot;</span> )
&nbsp;
  <span style="color: #0000A6;">If</span> InStr(1, pValUINameSiebList, <span style="color: #800000;">&quot;uiname&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
    pValUINameSiebList = Trim(Split(pValUINameSiebList, <span style="color: #800000;">&quot;:=&quot;</span>)(1))
  <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
  n = 0
&nbsp;
  <span style="color: #008000;">'Calls the method: GetSiebListRows (see method above)
</span>  iRowsTotal = GetSiebListRows( oSiebApplet, pValUINameSiebList )
  iRowsRef = CInt(oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebList).RowsCount)
&nbsp;
  oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebList).FirstRowSet
&nbsp;
  <span style="color: #0000A6;">For</span> r = 0 <span style="color: #0000A6;">to</span> iRowsTotal - 1
    i = r
    <span style="color: #0000A6;">If</span> iRowsRef &lt;= r + 1 <span style="color: #0000A6;">Then</span>
      i = iRowsRef - 1
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
    sData = Trim(oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebList).GetCellText(sColumnName, i))
&nbsp;
    <span style="color: #0000A6;">If</span> sData = sVal <span style="color: #0000A6;">Then</span>
      oDict.Add n+1, r
      n = n + 1
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
    oSiebApplet.SiebList(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebList).NextRow
  <span style="color: #0000A6;">Next</span>
&nbsp;
  <span style="color: #0000A6;">Set</span> SiebListFindValAllRows = oDict
&nbsp;
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span>
&nbsp;
<span style="color: #008000;">'* Usage:
</span><span style="color: #008000;">' Dim oSiebApplet, RowCollection
</span><span style="color: #008000;">' Set oSiebApplet = SiebApplication(&quot;&quot;).SiebScreen(&quot;&quot;).SiebView(&quot;&quot;).SiebApplet(&quot;&quot;)
</span><span style="color: #008000;">'
</span>' <span style="color: #0000A6;">Set</span> RowCollection = SiebListFindValRow(oSiebApplet, <span style="color: #800000;">&quot;uiname:=mySiebList&quot;</span>, <span style="color: #800000;">&quot;Application ID&quot;</span>, <span style="color: #800000;">&quot;Text&quot;</span>)</pre></div></div>

<p><a href="http://relevantcodes.com/Articles/SiebList/SiebList.txt">Download this code</a></p>
<p>
<span class="postheading">References</span></p>
<ol>
<li><a href="http://download.oracle.com/docs/cd/B31104_02/books/TestGuide/TestGuide_FuncTestObjRef2.html#wp1004323">Functional Test Automation Objects for High Interactivity Siebel Applications</a></li>
<li><a href="http://www.advancedqtp.com/forums/">AdvancedQTP Forums</a></li>
</ol>
<p class="alert">If you have any questions, please ask them in the comments section. If your query is confidential, please use the <a href="http://relevantcodes.com/contact/">Contact Form</a> to send me an e-mail instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://relevantcodes.com/qtp-working-with-sieblist/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>QTP: Working with SiebPickLists</title>
		<link>http://relevantcodes.com/qtp-working-with-siebpicklists/</link>
		<comments>http://relevantcodes.com/qtp-working-with-siebpicklists/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 21:37:57 +0000</pubDate>
		<dc:creator>Anshoo Arora</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[QTP/Siebel]]></category>
		<category><![CDATA[Pick List]]></category>
		<category><![CDATA[QTP PickList]]></category>
		<category><![CDATA[QTP Siebel Automation]]></category>
		<category><![CDATA[QTP SiebPickList]]></category>
		<category><![CDATA[Siebel]]></category>
		<category><![CDATA[Siebel Automation]]></category>
		<category><![CDATA[SiebPickList]]></category>

		<guid isPermaLink="false">http://relevantcodes.com/?p=68</guid>
		<description><![CDATA[This article introduces the SiebPickList object in a QTP and Siebel Environment, and demonstrates some methods that can be performed to enhance working capabilities in Siebel.]]></description>
			<content:encoded><![CDATA[<p></p><p>A SiebPickList object closely resembles a List object (WebList) in a Web based environment. A good reference for SiebPickList apart from the QTP help can be found <a href='http://download.oracle.com/docs/cd/B31104_02/books/TestGuide/TestGuide_FuncTestObjRef69.html#wp1004438'> here</a>. Do not confuse a PickList with a SiebList object &#8211; they are very different in the way they work, and the latter is much more complex.</p>
<p>In our environment, there are many many SiebPickLists. A good majority of these PickLists are not required fields, but according to the requirements, random values must be selected; ie. the fields cannot be left blank. Since selecting random items in some PickLists does not impact the process, the following can be used to accomplish this task.</p>
<p>
<span class="postheading">Selecting a random value in SiebPickList</span><br />
The below function can be used to select a random value from the SiebPickList object:
</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #008000;">' Name: Function SiebPickListRandomSelect
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Purpose: Randomly selects an item in a PickList object
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Input:
</span><span style="color: #008000;">'  oSiebApplet - object reference to the SiebApplet hierarchy
</span><span style="color: #008000;">'  pValUINameSiebPickList - uiname property's value for the SiebList object
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Output
</span><span style="color: #008000;">'  Object
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Date:
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Author: Anshoo Arora
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Remarks: 
</span><span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #0000A6;">Sub</span> SiebPickListRandomSelect( <span style="color: #0000A6;">byRef</span> oSiebApplet, pValUINameSiebPickList )
<span style="color: #008000;">'—————————————————————————————————————————
</span>    <span style="color: #008000;">'A pick list in a Siebel test automation environment.
</span>
    <span style="color: #0000A6;">Dim</span> iCnt, i, vNextItemByIndex
&nbsp;
    <span style="color: #0000A6;">If</span> InStr(1, pValUINameSiebPickList, <span style="color: #800000;">&quot;uiname&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
        pValUINameSiebPickList = Trim(Split(pValUINameSiebPickList, <span style="color: #800000;">&quot;:=&quot;</span>)(1))
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
    <span style="color: #0000A6;">With</span> oSiebApplet.SiebPicklist(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebPickList)
&nbsp;
        <span style="color: #008000;">' Check if PickList is enabled
</span>        <span style="color: #0000A6;">If</span> .IsEnabled <span style="color: #0000A6;">Then</span>
            <span style="color: #008000;">' Check if PickList is required
</span>            <span style="color: #0000A6;">If</span> <span style="color: #0000A6;">Not</span> .IsRequired <span style="color: #0000A6;">Then</span>
                .<span style="color: #0000A6;">Select</span> <span style="color: #800000;">&quot;#&quot;</span> &amp; RandomNumber.Value(0, .Count - 1)
            <span style="color: #0000A6;">Else</span>
                Reporter.ReportEvent micWarning, pValUINameSiebPickList, <span style="color: #800000;">&quot;Cannot&quot;</span> &amp;_
                <span style="color: #800000;">&quot; Random Select. Field is Required.&quot;</span>
            <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
        <span style="color: #0000A6;">Else</span>
            Reporter.ReportEvent micWarning, pValUINameSiebPickList, <span style="color: #800000;">&quot;Cannot&quot;</span> &amp;_
            <span style="color: #800000;">&quot; Random Select. Field is disabled.&quot;</span>
        <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">With</span>
&nbsp;
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span></pre></div></div>

<p>
<span class="postheading">Getting all objects of a SiebPickList in a Collection</span><br />
For required PickLists, I usually check if the item that is to be selected exists before making the selection. Following is how you can retrieve all the items of the PickList in a collection:
</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #008000;">' Name: Function SiebPickListGetAllItems
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Purpose: Retrieve names of all items in a Collection from the PickList object
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Input:
</span><span style="color: #008000;">'  oSiebApplet - object reference to the SiebApplet hierarchy
</span><span style="color: #008000;">'  pValUINameSiebPickList - uiname property's value for the SiebList object
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Output
</span><span style="color: #008000;">'  Collection 
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Dependancy:
</span><span style="color: #008000;">'  SiebPickListGetItemsCnt
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Date:
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Author: Anshoo Arora
</span><span style="color: #008000;">' 
</span><span style="color: #008000;">' Remarks: 
</span><span style="color: #008000;">'—————————————————————————————————————————
</span><span style="color: #0000A6;">Function</span> SiebPickListGetAllItems( <span style="color: #0000A6;">byRef</span> oSiebApplet, pValUINameSiebPickList )
<span style="color: #008000;">'—————————————————————————————————————————
</span>    <span style="color: #008000;">'A pick list in a Siebel test automation environment.
</span>
    <span style="color: #0000A6;">Dim</span> iCnt, i, vNextItemByIndex
&nbsp;
    <span style="color: #0000A6;">Dim</span> oDict: <span style="color: #0000A6;">Set</span> oDict = <span style="color: #0000A6;">CreateObject</span>( <span style="color: #800000;">&quot;Scripting.Dictionary&quot;</span> )
&nbsp;
    <span style="color: #0000A6;">If</span> InStr(1, pValUINameSiebPickList, <span style="color: #800000;">&quot;uiname&quot;</span>) &lt;&gt; 0 <span style="color: #0000A6;">Then</span>
        pValUINameSiebPickList = Trim(Split(pValUINameSiebPickList, <span style="color: #800000;">&quot;:=&quot;</span>)(1))
    <span style="color: #0000A6;">End</span> <span style="color: #0000A6;">If</span>
&nbsp;
    iCnt = oSiebApplet.SiebPicklist(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebPickList).Count
&nbsp;
    <span style="color: #0000A6;">For</span> i = 0 <span style="color: #0000A6;">to</span> iCnt - 1
        vNextItemByIndex = oSiebApplet.SiebPicklist(<span style="color: #800000;">&quot;uiname:=&quot;</span> &amp; pValUINameSiebPickList).GetItemByIndex(i)
        oDict.Add i+1, vNextItemByIndex
    <span style="color: #0000A6;">Next</span>
&nbsp;
    <span style="color: #0000A6;">Set</span> SiebPickListGetAllItems = oDict
&nbsp;
<span style="color: #0000A6;">End</span> <span style="color: #0000A6;">Function</span></pre></div></div>

<p class="note">The concepts in this article apply strictly to Siebel v7.7</p>
<p class="alert">If you have any questions, please ask them in the comments section. If your query is confidential, please use the <a href="http://relevantcodes.com/contact/">Contact Form</a> to send me an e-mail instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://relevantcodes.com/qtp-working-with-siebpicklists/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>QTP: Working with Siebel &#8211; An Introduction</title>
		<link>http://relevantcodes.com/qtp-working-with-siebel-an-introduction/</link>
		<comments>http://relevantcodes.com/qtp-working-with-siebel-an-introduction/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 22:20:27 +0000</pubDate>
		<dc:creator>Anshoo Arora</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[QTP/Siebel]]></category>
		<category><![CDATA[AllowAnonUsers]]></category>
		<category><![CDATA[Automating Siebel With QTP]]></category>
		<category><![CDATA[AutoOn Token]]></category>
		<category><![CDATA[EnableWebClientAutomation]]></category>
		<category><![CDATA[QTP Siebel]]></category>
		<category><![CDATA[Siebel]]></category>
		<category><![CDATA[Siebel Addin]]></category>
		<category><![CDATA[Siebel Automation]]></category>
		<category><![CDATA[Siebel AutoOn]]></category>
		<category><![CDATA[Siebel Introduction]]></category>
		<category><![CDATA[StrictSync]]></category>

		<guid isPermaLink="false">http://relevantcodes.com/?p=56</guid>
		<description><![CDATA[This article introduces the Siebel add-in with QTP and outlines various techniques to work with Siebel objects. It also offers an excellent introduction to the Siebel automation process with QTP.]]></description>
			<content:encoded><![CDATA[<p></p><p>I have now been working with Siebel apps on and off for about 6 months now and I feel that even though there is a great wealth of information available on other technologies, there was very little information available for automating Siebel apps with QTP. I don’t consider myself an expert nor do I feel that the techniques in this and coming articles are ‘best practices’; but, my goal is to share what I did and as always, if you have more efficient ways of performing tasks outlined in any articles here, then I would surely like to hear them!</p>
<p>
<span class="postheading">Introduction</span></p>
<ul>
<li>See QTP Reference for:
<ul>
<li>Siebel Test Automation-> AutoOn Token</li>
<li>Siebel Test Automation-> Setting Siebel Record and Run Options</li>
<li>Siebel Test Automation-> SiebAutomationAccessCode property (optional)</li>
<li>Siebel Test Automation-> SiebAutomationRequestTimeout property (optional)</li>
</ul>
</li>
<li>See the &#8216;SetTimeOut&#8217; property of the SiebApplication object (Configure the advanced timeout and access settings specific for the Siebel 7.7 application)</li>
<li>See the ReadMe file for known limitations. Adding to the list of limitations:
<ul>
<li>With SiebList, sorting does not work for columns not displayed on the screen. This affects all columns that are accessed using the horizontal slider.</li>
<li>With SiebList, the columns displayed by the horizontal slider cannot be accessed directly.</li>
</ul>
</li>
<li><a href="http://www.oracle.com/applications/crm/siebel/resources/siebel-test-automation-data-sheet.pdf">Siebel Test Automation</a> data-sheet at Oracle.com contains the latest information on Siebel objects (optional).</li>
<li><i>Do not load the Web Add-in with the Siebel add-in loaded</i>. The Siebel Add-in accounts for both.</li>
</ul>
<p>Unlike some other environments, we cannot bypass the parent to reach the child in the object hierarchy. We must create descriptions for each object in the hierarchy if we are using DP. If you record, you will automatically see the entire object hierarchy. Please see the code below for explanation (the page object was not included in the object hierarchy): </p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">''''Web 
</span>
<span style="color: #008000;">'Correct:
</span>1. Browser(<span style="color: #800000;">&quot;title:=Google&quot;</span>).Page(<span style="color: #800000;">&quot;title:=Google&quot;</span>).WebEdit(<span style="color: #800000;">&quot;name:=q&quot;</span>).<span style="color: #0000A6;">Set</span> <span style="color: #800000;">&quot;AdvancedQTP&quot;</span>
<span style="color: #008000;">'Correct (without the page object defined in the hierarchy):
</span>2. Browser(<span style="color: #800000;">&quot;title:=Google&quot;</span>).WebEdit(<span style="color: #800000;">&quot;name:=q&quot;</span>).<span style="color: #0000A6;">Set</span> <span style="color: #800000;">&quot;AdvancedQTP&quot;</span></pre></div></div>

<p>With Siebel, if an action is to be performed on the SiebList (which is an immediate child of SiebApplet):</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;"><span style="color: #008000;">''''Siebel
</span>
<span style="color: #008000;">'Correct:
</span>1. SiebApplication(<span style="color: #800000;">&quot;&quot;</span>).SiebScreen(<span style="color: #800000;">&quot;&quot;</span>).SiebView(<span style="color: #800000;">&quot;&quot;</span>).SiebApplet(<span style="color: #800000;">&quot;&quot;</span>).SiebList(<span style="color: #800000;">&quot;&quot;</span>).Event
&nbsp;
<span style="color: #008000;">'Incorrect:
</span>2. SiebApplication(<span style="color: #800000;">&quot;&quot;</span>).SiebList(<span style="color: #800000;">&quot;&quot;</span>).Event
3a. SiebApplication(<span style="color: #800000;">&quot;&quot;</span>).SiebScreen(<span style="color: #800000;">&quot;&quot;</span>).SiebApplet(<span style="color: #800000;">&quot;&quot;</span>).SiebList(<span style="color: #800000;">&quot;&quot;</span>).Event
3b. SiebApplication(<span style="color: #800000;">&quot;&quot;</span>).CurrentSiebScreen.SiebApplet(<span style="color: #800000;">&quot;&quot;</span>).SiebList(<span style="color: #800000;">&quot;&quot;</span>).Event
4a. SiebApplication(<span style="color: #800000;">&quot;&quot;</span>).SiebView(<span style="color: #800000;">&quot;&quot;</span>).SiebApplet(<span style="color: #800000;">&quot;&quot;</span>).SiebList(<span style="color: #800000;">&quot;&quot;</span>).Event
4b. SiebApplication(<span style="color: #800000;">&quot;&quot;</span>).CurrentSiebView.SiebApplet(<span style="color: #800000;">&quot;&quot;</span>).SiebList(<span style="color: #800000;">&quot;&quot;</span>).Event</pre></div></div>

<p>
<span class="postheading">StrictSync</span><br />
By default, the default wait time for performing an action on any Sieb object is 2 seconds. This is controlled by <i>StrictSync</i>. You can read more about it at HP’s KB, and to increase performance, also set it to 0. Below is how you set the value of StrictSync to 0:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:consolas, monospace;">Setting.Packages.WebPackage.Settings(<span style="color: #800000;">&quot;StrictSync&quot;</span>) = 0</pre></div></div>

<p>
<span class="postheading">AutoOn Token</span><br />
The user must append &#8216;SWECmd=AutoOn&#8217; to the URL for the Siebel Web Engine to to generate test automation information for the Siebel application. Please see below:</p>
<p>The following URL:<br/>&nbsp;&nbsp; -> &nbsp; http://yourHostName/start.swe?{someLongString}</p>
<p>must be:<br />
&nbsp;&nbsp;-> &nbsp; http://yourHostName/start.swe?SWECmd=AutoOn</p>
<p>
<span class="postheading">Server Configuration</span><br />
The following 2 entities must be set to &#8216;True&#8217;:</p>
<ul>
<li>EnableAutomation = TRUE</li>
<li>AllowAnonUsers = TRUE</li>
</ul>
<p>
<span class="postheading">Siebel Test Automation Overview and Resolutions</span><br />
<span class="highlight">[Update Feb 19, 2010: Reported by and Credits to Todd Mescher]</span>: <a href="http://blogs.oracle.com/aamat/2009/09/siebel_test_automation.html">This post</a> at Oracle Blogs also provides numerous resolutions to issues dealt in the Siebel environment.
</p>
<p>
<span class="postheading">References</span></p>
<ol>
<li><a href="http://www.advancedqtp.com/forums/index.php/topic,3153.msg11956.html#msg11956">Object Identification Issue with Siebel 8.1</a></li>
</ol>
<p><i>This post is updated often so be sure to check back at a later date.</i></p>
<p class="alert">If you have any questions, please ask them in the comments section. If your query is confidential, please use the <a href="http://relevantcodes.com/contact/">Contact Form</a> to send me an e-mail instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://relevantcodes.com/qtp-working-with-siebel-an-introduction/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
	</channel>
</rss>

