SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Jul 2006
    Location
    Fairfax, VA
    Posts
    145
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    not able to retrieve outertext of the page

    Hi All,

    I am trying to retrieve outerhtml of the page.

    This code is giving me just part of the outerhtml
    <font class="small">Code:</font><hr /><pre>
    Browser.page.Link("name:="&amp;strCNumber, "index:="&amp;finalLinkIndex).click
    strOuterText = oPage.object.documentElement.outerText
    </pre><hr />

    But When I use wait statment of 2 seconds i am getting full outer text of the page. I think Synchornization is the problem here.

    <font class="small">Code:</font><hr /><pre>
    Browser.page.Link("name:="&amp;strCNumber, "index:="&amp;finalLinkIndex).click
    Wait(2)
    strOuterText = oPage.object.documentElement.outerText
    </pre><hr />

    I tried to use one function which i got from this forum but
    in that case i am getting a part of the outer text

    <font class="small">Code:</font><hr /><pre>
    objBrowser("name:=XYZ")
    Browser.page.Link("name:="&amp;strCNumber, "index:="&amp;finalLinkIndex).click
    BrowserSync(objBrowser)
    strOuterText = oPage.object.documentElement.outerText

    'here is the function

    Function BrowserSync(ByVal obj)

    On Error Resume Next

    On Error Goto 0
    intTimeOut = GetSyncTimeout * 1000
    startTime = Now
    blnBrowserBusy = obj.object.busy 'Loop until object.bust = False or timeout is reached
    Do
    If blnBrowserBusy = False Then
    'Browser is no longer busy, exit function
    Exit Do
    End If
    'Wait defined number of milliseconds
    Call wait (0, 50)
    'Subtract the wait from the timeout
    intTimeOut = intTimeOut - 50
    'Get the object.busy property
    blnBrowserBusy = obj.object.busy
    Loop until intTimeOut &lt;= 0
    EndTime = Now
    print "Browser sync took : " &amp; second(startTime - EndTime) &amp; " seconds" ' Print to log not required in future
    End Function


    </pre><hr />


    Any Idea how can i do this without using wait statement?

    Thanks,
    SIK

  2. #2
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: not able to retrieve outertext of the page

    Can you try with QTP sync method?

    Ex:
    objBrowser("name:=XYZ")
    Browser.page.Link("name:="&amp;strCNumber, "index:="&amp;finalLinkIndex).click
    Browser("...").Sync
    strOuterText = oPage.object.documentElement.outerText

  3. #3
    Senior Member
    Join Date
    Jul 2006
    Location
    Fairfax, VA
    Posts
    145
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: not able to retrieve outertext of the page

    TReddy,

    I tried your code it works. I tried this one
    <font class="small">Code:</font><hr /><pre>
    oPage.Link("name:="&amp;strCNumber, "index:="&amp;finalLinkIndex).click Browser("name:=Browsername").sync
    strOuterText = oPage.object.documentElement.outerText
    </pre><hr />

    Thanks alot TReddy and Everyone
    SIK

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

    Re: not able to retrieve outertext of the page

    I got the same issue.I don't get the complete text of page even if I use Browser().sync method

    I tried wait(4) statement also.Nothing seems working. I get only half of the page with outertext method.

    please suggest.

  5. #5
    Member
    Join Date
    Nov 2007
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: not able to retrieve outertext of the page

    TReddy,

    do you have any other workarounds?anyone else has any idea?

  6. #6
    Senior Member
    Join Date
    Jan 2000
    Location
    USA, CA
    Posts
    1,998
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: not able to retrieve outertext of the page

    Show how you identify: oPage

    Janna

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

    Re: not able to retrieve outertext of the page

    var=Browser("Browsername").Page("Pagename").object .documentElement.outerText
    msgbox var

  8. #8
    Member
    Join Date
    Nov 2007
    Posts
    70
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: not able to retrieve outertext of the page

    jbotash,
    Did you get a chance to look into this?

 

 

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 04:21 PM.

Copyright BetaSoft Inc.