I currently am using Marathon (Java Automation tool for testing) that runs a Ruby script on a Java application and need to detect if a specific alert appears. For example, I want it to press "Accept" on a row in a while loop and handle potential pop-up alerts during the process.
Only 2 pop-ups can appear during this process of accepting.
If a popup with the window title "Are you sure?" appears, I want it to press enter or click "OK" as usual.
But, if a popup with the window title "Message" (which indicates error), I want it to press "OK" and exit the while loop. Exiting the while loop should be trivial to code after I figure out a way to differentiate the two pop-ups.