Iam trying to get list of everything that failed.ie catch error message if any one of the id is not found.Follwoing is a capybara automation script.
In the following code exception handling is working fine!
puts "Verifying Home Page"
def verifyHomepage(id, successMsg, errorMsg)
begin
page.find(id)
puts successMsg
rescue
puts errorMsg
end
end
verifyHomepage("#logoAnchor", "logo anchor found", "Logo anchor not Found")
verifyHomepage(".navbar-inner", "Header Bar found", "Header Bar not Found")
verifyHomepage(".unstyled", "All Occasions Frame found", "All Occasions Frame not Found")
verifyHomepage("##easyPrintPromoBox", "Easy Print Frame", "Easy Print Frame not Found")
verifyHomepage(".tabbable", "l3 Tabs Featured Occasions/Pairings/ArtistEasy Print Frame", "3 Tabs Featured Occasions/Pairings/ArtistEasy Print Frame Not found")
verifyHomepage("##givingCardPromoBox", "Create the perfect gift found", "Create the perfect gift not Found")
verifyHomepage(".footerr", "Footer Frame found", "Footer Frame found not Found")
Here iam repeatedly calling verifyHomePage method 7 times using different param values.
How is it possbile to pass the 3 params as array values instead of string values.what i meant is
eg:
verifyHomepage(idArray[],successMsg[],errorMsg[])
[sth]