arjuna.tpi.guiauto.model.content module

class arjuna.tpi.guiauto.model.content.GuiAppContent(*args, automator: GuiAutomator = None, label: str = None, gns_dir: str = None, gns_file_name: str = None, **kwargs)

Bases: arjuna.tpi.guiauto.model.gui.Gui, arjuna.tpi.protocol.screen_shooter.ScreenShooter

Represents content of any type in a GuiApp.

This is the base class for GuiPage, GuiSection and GuiDialog and wraps the underlying GuiAutomator object.

Parameters

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

Keyword Arguments
  • automator – (Mandatory) GuiAutomator object as created by the GuiApp.

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

  • gns_dir – Relative Root Directory for GNS file(s) associated with this GuiAppContent. Default is the GNS directory of parent GuiApp.

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

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

property app

GuiApp associated with this GuiAppContent.

property browser

Browser object in which this GuiAppContent exists.

contains(*, fargs=None, **kwargs)

Check whether this GuiAppContent object contains a GuiWidget. Includes dynamic waiting.

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

Note

By default Wait is done until ArjunaOption.GUIAUTO_MAX_WAIT in the Configuration object associated with this GuiAppContent.

You can pass max_wait argument to change this. Value is considered in seconds.

property def_file_path

Absolute GNS File path associated with this GuiAppContent.

dropdown(fargs=None, **kwargs)

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)

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.

execute_javascript(js, *args)

Inject and Execute JavaScript.

Parameters
  • js – Arbitrary JavaScript

  • *args – Any number of positional arguments used for formatting of JavaScript by underlying automation engine.

formatter(**fargs)arjuna.tpi.guiauto.meta.formatter.GuiWidgetDefinitionFormatter

Create a GuiWidgetDefinitionFormatter object.

Keyword Arguments

**fargs – Arbitrary key-value pairs to be used for formatting identifiers in GuiWidgetDefinition.

property gns

GNS object associated with this GuiAppContent object.

Encapsulates the externlized namespace and all GuiWidget meta data inside it.

go_to_url(url: str = None)

Go to a URL.

This action takes place in the current browser window/tab.

locate(locator) → GuiWidget

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)

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 network_recorder
radio_group(fargs=None, **kwargs)

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

send_keys(key_chord)
set_slomo(*, on=None, interval=None)

(Not Supported Yet) Set Slow Motion mode.

Keyword Arguments
  • on – If True the mode is switched on.

  • interval – Number of seconds between successive actions.

property title

(Not Supported Yet) Title of the window containing this GuiAppContent.

wait_until_absent(*, fargs=None, **kwargs)

Wait until a GuiWidget is absent.

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

Note

By default Wait is done until ArjunaOption.GUIAUTO_MAX_WAIT in the Configuration object associated with this GuiAppContent.

You can pass max_wait argument to change this. Value is considered in seconds.