strBrowser = "Assumptions for Home insurance"    <-- remove the quotes when
you are assining to any variable you don't need to have so many quotes..
                                                 <-- even if you are
intented to do it you can use following method.

strBrowser = ""&"Assumptions for Home insurance"&""  <-- we have to use '&'
for concatenation.



strPage = "Page_1_Personal_Details_PH1"

Set vLoginBrowser=
Browser("name:="&strBrowser&".*").Page("title:="&strPage&".*")

 'Title
       Call DPWebList ("titleData", vTitle)         <- this is totally wrong

                                                    <- when you are trying
to call and execute procedure.. you need to know
                                                    <- what are the values
you can pass to that partiucalr function or procedure.


'Web List
Public Sub DPWebList (strWebList, strInValue)   <-- this procedure needs two
input variable same data you have to pass
       If strInValue <> "" Then
               Set obj_WebList = Description.Create
               obj_WebList ("Class Name").value = "WebList"
               obj_WebList ("name").value= strWebList

               Browser(strBrowser).page(strPage).Sync          <-- This is
totally wrong.  when you are using with Object repository then only you can
use

               vLoginBrowser.sync

               vLoginBrowser.WebList(obj_WebList).select strInValue   <-
some times this will not work.. then include index..

              ' obj_WebList("index").value= 0    <-- you can increase the
index value untill it identifies the object..
              ' vLoginBrowser.WebList(obj_WebList).select strInValue



        End If
End Sub







> Hi,
>
> If u r running script in vbs file, what happens is Object Repository will
> not be available. So u r statement
> -->Browser(strBrowser).page(strPage).Sync---is invalid/will fail. More over
> u have DP for List object not for Browser/page.
>
> Please let me know if U have any doubts.
>
> Regards,
> Afroz
>
>  On Mon, Jun 15, 2009 at 10:22 AM, johnthenu <[email protected]> wrote:
>
>>
>> Hi,
>>
>> QTP Script:
>>
>> strBrowser = """Assumptions for Home insurance"""
>>                MsgBox strBrowser
>>        strPage = """Page_1_Personal_Details_PH1"""
>>           MsgBox strPage
>>
>>  'Title
>>        Call DPWebList ("titleData", vTitle)
>>
>>
>> Function:
>>
>> 'Web List
>> Public Sub DPWebList (strWebList, strInValue)
>>        If strInValue <> "" Then
>>                Set obj_WebList = Description.Create
>>
>>                obj_WebList ("Class Name").value = "WebList"
>>                obj_WebList ("name").value= strWebList
>>
>>                Browser(strBrowser).page(strPage).Sync
>>
>>  Browser(strBrowser).Page(strPage).WebList(obj_WebList).Select
>> strInValue
>>        End If
>> End Sub
>>
>>
>> -----
>>
>> When run this script i get an :
>>
>> Failed to run the test due to an unknown error.
>>
>> Function file: C:\Documents and Settings\Get\Desktop\DP.vbs
>> Line (27): "            Browser(strBrowser).page(strPage).Sync".
>>
>> If if use the function with QTP script it runs ok.
>>
>> An help will be very much appreciated...
>>
>> >>
>>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to