← Back to team overview

sikuli-driver team mailing list archive

[Question #292399]: Sikuli App object throws java.lang.ArrayIndexOutOfBoundsException

 

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

Running the following script to manage whether Google Chrome is open from a previously running script.  I want to test if it is open.  If it is, close it and start a fresh instance of Chrome...

Sikuli Code:
from sikuli.Sikuli import *
# Above: using import because I eventually want to build a callable routine in here that does this, 
# and call is from variuous scripts to launch Chrome, and hav it ready to have a URL typed in.

# App to work with is Google Chrome
browsername = "Google Chrome"

# First see if a previous session of Chrome is open.  If so, close it.
myBrowser = App(browsername)
if myBrowser.window() :
    myBrowser.close() 

# Now launch a fresh Chrome session.    
newBrowser = App(browsername)
newBrowser.open()  # this is line 15!
wait(3)

# End of SIkuli code

Mac OS 10.11.4 El Capitan
Google Chrome Version 50.0.2661.86 (64-bit)
Sikuli 1.1.0
Jython 2.7

SIKULI_HOME=/Users/macuser/Sikulix
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home

Error is thrown both in the IDE and from command line.  (Error from IDE below)
[error] script [ launchChrome ] stopped with error in line 15
[error] java.lang.ArrayIndexOutOfBoundsException ( java.lang.ArrayIndexOutOfBoundsException: 2 )

This is a very new install I am putting together.  Sikuli ran great on it last week, and I actually was teaching myself how to make this a subscript in Sikuli, but as I kept working on installing the Python/MySQL drivers on the machine, and updating Java, I managed to break Sikuli.

Also I created a little script in the IDE to check those environment variables (SIKULI_HOME and JAVA_HOME) as the IDE ran, and they were accurate.  I completely removed Sikuli and re-installed it, and it did not change the behavior.

After the crash, Sikuli has managed to corrupt the instance of the browser it just launched.  It no longer has the name "Chrome" in the upper left, near the Apple menu, but instead says "Sikuli".  Very weird. 


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.