我有一些代码需要附加一个新的窗口页面并检查它是否存在。我需要多次这样做。我想创建一些可以定义算法的类,然后将其应用于具有确切标题值的类。我写了以下代码:
def check_title()
@a
$ie=Watir::IE.attach(:title, @a)
rescue Watir::Exception::NoMatchingWindowFoundException
puts ("could not find browser")
end
end
在需要的地方我粘贴代码来调用方法
check=Title.new("Business Partner")
check.check_title()
我收到此错误消息 -
`initialize': wrong number of arguments(1 for 0) (ArgumentError)
请告诉我应该如何正确描述这种情况。