← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #173217]: Problems running unit tests from Win7 command line

 

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

surfdork posted a new comment:
Help, How can I use a central image library?

The following script should work from NETBEANS

Log first

[info] Sikuli vision engine loaded.
[info] Windows utilities loaded.
[info] VDictProxy loaded.
[log] App.open C:\Program Files (x86)\Mozilla Firefox\firefox.exe(4928)
[log] Ctrl+TYPE "l"
[log] TYPE "
"
[error] Hummhgbird.png looks like a file, but can't be found on the disk. Assume it's text.
[info] Text Recognizer inited.

from sikuli.Sikuli import *

popup("test")


login= '1066'
ADlogin= 'test'
PRODpw='test'
password= 'test123'
firefox = 'C:\\Program Files (x86)\Mozilla Firefox\\firefox.exe'
ie9 = 'C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe'
INTHB='https://inthb.gmi-mr.com/'
PROD='https://hb.gmi-mr.com/'
setBundlePath = ("C:\\SikuliImages")
#popup (BundlePath)
#popup (login)
App.open(firefox)# create def() to launch all browsers
wait(5) #include visual assertuion later
type("l",KeyModifier.CTRL)# places focus in the address bar
#add code to expand browser window
paste(PRODpw)#create def() to cover all sites
wait(5)#add visual assertion later
type(Key.ENTER)
popup("begin visual assertion")
if exists('C:\\SikuliImages\\Eh.png', 10):
    type(Pattern('C:\\SikuliImages\\1325022795806.png').targetOffset(12,0), login)
    type (Key.ESC)#to clear the hover window if shown
    type (Key.TAB)#to move to next field
    type (PRODpw)
    wait(1) 
    click(Pattern('C:\\SikuliImages\\DefaultHBv.png').targetOffset(35,2))
    wait(1)
    click('C:\\SikuliImages\\Green.png')
    wait(2)
    #type(Key.DOWN + Key.DOWN + Key.DOWN + Key.DOWN + Key.DOWN + Key.DOWN +Key.ENTER)
    click(Pattern('C:\\SikuliImages\\1325023103928.png').targetOffset(39,3))
else:
    popup("login page not displayed")
#make all of the above into a def() login
if exists("Hummhgbird.png", 10):
    popup ("successful login to the hummingbird page")
else:
    popup("hummingbird failed to launch")
    exit
# below is script for launching admin and verufying permissions
#to be skipped for now
#if exists("1325023983868.png",10):#color not imporntat for this step
#     click(getLastMatch())#syntasx to reuse the last find operation 
#else:
#    popup("admin tab does not exist")
#    exit
#if exists(Pattern("AggicalionSe.png").targetOffset(-81,-27), 10):
#    click(getLastMatch())
#else:
#    popup("can't verify permissions")
#    exit
#go to feasability tab
if exists("1325037983959.png", 10):
    click(getLastMatch())
else:
    popup("feasability tab missing, exit test")
    exit
if exists("1325038638563.png"):
    click(getLastMatch())
else:
    popup("profilers sub tab missing, exit test")
    exit
if exists("BrowseProfil.png"):
    popup("Browser Profiler Attributes Displayed")
else:
    popup("Browser Profiler Missing, exit test")
    exit

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