- minium如何处理webview的内容?
ide模式下,是不是无法定位webview中的元素的额?
2022-03-18 - minium开启真机远程调试模式链接断开?
minium版本:v1.2.2 android 手机系统: 11 日志: 2022-03-15 10:13:25 [INFO] ['bad053a4'] (adbwrap.py:152) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 shell pm path com.tencent.mm.atstub.test (adbwrap.py:219) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 shell ls /data/app/~~HOXm_oGc4g4PZdds_Xf6fQ==/com.tencent.mm.atstub.test-98vJ-05ZRMFXryX9vX9_eA==/base.apk (adbwrap.py:219) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 pull /data/app/~~HOXm_oGc4g4PZdds_Xf6fQ==/com.tencent.mm.atstub.test-98vJ-05ZRMFXryX9vX9_eA==/base.apk /var/folders/yt/jpd32549509g18s4fb0nxqbh0000gn/T/temp.apk (adbwrap.py:219) 2022-03-15 10:13:25 [INFO] com.tencent.mm.atstub.test check result:True (adbwrap.py:1238) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 shell pm path com.tencent.mm.atstub (adbwrap.py:219) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 shell ls /data/app/~~Idav1lhsZNcFlT6fqMoO5g==/com.tencent.mm.atstub-ZQQZ3bkaT05St6h4Vpc2Eg==/base.apk (adbwrap.py:219) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 pull /data/app/~~Idav1lhsZNcFlT6fqMoO5g==/com.tencent.mm.atstub-ZQQZ3bkaT05St6h4Vpc2Eg==/base.apk /var/folders/yt/jpd32549509g18s4fb0nxqbh0000gn/T/temp.apk (adbwrap.py:219) 2022-03-15 10:13:25 [INFO] com.tencent.mm.atstub check result:True (adbwrap.py:1238) 2022-03-15 10:13:25 [INFO] 环境检查OK! (command_line.py:23) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 shell pm list packages (adbwrap.py:219) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 shell pm list packages (adbwrap.py:219) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 forward tcp:63258 tcp:9999 (adbwrap.py:219) 2022-03-15 10:13:25 [DEBUG] true_or_false:False (basedriver.py:83) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 shell ps (adbwrap.py:219) 2022-03-15 10:13:25 [DEBUG] adb -s bad053a4 shell ps -A (adbwrap.py:219) 2022-03-15 10:13:26 [INFO] adb -s bad053a4 shell am instrument -w -r -e class 'com.tencent.mm.atstub.atserver.StubRunner#testStartServer' com.tencent.mm.atstub.test/androidx.test.runner.AndroidJUnitRunner (javadriver.py:236) 2022-03-15 10:13:27 [DEBUG] java print:INSTRUMENTATION_STATUS: class=com.tencent.mm.atstub.atserver.StubRunner (javadriver.py:283) 2022-03-15 10:13:27 [DEBUG] java print:INSTRUMENTATION_STATUS: current=1 (javadriver.py:283) 2022-03-15 10:13:27 [DEBUG] java print:INSTRUMENTATION_STATUS: id=AndroidJUnitRunner (javadriver.py:283) 2022-03-15 10:13:27 [DEBUG] java print:INSTRUMENTATION_STATUS: numtests=1 (javadriver.py:283) 2022-03-15 10:13:27 [DEBUG] java print:INSTRUMENTATION_STATUS: stream= (javadriver.py:283) 2022-03-15 10:13:27 [DEBUG] java print:com.tencent.mm.atstub.atserver.StubRunner: (javadriver.py:283) 2022-03-15 10:13:27 [DEBUG] true_or_false:True (basedriver.py:83) 2022-03-15 10:13:27 [DEBUG] java print:INSTRUMENTATION_STATUS: test=testStartServer (javadriver.py:283) 2022-03-15 10:13:27 [DEBUG] java print:INSTRUMENTATION_STATUS_CODE: 1 (javadriver.py:283) 2022-03-15 10:13:29 [DEBUG] adb -s bad053a4 shell am start -W -n com.tencent.mm.atstub/.ui.LauncherUI (adbwrap.py:219) 2022-03-15 10:13:29 [DEBUG] Starting: Intent { cmp=com.tencent.mm.atstub/.ui.LauncherUI } Status: ok LaunchState: WARM Activity: com.tencent.mm.atstub/.ui.LauncherUI TotalTime: 641 WaitTime: 706 Complete (adbwrap.py:765) 2022-03-15 10:13:29 [DEBUG] wait_for_ui_ready start (javadriver.py:206) 2022-03-15 10:13:29 [DEBUG] id=140411163892656, http://127.0.0.1:63258/ping, params:None (basedriver.py:168) here here here here here here here 2022-03-15 10:13:29 [DEBUG] {"ret":0,"msg":"pong","data":{"result":true,"value":"pong"}}, java request costs 25ms (basedriver.py:124) 2022-03-15 10:13:29 [DEBUG] id=140411163892656, http://127.0.0.1:63258/hasReady, params:None (basedriver.py:168) here here here here here here here 2022-03-15 10:13:30 [DEBUG] {"ret":0,"msg":"","data":{"result":true}}, java request costs 502ms (basedriver.py:124) 2022-03-15 10:13:30 [INFO] At init completed (javadriver.py:233) 2022-03-15 10:13:31 [DEBUG] adb -s bad053a4 shell ps (adbwrap.py:219) 2022-03-15 10:13:31 [DEBUG] adb -s bad053a4 shell am force-stop com.tencent.mm (adbwrap.py:219) 2022-03-15 10:13:31 [DEBUG] adb -s bad053a4 shell am start -W -n com.tencent.mm/.ui.LauncherUI (adbwrap.py:219) 2022-03-15 10:13:32 [DEBUG] Starting: Intent { cmp=com.tencent.mm/.ui.LauncherUI } Status: ok LaunchState: COLD Activity: com.tencent.mm/.ui.LauncherUI TotalTime: 1082 WaitTime: 1118 Complete (adbwrap.py:765) ReLaunch(/pages/index/index) but(/pages/home/home) 到这里访问http://127.0.0.1:63258/ping都可以拿到正确结果,后面的代码开始执行 enable_remote_debug。后面再开始访问ping,就拿不到内容了,网页访问这个url一直转圈。发现的原因是,使用allow_get_user_phone去点击弹窗button,报错说connection error,然后代码做了判断说尝试3次后还是失败,要做一个reconnect操作,reconnect之后就可以了。我想问这种情况下,尝试都是没用的。请问是code本身有问题,还是默认就是这样的机制。谢谢
2022-03-15 - 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 - minium如何在ide上自动处理手机号授权问题?
执行自动化测试时,跳出来手机号授权对话框,请问用什么方法可以处理掉啊?(是ide模式下的,谢谢)。 如图: [图片]
2022-03-14 - minium里面关于查找子元素的问题?
使用xpath找到了元素之后,如果我想要通过这个元素再寻找它下面的子元素,可以使用什么方法?看代码,好像出来的baseelement有一个get_css_selector的方法,但是传css selector进去,又说找不到。有没有使用过的同学解答下,谢谢。
2022-03-10 - cli启动开发者工具的时候 --auto-account <openid> 怎么用
https://developers.weixin.qq.com/miniprogram/dev/devtools/cli.html 用命令行启动开发者工具时,看文档说支持--auto-account选项。不知道这个参数的用途是什么?我的理解是设置了这个参数,就不需要微信扫码登录开发者工具了?如果是,那么这个值怎么获取?如果不是,那这个东西是用来干什么的呢?谢谢。
2022-02-11