Robot Framework SeleniumLibrary
SeleniumLibrary.keywords.formelement.FormElementKeywords Class Reference
Inheritance diagram for SeleniumLibrary.keywords.formelement.FormElementKeywords:
SeleniumLibrary.base.librarycomponent.LibraryComponent SeleniumLibrary.base.context.ContextAware

Public Member Functions

def checkbox_should_be_selected (self, locator)
 Verifies checkbox locator is selected/checked. More...
 
def checkbox_should_not_be_selected (self, locator)
 Verifies checkbox locator is not selected/checked. More...
 
def choose_file (self, locator, file_path)
 Inputs the file_path into file input field locator. More...
 
def input_password (self, locator, password, clear=True)
 Types the given password into text field identified by locator. More...
 
def input_text (self, locator, text, clear=True)
 Types the given text into text field identified by locator. More...
 
def page_should_contain_button (self, locator, message=None, loglevel='TRACE')
 Verifies button locator is found from current page. More...
 
def page_should_contain_checkbox (self, locator, message=None, loglevel='TRACE')
 Verifies checkbox locator is found from current page. More...
 
def page_should_contain_radio_button (self, locator, message=None, loglevel='TRACE')
 Verifies radio button locator is found from current page. More...
 
def page_should_contain_textfield (self, locator, message=None, loglevel='TRACE')
 Verifies text field locator is found from current page. More...
 
def page_should_not_contain_button (self, locator, message=None, loglevel='TRACE')
 Verifies button locator is not found from current page. More...
 
def page_should_not_contain_checkbox (self, locator, message=None, loglevel='TRACE')
 Verifies checkbox locator is not found from current page. More...
 
def page_should_not_contain_radio_button (self, locator, message=None, loglevel='TRACE')
 Verifies radio button locator is not found from current page. More...
 
def page_should_not_contain_textfield (self, locator, message=None, loglevel='TRACE')
 Verifies text field locator is not found from current page. More...
 
def radio_button_should_be_set_to (self, group_name, value)
 Verifies radio button group group_name is set to value. More...
 
def radio_button_should_not_be_selected (self, group_name)
 Verifies radio button group group_name has no selection. More...
 
def select_checkbox (self, locator)
 Selects checkbox identified by locator. More...
 
def select_radio_button (self, group_name, value)
 Sets radio button group group_name to value. More...
 
def submit_form (self, locator=None)
 Submits a form identified by locator. More...
 
def textarea_should_contain (self, locator, expected, message=None)
 Verifies text area locator contains text expected. More...
 
def textarea_value_should_be (self, locator, expected, message=None)
 Verifies text area locator has exactly text expected. More...
 
def textfield_should_contain (self, locator, expected, message=None)
 Verifies text field locator contains text expected. More...
 
def textfield_value_should_be (self, locator, expected, message=None)
 Verifies text field locator has exactly text expected. More...
 
def unselect_checkbox (self, locator)
 Removes selection of checkbox identified by locator. More...
 
- Public Member Functions inherited from SeleniumLibrary.base.librarycomponent.LibraryComponent
def assert_page_contains (self, locator, tag=None, message=None, loglevel='TRACE')
 
def assert_page_not_contains (self, locator, tag=None, message=None, loglevel='TRACE')
 
def debug (self, msg, html=False)
 
def get_timeout (self, timeout=None)
 
def info (self, msg, html=False)
 
def log (self, msg, level='INFO', html=False)
 
def log_source (self, loglevel='INFO')
 
def warn (self, msg, html=False)
 
- Public Member Functions inherited from SeleniumLibrary.base.context.ContextAware
def __init__ (self, ctx)
 Base class exposing attributes from the common context. More...
 
def find_element (self, locator, tag=None, required=True, parent=None)
 Find element matching locator. More...
 
def find_elements (self, locator, tag=None, parent=None)
 Find all elements matching locator. More...
 
def is_element_enabled (self, locator, tag=None)
 
def is_text_present (self, text)
 
def is_visible (self, locator)
 

Private Member Functions

def _get_checkbox (self, locator)
 
def _get_radio_button_with_value (self, group_name, value)
 
def _get_radio_buttons (self, group_name)
 
def _get_value (self, locator, tag)
 
def _get_value_from_radio_buttons (self, elements)
 
def _input_text_into_text_field (self, locator, text, clear)
 

Additional Inherited Members

- Public Attributes inherited from SeleniumLibrary.base.context.ContextAware
 ctx
 
- Properties inherited from SeleniumLibrary.base.librarycomponent.LibraryComponent
 log_dir = property
 
- Properties inherited from SeleniumLibrary.base.context.ContextAware
 driver = property
 
 drivers = property
 
 element_finder = property
 

Detailed Description

Definition at line 24 of file formelement.py.

Member Function Documentation

◆ _get_checkbox()

