2

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?

Eugene S
  • 6,709
  • 8
  • 57
  • 91
mahinlma
  • 1,208
  • 3
  • 11
  • 24

2 Answers2

2

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).

Juxhin
  • 5,068
  • 8
  • 29
  • 55
0

It is not very clear what are you asking? Do you want to know whether you can use Sikuli just for keyboard manipulation without taking and using screenshots? If that's the case, the answer is yes. You can always run standalone commands like these:

type(Key.ENTER) #for Enter key
type("\t")      #for tab
Eugene S
  • 6,709
  • 8
  • 57
  • 91
  • I already mentioned those keys..I want to know how to select radio button and checkbox without screen shot – mahinlma Jul 29 '15 at 03:04
  • Well, the answer is simple. If you are able to get to these elements with your keyboard then yes. – Eugene S Jul 29 '15 at 03:07
  • Building on @EugeneS 's answer: As an example, you could type("f", KeyModifier.CTRL) to 'find', then have Sikuli type the text that is nearest to the radio button you want to select with type("textToFind"). Then type(Key.ESC) to exit the 'find' box. Then perhaps you can type(Key.TAB) or type(Key.Tab, KeyModifier.SHIFT) to get on the radio button. Finally, type(" ") (spacebar) to select your radio dial. – autoKarma Jul 29 '15 at 20:47