lib/pages/mobile_authorize_page.py:21: in authorize self.native.allow_get_user_phone() ../lib/python3.8/site-packages/minium/native/wx_native/androidnative.py:246: in allow_get_user_phone self.allow_authorize(answer) ../lib/python3.8/site-packages/minium/native/wx_native/androidnative.py:194: in allow_authorize return self._handle_btn("允许") ../lib/python3.8/site-packages/minium/native/wx_native/androidnative.py:263: in _handle_btn ret = do() ../lib/python3.8/site-packages/minium/native/wx_native/androidnative.py:260: in do return self.e.cls_name("android.widget.Button").focusable(True).text(btn_text).click_if_exists(timeout) ../lib/python3.8/site-packages/minium/native/lib/at/core/element.py:739: in click_if_exists if self.exists(0.5): ../lib/python3.8/site-packages/minium/native/lib/at/core/element.py:773: in exists return self.wait_exists(seconds) ../lib/python3.8/site-packages/minium/native/lib/at/core/element.py:461: in wait_exists uiview = self.get_view(timeout=0.5) ../lib/python3.8/site-packages/minium/native/lib/at/core/element.py:445: in get_view view = self._get_view() ../lib/python3.8/site-packages/minium/native/lib/at/core/element.py:428: in _get_view for ui_view_list in self.jd.dump_all_views(): ../lib/python3.8/site-packages/minium/native/lib/at/core/javadriver.py:338: in dump_all_views res = self.request_at_device("dumpXmls", []) ../lib/python3.8/site-packages/minium/native/lib/at/core/javadriver.py:383: in request_at_device return self.request_action(self.ACTION_AT_DEVICE, method, params) ../lib/python3.8/site-packages/minium/native/lib/at/core/javadriver.py:371: in request_action return self.request_java(action, params) ../lib/python3.8/site-packages/minium/native/lib/at/core/javadriver.py:453: in request_java return self.do_request(action, http_params, **kwargs) ../lib/python3.8/site-packages/minium/native/lib/at/core/basedriver.py:161: in do_request ret = self.request(method.lower(), url, http_params, timeout=timeout, **kwargs) ../lib/python3.8/site-packages/minium/native/lib/at/core/basedriver.py:178: in request res = session.request(method, url, params=params, **kwargs) ../lib/python3.8/site-packages/requests/sessions.py:529: in request resp = self.send(prep, **send_kwargs) ../lib/python3.8/site-packages/requests/sessions.py:645: in send r = adapter.send(request, **kwargs) 真机调用allow_get_user_phone报错,是哪里调用的不对?
minium如何在ide上自动处理手机号授权问题?执行自动化测试时,跳出来手机号授权对话框,请问用什么方法可以处理掉啊?(是ide模式下的,谢谢)。 如图: [图片]
2022-03-14直接传xpath了只能
minium 通过xpath判断元素是否存在?def element_is_exists( self, selector: str = None, max_timeout: int = 10, inner_text=None, text_contains=None, value=None, xpath: str = None, ) -> bool: """ 查询元素是否存在 :param selector: :param max_timeout: 超时时间 :param inner_text: inner_text :param value: value :param text_contains: 包含的文字 :param xpath: 使用xpath :return: bool """ if selector and selector.startswith("/"): # 以/或//开头的认为是xpath xpath = selector selector = None return self._wait( lambda: self._element_is_exists( selector, xpath, inner_text=inner_text, value=value, text_contains=text_contains ), max_timeout, ) 如果使用了带()的xpath,这个方法就走selector了,存在问题的吧
2022-03-14子元素可能只能用get_element找,只能是css selector。xpath找子元素从1.2.2版本来看我没找到。
minium里面关于查找子元素的问题?使用xpath找到了元素之后,如果我想要通过这个元素再寻找它下面的子元素,可以使用什么方法?看代码,好像出来的baseelement有一个get_css_selector的方法,但是传css selector进去,又说找不到。有没有使用过的同学解答下,谢谢。
2022-03-11