#2 楼 @seveniruby 我的 testcase 关键字之间传递参数出现问题,能否帮忙看下,谢谢:
testcase_
open app
sleep 10s
${driver} = open app
sleep 10s
click button ${driver}
脚本是这样的:
def open_app():
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.2'
desired_caps['deviceName'] = 'Android Emulator'
desired_caps['appPackage'] = 'com.xxx.xxx'
desired_caps['appActivity'] = '.activity.xxxActivity'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
sleep(10)
return driver
def click_button(dr):
radio_setting = dr.find_element_by_id('com.xxx.xxx:id/radio_setting')
radio_setting.click()
执行时,第一步 open app 通过,到了 click button 报错:error: Failed to start an Appium session, err was: Error: Requested a new session but one was in progress。请问是什么问题呢?
#1 楼 @yangyajie_002 发现是 app 程序本身的问题打不开,谢谢啦
#9 楼 @lihuazhang 谢谢,还是出现 Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity 错误.....
我的.apk 路径填的是本地的一个 apk 文件,模拟器上已安装此.apk,是否应该填写模拟器上.apk 的路径?
#6 楼 @lihuazhang 在 manifest.xml 里,这个 activity 有 和 标签,应该是这个 activity 吗?
另外,在 hierachy viewer 中看到第一个出现的 activity 是:com.tencent.news/com.tencent.news.activity.SplashActicvity, 前面是我填的 package 名,请问 activity 名应该填:‘.SpalshActivity’ 还是 ‘.activity.SplashActicvity’,或者是别的?
谢谢!