It is a bug in the code,

  def hasCssClass(String uid, String cssClass) {
    WorkflowContext context =
WorkflowContext.getContextByEnvironment(this.exploreJQuerySelector,
this.exploreSelectorCache)
    String[] strings = walkToWithException(context, uid)?.hasCssClass()
{loc, classAttr ->
     ......
    if (strings?.length) {
      for (i in 0..strings?.length) {  <--- Here
        if (cssClass.equalsIgnoreCase(strings[i])) {
          return true
        }
      }
    }
    return false
  }

The indicated line is wrong and should use exclusive range operator instead
of the inclusive range operator, i.e., should be

for (i in 0..<strings?.length) {

I will fix this to trunk and deploy the snapshot to Maven repo soon.

Thanks,

Jian


On Wed, Jul 8, 2009 at 12:17 PM, dominicm <[email protected]>wrote:

>
> Hi,
>
> I'm working with an element that has quite a few css classes and using
> hasCssClass on it throws an error.
>
> 17:14:41.572 INFO - Command request: getAttribute[jquery=#userAccount
> div.accountRow:eq(1) div[class*=wall...@class, ] on session
> ce13560475274851b37145177f8b7f92
> 17:14:41.634 INFO - Got result: OK,inline accountBalance
> marketFundsText wallet on session ce13560475274851b37145177f8b7f92
>
> ...
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
>        at
> org.codehaus.groovy.runtime.dgmimpl.arrays.ObjectArrayGetAtMetaMethod
> $MyPojoMetaMethodSite.call(ObjectArrayGetAtMetaMethod.java:57)
>        at
> org.tellurium.dsl.BaseDslContext.hasCssClass(BaseDslContext.groovy:
> 1109)
> ...
>
> Any ideas?
>
> Thanks
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to