用genymotion Android6.0 和Android8.0 微信7.0.15 总是打开小程序雪球后就闪退,有没有官方模拟器测的更稳定的版本,另外还有一个问题,Android8.0无法用uiautomatorviewer,会报错,有什么办法解决,代码如下:
class TestWxMicro:
def setup(self):
desire_caps = {
“platformName”: ‘android’,
“deviceName”: ‘192.168.216.103:5555’,
“appPackage”: ‘com.tencent.mm’,
“appActivity”: ‘com.tencent.mm.ui.LauncherUI’,
“noReset”: ‘true’,
‘unicodeKeyBoard’: ‘true’,
‘resetKeyBoard’: ‘true’,
“ChromedriverExecutable”: “D:/Study/Automation_Tester_Guide/Lesson6_appium/chromedriver”,
“chromeOptions”: {‘androidProcess’: ‘com.tencent.mm:appbrand0’}
# “adbPort”:5038
}
self.driver = webdriver.Remote(“http://127.0.0.1:4723/wd/hub”, desire_caps)
self.driver.implicitly_wait(30)
self.driver.find_element(By.XPATH,"//*[@text='Contacts']")
self.driver.implicitly_wait(10)
def teardown(self):
pass
def test_search1(self):
self.driver.find_element_by_xpath("//*[@text='Contacts']")
size = self.driver.get_window_size()
width = size.get("width")
height = size.get("height")
self.driver.swipe((width / 2), int((height * 0.2)), (width / 2), (height * 0.8), 2000)
self.driver.find_element_by_xpath("//*[@resource-id='com.tencent.mm:id/ipm' and @text='雪球']").click()
print(self.driver.contexts, '第一次打印')
self.driver.find_element_by_xpath("//*[@content-desc='搜索股票信息/代码']/..").click()