在执行完20多Case之后开始出现page destroyed,然后后续的Case也无法正常获取元素
可以确认的是小程序源代码本身在测试期间没有任何改动
[E 2024-01-18 18:46:23,428 minium.Conn8160 connection#657 __on_message] [5b345e7d-424b-4bc6-b1f2-dad416199a88]: page destroyed
[E 2024-01-18 18:46:23,694 minium.Conn8160 connection#657 __on_message] [f953fc68-2cd9-4750-acbf-acaa4ad8588f]: page destroyed
[E 2024-01-18 18:46:23,954 minium.Conn8160 connection#657 __on_message] [2f518df0-d5d3-427b-8ec0-04cc236eb598]: page destroyed
[E 2024-01-18 18:46:24,221 minium.Conn8160 connection#657 __on_message] [42384ff6-17b3-4466-b1b2-a26f042891dd]: page destroyed
[E 2024-01-18 18:46:24,483 minium.Conn8160 connection#657 __on_message] [913b325a-f29d-4e88-8ece-5718a53d5c42]: page destroyed
[E 2024-01-18 18:46:24,748 minium.Conn8160 connection#657 __on_message] [6127e0d3-ebb2-48c2-9efe-83e4a9946a43]: page destroyed
[E 2024-01-18 18:46:25,015 minium.Conn8160 connection#657 __on_message] [de9e6ba0-4668-44f2-9917-4a747a13d223]: page destroyed
[E 2024-01-18 18:46:25,277 minium.Conn8160 connection#657 __on_message] [d2a1c5b3-205b-4dd7-9ebc-458b346102f6]: page destroyed
[E 2024-01-18 18:46:25,540 minium.Conn8160 connection#657 __on_message] [6560d4f0-d4d7-49e5-b18c-e39e70362b36]: page destroyed
[E 2024-01-18 18:46:25,806 minium.Conn8160 connection#657 __on_message] [46ea5a8e-42a3-4c42-96e9-2bc94d320492]: page destroyed
[E 2024-01-18 18:46:26,070 minium.Conn8160 connection#657 __on_message] [a088849d-bca9-41e8-8220-6a37ea8fc84c]: page destroyed
[E 2024-01-18 18:46:26,334 minium.Conn8160 connection#657 __on_message] [72801f16-0271-4504-b93f-e8b3a82f37d4]: page destroyed
[E 2024-01-18 18:46:26,597 minium basedef#134 tap] 找不到该元素//text[contains(@class,'iconfont sp_weapp_iconguanbi1')],无法点击!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[E 2024-01-18 18:46:26,600 minium.Conn8160 connection#657 __on_message] [9ea3ddbe-df11-4d89-860c-20a31b48ea5f]: page destroyed
[E 2024-01-18 18:46:26,861 minium.Conn8160 connection#657 __on_message] [47390b46-0057-4580-a8d4-be5de56b622e]: page destroyed
[E 2024-01-18 18:46:27,124 minium.Conn8160 connection#657 __on_message] [9c6688a1-a93f-4aee-b148-c27a7ad84288]: page destroyed
[E 2024-01-18 18:46:27,390 minium.Conn8160 connection#657 __on_message] [172bf0b2-1eb0-4076-8e5c-f2f5298d23e9]: page destroyed
[E 2024-01-18 18:46:27,649 minium.Conn8160 connection#657 __on_message] [e8891d09-6047-42f6-8354-b84ca16d7f1e]: page destroyed
[E 2024-01-18 18:46:27,917 minium.Conn8160 connection#657 __on_message] [a4cb36a1-e78a-4aac-8e94-49e76765241f]: page destroyed
[E 2024-01-18 18:46:28,180 minium.Conn8160 connection#657 __on_message] [7b2d825e-15a3-4879-a00c-5aecf09d97b9]: page destroyed
[E 2024-01-18 18:46:28,436 minium.Conn8160 connection#657 __on_message] [91ee9842-a28e-4d9c-b449-c89609f87a51]: page destroyed
[E 2024-01-18 18:46:28,704 minium.Conn8160 connection#657 __on_message] [bc4aad24-1d69-4a5b-b6ae-6523f27b52ed]: page destroyed
[E 2024-01-18 18:46:28,966 minium.Conn8160 connection#657 __on_message] [80bfcb3f-f084-4700-9dc7-6d559c6832af]: page destroyed
[E 2024-01-18 18:46:29,235 minium.Conn8160 connection#657 __on_message] [1598b8a8-c22b-4552-bafc-00f6519e0b6a]: page destroyed
这里minium版本是怎样的呢?具体case能截取出来看看?
如果是使用self.page.get_element操作的话,应该是会针对page destoryed做一次get_current_page操作来强制更新当前页面实例的
case大致代码请看分割线前半部分
所要点击的元素://text[contains(@class, 'iconfont sp_weapp_iconguanbi1')]
config.json请看分割线后半部分
def tap(self, element, max_timeout=15):
"""
:param max_timeout:
:param element: 要点击的元素
:return:
"""
sleep(1)
try:
for i in range(10):
ele = self.page.wait_for(element, max_timeout=max_timeout)
if ele:
self.logger.info(f"目前在点击元素{element},点击方式Tap")
ele_tap = self.page.get_element(element, max_timeout=max_timeout)
ele_tap.tap()
sleep(0.7)
return
else:
self.mini.logger.error(f"找不到该元素{element},无法点击!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
# 最后再次尝试点击
self.page.get_element(element, max_timeout=max_timeout).tap()
except Exception as e:
self.mini.logger.error(f"找不到该元素{element},无法输入!!!,,报错原因: {e}")
raise e
---------------------------------------------------------------------
[
{
"project_path": "D:\\Project\\sopei-other\\fronted\\weapp_u_sopei_cn",
"dev_tool_path": "D:\\Software\\微信web开发者工具\\cli.bat",
"debug_mode": "info",
"outputs": ".\\Outputs\\wx_u_report",
"platform": "ide",
"app": "wx",
"debug": false,
"close_ide": true,
"full_reset": true,
"test_port": 9420,
"assert_capture": true,
"auto_relaunch": false,
"enable_app_log": false,
"use_push": true
}
]