我正在用 Watir 编写一个示例测试,在该测试中我使用 IE 类浏览网站,发出查询等。效果很好。
我想继续在我登陆的最后一页上使用PageContainer的方法。例如,在该页面上使用其 HTML 方法。
现在我是 Ruby 的新手,刚开始为 Watir 学习它。
我尝试在 OpenQA 上问这个问题,但由于某种原因,Watir 部分仅限于普通成员。
谢谢你看我的问题。
编辑:这是一个简单的例子
require "rubygems"
require "watir"
test_site = "http://wiki.openqa.org/"
browser = Watir::IE.new
browser.goto(test_site)
# now if I want to get the HTML source of this page, I can't use the IE class
# because it doesn't have a method which supports that
# the PageContainer class, does have a method that supports that
# I'll continue what I want to do in pseudo code
Store HTML source in text file
# I know how to write to a file, so that's not a problem;
# retrieving the HTML is the problem.
# more specifically, using another Watir class is the problem.
Close browser
# end