我能否在没有目标应用程序的情况下运行移动设备上的Appium?

4

由于我工作的平台涉及多个应用程序(而不是单个目标应用程序),我发现选择目标应用程序对我的需求来说效率低下。我想知道是否有什么方法可以避免这种情况。

我想自由运行,向iOS和Android真实设备发送UI命令,包括从另一个应用程序(如Play Store、Apple Store、Test Flight等)安装应用程序。

谢谢帮助,

大卫。

1个回答

2

规则是:每个应用程序只有一个Webdriver实例。

您可以通过确保自动启动设置为false,不设置bundleId或应用程序来运行Appium服务器而没有--app参数。

然后,在客户端/测试框架中,您使用多个Webdrivers,配置为使用不同的期望功能,将其全部绑定到单个测试用例/套件下。

解决方案:

  • You may have a test suite that sets desired_capabilities to launch the Safari app, then you install the app, then you quit the webdriver.

  • Then you change the desired_capabilities to point to the bundle_id of the new app, launch another webdriver instance, do your tests, quit the webdriver..

  • Then you change the desired_capabilities to point to (etc., etc.)

    driver = webdriver.new(url, desired_capabilities)
    // do some stuff
    driver.quit()
    
    desired_capabilities['app'] = 'company.app.com'
    driver = webdriver.new(url, desired_capabilities)
    // do some stuff
    driver.quit()
    
    desired_capabilities['app'] = '/path/to/application.app'
    driver = webdriver.new(url, desired_capabilities)
    // do some stuff
    driver.quit()
    

可以通过自动启动fakse来启动webdriver,只是为了更改设备语言,然后退出。然后再启动一个具有完整功能的新webdrive吗? - andrepm

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接