是否可以自动化在本机应用程序中启动的customTab以便使用appium登录

时间:2019-06-27 12:20:12

标签: python automation appium hybrid-mobile-app appauth

我正在启动我的本机应用程序。进入下一个屏幕后,它将自动启动使用appAuth实现的登录屏幕。通过appAuth,自定义浏览器选项卡将启动以进行登录过程。我想通过输入电子邮件和密码来自动执行此操作。这不是Webview。如何使它自动化?所需的功能是什么,以及如何在customTab中输入邮件和密码。

试图启动本机应用程序并切换上下文,但未成功。

所需功能:

desired_caps = {}
    desired_caps['platformName'] = 'Android'
    # desired_caps['platformVersion'] = '7.1.1'
    desired_caps['deviceName'] = 'Samsung_S9'   # 'F8332'
    desired_caps['automationName'] = 'UiAutomator2'
    desired_caps['noReset'] = False 
    desired_caps['autoGrantPermissions'] = True  # give permission to 
    app for access to device
    desired_caps['appPackage'] = 'com.xxx.personi'   
    desired_caps['appActivity'] = '.ui.splash.SplashActivity'

    # desired_caps['browserName'] = "Chrome"
    desired_caps['chromeOptions']: {'androidPackage': 'com.android.chrome'}

    global driver
    driver = webdriver.Remote('http://127.0.0.1:4452/wd/hub', desired_caps)


    #How to switch from Native to customTab view.
    #


    ----------


Below code  is not working as it is not Webview

    webview = self.driver.contexts[1]
    self.driver.switch_to.context(webview)


0 个答案:

没有答案