Mailing list - Entries of 2006

Re: [qftestJUI] Handling ComboBoxes

Subject: Re: [qftestJUI] Handling ComboBoxes

From: Gregor Schmid <Gregor.Schmid@?.de>

Date: 24 Jan 2006 22:35:18 +0100

Hello Mark,
it's relatively easy to do what you want with qftestJUI. Please see
inline comments.
"Michaelis, Mark" <mark.michaelis@?.com> writes:
> Hello,
>
> I want to write a procedure to access generic ComboBoxes. Of course one way
> might be to use scripting and access the combobox-component directly. But I
> want to use as much of qftestJUI's default nodes as possible.
>
> How far I got:
>
> I have a procedure:
>
> combobox.selectItem(comboBox,item):
> MPRC (1,1) [$(comboBox)=>$(client)]
> MPRC (0,0) [$["combo.list%s" % (rc.lookup("item"))]=>$(client)]
The second component ID is a bit convoluted and needlessly
complicated. A simple
MPRC (0,0) [combo.list$(item)]=>$(client)]
is sufficient.
> Where combo.list is:
>
> BasicComboPopup
> `- JScrollPane
> `- JList combo.list
>
> and item is specified as @text or &index.
>
> For the first try the BasicComboPopup and the ComboBox resided in
> the same window-component. This worked fine. Then I wanted to move
> the combobox.selectItem-procedure to a more generic suite-file.
Good idea.
> But what to do with the BasicComboPopup which still was very
> window-specific. My idea was to have a generic window like a
> java.awt.Window with nothing else specified which contains this
> BasicComboPopup. I had to extend combobox.selectItem to wait for
> this window...
>
> May be this would have worked if there won't be two windows open (the one
> where the combobox is in is a modal dialog). But it seems the generic window
> matches the window behind the modal dialog. Thus the BasicComboPopup and
> therefore the combo.list cannot be found.
No, your idea was correct and this should work regardless of whether
you have one or more windows opened, provided you keep the ComboPopup
well-defined.
I'm attaching a suite which shows how this can be done. I hope this
helps and your scripts can be seen as a useful exercise :-)
Best regards,
Greg
> Any ideas how I may continue from here? Or nice solitions how to access
> comboboxes?
>
> Thanks in advance.
>
> Regards,
> Mark
--
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