Group Interface

Warning

The following link presents auto-generated interface documentation for the abstract Element class.

This documentation is essential because it provides a comprehensive overview of all available methods for the Element and Group objects as well.

For the actual method signatures, please refer to the mops.base.group.Group class.

The Group class is a fundamental building block for creating Page Object Models (POM) in web testing. It provides a comprehensive set of methods, identical to the Element class.

Refer to the Element Interface for available APIs.

class mops.base.group.Group(*args: Any, **kwargs: Any)[source]

Represents a group of Element.

The Group class is an independent class that can be used to manage a collection of Element objects.

However, it can be imported and defined as a class variable within a Page or another Group class. This allows grouping elements together and interacting with them collectively.

This class provides functionality for handling element locators, initialization with respect to the driver, and managing sub-elements within the group.

__init__(locator: Locator | str, name: str = '', parent: Group | Element | bool = None, wait: bool | None = None, driver_wrapper: DriverWrapper | Any = None)[source]

Initialize a group of elements based on the current driver.

If no driver is provided, the initialization will be skipped until

handled by a Page or Group class.

The Group class is designed to represent a container for other elements,

with specific methods to manage child elements, locator handling, and initialization with respect to the driver.

Parameters:
  • locator (Union[Locator, str]) – The anchor locator for the group. .LocatorType is optional.

  • name (str) – The name of the group, used for logging and identification purposes.

  • parent (Union[Group, Element, bool]) – The parent group. Provide False to skip the association.

  • wait (Optional[bool]) – If set to True, the entire group will be checked as part of the wait_page_loaded and is_page_opened methods in the Page.

  • driver_wrapper (Union[DriverWrapper, Any]) – The DriverWrapper instance or an object containing it to be used for entire group.