Results 1 to 4 of 4
  1. #1

    dealing with dynamic link object in OR

    I have the case where i have a list of songlist (collection of song). I want to click on of them which goes to Edit page and want to modify the name of list

    I want to do that for few list to see its edit is working right.

    I used datable to parametrize which links to go to

    Browser("xxx").Page("musiclover's Playlists").Link(DataTable("PlaylistName", dtGlobalSheet)).Click

    Now problem is it works fine with the link i recorded with the second time around it throws error object not found in repository. I tried to used regular expression in OR and all still giving same problem. I have spent lot of time to try different things but still not working.

    NOTE: Browser("xxx").Page("music's Playlists")
    Page(<"music's" its actually a log in id of the user&gt

    Any help or point to right direction would be appropriated. Thanks.

  2. #2

    Re: dealing with dynamic link object in OR

    Read more about Descriptive programming from the QTP FAQ post.

  3. #3

    Re: dealing with dynamic link object in OR

    Well I tried descriptive programming and still at the same line it says object not found in repository

    Set ObjBrowser = Description.Create
    Set ObjPage = Description.Create
    Set ObjLink = Description.Create
    Set ObjImage = Description.Create
    Set ObjWebEdit = Description.Create
    Set ObjOK = Description.Create

    ObjBrowser("name").value="New Songs"
    ObjBrowser("title").value="New Songs"

    ObjPage("title").value="New Songs"

    ObjLink("name").value=DataTable("Name", dtGlobalSheet)
    ObjLink("title").value=DataTable("Name", dtGlobalSheet)

    ObjImage("abs_x").value = "429"
    ObjImage("abs_y").value = "368"

    ObjWebEdit("html tag").value="INPUT"
    ObjWebEdit("html id")="listInputBox"

    ObjOK("html tag").value="DIV"

    Browser("New Songs").Page("New Songs_2").Link("View/Edit lists").Click
    Browser(ObjBrowser).Page(ObjPage).Link(DataTable(" Name", dtGlobalSheet)).Click

    The last line gives error and i know its because i am using the browser and as descritpive objects.

    If i use the below then it would work for the first name which i used to record but next link clicking says object not found.
    'Browser("New Songs").Page("ml23's Playlists").Link(DataTable("Name", dtGlobalSheet)).Click

    I also tried to parameterized the link object name so it takes from Data table..no luck
    Also tried to put regular expression for that link page title still not working.
    I tried so many different ways after reading more but no luck so far [img]/images/graemlins/frown.gif[/img]

  4. #4
    Senior Member
    Join Date
    Feb 2008
    Los Angeles, CA, USA

    Re: dealing with dynamic link object in OR

    A few things I would like to mention first up:

    <ul type="square">[*]
    ObjBrowser("name").value="New Songs"
    ObjBrowser("title").value="New Songs"

    ObjPage("title").value="New Songs"

    This defines static browser and page objects. Hence if you navigate to another page, QTP can not find this object any more. So you what you might want to do is define a browser object based on its handle (hwnd)

    'get handle first up before you execute any step and after the browser has come into existence

    Set oBrowser("hwnd:="&amp;hwnd)
    Set oPage=oBrowser.Page("micclass:=Page")

    From now on, you can just use
    oPage.WebEdit("abc").Set "aaa", etc.

    or another method would be

    -&gt; after the step that creates the first browser instance, create your primary browser object, save its handle and create a page object.

    Set oBrowser=Browser("micclass:=Browser")
    Set oPage=oBrowser.Page("micclass:=Page").

    This will eliminate the steps to create a description object for page or browser.
    Once you navigate away from a page, all the references to its child objects are lost. So if you have a list of child objects, lets say links. If you click on one, navigate to a different page and then come back and try to click second link in you list of childobjects, you cant refer to it anymore.

    This from FAQ section should help
    17 Object Reference lost after Navigation
    17.A http://www.sqaforums.com/showflat.php?Number=214679



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:24 PM.

Copyright BetaSoft Inc.