← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #204801]: Open browser, type the url/IP address and hit enter

 

Question #204801 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/204801

    Status: Open => Answered

RaiMan proposed the following answer:
Since you say it is running somehow, i guess there are some typos, when
putting code here:

--- the backslashes must either be doubled or you use a raw string
r"C:\...."

# switchApp("Desktop") # delete - not needed
openApp(r"C:\Users\lightspeed\AppData\Local\Google\Chrome\Application\chrome.exe")
click("1343856403600.png") # you must click to give focus to the entry field
type("192.168.1.X") # apo's missing
type("Key.ENTER")

An alternative that gives the Chrome window some time to get ready:
openApp(r"C:\Users\lightspeed\AppData\Local\Google\Chrome\Application\chrome.exe")
wait("1343856403600.png", 5) # waits max 5 seconds
type(getLastMatch(), "192.168.1.X") # first clicks on what was just found and then types
type("Key.ENTER")

An alternative using keyboard shortcut to focus address field:
openApp(r"C:\Users\lightspeed\AppData\Local\Google\Chrome\Application\chrome.exe")
wait( 5) # waits 5 seconds
type("l", KeyModifier.CTRL) # press lowercase L + CTRL
type("192.168.1.X")
type("Key.ENTER")

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