【appium】0.appium踩坑集锦

1.appium创建session失败:selenium.common.exceptions.WebDriverException: Message: A new session could not be created. (Original error: com.client.xrxs.com.xrxsapp/.activity.WelcomeActivity' never started. Current: com.huawei.android.launcher/.Launcher)

拿华为真机运行python代码,报了个这个错,但是appium setting和unlock安装成功了

具体的报错信息如下:
 selenium.common.exceptions.WebDriverException: Message: A new session could not be created.
 (Original error: **************** never started. Current: com.huawei.android.launcher/.Launcher)
这个其实是项目apk里面启动的问题:由于项目的apk启动默认的第一个activity,在调试的时候才停留在该activity,生产版本,则在启动后跳到第二个activity。
(就是调试版本可以自己填写apk的跳转地址,但是现网的跳转地址是写死的那种)
 

解决方法:在启动参数里面加一个appWaitActivity,参数值填写第二个activity的值即可

{'appActivity': '', 'appWaitActivity': ''}

(后来发现是我的launchActivity写错了,不过加上就加上吧,如果出现这个问题,先看appActivity有么有写错,木有写错就加个appWaitActivity)

2.error: Failed to start an Appium session, err was: Error: Activity used to start app doesn’t exist or cannot ve launched! Make usre it exists and is launchable activity

这里是我对appium的理解错误,在我删除setting和unlock之后,顺手删了app的应用,我以为他会自动给我装上,但是没有,还是要手动adb install一下,所以这里会报找不到activity,app都没了,自然没有activity了;

3.urllib.error.URLError: <urlopen error [WinError 10061] 由于目标计算机积极拒绝,无法连接。>

这是小问题,但是说一下,怕有人不知道,出了这个错,你只需要把appium的小三角点成小方块即可,哈哈哈

4.adb server version (31) doesn't match this client (36); killing...

adb server version (31) doesn't match this client (36); killing...

could not read ok from ADB Server* failed to start daemon *

 error: cannot connect to daemon

端口被占用,重启一下,不行的就强制释放端口号

https://blog.csdn.net/rodulf/article/details/51939974

猜你喜欢

转载自blog.csdn.net/qq471011042/article/details/80840435
今日推荐