I want to perform multiple actions within a single captured image.

Asked by Mohamed Waseem

Hi,

I am new to Sikuli. I liked this tool very much. I have gone through the documentation as you suggest everyone to. But I don't see examples here except the methods of how to do. I have been asked by my Team lead to search for the script which can perform multiple actions within a single image captured. For example Selecting date from a single image of Calender container(Instead of capturing screenshots for each date) or like Windows Application(Calculator) in which we can perform multiple actions like clicking on add button, minus button and so on. I kindly request you to add one example over here on this method. I would be so grateful to you. For your information this site ( http://www.yatra.com/ ) has a date selector.Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
RaiMan Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

If you do not want to capture, you have to use the geometry of a GUI and calculate other regions and click points based on reference images, that can be found on the screen.

download and unzip: http://dl.dropbox.com/u/42895525/calendar.sikuli.zip

this is a quick and dirty showcase based on the calendar on ( http://www.yatra.com/ ).

This is made on Mac with Safari. You might have to adopt it to Windows and other browsers.

If you wonder about using:
if 1 > days: break

There seams to be a bug in the script save action when using
if days < 1: break
the < seems to produce an exception during the production of the contained script's HTML version.

Revision history for this message
Mohamed Waseem (wasurk) said :
#2

Thank you so much for your reply sir. This is what i need. But the date container which you have used is not what I am asking you for. What I want is, On Yatra site if you click on Date selector field(In "Book Your Domestic Flight" container) you need to select particular date(Eg: 20/03/2012) for booking flight.
What I want to do is first I want to capture full Image of Date selector from which I want to select any date i want without capturing images for each date from 1 to 31. And what you've provided here is somewhat difficult to understand. Can you please write a simple script or else write a comment for each line??. We are actually doing it on java then integrating to testlink. So we need simple script for this. I hope you understand. Plz kindly do the needful. Thank You.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

--- We are actually doing it on java
To transpose my examples to Java is your job. It would cost me nearly double the time. Should not be such complicated for a programmer.

--- And what you've provided here is somewhat difficult to understand. Can you please write a simple script or else write a comment for each line??
I have adopted my first example to the drop down calendar and added some comments. Of course it might be "difficult" as with all new things, but nothing can be accomplished without some effort.
Most of the code is just date calculation and looping and should be familiar to a Java programmer.

the new example: http://dl.dropbox.com/u/42895525/ddcalendar.sikuli.zip

Revision history for this message
Mohamed Waseem (wasurk) said :
#4

Thank you so much. That really solved my question. Thanks for encouraging me by this point "Nothing can be accomplished without some effort". I am giving my effort to understand the code.

Revision history for this message
Mohamed Waseem (wasurk) said :
#5

Thank you so much. That really solved my question. Thanks for encouraging me by this point "Nothing can be accomplished without some effort". I am giving my effort to understand the code.

Revision history for this message
Mohamed Waseem (wasurk) said :
#6

Thanks RaiMan, that solved my question.

Revision history for this message
dude (dude1) said :
#7

any chance you could re-upload
the new example: http://dl.dropbox.com/u/42895525/ddcalendar.sikuli.zip

I've got a similar issue and am big on learning by example

thanks

Revision history for this message
RaiMan (raimund-hocke) said :
#8