def SeleniumLibrary.keywords.formelement.FormElementKeywords._get_checkbox (   self,
  locator 
)
private

Definition at line 387 of file formelement.py.

◆ _get_radio_button_with_value()

def SeleniumLibrary.keywords.formelement.FormElementKeywords._get_radio_button_with_value (   self,
  group_name,
  value 
)
private

Definition at line 399 of file formelement.py.

◆ _get_radio_buttons()

def SeleniumLibrary.keywords.formelement.FormElementKeywords._get_radio_buttons (   self,
  group_name 
)
private

Definition at line 390 of file formelement.py.

◆ _get_value()

def SeleniumLibrary.keywords.formelement.FormElementKeywords._get_value (   self,
  locator,
  tag 
)
private

Definition at line 384 of file formelement.py.

◆ _get_value_from_radio_buttons()

def SeleniumLibrary.keywords.formelement.FormElementKeywords._get_value_from_radio_buttons (   self,
  elements 
)
private

Definition at line 409 of file formelement.py.

◆ _input_text_into_text_field()

def SeleniumLibrary.keywords.formelement.FormElementKeywords._input_text_into_text_field (   self,
  locator,
  text,
  clear 
)
private

Definition at line 415 of file formelement.py.

◆ checkbox_should_be_selected()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.checkbox_should_be_selected (   self,
  locator 
)

Verifies checkbox locator is selected/checked.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 47 of file formelement.py.

◆ checkbox_should_not_be_selected()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.checkbox_should_not_be_selected (   self,
  locator 
)

Verifies checkbox locator is not selected/checked.

    See the `Locating elements` section for details about the locator
    syntax..

Definition at line 60 of file formelement.py.

◆ choose_file()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.choose_file (   self,
  locator,
  file_path 
)

