SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Sep 2001
    Location
    usa
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Facing problem with html link in Html Table.

    Here i have a question from SilkTest,

    On the browser page there is one Html table and in one of the column of
    the table, there are html links.
    I want to select any html link randomly. The html links can be one or
    can be more than 10 or can be more than 20 whatever.

    So the problem i am facing here is when i try to click the link which
    is from index no. 1 to 5, then it get clicked but if the index no. is
    more than 5 then the Agent scrolls down to find that link but some how
    it doesn't get that html link whoes index number is more than 5.

    So even i tried by recording the testcase in which i clicked the html
    link whoes index number is 12 and executed the script again, but it
    failed and showed error message, 'Cannot find #htmllink(12)'

    That means the agent can not find the html link which need the page to
    scroll down.

    So please let me know if you have the answer, Any kind of assistance is
    appreciated.

    Thanks
    Manjusha Joshi
    QA Engineer
    GlobalSight Corp.
    phone : 408-350-3612
    email : mjoshi@globalsight.com

  2. #2
    AJ
    AJ is offline
    Moderator AJ's Avatar
    Join Date
    Jun 1999
    Location
    San Jose, CA
    Posts
    1,691
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Facing problem with html link in Html Table.

    Try the following:

    use the ScrollIntoView () method before you click it.
    or use SetActive (), try different methods to workaround that problem.

    (You can even write your own little function to pass it the number of the link and while it's not IsViewable () scroll page down)

    PS try to register next time, this way you can use more features of this forum.


    ------------------
    AJ Alhait
    BetaSoft Inc.
    AJ Alhait
    BetaSoft Inc.

  3. #3
    Junior Member
    Join Date
    Jul 2000
    Location
    Rosemont, IL USA
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Facing problem with html link in Html Table.

    Here's the method you're looking for

    method: RandomPick Method
    decription: Clicks on any Random HtmlLink from an HTmlTable
    parameters: none
    returns: none

    winclass HtmlTable : HtmlTable//
    void RandomPick()
    int i, iNumRows
    iNumRows this.GetRowCount()
    LIST OF AnyType laLnkList = {...}
    LIST OF AnyType laRowContents
    AnyType aItem

    for (i = 1; i <= iNumRows; i++)
    do
    laRowContents = this.GetRowChildren(i)
    except
    break

    for each aItem in laRowContents
    if (ClassOf(aItem) == HtmlLink)
    ListAppend (laLnkList, aItem)

    AnyType aAnyLnk = RandPick(laLnkList)
    aAnyLnk.Click()
    return

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 09:20 PM.

Copyright BetaSoft Inc.