当前位置:网站首页>Dry goods | read appium logs and double the test efficiency!
Dry goods | read appium logs and double the test efficiency!
2022-04-21 18:13:00 【Hua Weiyun】

Appium A lot of logs are generated when the server is running , But a lot of people don't understand what it means , And you can't get useful information . This article will explain in detail how to read Appium journal , And double your testing efficiency .
The first line of the log shows Appium Version and running address .
If you are in the Appium Parameter added on , They will show in the Journal , If you add defaultCapabilities, The log will also show .
For automated testing , This information is very important , Because it's different Appium The version has different functions and problems , You have to know your own Appium edition .
Run for automated testing ,session There's a lot to do , Logs provide some basic session Information , especially desired capabilities and default capabilities. You should always pay attention to Appium Whether the service received the request correctly , The log lists the creation of automation session( Don't understand, automation session Look at the link below ).
Appium It's a REST service , receive HTTP request , Show the content of the request , Return some result .Appium The server-side log shows the requested and returned content with lines and arrows . Between the two arrows is Appium Log information of the server executing the request command :
Log can be very convenient to check the error , Mistakes usually occur in automation session after . But sometimes , If session Persistent existence , Mistakes can also occur . So the first step is to find out what's wrong .
The following example shows that , Each instruction uses [HTTP] --> and [HTTP] <-- Mark . Between these tags are instruction details , Contains error output :
The user tried to use Android driver Start a session, But something went wrong .Appium in preparation for session And turn it off and clear it AUT When I found a mistake , This mistake tells us two things :
1.Appium What are you trying to do
2. What went wrong
In this case ,Appium Try to run adb command (adb shell am force-stop),adb Parameters are also shown in the error message . It happened. Android System permissions error . here , We can run this manually adb command , See if the error can be reproduced . If the error reappears , Check it online ! If adb The command ran successfully , May be Appium Of bug, Should go Github Of issue View or submit this on bug .( The error in the example is caused by the device manufacturer's security model )
This example is just one of many mistakes , But it shows a crucial point , When a mistake happens , Logs can provide more information , If there is no complete log information , Yes Appium It's even more difficult to correct mistakes .
Usually , The default log content is enough , If you want to go Github Ask for help , Of course, the more information, the better ! The following parameters can be changed Appium Server side logging behavior :
- –log-level - change Appium Log display level .
- Appium All logs are displayed by default , It has the following options :‘info’, ‘info:debug’, ‘info:info’, ‘info:warn’, ‘info:error’, ‘warn’, ‘warn:debug’, ‘warn:info’, ‘warn:warn’, ‘warn:error’, ‘error’, ‘error:debug’, ‘error:info’, ‘error:warn’, ‘error:error’, ‘debug’, ‘debug:debug’, ‘debug:info’, ‘debug:warn’, ‘debug:error’.
- –log-no-colors - If your console has no color ( The log may produce some strange characters , such as "TODO: find the color"), You can turn off the color with this parameter .
- –log-timestamp - Add a timestamp before the log , It is very effective in checking timeout errors , It's shown as follows :
Link to the original text
Get more :https://qrcode.ceba.ceshiren.com/link?name=article&project_id=qrcode&from=hwyun×tamp=1650524546
版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211805415481.html
边栏推荐
猜你喜欢

C语言进阶第45式:函数参数的秘密(下)

搭建JMeter+Jenkins+Ant持续化

靶机渗透练习80-Momentum:1

MySQL——远程连接非本地MySQL数据库服务器,报错ERROR 1130: Host 192.168.3.100 is not allowed to connect to this MySQL s

WPF学习笔记——概述

In order to offer several big factories, "closed door practice"

The conflict between Russia and Ukraine raised concerns. The five eye network security department suggested that allies strengthen the protection of key infrastructure

【论文精读】Perception-based seam cutting for image stitching

看看技术宅怎么拯救学霸机,我用10块钱修好了笔记本电脑

【Redis】 使用Redis优化省份展示数据不显示
随机推荐
【acwing】1118. 分成互质组 ***(DFS)
中介者模式
Appium source code analysis of dry goods app automated testing
Live app source code, add picture display function on the basis of unable to display pictures
干货 | 谁懂这篇文,玩游戏还会卡顿?
SQL command delete (I)
Failed to install network card driver (resolved)
[brush force buckle] questions 51-60
Look at how the technology house saves Xueba machine. I repaired my laptop with 10 yuan
VS2019 visual studio 终端调试乱码问题
接口测试框架实战(二)| 接口请求断言
【今晚七点】metaRTC的发展和应用场景探讨
Laravel soar (2. X) - automatically monitor and output SQL optimization suggestions and assist laravel to apply SQL optimization
西北工业大学机考《财政金融法》网考
Mobile platform workplus integrated office, creating a full scene business ecosystem for enterprises
靶机渗透练习75-DC7
关于Linq语句
STM32 MCU memory manager code can be directly used in engineering
String(一个特殊的数据类型)
Online examination of "financial law" in the computer examination of Northwest University of Technology