mardi 20 février 2018

rescue / exeception marked as red in editor? Were Am I going wrong

I have just started test automation project in ruby, however, am only used to java so trying to get the hang of ruby and I cant see where my syntax is going wrong.

rescue Watir::Exception::TimeOutException => e

is underlined in red, why? Unexpected keyword rescue?

   def check(UpTimer)
        limit = 0
      begin
     @browser.alert.wait_until_present(UpTimer)
     if code
      code
      rescue Watir::Exception::TimeOutException => e
       limit += 1
       retry if limit <= 3
       #Add in Message for HTML Report?
     end
  end
end

Aucun commentaire:

Enregistrer un commentaire