jiuka.selenium.selenium_fill (0.0.2) — module

Fill forms in a selenium browser.

| "added in version" 0.0.1 of jiuka.selenium"

Authors: Marius Rieder (@Jiuka)

preview | supported by community

Install collection

Install with ansible-galaxy collection install jiuka.selenium:==0.0.2


Add to requirements.yml

  collections:
    - name: jiuka.selenium
      version: 0.0.2

Description

Fills in forms in a selenium session.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Fill the Search field of the Ansible Documentation
  selenium_fill:
    session: '{{ selenium.session }}'
    fill:
      - xpath: "//input[@name='q']"
        value: Selenium
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Fill out the login form
  selenium_fill:
    session: '{{ selenium.session }}'
    fill:
      - id: login_field
        value: alice
      - id: password
        value: bob4ever

Inputs

    
fill:
    description: List of thinks to fill out.
    elements: dict
    required: true
    suboptions:
      class_name:
        description: Finds the element to fill in by class name.
        type: str
      css_selector:
        description: Finds the element to fill in by css selector.
        type: str
      id:
        description: Finds the element to fill in by id.
        type: str
      link_text:
        description: Finds the element to fill in by link_text.
        type: str
      name:
        description: Finds the element to fill in by name.
        type: str
      partial_link_text:
        description: Finds the element to fill in by a partial match of its link text.
        type: str
      tag_name:
        description: Finds the element to fill in by tag name.
        type: str
      value:
        description: Value to fill in.
        required: true
        type: str
      xpath:
        description: Finds the element to fill in by xpath.
        type: str
    type: list

session:
    description:
    - Session to try to reconnect to.
    - If not specified, the value of environment variable C(SELENIUM_SESSION) will be
      used instead.
    type: str

executor:
    description:
    - URL of the Selenium server.
    - If not specified, the value of environment variable C(SELENIUM_EXECUTOR) will be
      used instead.
    type: str

headless:
    description:
    - If the Browser should be headless.
    - C(FIREFOX) and C(CHROME) only.
    required: false
    type: bool

capabilities:
    description:
    - Name of the browser to use as capabilities.
    - If not specified, the value of environment variable C(SELENIUM_BROWSER) will be
      used instead.

Outputs

browser:
  description: Name of the Selenium browser used.
  returned: always
  type: str
executor:
  description: URL of the Selenium executor used
  returned: always
  type: str
session:
  description: Selenium session id.
  returned: always
  type: str