Can SIKULI work on RIM, iPhone, Android devices

Asked by suresh

Hi,

I have different mobile applications that are sitting in different devices like RIM, Android, and IPhone. I would like to automate those mobile applications in the said devices.

Will this SIkuli help us in creating automation solution, if so please let me know the following:

1) If I create script for one device, what could be the percentage of reusability if wish to execute on another device.
2) What is the license cost for this?
3) Can I integrate these tools with any Test Management tool like HP Quality Center
4) Please share any sample application that I can use to test using SIKULI.

Thank,
Suresh.

Question information

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

Please also do send me installation instructions for installing DOWNLOAD SIKULI IDE 0.10.2. I need to know the system preferences and hardware preferences etc..

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

I guess you mean: use it with the test scenarios with onscreen device emulators on Windows/Mac/Linux systems.

Sikuli only runs on Windows/Mac/Linux, because the internally used native libraries for accessing the screen are only running/available on these systems.

at (2): Still there is no license cost (open source).

All information you need is available on the homepage.

The only prereq on Windows and Mac is the JRE, since the native screen access software comes with the download.

You may decide to not use the packaged IDE and use NetBeans or Eclipse instead. Come back if more info on that is needed.
In both cases, you have the option to program your unit testing on the Java level or on the Python/Jython level (which is the level used in Sikuli script)

at (3): yes, is possible (someone did it already, but no valuable information available (search in Q&A)).

at (1): if you talk about testing an app, that is implemented on all 3 environments and supposing the app workflow is to a large extent identical, than an intelligent code (seperating the environment dependent things from the code and implementing reusable code libraries) should be reusable at near 100% with all environments.
the biggest effort will be to record the needed visual objects for each environment, since as far as I understand something on an iPhone looks different than on Android, even if it is the "same" app (talking in pixel filled rectangles, which are the base for Sikuli) and on top you may have to take care for different pixel resolutions.

at (4): to have an example for that, would be great - but there is none. The cracks who are using Siklui for testing mobile apps (I know there are some) don't share their test knowledge. There Questions and bug reports are more addressed towards Sikuli usage and missing features.
My recommendation:
- make sure you have some basic knowledge about Python language
- give yourself 1/2 an hour to read across the reference (http://sikuli.org/trac/wiki/reference-0.10)
- download and install Sikuli
- start your device emulator and position on one of your apps
- use the IDE to make some find and click tests (1 - 2 hours) to get a feeling

So in my experience, after an investment of 2 - 3 hours, you should be able to decide, wether Sikuli could help you (I predict it can ;-).

If you need more help with your first steps, feel free to use my private mail from https://launchpad.net/~raimund-hocke. It is easier to send code samples back and forth.

Revision history for this message
suresh (suresh-kannegandla) said :
#3

Thank you very much for your help in this regard.

I have some experience in python langauge. Would you please help me in

1) Please share installation document, if any
2) Would you please suggest me any sample applications to use for testing before I kick-start with actual application
3) Can you share any handy tips on this tool.

Thanks,
Suresh.

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

at (1):
Supposing you are on windows, I recommend to download the portable version (no need for any "install") from

unzip it to a directory of your choice and replace the contained .bat with the on downloaded from http://launchpad.net/sikuli/trunk/0.10.2/+download/Sikuli-IDE.bat
and use it to start the IDE.
I even recommend to delete the .exe, since for "real" programming and testing, you never need it.

With this .bat you can run a script from commandline (.sikuli or .skl) as:
sikuli-ide.bat -options full-path-to-sikuli-script arg1 arg2 ... argN
--- -options: see section command line tool at http://groups.csail.mit.edu/uid/sikuli/download.shtml
--- argX parameters for your script

I even recommend to delete the .exe, since for "real" programming and testing, you never need it.

As already mentioned, a current and running JRE (> version 16) should be available.

You could even put the Sikuli dir on a stick an run it from there. If interested, I have a version of Sikuli available on a stick based on PoartableApps.com including the JRE (approach see https://bugs.launchpad.net/sikuli/+bug/667568/comments/5).

at (2):
You have to look at the different areas on the homepage, that show up some examples. If you give me a mail-address (mine see comment before) I could send you two more eleborated examples running on Windows/Firefox.

at(3):
I have many of them, but this are the most valuable for beginners, who not only want to play around with Sikuli:

some of the tips may be cryptic in the moment ;-)

