Codeformer
Codeformer

Reputation: 2300

Get table row count in watir

How to get the table row count in Watir.

I tried row_count function like this but it gives an error.

table = $browser.table(:id,"student_list")
table.row_count()

This gives the following error.

NoMethodError: undefined method `row_count' for < #Watir::Table:0x000000034ee2f8

Upvotes: 1

Views: 928

Answers (1)

RAJ
RAJ

Reputation: 898

Use this line

puts $browser.table(:id,"student_list").rows.count

Or

puts $browser.table(:id,"student_list").rows.length

Upvotes: 4

Related Questions