Dashboard > Selenium > ... > Contributed User-Extensions > storeTableContent
Selenium Log In View a printable version of the current page.
storeTableContent
Added by Sumith Gamage, last edited by Sumith Gamage on Jan 19, 2007  (view change) show comment
Labels: 
(None)

description

Allows to search the content within a table. This is a very useful functionality for scenario like:

Assume a table of users with an 'Edit' link in front of each name. We want to search through the name list and want to click the corresponding 'Edit' link in front of the name.

storeGlobalTable* also can be enabled if you install global extension.

example of use

example of use:

storeTableContent user/0/1/userId=(\w+)/1 varUserId
storeTableRow user/0/3 varRowNo

notes

Selenium accepts only two parameters first as input and second as output variable. But in this function we need to pass 5 parameters to the function. Simple work-arround I did is simply to separate parameters by forward-slash ("/"). This works fine for many general senarios (Thanks to the power of regular expressions). But there will issues need to pay speciall attention if you use complex 'searchText' and complex 'contentPattern's.

  • storeTableContent
    • Five parameters: searchText/searchCol/contentCol/contentPat/contentPos
      • searchText: Text you are looking in the Table
      • searchcol: Searching column number (start count from 0)
      • contentCol: Column number of the content
      • contentPat: Pattern used to grab only the required portion of the column content. (.* - catch all the content)
      • contentPos: The matching group to return (0 - for complete match)
  • storeTableRow
    • Three parameters: searchText/searchCol/minCol
      • searchText: Text you are looking in the Table
      • searchcol: Searching column number (start count from 0)
      • minCol: (Optional) Tables having columns less than minCol with ignore
  • Tested with
    • Selenium core: 0.8.0, 0.8.1 and 0.8.2.
    • Selenium IDE: 0.8.6.
    • FireFox: 1.5.0.8, 2.0

download

storeTableContent_1_2

Hi

I tried to store the rownum of a table using storeTableRow command ,but its not working
Could you explain more on that parameter which we pass in the commnad
I wrote
storeTableRow |test/3| r

ie i am searching in 3rd column of the table for the text "test"
With the execution of this command the corresponding rowNum should be saved in r

but value 0 is stored in "r" value.(actually it is in third row)

Thanks inadvance
Srini

Site running on a free Atlassian Confluence Community License granted to OpenQA. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators