Ejemplo n.º 1
0
    def __init__(self):
        # Create a WebDriver instance for chrome.
        self._web_driver = Chrome()

        # The google apps grid button is in the top-right.
        # This button is always in the page, so it is StaticElement.
        self._google_apps_grid_button = StaticElement(self._web_driver,
                                                      "class=gb_b")

        # After clicked the google apps grid button, the google apps list will be shown.
        # This list is always in the page, although it is invisible, it is StaticElement.
        self._google_apps_list = StaticElement(self._web_driver, "class=gb_ha")

        # Currently the StaticElement does not refer to WebElement in Browser,
        # so open url here is fine.
        self._web_driver.get("https://www.google.com")
Ejemplo n.º 2
0
    def __init__(self, element):
        self.__element = element

        # This locator is relative to parent.
        self.__name = StaticElement(self.__element, "class=gb_4")