I have some code in which I need to attach a new window page and check if it exists. I need to do this several times. I want to create some class where I can define an algorithm and then just apply to the class with the exact value of title. I wrote the following code:
def check_title()
@a
$ie=Watir::IE.attach(:title, @a)
rescue Watir::Exception::NoMatchingWindowFoundException
puts ("could not find browser")
end
end
In the required place I paste the code to call the method
check=Title.new("Business Partner")
check.check_title()
I get this error message –
`initialize': wrong number of arguments(1 for 0) (ArgumentError)
Please tell me how I should describe this situation properly.
if you don’t know how to create a class in ruby, you should probably buy yourself a book about it, or read one of the gazillion online resources that help you learning ruby…