在 qmetry 中的驱动程序之间来回切换 [英] Switch back and forth between drivers in qmetry

查看:40
本文介绍了在 qmetry 中的驱动程序之间来回切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在多个驱动程序之间切换以执行测试.例如启动 android 应用程序,执行一些步骤并在桌面浏览器中进行验证.完成后,切换回 android 应用程序并继续其余流程.可能有多个实例,我必须在多个驱动程序之间切换

I have a requirement where I want to switch between multiple drivers to execute tests. For e.g. Launch android app, perform some steps and do the validation in desktop browser. Once done, switch back to android app and continue with rest of the flow. There can be multiple instances, where I have to switch between multiple drivers

推荐答案

使用QAFTestBasesetDriver方法切换驱动程序.

Use setDriver method of QAFTestBase to swich between drivers.

QAFTestBase testBase = getTestBase(); //TestBaseProvider.instance().get()
//switch to another driver
testBase.setDriver("firefoxDriver");
//do the needfull
testBase.setDriver("appiumDriver");
//switch back to mobile driver

参考类似问题的答案来自 QAF 的注释.

这篇关于在 qmetry 中的驱动程序之间来回切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