比较少见的异常记录和对应的解决方法

UI自动化测试中比较少见的异常记录

jenkins的Allure报告中没有趋势和运行器信息

在这里插入图片描述
解决办法 修改allure的path
在这里插入图片描述

浏览器无响应/超时/界面点击无效

在这里插入图片描述

timeout: Timed out receiving message from renderer: 300.000
org.openqa.selenium.TimeoutException: timeout: Timed out receiving message from renderer

from unknown error: cannot determine loading status
from tab crashed
(Session info: chrome=100.0.4896.60)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘CODE007’, ip: ‘192.168.10.241’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_211’
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 100.0.4896.60, chrome: {chromedriverVersion: 100.0.4896.60 (6a5d10861ce8…, userDataDir: C:\Users\Franciz\AppData\Lo…}, goog:chromeOptions: {debuggerAddress: localhost:50203}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: 91d67a9aaf02d69b760e522550034e2d

上面是出现错误时的代码片段,如果你的情况与我类似,那么可能是你的UI自动化测试中执行某个用例时遇到了xxx bug 导致你的浏览器卡死/无效操作.

元素点击拦截异常

org.openqa.selenium.ElementClickInterceptedException:
element click intercepted: Element … is not clickable at point (491, 324). Other element would receive the click:

这种情况一般是浏览器界面在操作时 鼠标正在转圈圈(卡顿了),一般在操作这个元素之前加一点等待时间即可解决.

自动化测试中遇到element.getText()为空值

改变为element.getAttribute("innerText");


Java代码异常

InvalidPathException

java.nio.file.InvalidPathException: Trailing char < > at index 87: D:\WORK\2022-10-09\debug20221009-11-35-36-564.png

笔者实测,jar包冲突,解决方法:
在maven的pom.xml中
找到 commons-io
在这里插入图片描述
注释,重试.

VersionDetector /NoSuchMethodError

[main] WARN io.github.bonigarcia.wdm.versions.VersionDetector - Error reading commands.properties, using local instead

java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.toString(Ljava/io/InputStream;Ljava/nio/charset/Charset;)Ljava/lang/String;

笔者实测,jar包冲突,解决方法:
在maven的pom.xml中
找到 commons-fileupload
在这里插入图片描述
注释,重试.

java.lang.IllegalArgumentException: Illegal group reference

场景:String类型的变量替换值,变量中包含$,

Sting value = java.util.regex.Matcher.quoteReplacement(replaceStr);

使用java.util.regex.Matcher.quoteReplacement先处理下,即可。

java.lang.IllegalArgumentException: Input must be set

在这里插入图片描述

可能的原因是 内存不足?

IDEA报错:org.testng.TestNGException: java.net.ConnectException: Connection timed out: connect

org.testng.TestNGException: java.net.ConnectException: Connection timed out: connect
at org.testng.TestNG.parseSuite(TestNG.java:327)
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:348)
at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:39)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)

在这里插入图片描述

解决方法 关闭一切网络代理 比如小猫咪 clash 等;最后还是不行你就只能网络重置或者重装系统.笔者使用clash的TUN模式
在这里插入图片描述
也解决了这个问题

IDEA报错:org.testng.testngexception: java.net.unknownhostexception: testng.org

你的电脑没联网 导致的


Python代码错误

ImportError: DLL load failed while importing win32gui

场景:使用pyinstaller打包exe后 窗口报错
解决方法:在win32gui 上面加入代码
在这里插入图片描述

import pywintypes  # 解决pyinstaller打包后win32gui识别不到的问题

Django 启动错误

Unknown command: 'manage.py runserver

启动配置
在这里插入图片描述


Linux错误

chmod -R cannot access Input Error

或者
find: ‘/var/lib/mysql/eman908/p_smalltask.frm’: Input/output error

在这里插入图片描述
在使用docker挂载mysql时候报错
find: ‘/var/lib/mysql/eman908/p_smalltask.frm’: Input/output error
在这里插入图片描述
原本以为是权限的问题
然后使用chmod 777 -R
结果又报错
chmod -R cannot access Input Error

解决方法:
应该是磁盘分区损坏了

  1. 卸载对应的分区,使用
 lsblk -l

获取分区信息
在这里插入图片描述

umount -v 分区路径

卸载对应分区

然后使用fsck 命令修复分区(注意:此操作会损失部分损坏的数据)
fsck 还可以检测分区,可以百度获取更多相关用法

# /dev/hda2为分区路径
fsck -y /dev/hda2

然后

reboot

重启系统后,重新挂载分区即可

# mount 分区 本地路径
mount /dev/vdb1 /data

mariadb/mysql报错 Changing some columns to TEXT or BLOB or using ROW_FORMAT-DYNAMIC or ROW_FORMAT=COMPRESSED may help.

在这里插入图片描述
解决方案:
第一种:
[mysqld]下增加

max_allowed_packet = 512M

也可以设置为1G

第二种:
[mysqld]下增加

# 关闭严格模式,解决Changing some columns to TEXT or BLOB错误
innodb_strict_mode = 0

这种可能存在弊端,具体权衡自行百度.

bat脚本输出内容乱码

现象:
在这里插入图片描述
bat源码:

cd /d %~dp0

:: 设置日期和时间格式
set datetime=%date%-%time%

:: 定义日志文件路径
set logfile=log.txt

:: 输出日期和时间信息到日志文件
echo "--- --- ---"
echo %datetime%-start restore >> %logfile%


:: 还原稳定版数据库
sql_tool.exe -debug -restore -sf "D:\NEM\my_conf\database_utils\nem_202306_bak.sql" >> %logfile%

if %errorlevel% neq 0 (
    echo Error: restore stable database fail! >> %logfile%
    exit /b
)

echo %datetime%-restored >> %logfile%

解决方法:

保存bat文件为ansi/gbk编码

在这里插入图片描述


Proxmox 无法访问web 8006打不开

终端输入

journalctl -f

journalctl -f 是一个用于实时监视系统日志的命令。通过运行这个命令,您可以看到最新的日志消息,而不必手动刷新。

请注意,您需要以root用户或拥有sudo特权的用户身份运行此命令才能查看系统日志。
在这里插入图片描述

被ufw防火墙拦截了,执行以下命令解决

sudo ufw allow 8006

Navicat还原sqlserver的数据库报错

[ODBC Driver 18 for SQL Server][SQL Server]The backup set holds a backup of a database other than the existing …
在这里插入图片描述
笔者的解决方法是勾选WITH REPLACE选项(测试软件版本为navicat16)
在这里插入图片描述

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Franciz小测测

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值