- understand how Sikuli works (reference guide, system overview)

- understand the "structure" of .sikuli and .skl

- understand the "What you see, is what you can script" principle of Sikuli

- before starting to invest in code, go through your workflow manually and write down a plan of related steps (could be as comments in the IDE). Find out for each step, what are the visuals that define the step, which are the ones you have to handle and which are the ones that show you, that the step is succesfully completed. Make some screenshots on your way through.

- from beginning get used to think in regions of interest (e.g. the image of your emulated device on the screen) and use them as often as possible (better performance and less FindWrong/FindFailed situations)

- understand the FindFailed exception handling and get friend with exists() especially using a 0 waiting time

- from beginning think in reusable chunks of code and make as much def()'s as possible

- decide to use an image repository to be able to reuse captured visual objects

- have a fully qualified naming convention for variables, def()'s and images

- decide to use NetBeans or Eclipse with Python PlugIn (standard use of import, debugging, full featured IDE, ...)

- emulate keyboard shortcuts as often as possible instead of searching and clicking visuals

- use find operations only if needed. Using a pixel offset to do some clicks or calculate a region from the matches you already have is most efficient. save matches of key visuals in a workflow step for later use (don't search again, what you have already found)

- don't use the function board on the left side of the IDE. always do something like this (in another IDE you will have to script without having this ;-)
imgAppLogin = captured-image # use the camera-symbol in the upper left or the quick-capture hotkey
mAppLogin = exists(imgAppLogin) # save the match
if not mAppLogin: print "[App Error]" imgAppLogin; exit(1) # not found, workflow broken
click(mAppLogin)
only this approach makes it possible to be flexible with your scripts

- implement some intelligent logging enriched with saved screenshots on your way to track back in case of errors (has to be programmed as def() )

- be aware, that in many cases FindFails and other symptoms are caused by the fact that Sikuli is faster than the scripted application. So waiting on things to come up or just waiting even for only 0.1 second makes your script robust and be the most used feature.

many more tips available on details ;-)

Revision history for this message
RaiMan (raimund-hocke) said :
#5
Revision history for this message
suresh (suresh-kannegandla) said :
#6

Thank you RaiMan for your inputs.

Can you please share examples to <email address hidden>.

I will let you know if I need any help. For now I am closing this thread and will open if needed in the future.

Thanks,
Suresh

Revision history for this message
suresh (suresh-kannegandla) said :
#7

Thanks RaiMan, that solved my question.

Revision history for this message
suresh (suresh-kannegandla) said :
#8

Hi Raiman,

Thank you for your assistance.

Can you please let me know whether is any feature like "Record and Play back" with this Sikuli tool on applications?

Can you suggest any framework for automating Mobile Applications using Sikuli for RIM, IPhone, Android devices?

Thank you for your help in advance,

SureshBabu Kannegandla | ProjectLead | AppLabs
DLF Building, 6th Floor, Plot No. 129-132, APHB Colony, Gachibowli, Hyderabad - 500 019
Office: +91 40 3082 9000 extn:9598 | Mobile: +91 9700175749
<email address hidden> | AppLabs.com

