← Back to team overview

sikuli-driver team mailing list archive

[Question #258406]: Confused about Jython example

 

New question #258406 on Sikuli:
https://answers.launchpad.net/sikuli/+question/258406

I am trying to run a simple example that I found at Sikuli's documentation, but I am confused about what am I missing. This is my environment:

- WIndows 7
- Java 1.7.0_71
- SikuliX 1.1.0
- jython 2.7b3
-Eclipse Luna + PyDev

I am trying to run this example that:

- opens firefox
- clicks the url box
- types in an url
- closes firefox

So far I am only able to open firefox. This is the code:

============================================================
import org.sikuli.basics.SikulixForJython
from sikuli import *

import unittest

class Test(unittest.TestCase):
    
    def test_open_browser(self):
                     
        firefox = App.open("c:\\Program Files\\Mozilla Firefox\\Firefox.exe");
        wait(2)
        firefox.focus()
        wait(1)
        
        # now your just opened new window should be the frontmost
        with firefox.window(): # see the general notes below
            # some actions inside the window(0)'s region
            click("url_image.png")
            type("url_string")
            firefox.close() # close the window - stop the process

===================================================

- Am I missing importing something?
- What instance / class defines methods "click" and "type"
- Can you suggest how to make this example run or a different example that does the same with the environemnt described above.

Thanks,

Rodolfo


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.