osx .observe(1) getsRuntimeError ( maximum recursion depth exceeded (Java StackOverflowError) )
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Opinion
|
Undecided
|
Unassigned |
Bug Description
This works on the same Mac OS 10.11.6 system with SikuliX 1.1.0.
Running the same program attached give a Java StackOverflowError on
the line "sample.observe(1) # observing for 1 seconds (script pauses here - Java Stack Overflow)
It happens the very first observation.
#######
[log] App.focus: [0:Firefox]
[log] ( ⌘ ) TYPE "t"
2016-08-02 11\:47\:42, Typed "t", KeyModifier.CMD
[log] TYPE "nist.time.
2016-08-02 11\:47\:44, Typed "nist.time.gov" + Key.ENTER
2016-08-02 11\:47\:45, Found Right now
[log] highlight M[749,127 410x25]@S(0) for 2.0 secs
[log] highlight R[793,175 350x62]@S(0) for 2.0 secs
========= Starting Observation#0 ========
[error] script [ test3 ] stopped with error in line 132
[error] RuntimeError ( maximum recursion depth exceeded (Java StackOverflowError) )
#######
import sys
import subprocess
import time
import shutil
setAutoWaitTime
Settings.
def logit(msg):
lfile = open(id, "a")
msgall = time.strftime(
print(msgall)
lfile.
lfile.close()
def snapit(msg):
bounds = getBounds()
pic = Screen(
print("snapshot taken, + msg")
msg = msg.rstrip("\n")
sfile = path + "OSX10.11.5 " + time.strftime(
shutil.
def findit(
found = False
for i in range(3):
if wait(pattern,2):
msg = "Found %s\n" % desc
found = True
break
if (not found):
msg = "%s not found\n" % desc
logit(msg)
snapit(msg)
return False
return True
def typekeys(
defined = False
if (app == "Firefox"):
if (cmd == "Clear Recent History"):
defined = True
keys = "Key.BACKSPACE, KeyModifier.
msg = "Typed %s\n" % keys
desc = "Clear Now"
rc = clickit(clearnow, desc)
if (rc == False):
elif (cmd == "New Tab & URL"):
defined = True
keys = "\"t\", KeyModifier.CMD"
msg = "Typed %s\n" % keys
keys = "\"%s\" + Key.ENTER" % parm1
msg = "Typed %s\n" % keys
elif (cmd == "Close Tab"):
defined = True
keys = "\"w\", KeyModifier.CMD"
msg = "Typed %s\n" % keys
elif (cmd == "Select URL field"):
keys = "\"l\", KeyModifier.CMD"
msg = "Typed %s\n" % keys
else:
pass
if (not defined):
msg = "No %s found\n" % cmd
logit(msg)
snapit(msg)
return False
return True
def timechanged(event):
print(
num = 0
for ch in event.changes:
num += 1
sleep(1)
print(
num = 0
for ch in event.changes:
num += 1
print(
Settings.
event.
#######
global id, path
# Create log file for msgs and path for snapshots
dir = "/users/
lfile = "OSX10.11.5_" + time.strftime(
id = dir + lfile
path = dir
lfile = open(id, "w")
lfile.close()
#######
setThrowExcepti
app = "Firefox"
myApp=switchApp
cmd = "New Tab & URL"
parm1 = "nist.time.gov"
rc = typekeys(
if (not rc):
exit(1)
header = "1469738059083.png"
rc = findit(
if (not rc):
exit(2)
headerloc = find(header)
headerloc.
hx = headerloc.getX()
hy = headerloc.getY()
timeloc = Region(hx + 44, hy + 48, 350, 62)
timeloc.
passed = 0
failed = 0
for i in range(10):
sample = timeloc
sample.
Settings.
print(
sample.
if Settings.isChanged: # check wether the handler was called (because there where changes)
passed += 1
else:
failed += 1
print("Passed=" + str(passed) + ",Failed=" + str(failed))
cmd = "Close Tab"
parm1 = None
rc = typekeys(
if (not rc):
exit(3)
exit(4)
#######
Changed in sikuli: | |
status: | New → Opinion |