1. Go to start>all program>sikuli you should see following window.
2. Open application in any browser then goto sikuli window

3. Select desire location and then release mouse.
4. You should now see below window.
5. Click on recorded image on sikuli Id rename and go to default directory where image save.
As E:\User\AppData\Temp-844679859.sikuli folder
Copy image and save it in your project directory “image-sikuli” folder

Sample example of sikuli scripts
import sys
import unittest
from sikuli.Sikuli import *
from vyewTestUtilities import *
###############################################################################
class TestFooERRORFF(unittest.TestCase):
browser = "ff"
account = "acct1"
def setUp(self):
App.open("E:\\Program Files\\Mozilla Firefox\\firefox.exe") #Browser path from your directory
s.wait(3)
s.type("t",KEY_CTRL)
s.wait(2)
def tearDown(self):
browser_name = "Mozilla Firefox"
App.close(browser_name) #ugly shutdown if stuck
def test(self):
s = Screen(0)
logInFromLoginPage(self.browser, self.account)
if s.exists("Close_started.png"):
s.click("Close_started.png")
s.wait(5)
s.click("CreateNewRoom.png")
s.wait(5)
s.wait("Close_popup.png", 60)
s.click("Close_popup.png")
s.click("invite_people.png")
s.wait(5)
s.click("InvitePeople.png")
s.wait(5)
s.type("click_to.png","test360.51@gmail.com")
s.wait(5)
s.type(Key.TAB)
s.type(Key.TAB)
s.type("test invitation")
s.wait(5)
s.click("check_box_conference.png")
s.click("check_box_conference.png")
s.wait(5)
s.click("NextConference.png")
s.wait(5)
s.click("NextConference.png")
s.wait(5)
s.click("Finishconference.png")
s.wait(5)
s.click("Close.png")
Note: above is simple example of sikuli. But if you need to run this example fist yo need to put all imaged in your image-sikuli folder.
How Run sikuli Scripts:
Right click on your script > select run as > jython unit-test as below.

Please feel free to share your views and let us if you have any questions for us.
Thanks,
Rohit Singh
www.360logica.com
how can i integrate sikuli with java eclipse
ReplyDeleteHello Sir..
ReplyDeleteI have add the sikuli jar file in the class path of system variable C:\Program Files\Sikuli X
and after that i add path to sikuli\libs i.e. C:\Program Files\Sikuli X\libs in the path of system variable
and path to java\jre6\bin i.e. C:\Program Files\Java\jre6\bin in the path of system variable
and in the command line i write:- java -jar "C:\Program Files\Sikuli X
\sikuli-script.jar" imgs2.sikuli // imgs2.sikuli is the name of the
folder where i capture screen shot of the start button//
but it doesnt run in the command prompt..
and i write a program in java but i also show some error
package defaultt;
import edu.mit.csail.uid.FindFailed;
public class anu {
public static void main(String[] args) throws FindFailed {
Screen s = new Screen();
s.click("imgs2/start.png", 0); // this command use for click on the start button//
s.wait("imgs2/AnuragVM4Int.png"); // this command use for wait to open the start menu/
s.find("imgs2/Run.png",0); // find the run button //
s.click("imgs2/Run-1", 0); // click on run //
}
}
now can u help me to tackle this problem...
if i made any mistake in command prompt, adding jar file and java file in system variable and in writting java program then plss guide me