Re: [tclwebtest] Subcommand suggestion for 'field select'
Status: Abandoned
Brought to you by:
tils
From: Grzegorz A. H. <gr...@ef...> - 2003-09-16 11:01:01
|
On 2003-08-22, Tilmann Singer <ti...@ti...> wrote: > * Grzegorz Adam Hankiewicz <gr...@ef...> [20030730 10:18]: > > When using [field select -index whatever], it would be nice > > if this returned the selected text. The purpose of this would > > be selecting something from the select at random, saving the > > text in a variable, and check that the selected text appears > > somewhere in the next web page after the form has been submited. > > Sounds useful. It seems a little bit complicated to insert a > return value especially for one variant of the field command, > maybe doing something like this in the test would be sufficient: > > field select -index whatever > set selected_text [field get_selected_text] > > However, the selected_text attribute is not yet implemented - > I'll try to remember it and see if I can add it one day (or > somebody else is faster ;-) Guess what, it was all implemented: field get_choices retrieves a pair list with the contents of the select box, so with an llength you can create the limit for the random command. And you can get the selected value with field get_value, it returns empty string, one string, or a list of strings depending on the status of the select box. I've added a few asserts to a test to check this. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |