SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    RFT - Click a link in a table

    hi guys,

    i would like to seek help in RFT.

    the problem is that, how to search for a link(in a html.table) and then click it.

    any help will do.

    thank you.

    sample table:

    table_col1 table_col2 table_col3 table_col4
    link01 link02 link03 link03
    link94 link82 link54 link47

  2. #2
    Junior Member
    Join Date
    Aug 2008
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: RFT - Click a link in a table

    Hi,
    First capture the table alone.

    table().click(atcell(atRow(1),atColumn(4)))

    Or
    Testobject[] oLinkProp;
    oLinkProp=table().find(atdescendant(".class","give the class value here","give any other unique property","give the unique property's value"))
    //{get the role of the link, i.e., guitestobject or subitemtestobject, etc}
    //presuming it is guitestobject
    Guitesobject oLink = new guitesobject(oLinkProp[0]);
    oLink.click;
    oLink.unregister
    oLinkprop=null;
    unregister(oLinkProp)

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: RFT - Click a link in a table

    hi.

    thanks for the help.

    i found this one... i just wanted to share this

    ((GuiTestObject)table_A().find(atDescendant(".clas s", "Html.A", ".text", var1))[0]).click();

    table_A is the name of the table and var1 is the variable to store the name of the link -- works for me! ^_^

    again, thank you for your help! ;-)

  4. #4
    Junior Member
    Join Date
    Nov 2010
    Location
    Iowa
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: RFT - Click a link in a table

    Hi. I am new to this site, and was looking for some assistance.

    I am using RFT, and in my app, there are tables within a table. My code breaks this apart, and was functional at one time. However, now I am getting an error that there are 41 occurrences of the instance. 41 because there is main table, and 40 rows, or tables, within the main table. My code is written as follows:

    TestObject[] foundTOs = table_htmlTable_0().find(atDescendant(".class", "Html.TABLE"));
    int noOfRows = T.getNoOfTableRows(table_htmlTable_0());

    I recently switched from RFT 7.0.2 to 8.1.1.1, which caused an error on the TestObject, but then moved to 8.2, and now I have this occurrence error.

    Any thoughts, suggestions, or someone else finding this problem?

    Thanks!!

  5. #5
    Senior Member
    Join Date
    Apr 2005
    Location
    Galway, Ireland
    Posts
    106
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: RFT - Click a link in a table

    Can you clarify what you problem is?

    {code}TestObject[] foundTOs = table_htmlTable_0().find(atDescendant(".class", "Html.TABLE"));{code}
    Nothing wrong with that - It will return an array with 40 elements, not an error.

    {code}int noOfRows = T.getNoOfTableRows(table_htmlTable_0());{code}
    What is T? how does that relate to your array foundTOs?

  6. #6
    Member
    Join Date
    Jun 2008
    Posts
    120
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    RFT - Click a link in a table

    Hi,

    i have 2 links in a row i need to click 2 link can any one help who to do this
    Thanks
    JC

  7. #7
    Apprentice
    Join Date
    May 2009
    Posts
    42
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: RFT - Click a link in a table

    [ QUOTE ]
    Hi,

    i have 2 links in a row i need to click 2 link can any one help who to do this

    [/ QUOTE ]

    can't you not able to use .find?
    eg:

    <font class="small">Code:</font><hr /><pre>
    GuiTestObject gtoTextLink = null;
    TestObject []links = Table_name().find(atDescendant(".class", "Html.A"));
    for (int i=0; i&lt;links.length; i++){
    if (links[i].getProperty(".title").toString().equalsIgnoreCase ("Whatever")){
    gtoTextLink = (GuiTestObject)toTemp[i];
    break;
    }
    }
    gtoTextLink.click();
    </pre><hr />

    instead of ".title", you can use name, value, or id.

  8. #8
    Junior Member
    Join Date
    Jan 2012
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: RFT - Click a link in a table

    Hey guys,

    I am new to RFT too, and I am trying to do this random link clicker, like on a search result using any property, anyone have an idea how to do this?

  9. #9
    SQA Knight
    Join Date
    May 2006
    Location
    Playa Del Rey, California, United States
    Posts
    2,594
    Post Thanks / Like
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: RFT - Click a link in a table

    You'll want to read the documentation about using the .find() method. It'll form the basis of any "..search for elements matching xxxx properties request..."

    http://www.ibm.com/developerworks/ra...wacki_nodwell/

    You can use find() with regular expression objects. Make sure you use the IBM one though. Java.Util has one with the same exact name, but you need to use the one provided by IBM RFT. Using find with atlist() (attribute list), and regular expressions will get your an array of all matching elements. From there it's selecting one of them, then making sure you deallocate the objects when you're done.
    David Lai
    SDET / Consultant
    LinkedIn profile

 

 

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 7.89%
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 09:53 AM.

Copyright BetaSoft Inc.