Mailingliste - Einträge 2005

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] Documentation for ComponentNameResolver

  • Subject: Re: [qftestJUI] Documentation for ComponentNameResolver
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 15 Dec 2005 16:31:42 +0100

Hello René,

the ComponentNameResolver needs to work directly with the Java API, so
you can use any Java API reference, e.g.

The problem in your case is that the NameResolver needs to create its
own cache of components, their names and their parents to find out
whether a name is unique or not. qftest already has that information,
but there is no API to access it.

Similar questions have come up recently so I'm contemplating whether
implementing automatic disambiguation directly in qftest is a good

The problem is that such a solution would make the name of a component
depend on whether there is another component of the same name in the
same window (or ancestor in case of hierarchical resolution). So it
would have to be optional.

For now it is probably best to modify the name resolver as such:

- Get the component's name and set count=1

- Traverse the hierarchy up to the dialog

- Traverse the hierarchy downwards from the dialog until you hit your

- For each component encountered on the way that has the same name
  increase count

- if count > 1 return name_count otherwise plain name

If that turns out to be too slow we need to rethink.

Best regards,

"Rene Villiger, Infonic AG" <rvilliger@?.net> writes:

>    Hi
>    For our tests we have written a ComponentNameResolver of our own. Now
>    I have to make some changes to it. Until now the resolver returned
>    only the components name, if the component was found in a JDialog. In
>    the newest version of our software it is now possible, that 2
>    components with the same name appear in a dialog. With our name
>    resolver they will get the same name.
>    Now I want to change the name resolver to enumerate the returned
>    components. The first component in a JDialog will still get it's name
>    if there is no ancestor with a component with the same name. The
>    returned names would be NAME_x where x is the number of ancestors
>    which have a component with the same name.
>    Is there any documentation which could help me achieve this? Eg an API
>    docu for ComponentInfo, ComponentNameResolver, etc?
>    Thanks
>    René Villiger

Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH           
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876