SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    why Table behaving differently in Descriptive prog

    Hi
    I working in web application for that one webtable I given below code (DP Style)
    Msgbox Browser(“b”).page(“p”).webtable(“html tag:=Table”,”name:=xyz”).getcelldata(1,1)
    for this code it is showing all the columns of data of Fist row but if I add this webtable in to OR
    Msgbox Browser(“b”).page(“p”).webtable(“xyz”).getcelldata (1,1)
    It’s showing 1st Row 1st Column data only
    Why it’s behaving differently if Table object is not in the OR

    Thanks
    bond

  2. #2
    Advanced Member
    Join Date
    May 2007
    Posts
    609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: why Table behaving differently in Descriptive prog

    My guess would be that you've got two tables named "xyz" and that the first one is the first column of data. When you reference the table using DP, it picks the first one. Perhaps the second one contains all of your data and it is the one getting saved in the OR.

    I would try this, to see if my theory is correct. If it returns more than 1, you need to use an an ordinal identifier on the description.

    <font class="small">Code:</font><hr /><pre>
    Set objectDesc = Description.Create()
    objectDesc("micclass").Value = "WebElement"
    objectDesc("html tag").value = "Table"
    objectDesc("name").value = "xyz"

    Set Elements = Browser("b").page("p").ChildObjects(objectDesc)

    Msgbox Elements.Count

    </pre><hr />


    EDIT: I just realized that if you had multiple matching items, it would return a run-time error. Sorry, my brain isn't working very well today.
    Dennis Belew

  3. #3
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: why Table behaving differently in Descriptive prog

    I am sure Dennis is right. There should be 2 tables. Here's an explanation.

    The First table that you are referring, by way of Descriptive programming, should be the Parent Table of the second table that you are referring using OR.

    Open the OR &amp; check the Description Properties. If you have the Default settings, then you are using Html Tag &amp; micclass as the mandatory property, for identification. With this description there are more than 1 similar object &amp; so, QTP uses the Ordinal Identifier, index, based on, which object you selected from the Object hierarchy, when you created the OR.
    Rajkumar

  4. #4
    Member
    Join Date
    Jun 2012
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: why Table behaving differently in Descriptive prog

    I face this issue all the time ..

    If You observe the QTP OR has the index which it is using for identifying the Table..and the same value/ same reference index is not used by you in your DP

    The remedy has already been shared [img]/images/graemlins/smile.gif[/img]

    Regards,
    Ankur

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:52 AM.

Copyright BetaSoft Inc.