6 Replies Last post: Feb 4, 2009 8:03 AM by Pascal  
petergriffin Beginner 7 posts since
Mar 31, 2008
Currently Being Moderated

Jul 10, 2008 3:21 AM

java.lang.StringIndexOutOfBoundsException: String index out of range: -1

I've had a DOS batch file which I've been using for quite a while to run tests but this morning I keep getting the following error:

 

09:10:53.903 INFO - Java: Sun Microsystems Inc. 10.0-b22
09:10:53.903 INFO - OS: Windows XP 5.1 x86
09:10:53.903 INFO - v1.0-beta-1 [2201], with Core v1.0-beta-1 [1994]
09:10:53.981 INFO - Version Jetty/5.1.x
09:10:53.997 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
09:10:53.997 INFO - Started HttpContext[/selenium-server,/selenium-server]
09:10:53.997 INFO - Started HttpContext[/,/]
09:10:53.997 INFO - Started SocketListener on 0.0.0.0:4444
09:10:53.997 INFO - Started org.mortbay.jetty.Server@32c41a
HTML suite exception seen:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(Unknown Source)
        at org.openqa.selenium.server.browserlaunchers.WindowsUtils$RegKeyValue.<init>(WindowsUtils.java:622)
        at org.openqa.selenium.server.browserlaunchers.WindowsUtils.deleteRegistryValue(WindowsUtils.java:577)
        at org.openqa.selenium.server.browserlaunchers.WindowsProxyManager.handleEvilPopupMgrBackup(WindowsProxyManager.java:106)
        at org.openqa.selenium.server.browserlaunchers.WindowsProxyManager.init(WindowsProxyManager.java:81)
        at org.openqa.selenium.server.browserlaunchers.WindowsProxyManager.<init>(WindowsProxyManager.java:65)
        at org.openqa.selenium.server.browserlaunchers.InternetExplorerCustomProxyLauncher.<init>(InternetExplorerCustomProxyLauncher.java:48)
        at org.openqa.selenium.server.browserlaunchers.InternetExplorerCustomProxyLauncher.<init>(InternetExplorerCustomProxyLauncher.java:41)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(BrowserLauncherFactory.java:124)
        at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.getBrowserLauncher(BrowserLauncherFactory.java:81)
        at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:87)
        at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:141)
        at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:1138)
        at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:386)
09:10:54.434 INFO - Shutting down...

I've been running it using the command:

java -jar %SELENIUM_HOME%\selenium-server.jar -htmlSuite *iexplore "http://mylovelysite.com" "TestSuites/TestSuite-ABC.html" "TestResults/ABC.html"

The folders containing my test suite and the tests it's running exist so I'm a bit puzzled. The only thing I can think of that's changed is I installed the latest updates from Windows this morning so maybe that's knocked something out. Any ideas would be greatly appreciated!!

Yuka Beginner 1 posts since
Aug 13, 2008
Currently Being Moderated
2. Aug 13, 2008 2:49 AM in response to: petergriffin
Re: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Thanks! It’s works now!

I spend a lot of time with this problem…

I can add that it’s necessary to turn off popup blocker by this way – ‘Tools -> popup blocker -> Turnoff popup blocker’, not from security options.

Nicolas Kyriazopoulos-Panagiotopoulos Beginner 19 posts since
Jul 18, 2008
Currently Being Moderated
3. Aug 27, 2008 11:09 AM in response to: Yuka
Re: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Hello, I have the problem even with the pop up blocker deactivated, but I am working in high security IE 7 mode (as it is a Windows Server 2003 machine, and there isn't any easy way to change this).

Do you know of any other IE security properties that could cause that?

healthyfat Beginner 1 posts since
Jan 4, 2009

For me, modifying the popup settings via Internet Explorer was not enough.  I had to manually modify the Windows registry.

 

Specifically, I had to add a DWORD value called "PopupMgr" with data "0" to the [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows] key.

Pascal Beginner 4 posts since
Feb 4, 2009
Currently Being Moderated
5. Feb 4, 2009 7:50 AM in response to: healthyfat
Re: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Hi,

 

none of your answers fixed the problem . I turned of the pop-up-manager und changed the registry entry without succes. Any one another idea?

Here once again my Error message...

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
     at java.lang.String.substring(String.java:1938)
     at org.openqa.selenium.server.browserlaunchers.WindowsUtils$RegKeyValue.<init>(WindowsUtils.java:622)
     at org.openqa.selenium.server.browserlaunchers.WindowsUtils.deleteRegistryValue(WindowsUtils.java:577)
     at org.openqa.selenium.server.browserlaunchers.WindowsProxyManager.handleEvilPopupMgrBackup(WindowsProxyManager.java:106)
     at org.openqa.selenium.server.browserlaunchers.WindowsProxyManager.init(WindowsProxyManager.java:81)
     at org.openqa.selenium.server.browserlaunchers.WindowsProxyManager.<init>(WindowsProxyManager.java:65)
     at org.openqa.selenium.server.browserlaunchers.InternetExplorerCustomProxyLauncher.<init>(InternetExplorerCustomProxyLauncher.java:48)
     at org.openqa.selenium.server.browserlaunchers.InternetExplorerCustomProxyLauncher.<init>(InternetExplorerCustomProxyLauncher.java:41)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(BrowserLauncherFactory.java:124)
     at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.getBrowserLauncher(BrowserLauncherFactory.java:81)
     at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:87)
     at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:141)
     at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:1138)
     at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:386)
Pascal Beginner 4 posts since
Feb 4, 2009
Currently Being Moderated
6. Feb 4, 2009 8:03 AM in response to: Pascal
Re: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Ok, I found it out myself. I had to add the Starturl to the trusted sites of the pop-up blocker.

More Like This

  • Retrieving data ...