arjuna.tpi.guiauto.widget.dropdown module¶
-
class
arjuna.tpi.guiauto.widget.dropdown.
GuiDropDown
(gui, wmd, parent=None)¶ Bases:
object
Represents a drop down list in th Gui.
Not meant to be directly created. It is created using calls from Gui object or GuiNamespace object of Gui.
Parameters: - gui – Gui object containing this GuiDropDown.
- wmd – GuiElementMetaData object for this GuiDropDown.
Keyword Arguments: parent – GuiElement in case it is found inside a GuiElement. Default is the Gui object.
-
gui
¶ Gui object containing this GuiDropDown.
-
has_index_selected
(index: int) → bool¶ Check if this GuiDropDown has option selected at given index.
Parameters: index – Target index.
-
has_value_selected
(value: str) → bool¶ Check if this GuiDropDown has option with given value attribute content selected.
Parameters: value – Exact content of value attribute.
-
has_visible_text_selected
(text: str) → bool¶ Check if this GuiDropDown has option with visible text selected.
Parameters: text – Exact visible text content.
-
is_multi_select
() → bool¶ Check if this GuiDropDown allows multiple selection of options.
-
select_index
(index: int) → None¶ Select option at given index.
Parameters: index – Target index.
-
select_ordinal
(ordinal: int) → None¶ Select option at given ordinal.
Ordinals are as per human counting. First element is at ordinal 1.
Parameters: ordinal – Target ordinal.
-
select_text
(text: str) → None¶ Select option with given visible text.
Parameters: text – Exact visible text content.
-
select_value
(value: str) → None¶ Select option with given content of value attribute.
Parameters: value – Exact content of value attribute.
-
source
¶ GuiSource for this GuiDropDown (source of root element).
-
text
¶ Visible text of selected option
Note
- You can select an option with visible text of this GuiDropDown too using following Python code:
dropdown.text = "<some_text>"
Method used for this diffent from **select_text**. It uses send_keys to simulate this interaction instead of clicking an option.
Waits for clickability.
ArjunaOption.GUIAUTO_MAX_WAIT in associated configuration is used as the default. Can be overriden using max_wait argument in GuiWidgetDefinition or GNS file.
-
value
¶ Content of value attribute of selected option