Mailingliste - Einträge 2006


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

Re: [qftestJUI] Tree with some static and dynamic nodes


  • Subject: Re: [qftestJUI] Tree with some static and dynamic nodes
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 26 Jan 2006 11:55:14 +0100

Hi Bostjan,

interesting question. This is exactly one of the things I'm currently
working on for version 2 and I've been breaking my head about a good
syntax that will make migration of current tree node representations
possible.

You suggestion

tree@/$(static_node_level1)@/$(static_node_level2)&/$(dyn_node_level3)

is basically what I would also suggest. Normally we wouldn't even need
the '/' characters except that qftestJUI currently can also treat
trees as lists. So right now one could have

tree@/root/branch

or just 

tree@branch

with the same effect as long as branch is unique.

If we change the syntax to

tree@/root@/branch

things are precisely defined. Using

tree@root@branch

would be much more natural though and treating trees as lists is a
rather obscure and rarely used construct anyway. What if we change the
list syntax to 

tree@//branch

which is close to XPath meaning "any node named branch". We could
event combine that to use

tree@root@branch@//subbranch

meaning "the first node named subbranch below /root/branch". Very
powerful and expressive and I think we can automatically update old
test-suites to reflect the change without manual intervention.

Am I making any sense? Thoughts anyone?

Anyway, you can't do that with qftestJUI version 1.8. Funny enough, to
do what you're looking for, the list-based index is just what you need.

First, use a "Fetch index" node to get the list based index of 

tree@/$(static_node_level1)/$(static_node_level2)

into a variable, say "row". Then use

tree&$[$(row) + $(dyn_node_level3)]

to address your node. Similar, use a Jython script to read the row
index of the selected node, 

tree = rc.getComponent("tree")
# there is no tree.getSelectedRow for simply retrieving a single row
rc.setLocal("row", tree.getRowForPath(tree.getSelectedPath()))

then use a "Fetch text" node on tree&$(row).

Best regards,
    Greg

Bostjan Praznik <bostjan.praznik@?.si> writes:

> Hi,
> 
> in my application I use a tree component (JTree) which has static nodes on
> first two levels and dynamic nodes on third and further levels. I don't know
> how to select one dynamic node. After component recording I removed all
> dynamic nodes from my test suite. I would like to know if I can use a
> combination of operators "@" and "&" in the way
> "tree@/$(static_node_level1)@/$(static_node_level2)&/$(dyn_node_level3)". It
> is important that when selecting nodes on first two levels (static nodes)
> they are referenced by string (name).
> 
> Is it aso possible to get the selected node's text (e.g. first dynamic node
> is selected and we would like to know which one we selected)?
> 
> Thank you in advance,
> Bostjan

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


Videos Downloads Dokumentation Kaufen Gratis Testen