I thought you use the above UI module to present all the six "div"
elements.

Just run the dump method and got the following result,

Dump locator information for classOneList
-------------------------------------------------------
classOneList: //descendant-or-self::d...@class="Listing"]
classOneList[1]: //descendant-or-self::d...@class="Listing"]/div[1]
-------------------------------------------------------

Seems Tellurium did not use the clocator attributes except the tag
when
it generates the runtime locators. I will create an issue for this and
fix it.

You are probably right. Logically, your HTML could be represented by
two lists, i.e.,

List(uid:"classOneList", clocator:[tag:"div", class:"Listing"]){
     Container(uid:"all", clocator:[tag:"div", class:"ClassOne"])
}

List(uid:"classTwoList", clocator:[tag:"div", class:"Listing"]){
     Container(uid:"all", clocator:[tag:"div", class:"ClassTwo"])
}

But to be more elegant, we could provide the following syntax for List
template definition.

List(uid:"list", clocator:[tag:"div", class:"Listing"]){
     Container(uid:"1..3", clocator:[tag:"div", class:"ClassOne"])
     Container(uid:"4..6", clocator:[tag:"div", class:"ClassTwo"])
}

Or if the number of each type of elements does not know beforehand,
we could use some syntax similar to

List(uid:"list", clocator:[tag:"div", class:"Listing"]){
     Container(uid:"group: classOne", clocator:[tag:"div",
class:"ClassOne"])
     Container(uid:"group: classTwo", clocator:[tag:"div",
class:"ClassTwo"])
}

Then you could use list[classOne(i)] or list[classOne[i]] to reference
the object.

Of course, this requires some special parser. We are looking at ANTLR
V3 now
(for both List and Table refactoring) and hopefully we can add the
parser as soon
as we can (we all contribute our spare time to the Tellurium project
and
unfortunately, I am very busy at work recently).

For the time being, please still use what Tellurium can provide at
this point.

We will let you know once we fix the attribute problem.

Thanks,

Jian



On Sep 24, 5:46 pm, JustB <[email protected]> wrote:
> I dint get it...when I give the condition class="ClassOne", why will
> there be an index from 4-6. It should just be 1-3.
> Also why is it, when I remove tag="div" in the clocator, it return 0
> list size?
>
> Bala.
>
> On Sep 24, 2:21 pm, John <[email protected]> wrote:
>
> > Could you run a dump(), for example,
>
> > dump("classOneList")
>
> > to check the generated runtime locators. It the class:"ClassOne" is
> > not presented, we need to fix it.
>
> > Also, your UI module has some problem because the index 1-3 are for
> > "ClassOne"
> > and 4-6 are for "ClassTwo". Thus, you should not use uid: "all". Right
> > now,
> > Tellurium does not support  index range yet. That means you may have
> > to
> > list all the different scenarios. But this is a good example for us
> > to consider to add support for the index range in 0.7.0.
>
> > Thanks,
>
> > Jian
>
> > On Sep 24, 5:08 pm, JustB <[email protected]> wrote:
>
> > > Hey Guys,
>
> > > When I am trying to get a list of div's with a particular class name
> > > say 'ClassOne', it doesn't seem to consider that condition if I
> > > mention my clocator as something like [tag:"div", class:"ClassOne"].
>
> > > Example:
>
> > > Consider this UI Module,
>
> > > <div class="Listing">
> > >     <div class="ClassOne">
> > >           <input value="value" type="text" />
> > >     </div>
> > >     <div class="ClassOne">
> > >           <input value="value" type="text" />
> > >     </div>
> > >     <div class="ClassOne">
> > >           <input value="value" type="text" />
> > >     </div>
> > >     <div class="ClassTwo">
> > >           <input value="value" type="text" />
> > >     </div>
> > >     <div class="ClassTwo">
> > >           <input value="value" type="text" />
> > >     </div>
> > >     <div class="ClassTwo">
> > >           <input value="value" type="text" />
> > >     </div>
> > > </div>
>
> > > I define my UI module as,
>
> > > List(uid:"classOneList", clocator:[tag:"div", class:"Listing"]){
> > >      Container(uid:"all", clocator:[tag:"div", class:"ClassOne"])
>
> > > }
>
> > > getListSize("classOneList") ..... I assume should return 3 rather it
> > > returns 6. Was my assumption wrong. If not why is this the behavior I
> > > see.
--~--~---------~--~----~------------~-------~--~----~
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