class BasePage(object): def __init__(self): self.driver = AndroidClient().driver def find(self, kv) -> WebElement: return self.driver.find_element(*kv) def back(self): self.driver.back()
def main(cls): # 这里要改成cls,不应该是self AndroidClient.restart_app() return MainPage()
def main(self): AndroidClient.restart_app() return MainPage()
def main(cls): AndroidClient.restartApp() return MainPage()
def __init__(self): self.driver = AndroidClient().driver
def __init__(self): AndroidClient.restart_app()
from page_object.driver.AndroidClient import AndroidClient Mi = AndroidClient().installAPP() Mi.find_element_by_xpath()