Sikuli: Taking Screenshots
Taking Images/Screenshots using Sikuli
Sikuli works by using image recognition modules for screen automation. Writing scripts requires screenshots to be taken and placed into the script. Images are most commonly used with the click() command. When the image is placed inside the parenthesis, Sikuli will go ahead and click if it finds the image on the screen. Sikuli has multiple methods of inserting images in the script. Sikuli has two buttons built into the IDE. The Take screenshot button uses the default Sikuli screen capturing tool to take a screenshot and automatically places this image into the script. The second button Insert image allows you to select an image that you have saved in your local computer. This is really beneficial if you have a preference in using one screenshot tool over the other.
With the take screenshot button, convenience is a key feature. The hotkey to take a screenshot is CTRL+SHIFT+2. Using this hotkey is useful when needing to take a screenshot when the screen is frozen on a certain view or menu.
Once the images are placed in the script, you can move the image around by highlighting past the image and (CTRL+C) to copy, then (CTRL+V) to paste the image at a different point in the script. This allows you to easily use the same image without having to take multiple screenshots of the same thing.
Responses