在 watir 中获取 table 行数
Get table row count in watir
如何在 Watir 中获取 table 行数。
我试过 row_count 这样的函数,但它给出了一个错误。
table = $browser.table(:id,"student_list")
table.row_count()
这会产生以下错误。
NoMethodError: undefined method `row_count' for < #Watir::Table:0x000000034ee2f8
使用这条线
puts $browser.table(:id,"student_list").rows.count
或者
puts $browser.table(:id,"student_list").rows.length
如何在 Watir 中获取 table 行数。
我试过 row_count 这样的函数,但它给出了一个错误。
table = $browser.table(:id,"student_list")
table.row_count()
这会产生以下错误。
NoMethodError: undefined method `row_count' for < #Watir::Table:0x000000034ee2f8
使用这条线
puts $browser.table(:id,"student_list").rows.count
或者
puts $browser.table(:id,"student_list").rows.length