Basic GuiWidget Locators

Following are the basic locators supported and corresponding Selenium By locators.

The locator strategy in GNS files is expressed using locator type names supported by Arjuna. These are simple locators and hence are expressed as basic key value pairs, almost equivalent to the way you pass them as keyword arguments in app.element calls. Functionality is equivalent as well.

id Locator

Locates a GuiWidget by the content of its id attribute.

Coded

app.element(id="user_login")

GNS

user_id:
    id: user_login

name Locator

Locates a GuiWidget by the content of its name attribute.

Coded

app.element(name="log")

GNS

user_name:
    name: log

tags Locator

Locates a GuiWidget by the content of its tag name. For more advanced usage, see locator_exts.

Coded

app.element(tags="input")

GNS

user_tag:
    tags: input

classes Locator

Locates a GuiWidget by a class name contained in its class attribute. For more advanced usage, see locator_exts.

Coded

app.element(classes="cls")

GNS

user_class:
    classes: input

xpath Locator

Locates a GuiWidget by the specifield XML Path (xpath).

Coded

app.element(xpath="//*[contains(text(), 'Lost')]")

GNS

lost_pass_text_content:
    xpath: "//*[contains(text(), 'Lost')]"

selector Locator

Locates a GuiWidget by the specifield CSS Selector.

Coded

app.element(selector=".button.button-large")

GNS

button_compound_class:
    selector: ".button.button-large"