SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Feb 2007
    Location
    India
    Posts
    155
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Using DOM in QTP8.2

    Hi,
    I am new to QTP and i want to use DOM into my Script.
    we use Object.Document.GetElementByTagName or ID or any other such thing.
    But i am not confident about it.
    Can you please tell me in details of how do we actually use it.
    We are working with a web application that contains Calender Page in which dates Change everyday.means there is a changing object properties.Using DOM we have made to handle the selection of Date issue.But i am not much confident about it.
    Anyone knowing or using it than please help me to know much details about it.
    Saurabh Verma
    Test Automation Engineer

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

    Re: Using DOM in QTP8.2

    I think DOM is correct decision to solve this problem.

    Ok get the system date using date option, also get the current visible date from the application, then compare and select.

  3. #3
    Member
    Join Date
    Feb 2007
    Location
    India
    Posts
    155
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using DOM in QTP8.2

    We are not using the system date here,but our code is totaly based on DOM.
    If you have some ideas related to DOM than please give us
    some light related to that.

    Thanks
    Saurabh Verma
    Test Automation Engineer

  4. #4
    Member
    Join Date
    Apr 2007
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using DOM in QTP8.2

    Can you explain your problem briefly then only we can guide you. Even I used DOM for the same issue.

  5. #5
    Member
    Join Date
    Feb 2007
    Location
    India
    Posts
    155
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using DOM in QTP8.2

    we go to the view source of a web page and then use Object.Document.getelement

    But i want to know what should we look for after going there
    means tag name id .etc...

    Set all_InputElements=Browser("").Page("").Frame("").W ebTable("").Object.document.getElementById("tblSch edule").getElementsByTagName("tr")

    This is the line of code that we have been using.
    But i am not clear about this line in the code.
    Object.document.getElementById("tblSchedule").getE lementsByTagName("tr")

    can u explain how do we work after going in View source of a web page.
    Saurabh Verma
    Test Automation Engineer

  6. #6
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

  7. #7
    Member
    Join Date
    Apr 2007
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using DOM in QTP8.2

    [ QUOTE ]
    we go to the view source of a web page and then use Object.Document.getelement

    But i want to know what should we look for after going there
    means tag name id .etc...

    Set all_InputElements=Browser("").Page("").Frame("").W ebTable("").Object.document.getElementById("tblSch edule").getElementsByTagName("tr")

    This is the line of code that we have been using.
    But i am not clear about this line in the code.
    Object.document.getElementById("tblSchedule").getE lementsByTagName("tr")

    can u explain how do we work after going in View source of a web page.

    [/ QUOTE ]

    Set all_InputElements=Browser("").Page("").Frame("").W ebTable("").Object.document.getElementById("tblSch edule").getElementsByTagName("tr")

    Instead of this use the following

    For each row in Browser("").Page("").Frame("").WebTable("").Object .rows
    ' x=row.rowIndex
    ' y=row.innerHtml
    For element=0 to row.getElementsByTagName("TD").length - 1
    Reporter.ReportEvent micDone,"row " & row.rowIndex , row.getElementsByTagName("TD").item(element).inner Text
    Next
    Next

    If you want the HTML code instead of innerText use innerHtml in Reporter.ReportEvent.

 

 

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 11.54%
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 11:40 AM.

Copyright BetaSoft Inc.