我有一个检查页面标题是否存在的类。我需要执行几次。在每种情况下,我都在不同级别的 ie 中操作 - ie1、ie2。在我的代码中,我检查了 $ie,如何将其概括为 $ie1 等等?
class Text_neg
def initialize(text, object)
@text=text
@object=object
if $ie.contains_text(@text)
puts("Test for " + @object + " failed")
puts ($ie.link(:text => /Exception:/))
h= $ie.link(:text => /Exception:/)
$r.addtoReport($testReport, "check " + @object, "FAILED", h.text)
else
puts("Test for " + @object + " passed")
$r.addtoReport($testReport, "check " + @object, "PASSED", "Test for " + @object + " passed" )
end
end
end