I'm trying to write some ruby to perform the following:
I'm testing a web page which has a form, a search button, and a search results underneath.
When I enter an invoice number into the form e.g. 123456 and I click the "Search" button, if the Invoice has been successfully saved , then it will show up under the "Search Results" section, and if not, then it will say "No results found". Sometimes it takes a few seconds for the database to finish processing an invoice so I would like to make a loop that keeps pressing the search button every few seconds until the invoice is found, and once the condition is met, then do something else.