0
我试图根据该表头中保存的:text
值来查找某个表头的索引。我收集了所有使用.ths
的表头,但是我不确定什么是在这个数组上执行搜索的最佳方法,以找到内部具有正确值的表头。我尝试使用array.index函数,但似乎没有工作。我试图避免在整个数组中循环查找索引(如果可能)。 这是我的代码片断。watir-webdriver查找数组中的值的索引
location = @browser.table(:id, "sprintCalTable").tr.ths
index = location.index(data)
谢谢。
我迷路了。你想做什么?另外,请发布相关的HTML。 – 2012-07-11 13:18:54