how to call this recorded script from java

Asked by Madhu chandra

Hi,

If an mobile application is given, how to record and execute using SIKULI?

how how to call this recorded script from java?. where can i get documention on java, pls let me know.

typical use case :

1.Open any secure webpage gmail.com,
2. enter invalid username and password, i need to capture the dialogs for wrong uname and passwd and i need to compare with the existing defined images/ text sure, if matches make sure that test passes, else fail.

Regards,
Madhu

Question information

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

Nice try - new question - similar answer ;-)

--1. Sikuli scripts are not recorded, they are written in Python language using the defined Sikuli API according to your wanted workflow. To write these scripts, you usually use the Sikuli IDE. Scripts can be run either from within the IDE or from commandline. (see docs and examples: http://sikuli.org/docx/)

--2. As far as mobile apps are concerned, you write your scripts again the emulator window on your screen (Sikuli is WYSIWICS --- What you see is what you can script ;-)

--3. If you plan to program your workflows in Java, you can use the Sikuli features directly in your code (see: http://sikuli.org/docx/faq/030-java-dev.html). Principally it is possible, to "call" existing Sikuli scripts using the Java internal commandline feature. What you choose depends on your knowledge, development environment and goals.

--4. your typical use case (as already mentioned) a little bit extended:

openApp("path to your emulator")
click("capture of browser symbol on mobile's home screen")
wait(3) # sufficient to give browser time to start up
paste("gmail.com") # supposing addressfield is selected and ready for input
type(Key.ENTER)
wait("capture of login dialog", 10) # after max 10 seconds script fails
paste("the username") # supposing username field is focused
type(Key.TAB) # supposing one TAB selects password field
paste("the password")
type(Key.ENTER) # fire login
if exists("image of login reject message", 10): # wait max 10 seconds
   print "login not accepted"
else:
   print "login accepted"

Can you help with this problem?

Provide an answer of your own, or ask Madhu chandra for more information if necessary.

To post a message you must log in.