You don’t know which images will display and you need an easy way to create and maintain the Scenario.
Start with a “Find Image” action that looks for an image that loads in all three cases, something like a company logo. This ensures that the proper page has loaded. Give this Image action an adequate Timeout:
Add a “Find Image” action and capture the first image that could possibly result in your application. Check the “Continue On Failure” box in the Image Properties pane and change the timeout to 0 seconds:
Next, add the actions that should occur in the event of this image being found. In this example, Notepad is opened and a message is typed. Make all of these actions children of the Image action by indenting them. Child actions will only execute if their parent action is successful:
Now, add a “Label” action called “ProcessCard” and place it after the image and child actions. Then add a “Skip To” action as the last child of the “Find Image” action, which tells the Scenario to skip ahead to the “ProcessCard” label:
Add “Find Image” and subsequent child actions for the next two images which could possibly occur in your application. Your Scenario should look something like this:
In summary, this Scenario has three unique courses of action depending on whether the Gold, Platinum or Diamond image appears. It starts by looking for the Gold image. If the image is found, its child actions execute, culminating with the “Skip To” action that jumps past the two other image actions. If the image is not found the child actions are skipped (parent action was unsuccessful) and the Scenario looks for the Platinum image. The same sequence of events takes place for the Platinum image. If the image is not found, the sequence takes place again, this time looking for the Diamond image. After any one of the three images is found, the Scenario skips to the “ProcessCard” section and continues from there.