In the following code i want to handle the exception.if msg[0] not found i have to catch that exception message msg[2] in rescue and if it is found put the success message msg[1]
puts "Verifying Home Page"
def verifyHomepage(*args)
begin
args.each do |msg|
page.find(msg[0])
puts msg[1]
rescue
puts msg[2]
end
end
end
verifyHomepage(['#logoAnchorr', 'logo anchor found', 'Logo anchor not Found'], ['.navbar-inner', 'Header Bar found', 'Header Bar not Found'])
In the above code iam getting
error sysntax error unexpected keyword rescue expecting keyword end
rescueis inside theargs.eachblock?