no doubt about it

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of RaiMan
Sent: Tuesday, November 02, 2010 2:04 PM
To: <email address hidden>
Subject: Re: [Question #132186]: Can SIKULI work on RIM, iPhone, Android devices

Your question #132186 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/132186

    Status: Open => Answered

RaiMan proposed the following answer:
I guess you mean: use it with the test scenarios with onscreen device
emulators on Windows/Mac/Linux systems.

Sikuli only runs on Windows/Mac/Linux, because the internally used
native libraries for accessing the screen are only running/available on
these systems.

at (2): Still there is no license cost (open source).

All information you need is available on the homepage.

The only prereq on Windows and Mac is the JRE, since the native screen
access software comes with the download.

You may decide to not use the packaged IDE and use NetBeans or Eclipse instead. Come back if more info on that is needed.
In both cases, you have the option to program your unit testing on the Java level or on the Python/Jython level (which is the level used in Sikuli script)

at (3): yes, is possible (someone did it already, but no valuable
information available (search in Q&A)).

at (1): if you talk about testing an app, that is implemented on all 3 environments and supposing the app workflow is to a large extent identical, than an intelligent code (seperating the environment dependent things from the code and implementing reusable code libraries) should be reusable at near 100% with all environments.
the biggest effort will be to record the needed visual objects for each environment, since as far as I understand something on an iPhone looks different than on Android, even if it is the "same" app (talking in pixel filled rectangles, which are the base for Sikuli) and on top you may have to take care for different pixel resolutions.

at (4): to have an example for that, would be great - but there is none. The cracks who are using Siklui for testing mobile apps (I know there are some) don't share their test knowledge. There Questions and bug reports are more addressed towards Sikuli usage and missing features.
My recommendation:
- make sure you have some basic knowledge about Python language
- give yourself 1/2 an hour to read across the reference (http://sikuli.org/trac/wiki/reference-0.10)
- download and install Sikuli
- start your device emulator and position on one of your apps
- use the IDE to make some find and click tests (1 - 2 hours) to get a feeling

So in my experience, after an investment of 2 - 3 hours, you should be
able to decide, wether Sikuli could help you (I predict it can ;-).

If you need more help with your first steps, feel free to use my private
mail from https://launchpad.net/~raimund-hocke. It is easier to send
code samples back and forth.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/132186/+confirm?answer_id=1

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/132186

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
suresh (suresh-kannegandla) said :
#9

Hi Raiman,

Please share PPT's which talks about Sikuli in Automating application from several devices if any.

Thanks,

SureshBabu Kannegandla | ProjectLead | AppLabs
DLF Building, 6th Floor, Plot No. 129-132, APHB Colony, Gachibowli, Hyderabad - 500 019
Office: +91 40 3082 9000 extn:9598 | Mobile: +91 9700175749
<email address hidden> | AppLabs.com

no doubt about it

-----Original Message-----
From: Suresh [mailto:<email address hidden>]
Sent: Monday, November 08, 2010 11:30 AM
To: '<email address hidden>'
Cc: '<email address hidden>'
Subject: RE: [Question #132186]: Can SIKULI work on RIM, iPhone, Android devices

Hi Raiman,

Thank you for your assistance.

Can you please let me know whether is any feature like "Record and Play back" with this Sikuli tool on applications?

Can you suggest any framework for automating Mobile Applications using Sikuli for RIM, IPhone, Android devices?

Thank you for your help in advance,

SureshBabu Kannegandla | ProjectLead | AppLabs
DLF Building, 6th Floor, Plot No. 129-132, APHB Colony, Gachibowli, Hyderabad - 500 019
Office: +91 40 3082 9000 extn:9598 | Mobile: +91 9700175749
<email address hidden> | AppLabs.com

no doubt about it

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of RaiMan
Sent: Tuesday, November 02, 2010 2:04 PM
To: <email address hidden>
Subject: Re: [Question #132186]: Can SIKULI work on RIM, iPhone, Android devices

Your question #132186 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/132186

    Status: Open => Answered

RaiMan proposed the following answer:
I guess you mean: use it with the test scenarios with onscreen device
emulators on Windows/Mac/Linux systems.

Sikuli only runs on Windows/Mac/Linux, because the internally used
native libraries for accessing the screen are only running/available on
these systems.

at (2): Still there is no license cost (open source).

All information you need is available on the homepage.

The only prereq on Windows and Mac is the JRE, since the native screen
access software comes with the download.

You may decide to not use the packaged IDE and use NetBeans or Eclipse instead. Come back if more info on that is needed.
In both cases, you have the option to program your unit testing on the Java level or on the Python/Jython level (which is the level used in Sikuli script)

at (3): yes, is possible (someone did it already, but no valuable
information available (search in Q&A)).

at (1): if you talk about testing an app, that is implemented on all 3 environments and supposing the app workflow is to a large extent identical, than an intelligent code (seperating the environment dependent things from the code and implementing reusable code libraries) should be reusable at near 100% with all environments.
the biggest effort will be to record the needed visual objects for each environment, since as far as I understand something on an iPhone looks different than on Android, even if it is the "same" app (talking in pixel filled rectangles, which are the base for Sikuli) and on top you may have to take care for different pixel resolutions.

at (4): to have an example for that, would be great - but there is none. The cracks who are using Siklui for testing mobile apps (I know there are some) don't share their test knowledge. There Questions and bug reports are more addressed towards Sikuli usage and missing features.
My recommendation:
- make sure you have some basic knowledge about Python language
- give yourself 1/2 an hour to read across the reference (http://sikuli.org/trac/wiki/reference-0.10)
- download and install Sikuli
- start your device emulator and position on one of your apps
- use the IDE to make some find and click tests (1 - 2 hours) to get a feeling

So in my experience, after an investment of 2 - 3 hours, you should be
able to decide, wether Sikuli could help you (I predict it can ;-).

If you need more help with your first steps, feel free to use my private
mail from https://launchpad.net/~raimund-hocke. It is easier to send
code samples back and forth.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/132186/+confirm?answer_id=1

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/132186

You received this question notification because you are a direct
subscriber of the question.

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

--- Record and PlayBack
no this feature is not available.
You may write a script, that is triggered manually ( or by visual events ) and captures images and stores them in a place for later use (I made some experiments using subprocessing (watchdog) and using XML-RPC to instantly trigger Sikuli scripts).
But you cannot record the intervening key board actions and mouse clicks (only the location of the mouse cursor).
May be it is possible to combine the output of some other macro recorder with the captures from Sikuli (don't know wether that makes sense according to effort/outcome)

--- PPT's
sorry I have nothing in that direction.

Revision history for this message
suresh (suresh-kannegandla) said :
#11

HI RaiMan,

Thank you very much!

Is there any way to send the input values to Sikuli script from an Excel sheet or any other source (i.e something like parameterization). If yes, can you please share an example.

Thanks,

SureshBabu Kannegandla | ProjectLead | AppLabs
DLF Building, 6th Floor, Plot No. 129-132, APHB Colony, Gachibowli, Hyderabad - 500 019
Office: +91 40 3082 9000 extn:9598 | Mobile: +91 9700175749
<email address hidden> | AppLabs.com

no doubt about it

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of RaiMan
Sent: Monday, November 08, 2010 1:31 PM
To: <email address hidden>
Subject: RE: [Question #132186]: Can SIKULI work on RIM, iPhone, Android devices

Your question #132186 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/132186

RaiMan posted a new comment:
--- Record and PlayBack
no this feature is not available.
You may write a script, that is triggered manually ( or by visual events ) and captures images and stores them in a place for later use (I made some experiments using subprocessing (watchdog) and using XML-RPC to instantly trigger Sikuli scripts).
But you cannot record the intervening key board actions and mouse clicks (only the location of the mouse cursor).
May be it is possible to combine the output of some other macro recorder with the captures from Sikuli (don't know wether that makes sense according to effort/outcome)

--- PPT's
sorry I have nothing in that direction.

You received this question notification because you are a direct
subscriber of the question.

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

Using XLS may be too complicated to evaluate for parameters.

--- Decide to use a text file containing a key/value pair on each line:
key1 = value
key2 = value

--- and script like this (any validation left out here ;-)
f = file("path-to-file); lines = f.readlines(); f.close()

theParms = {} # a dictionary

for line in lines:
   thePair = line.strip().partition("=")
   theParms[ thePair[0].strip() ] = thePair[2].strip()

--- and you have your parms in the dictionary ready to use, e.g.
parm1 = theParms.get("key1", a-default-value)

you will have many ideas to enhance it ;-)

Revision history for this message
Karimulla Shaik (karimulla-shaik) said :
#13

Hello,

Can you please share some sample def(), other functionals scripts on Android Testing to my email Id "<email address hidden>"?

Regards
Karim

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

@ Karimulla
Pls. use Google, to find relevant examples in the net.
I do not have any.