码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • appium + app+HTML 经常遇到的问题


    目录

    问题1:Mac和iOS通信 进行自动化测试参考Desired Capabilities官方说明文档

    问题2:driver = webdriver.Remote(“http://localhost:4723/wd/hub“, caps)

    问题3:Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

    问题4:An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output

    问题5:The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource

    问题6:Encountered internal error running command: Error: Device 127.0.0.1:4723 was not in the list of connected device

    问题7:Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up

    问题8:Encountered internal error running command: Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output

    问题9:scrcpy 无线投屏 无法连接

    问题10:Mac和iOS通信 进行自动化测试参考Desired Capabilities官方说明文档

    问题11:SessionNotCreatedException

    问题12:AttributeError: 'XXX' object has no attribute 'endswith' 

    问题13:appium 中inspect   (如何切换定位H5   原生APP  混合型APP)  定位

    问题14:自动下载更新浏览器驱动可能会遇到问题?



    appium 库一定要装 

    问题1:Mac和iOS通信 进行自动化测试参考Desired Capabilities官方说明文档

    参考如下进行配置:

    Desired Capabilities官方说明文档:Desired Capabilities in Selenium Testing With Examples

    问题2:driver = webdriver.Remote(“http://localhost:4723/wd/hub“, caps)

    An unknown server-side error occurred while processing the command

    处理命令时发生未知的服务器端错误

    An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.tencent.mobileqq' application

    问题出现 appium server  ,修改appium服务器

    localhost:4723  改为127.0.0.1:4723

    问题3:Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

    JavaApp自动化测试系列[v1.0.0][Appium常见问题处理]_appiumservicebuilder does not define or inherit an_Davieyang.D.Y的博客-CSDN博客

    问题4:An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output

    An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output

    处理命令时发生了一个未知的服务器端错误.原始错误:无法初始化检测过程。制作确保测试中的应用程序不会崩溃,并调查logcat输出。

    第一步检查手机设备是否正常

    adb devives

    第二步检查手机上启动脚本时注意手机提示安装appium setting否者连接。调试脚本时需要注意手机动态

    第三步检查appium上日志输出

    第四步检查app日志输出,命令如下:

    adb shell logcat

    问题5:The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource

    The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource

    找不到请求的资源,或者使用映射资源不支持的 HTTP 方法接收到请求

    问题6:Encountered internal error running command: Error: Device 127.0.0.1:4723 was not in the list of connected device

    设备断开了,连接配置信息错误,如udid(adb devices获取)

    检查是否连接,时时注意手机动态

    问题7:Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up

    1. 运行如下两句
    2. adb uninstall io.appium.uiautomator2.server
    3. adb uninstall io.appium.uiautomator2.server.test

    问题8:Encountered internal error running command: Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output

    Encountered internal error running command: Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output
    遇到内部错误运行命令:错误:无法初始化检测进程。 确保被测应用程序没有崩溃并调查 logcat 输出

    确保如上三个全部安装 

    1. package:io.appium.settings
    2. package:io.appium.uiautomator2.server
    3. package:io.appium.uiautomator2.server.test
    4. 确保如上三个全部安装

    问题9:scrcpy 无线投屏 无法连接

    首先使用USB 数据连接手机和电脑,手机打开开发者模式

    使用adb devices  发现如下则没有连接上,请检查 开发者调式功能是否打开 

    打开开发调式即可再次输入adb devices 

    然后在scrcpy 进行无线投屏 连接操作步骤如下:GitHub - Genymobile/scrcpy 

    1. adb devices
    2. 确定是否连接
    3. adb tcpip 5555
    4. 后面的5555为端口,可以指定其他的端口,前提是端口未被调用
    5. adb connect 192.168.xxxx.xxxx:5555
    6. 192.168.xxxx.xxxx为你手机的ip地址,5555为了设置·的端口号
    7. adb devices
    8. 检查是否刚才输入192.168.xxxx.xxxx:5555
    9. scrcpy
    10. 输入scrcpy即可投屏

    问题10:Mac和iOS通信 进行自动化测试参考Desired Capabilities官方说明文档

    参考如下进行配置:

    Desired Capabilities官方说明文档:Desired Capabilities in Selenium Testing With Examples

    问题11:SessionNotCreatedException

    java报错:SessionNotCreatedException: Could not start a new session. Response code 500

    1. System.setProperty("webdriver.chrome.driver",
    2. "D:\\script\\java\\StudentAutoExcel\\DriverExe)

    系统环境变量设置了版本对应还是设置脚本设置启动webdriver

    需要设置System.setProperty() 路径带上exe     设置 webdriver驱动的路径

    python报错:exceptions.SessionNotCreatedException: Message: session not created: This version of xxxdriver 

    问题12:AttributeError: 'XXX' object has no attribute 'endswith' 

    如下几种报错

            AttributeError: 'int' object has no attribute 'endswith' 

            AttributeError: 'float' object has no attribute 'endswith' 

            AttributeError: 'bool' object has no attribute 'endswith' 

    了解endswith使用方法:startswith()  和 endswith()  都对字符处理

    解决办法:①检查本身代码脚本是否为 str 字符串

                      ②如调用外部文件如execl,yml,yaml 在代码进行强转操作为 str 字符串

    问题13:appium 中inspect   (如何切换定位H5   原生APP  混合型APP)  定位

    问题14:自动下载更新浏览器驱动可能会遇到问题?

    https://github.com/bonigarcia/webdrivermanager/blob/master/src/doc/asciidoc/index.adoc#http-response-code-403

    1. public WebDriver createChromeAndroidDriver(String browserVersion,String deviceName, URL appiumServerUrl) {
    2. // Resolve driver and get its path(解析驱动程序并获取其路径)
    3. WebDriverManager wdm = WebDriverManager.chromedriver().browserVersion(browserVersion);
    4. wdm.setup();
    5. String chromedriverPath = wdm.getDownloadedDriverPath();
    6. // Create WebDriver instance using the driver path
    7. DesiredCapabilities capabilities = new DesiredCapabilities();
    8. capabilities.setCapability("browserName", "chrome");
    9. capabilities.setCapability("version", browserVersion);
    10. capabilities.setCapability("deviceName", deviceName);
    11. capabilities.setCapability("platformName", "android");
    12. capabilities.setCapability("chromedriverExecutable", chromedriverPath);
    13. return new AndroidDriver<WebElement>(appiumServerUrl, capabilities);
    14. }

  • 相关阅读:
    葡萄糖-聚乙二醇-异硫氰基荧光素 FITC-PEG-Glucose
    【算法挨揍日记】day07——904. 水果成篮、438. 找到字符串中所有字母异位词
    数据结构笔记(王道考研) 第四章:串
    C++从入门到精通——初步认识面向对象及类的引入
    vscode使用内置插件断点调试vue2项目
    css实现一行N个元素动态布局(以4个为例)
    脑电信号分类问题的数据预处理方法
    Zynq UltraScale+ XCZU4EV 纯VHDL解码 IMX214 MIPI 视频,2路视频拼接输出,提供vivado工程源码和技术支持
    Java mail发送邮件时卡住,没有任何异常日志(出现阻塞线程)
    打算参加安全方面工作,信息安全工程师怎么样,软考考试需要怎么准备?
  • 原文地址:https://blog.csdn.net/qq_36675754/article/details/126549823
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号