arjuna.tpi.guiauto.model.section module

class arjuna.tpi.guiauto.model.section.GuiSection(*args, parent_gui: arjuna.tpi.guiauto.model.gui.Gui, label: str = None, root: LabelOrLocator = None, gns_dir: str = None, gns_file_name: str = None, **kwargs)

Bases: arjuna.tpi.guiauto.model.content.GuiAppContent

Represents a GUI Section i.e. a part of the current page in the Gui.

It is an implementation of GuiAppContent.

Parameters

*args – Any number of positional argumnts. These are passed to the prepare() method if defined in inherited class.

Keyword Arguments
  • parent_gui – (Mandatory) The Gui object that contains this GuiSection.

  • label – Label for the this GuiSection. If not provided, the class name is used as the label.

  • root – Root element of this GuiSection. Can be label string defined in its GNS File or a Locator object.

  • gns_dir – Relative Root Directory for GNS file associated with this GuiSection. Default is page/section directory in associated GuiApp namespace. If provided, it is considered relative to the namespace directory of associated GuiApp.

  • gns_file_name – Name of GNS file associated with this GuiSection. If not provided, default is <label>.yaml.

  • kwargs – Arbitrary keyword arugments. These are passed to the prepare() method if defined in inherited class.

Note

A GuiSection can have a root element. If defined, all locator calls in this object happen as a nested locating call using the root element.

  • Root element provided in __init__ call is given preference.

  • If not provided, Arjuna looks for root definition in load section of its GNS file.

  • If above is also not provided, then locating happens from the root of the DOM of current page.

dropdown(fargs=None, **kwargs) GuiDropDown

Locate a GuiDropDown.

Keyword Arguments
  • fargs – A dictionary of key-value pairs for formatting the GuiWidgetDefinition. Use .format(kwargs).wait_until_absent for more Pythonic code when formatting.

  • **kwargs – Arbitrary key-value pairs used to construct a GuiWidgetDefinition

Returns

GuiDropDown object.

element(*, fargs=None, **kwargs) GuiElement

Locate a GuiElement.

Keyword Arguments
  • fargs – A dictionary of key-value pairs for formatting the GuiWidgetDefinition. Use .format(kwargs).wait_until_absent for more Pythonic code when formatting.

  • **kwargs – Arbitrary key-value pairs used to construct a GuiWidgetDefinition

Returns

GuiElement object.

frame(fargs=None, **kwargs) GuiFrame

Locate a GuiRadioGroup

Keyword Arguments
  • fargs – A dictionary of key-value pairs for formatting the GuiWidgetDefinition. Use .format(kwargs).wait_until_absent for more Pythonic code when formatting.

  • **kwargs – Arbitrary key-value pairs used to construct a GuiWidgetDefinition

Returns

GuiFrame object

locate(locator)

Locate a GuiWidget.

Parameters
  • locatorGuiWidgetDefinition object.

  • Returns – An object of type GuiWidget. Exact object type depends on the value of type attribute in GuiWidgetDefinition.

multi_element(fargs=None, **kwargs) GuiMultiElement

Locate a GuiMultiElement.

Keyword Arguments
  • fargs – A dictionary of key-value pairs for formatting the GuiWidgetDefinition. Use .format(kwargs).wait_until_absent for more Pythonic code when formatting.

  • **kwargs – Arbitrary key-value pairs used to construct a GuiWidgetDefinition

Returns

GuiMultiElement object.

property parent

Parent GUI of this GuiSection.

radio_group(fargs=None, **kwargs) GuiRadioGroup

Locate a GuiRadioGroup

Keyword Arguments
  • fargs – A dictionary of key-value pairs for formatting the GuiWidgetDefinition. Use .format(kwargs).wait_until_absent for more Pythonic code when formatting.

  • **kwargs – Arbitrary key-value pairs used to construct a GuiWidgetDefinition

Returns

GuiRadioGroup object

property source: arjuna.tpi.guiauto.source.element.GuiElementSource

GuiElementSource object for the root element of this GuiSection.

Raises

Exception is raised if root element is not defined.