我的 RF 的 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。
请问是什么问题呢?


↙↙↙阅读原文可查看相关链接,并与作者交流