This article will demonstrate how to add/use variable images in Scenariobuilder. Using variable images for "Find Image" action in a scenario is useful for varying image search based on rUser or iteration. It can be used to allow rUsers to search for and interact with unique images and icons, enabling more robust testing of an application.
Using Capture Screen Tool to Capture Alternate Images
To begin adding variable images to the scenario, alternate images must be captured using ScenarioBuilder CaptureScreen tool.
Launch CaptureScreen tool by clicking on icon on the desktop;
On the app tray right click on the CaptureScreen tool icon
Change the naming scheme, for this example "Notepad" will be used
Change the folder to point to the following folder:
Click on "Hotkey"
Set up a hotkey. For example press ‘CTRL’ and ‘Z’ on your keyboard
After you are done, press the hotkey combination that you set up, this will allow you to capture an image
After capturing an image, the preview and name of the image should appear
Press the hotkey combination to capture another image
Continue this process until all the desired images are captured. Then click on "Close".
Creating the CSV for the image variable
The CSV file attached to the scenario will need to be edited to include the names of the variable images that will be accessed during the scenario playback.
Open Microsoft excel and create a column with the variable header, then fill the rows with the naming scheme of your images.
When finished, save the file as a .csv file. Be sure to save this file in the following folder:
Calling the CSV file in Scenariobuilder
Launch Scenariobuilder and open the scenario to which you want to add the variable images.
Go to the scenario's properties window and add the variable file that you created.
Setting up Find Image Action to include Variable Images
The "Find Image" action properties will need to be edited to use variable images. The same image variable added to the CSV file will be called from the "Find Image" action.
Right click on the "Find Image" action that will cycle through the variable images and select "Choose a variable"
Input the name of the variable enclosed by
Click on the "View" tab at the Scenariobuilder toolbar
Then click on "Scenario Resources"
Click on the "Images" tab and click on "Add var images" button
Select the variable images that were captured using the image capture tool. Then click "Add"
Close the "Scenario Resources" window and play the scenario. The variable images should now be used during playback.