Unexpected exception caught: java.lang.StringIndexOutOfBoundsException

View: New views
3 Messages — Rating Filter:   Alert me  

Unexpected exception caught: java.lang.StringIndexOutOfBoundsException

by Rhee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All

When executing this Webtest snippet w/ htmlunit 2.6 or the lastest snap shot (2.7) i get StringIndexOutOfBoundsException below probably because of the string length (name is auto generated). Please advice if there is a workaround. The second step throws error.


            <verifyXPath xpath="//*[@name= 'ctl00$ContentPlaceHolder1$grdHourlyEntry$grdHourlyEntry$ctl02$txtMonday']"
                description=  "Verify Mon HRS input box"/>

            <setInputField xpath="//*[@name= 'ctl00$ContentPlaceHolder1$grdHourlyEntry$grdHourlyEntry$ctl02$txtMonday']"
                value="${szMon}"
                description=  "Set Mon HRS "/>

Unexpected exception caught: java.lang.StringIndexOutOfBoundsException
    at com.canoo.webtest.steps.StepUtil.handleException(StepUtil.java:122)
    at com.canoo.webtest.steps.Step.handleException(Step.java:387)
    at com.canoo.webtest.steps.Step.execute(Step.java:118)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
    at com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:31)
    at com.canoo.webtest.steps.Step.execute(Step.java:103)

Thanks
--
- Rhee

"Risk nothing and you gain nothing"

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Re: Unexpected exception caught: java.lang.StringIndexOutOfBoundsException

by Marc Guillemot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

please don't open an issue and ask on the mailing list at the same time:
I have to answer twice.

I think that this problem has already been fixed and that you don't use
the latest 2.7 snapshot (the one provided with WebTest is at least 1 or
2 weeks old).

Cheers,
Marc.

Rhee a écrit :

> Hi All
>
> When executing this Webtest snippet w/ htmlunit 2.6 or the lastest snap
> shot (2.7) i get StringIndexOutOfBoundsException below probably because
> of the string length (name is auto generated). Please advice if there is
> a workaround. The second step throws error.
>
>
>             <verifyXPath xpath="//*[@name=
> 'ctl00$ContentPlaceHolder1$grdHourlyEntry$grdHourlyEntry$ctl02$txtMonday']"
>                 description=  "Verify Mon HRS input box"/>
>
>             <setInputField xpath="//*[@name=
> 'ctl00$ContentPlaceHolder1$grdHourlyEntry$grdHourlyEntry$ctl02$txtMonday']"
>                 value="${szMon}"
>                 description=  "Set Mon HRS "/>
>
> Unexpected exception caught: java.lang.StringIndexOutOfBoundsException
>     at com.canoo.webtest.steps.StepUtil.handleException(StepUtil.java:122)
>     at com.canoo.webtest.steps.Step.handleException(Step.java:387)
>     at com.canoo.webtest.steps.Step.execute(Step.java:118)
>     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>     at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
>     at org.apache.tools.ant.Task.perform(Task.java:348)
>     at
> com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
>     at
> com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:31)
>     at com.canoo.webtest.steps.Step.execute(Step.java:103)
>
> Thanks
> --
> - Rhee
>
> "Risk nothing and you gain nothing"
>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Re: Unexpected exception caught: java.lang.StringIndexOutOfBoundsException

by Rhee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Retested in the lastest and it is fixed.

Thanks
Rhee

On Tue, Nov 10, 2009 at 1:44 AM, Marc Guillemot <mguillemot@...> wrote:
Hi,

please don't open an issue and ask on the mailing list at the same time:
I have to answer twice.

I think that this problem has already been fixed and that you don't use
the latest 2.7 snapshot (the one provided with WebTest is at least 1 or
2 weeks old).

Cheers,
Marc.

Rhee a écrit :
> Hi All
>
> When executing this Webtest snippet w/ htmlunit 2.6 or the lastest snap
> shot (2.7) i get StringIndexOutOfBoundsException below probably because
> of the string length (name is auto generated). Please advice if there is
> a workaround. The second step throws error.
>
>
>             <verifyXPath xpath="//*[@name=
> 'ctl00$ContentPlaceHolder1$grdHourlyEntry$grdHourlyEntry$ctl02$txtMonday']"
>                 description=  "Verify Mon HRS input box"/>
>
>             <setInputField xpath="//*[@name=
> 'ctl00$ContentPlaceHolder1$grdHourlyEntry$grdHourlyEntry$ctl02$txtMonday']"
>                 value="${szMon}"
>                 description=  "Set Mon HRS "/>
>
> Unexpected exception caught: java.lang.StringIndexOutOfBoundsException
>     at com.canoo.webtest.steps.StepUtil.handleException(StepUtil.java:122)
>     at com.canoo.webtest.steps.Step.handleException(Step.java:387)
>     at com.canoo.webtest.steps.Step.execute(Step.java:118)
>     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>     at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
>     at org.apache.tools.ant.Task.perform(Task.java:348)
>     at
> com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
>     at
> com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:31)
>     at com.canoo.webtest.steps.Step.execute(Step.java:103)
>
> Thanks
> --
> - Rhee
>
> "Risk nothing and you gain nothing"
>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user



--
- Rhee

"Risk nothing and you gain nothing"

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user