Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8508863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:16:43+00:00 2026-06-11T03:16:43+00:00

Consider the following html http://www.carbide-red.com/prog/test_table.html I have worked out that I can move left

  • 0

Consider the following html
http://www.carbide-red.com/prog/test_table.html

I have worked out that I can move left to right on the columns using

browser.td(:text => "Equipment").parent.td(:index => "2").flash

to flash the 3rd column over on the line containing “Equipement”

But how can I move down a certain number of rows? I am having terrible luck using .tr & .rows, no matter how I try it just crashes out when using those. Even something as simple as

browser.tr(:text => "Equipment").flash

Am I just misunderstanding how tr/row works?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:16:45+00:00Added an answer on June 11, 2026 at 3:16 am

    Specific Row/Column

    It sounds like you have already calculated which row/column you want. You can get the cell at a specific row/column index by simply doing:

    browser.table[row_index][column_index]
    

    Where row_index and column_index are integers for the row and column you want (note that it is zero-based index).

    Specific Row

    You can also do the following to select rows based on an index:

    browser.table.tr(:index, 1).flash 
    browser.table.row(:index, 2).flash
    

    Note that .tr includes nested tables while .row ignores nested tables.

    Update – Find Rows After Specific Row

    To find a row after a specific row containing a certain text, determine the index of the specific row first. Then you can locate the other rows in relation to it. Here are some examples:

    #Get the 3rd row down from the row containing the text 'Equipment'
    starting_row_index = browser.table.rows.to_a.index{ |row| row.text =~ /Equipment/ }
    offset = 3
    row = browser.table.row(:index, starting_row_index + offset)
    puts row.text
    # => CAT03 ...
    
    #Get the 3rd row down from the row containing a cell with yellow background colour
    starting_row_index = browser.table.rows.to_a.index{ |row| row.td(:css => "td[bgcolor=yellow]").present? }
    offset = 3
    row = browser.table.row(:index, starting_row_index + offset)
    puts row.text
    # => ETS36401 ...
    
    #Output the first column text of each row after the row containing a cell with yellow background colour
    starting_row_index = browser.table.rows.to_a.index{ |row| row.td(:css => "td[bgcolor=yellow]").present? }
    (starting_row_index + 1).upto(browser.table.rows.length - 1){ |x| puts browser.table[x][0].text }
    # => CAT03, CAT08, ..., INTEGRA10, INTEGRA11
    

    Let me know if that helps or if you have a specific example you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

please see: http://jsfiddle.net/4Z4fQ/19/ consider the following html: <a id=myElement href=http://www.google.com/> <img id=image src=http://www.google.com/intl/en_com/images/srpr/logo3w.png alt=google/>
Consider the following scenario: http://www.restserver.com/example.php returns some content that I want to work with
consider following url: http://sitename.com/School/Admin/PageViewer i have a subfolder in School named UserFiles that contains
Consider the following: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> <html xmlns=http://www.w3.org/1999/xhtml xml:lang=en
Consider the following example: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> <html xmlns=http://www.w3.org/1999/xhtml
Consider the following code: index.html <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd> <html> <head>
Consider the following html snippet <!DOCTYPE html> <html> <head> <script type=text/javascript src=http://code.jquery.com/jquery-1.4.2.js ></script> <script
Consider the following scenario: http://www.yourdomain.com/Default.aspx?p=2 Now we ofcourse want to check if the querystring
Consider the following example code: http://code.google.com/apis/maps/documentation/javascript/examples/streetview-simple.html I can do scrollwheel: false on a mapOptions
Consider the following code: <html> <head></head> <body> <div id='test' class='blah'> <a href='http://somesite.com/' id='someLink'>click!</a> </div>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.