1

我正在尝试对 Watir 使用 .getContents 方法,但它说该方法不存在。所以我尝试更新 Watir,但我已经有了最新版本。这是我试图使用的代码行

Provence = e.frame(:name => "content").frame(:name => "main").text_field(:name => "txtLocDesc").getContents

然后获取和方法丢失错误。

4

2 回答 2

1

使用 #value 方法代替获取输入字段的值属性:

e.frame(:name => "content").frame(:name => "main").text_field(:name => "txtLocDesc").value
于 2012-06-07T13:45:27.743 回答
0

为什么你认为getContents会返回文本字段值?我在watir-classicwatir-webdriver gem API 中看不到该方法。

于 2012-06-06T22:56:26.743 回答