Inputs the file_path into file input field locator.

    This keyword is most often used to input files into upload forms.
    The file specified with ``file_path`` must be available on machine
    where tests are executed. When using Selenium Grid, Seleniun will,
    [https://seleniumhq.github.io/selenium/docs/api/py/webdriver_remote/selenium.webdriver.remote.command.html?highlight=upload#selenium.webdriver.remote.command.Command.UPLOAD_FILE|magically],
    transfer the file from the machine where test are executed
    to the Selenium Grid node where the browser is running.
    Then Selenium will send the file path, from to node file
    system, to the browser.

    Example:
    | `Choose File` | my_upload_field | ${CURDIR}/trades.csv |

Definition at line 209 of file formelement.py.

◆ input_password()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.input_password (   self,
  locator,
  password,
  clear = True 
)

Types the given password into text field identified by locator.

    See the `Locating elements` section for details about the locator
    syntax. See `Input Text` for ``clear`` argument details.

    Difference compared to `Input Text` is that this keyword does not
    log the given password on the INFO level. Notice that if you use
    the keyword like

    | Input Password | password_field | password |

    the password is shown as a normal keyword argument. A way to avoid
    that is using variables like

    | Input Password | password_field | ${PASSWORD} |

    Notice also that SeleniumLibrary logs all the communication with
    browser drivers using the DEBUG level, and the actual password can
    be seen there. Additionally Robot Framework logs all arguments using
    the TRACE level. Tests must thus not be executed using level below
    INFO if password should not be logged in any format.

    The `clear` argument is new in SeleniumLibrary 4.0

Definition at line 240 of file formelement.py.

◆ input_text()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.input_text (   self,
  locator,
  text,
  clear = True 
)

Types the given text into text field identified by locator.

    When ``clear`` is true, the input element is cleared before
    text is typed to the element. When false, the previous text
    is not cleared from the element. Use `Input Password` if you
    do not want the given ``text`` to be logged.

    See the `Locating elements` section for details about the locator
    syntax. See the `Boolean arguments` section how Boolean values are
    handled.

    The `clear` argument is new in SeleniumLibrary 4.0

Definition at line 258 of file formelement.py.

◆ page_should_contain_button()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.page_should_contain_button (   self,
  locator,
  message = None,
  loglevel = 'TRACE' 
)

Verifies button locator is found from current page.

    See `Page Should Contain Element` for explanation about ``message``
    and ``loglevel`` arguments.

    See the `Locating elements` section for details about the locator
    syntax. When using the default locator strategy, buttons are
    searched using ``id``, ``name`` and ``value``.

Definition at line 364 of file formelement.py.

◆ page_should_contain_checkbox()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.page_should_contain_checkbox (   self,
  locator,
  message = None,
  loglevel = 'TRACE' 
)

Verifies checkbox locator is found from current page.

    See `Page Should Contain Element` for explanation about ``message``
    and ``loglevel`` arguments.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 76 of file formelement.py.

◆ page_should_contain_radio_button()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.page_should_contain_radio_button (   self,
  locator,
  message = None,
  loglevel = 'TRACE' 
)

Verifies radio button locator is found from current page.

    See `Page Should Contain Element` for explanation about ``message``
    and ``loglevel`` arguments.

    See the `Locating elements` section for details about the locator
    syntax. When using the default locator strategy, radio buttons are
    searched using ``id``, ``name`` and ``value``.

Definition at line 129 of file formelement.py.

◆ page_should_contain_textfield()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.page_should_contain_textfield (   self,
  locator,
  message = None,
  loglevel = 'TRACE' 
)

Verifies text field locator is found from current page.

    See `Page Should Contain Element` for explanation about ``message``
    and ``loglevel`` arguments.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 271 of file formelement.py.

◆ page_should_not_contain_button()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.page_should_not_contain_button (   self,
  locator,
  message = None,
  loglevel = 'TRACE' 
)

Verifies button locator is not found from current page.

    See `Page Should Contain Element` for explanation about ``message``
    and ``loglevel`` arguments.

    See the `Locating elements` section for details about the locator
    syntax. When using the default locator strategy, buttons are
    searched using ``id``, ``name`` and ``value``.

Definition at line 380 of file formelement.py.

◆ page_should_not_contain_checkbox()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.page_should_not_contain_checkbox (   self,
  locator,
  message = None,
  loglevel = 'TRACE' 
)

Verifies checkbox locator is not found from current page.

    See `Page Should Contain Element` for explanation about ``message``
    and ``loglevel`` arguments.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 88 of file formelement.py.

◆ page_should_not_contain_radio_button()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.page_should_not_contain_radio_button (   self,
  locator,
  message = None,
  loglevel = 'TRACE' 
)

Verifies radio button locator is not found from current page.

    See `Page Should Contain Element` for explanation about ``message``
    and ``loglevel`` arguments.

    See the `Locating elements` section for details about the locator
    syntax. When using the default locator strategy, radio buttons are
    searched using ``id``, ``name`` and ``value``.

Definition at line 142 of file formelement.py.

◆ page_should_not_contain_textfield()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.page_should_not_contain_textfield (   self,
  locator,
  message = None,
  loglevel = 'TRACE' 
)

Verifies text field locator is not found from current page.

    See `Page Should Contain Element` for explanation about ``message``
    and ``loglevel`` arguments.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 283 of file formelement.py.

◆ radio_button_should_be_set_to()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.radio_button_should_be_set_to (   self,
  group_name,
  value 
)

Verifies radio button group group_name is set to value.

    ``group_name`` is the ``name`` of the radio button group.

Definition at line 151 of file formelement.py.

◆ radio_button_should_not_be_selected()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.radio_button_should_not_be_selected (   self,
  group_name 
)

Verifies radio button group group_name has no selection.

    ``group_name`` is the ``name`` of the radio button group.

Definition at line 166 of file formelement.py.

◆ select_checkbox()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.select_checkbox (   self,
  locator 
)

Selects checkbox identified by locator.

    Does nothing if checkbox is already selected.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 99 of file formelement.py.

◆ select_radio_button()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.select_radio_button (   self,
  group_name,
  value 
)

Sets radio button group group_name to value.

    The radio button to be selected is located by two arguments:
    - ``group_name`` is the name of the radio button group.
    - ``value`` is the ``id`` or ``value`` attribute of the actual
      radio button.

    Examples:
    | `Select Radio Button` | size    | XL    |
    | `Select Radio Button` | contact | email |

Definition at line 187 of file formelement.py.

◆ submit_form()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.submit_form (   self,
  locator = None 
)

Submits a form identified by locator.

    If ``locator`` is not given, first form on the page is submitted.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 34 of file formelement.py.

◆ textarea_should_contain()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.textarea_should_contain (   self,
  locator,
  expected,
  message = None 
)

Verifies text area locator contains text expected.

    ``message`` can be used to override default error message.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 328 of file formelement.py.

◆ textarea_value_should_be()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.textarea_value_should_be (   self,
  locator,
  expected,
  message = None 
)

Verifies text area locator has exactly text expected.

    ``message`` can be used to override default error message.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 345 of file formelement.py.

◆ textfield_should_contain()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.textfield_should_contain (   self,
  locator,
  expected,
  message = None 
)

Verifies text field locator contains text expected.

    ``message`` can be used to override the default error message.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 294 of file formelement.py.

◆ textfield_value_should_be()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.textfield_value_should_be (   self,
  locator,
  expected,
  message = None 
)

Verifies text field locator has exactly text expected.

    ``message`` can be used to override default error message.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 311 of file formelement.py.

◆ unselect_checkbox()

def SeleniumLibrary.keywords.formelement.FormElementKeywords.unselect_checkbox (   self,
  locator 
)

Removes selection of checkbox identified by locator.

    Does nothing if the checkbox is not selected.

    See the `Locating elements` section for details about the locator
    syntax.

Definition at line 113 of file formelement.py.


The documentation for this class was generated from the following file: