How to create description object model at runtime in uft/qtp?
<p>thank you for taking a look on this question. Just wondering if there is a best approach to create description object model at runtime. My code fails<br>
<code>Object doesn't support this property or method: 'Browser(...).page(...).WebButton'</code></p>

<pre><code>FunctionCreateDescObjAt_RunTime(StrBrowserNme,StrBrwsrTitle,StrObject,StrPgeNme,StrPgtitle,StrObjectName,index)`

    'create a description object for Browser &amp; Page`

    Set WebBrwsrDesc= Description.Create
        WebBrwsrDesc("application version").value= "Internet Explorer.*"
        If StrBrowser&lt;&gt;"" Then
            WebBrwsrDesc("name").value=StrBrowserNme
            WebBrwsrDesc("title").value=StrBrwsrTitle
        End If

    Set WebPageDesc= Description.Create
        WebPageDesc("name").value=StrPgeNme
        WebPageDesc("title").value=StrPgtitle

'   'Based on the type of object, execute the condition`

    Select Case StrObject`

        Case "WebButton"
            Set WebBtnDes= Description.Create
            WebBtnDes("html tag").value="INPUT"
            WebBtnDes("name").value=StrObjectName   
            WebBtnDes("micclass").value="button"
            WebBtnDes("index").value=index
            'Browser("title:=.*","name:=.*").page("title:=.*","name:=.*").WebButton(WebBtnDes).fnWebButtonClick
            Browser(WebBrwsrDesc).page(WebPageDesc).WebButton(WebBtnDes).click

    end select

End Function
</code></pre>

<p>I am making a call from action 
<code>CreateDescObjAt_RunTime "Account Login","Your Store", "WebButton", "", "Account Login", "Login", ""</code> And this is failing. However if I un comment  this line &amp; comment problem line, it works
<code>Browser("title:=.*","name:=.*").page("title:=.*","name:=.*").WebButton(WebBtnDes).fnWebButtonClick</code>  </p>

<p>Could you please help me with the right approach? thanks</p>