class Google: def __init__(self): # Create a WebDriver instance for chrome. self.__web_driver = WebDriver(WebDriverType.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.open("https://www.google.com") def click_google_apps_grid_button(self): # It is StaticElement, easyium will wait it to be visible automatically. self.__google_apps_grid_button.click() # Let's return the GoogleAppsList object. return GoogleAppsList(self.__google_apps_list) def quit(self): self.__web_driver.quit()
def __init__(self): # Create a WebDriver instance for chrome. self.__web_driver = WebDriver(WebDriverType.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.open("https://www.google.com")