SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Nov 2007
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Takes long to browser all cells of a WebTable

    I am using the following code:

    Set oBase = Browser("").Page("").WebTable("")
    rowCount = oBase.GetROProperty("rows")
    colCount = oBase.GetROProperty("cols")
    For rCount = 1 to rowCount
    For cCount = 1 to colCount
    RowColVal = oBase.GetCellData(rCount,cCount)
    If RowColVal = ExpectedVal Then
    Set targetCell = Browser("").Page("").WebTable("").ChildItem(rCount ,cCount,"Link",0)
    targetCell.Click
    Next
    Next

    The only problem is that if the link appears at the bottom of the table, it takes ages to get to that row and perform click action. What to do? [img]/images/graemlins/frown.gif[/img] To be very exact, it takes nearly 10 minutes to go through all cells and find the one that I want.

  2. #2
    Apprentice
    Join Date
    Sep 2007
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Takes long to browser all cells of a WebTable

    Hi,

    Can you please try to execute by changing the
    'Object Synchronization Timeout' value from 20 seconds (default) to 1 or 2 second.

    Path: 'File -> settings -> Run (Tab) -> Object Synchronization Timeout'

    Pls ignore if you've tried already.

    Regards,
    Jeeva

  3. #3
    Senior Member
    Join Date
    Mar 2006
    Location
    Bristol, UK
    Posts
    1,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Takes long to browser all cells of a WebTable

    Is QTP in normal or fast run mode?

    To find out; Options -> Tools -> Run tab

    If it's in normal then the arrow will have to physically loop around the For Loops.

    Fst mode should be much faster

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

    Re: Takes long to browser all cells of a WebTable


  5. #5
    Member
    Join Date
    Apr 2008
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Takes long to browser all cells of a WebTable

    Hi, Try with below code, if it take lessthan 10min, i hope you can use it.

    Set oBase = Browser("").Page("").WebTable("")
    Set oDesc = Description.Create()
    oDesc("micclass").Value = "Link"
    Set Lnks = oBase.ChildObjects(oDesc)
    NumberOfLnks = Lnks.Count()
    For i = 0 To NumberOfLnks - 1

    If Trim(ExpectedVal) = Trim(ExLnks(i).GetROProperty("innertext")) Then
    Lnks.Click
    Exit For
    End If
    Next

    Think Ahead,
    Vinodh.R

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

    Re: Takes long to browser all cells of a WebTable

    RobbieWinston, it is already on fast mode. It takes 10 minutes in Fast mode. I don't even want to try it in Normal. [img]/images/graemlins/frown.gif[/img]

    Tarun, I tried that but I don't understand how the array works if I have to click on the link. [img]/images/graemlins/frown.gif[/img]

    Vinodh, I tried this and it made the duration 8 minutes!! 2 minutes less, but still slow. [img]/images/graemlins/frown.gif[/img]

  7. #7
    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: Takes long to browser all cells of a WebTable

    How about this?
    <font class="small">Code:</font><hr /><pre>
    Set oBase = Browser("").Page("").WebTable("")
    rc = oBase.GetRowWithCellText (ExpectedVal)
    cc = oBase.ColumnCount(rc)
    For cCount = 1 to cc
    RowColVal = oBase.GetCellData(rc,cCount)
    If RowColVal = ExpectedVal Then
    Set targetCell = Browser("").Page("").WebTable("").ChildItem(rc,cCo unt,"Link",0)
    targetCell.Click
    Browser("").Page("").Sync
    End If
    Next </pre><hr />

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

    Re: Takes long to browser all cells of a WebTable

    qtp_noobsauce, It works the same way. The only thing is that you do a search in table using DOM but once you get the expected row you turn back to ChildItem to get the Link object

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

    Re: Takes long to browser all cells of a WebTable

    TReddy, it works perfectly and now it takes 2 seconds!! Thanks!! [img]/images/graemlins/smile.gif[/img]

    Tarun, I tried your function at first but I did not understand how to use it. One of the Automation guys on our team helped me with it and it works like a charm. Now I have 2 alternate ways to do 1 activity!! [img]/images/graemlins/smile.gif[/img]

    Thanks

 

 

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 9.38%
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 06:40 AM.

Copyright BetaSoft Inc.