Search code examples
sikulisikuli-scriptsikuli-ide

Sikuli scripts without images - Static applications


Sometimes we don't need to capture and use images for automating Desktop based application. We can simply use tab and Enter keys to achieve our task. But in some cases we need images, for example radio button, option selection, check box, etc.

Is there any way to automate these type of options without image or screen shot?


Solution

  • You could simply go through an order of keystrokes without needing to match any sort of pattern. Unfortunately I only make use of the Java API which may be a tad different but the idea is the same for Python (via Jython).

    Screen screen = new Screen();
    screen.type(Key.TAB + Key.ENTER);
    

    If you are able to get to your radio button through a series of keystrokes, you could put them in sequential order. However using Sikuli entirely without images and patterns kind of defeats its purpose and you're better off using other alternatives such as AutoIt or if you wish to maintain it in a Python environment you could use PyAutoIt. Both are very good but the latter lacks documentation (have to read the source to understand what is going on).