换家公司还这样呢?再换?
有些代码的图 可以贴代码吗?
https://testerhome.com/topics/5264 如果在这里提到 5264 这个帖子,那么那个帖子里会有反应。
好好排版啊
这种 请直接找他私聊。
#8 楼 @huang053117 环境变量不对吧
#5 楼 @chenhengjie123 让楼主在 check 一遍吧
1.5.3 亲测!
你已经安装好了 appium,无论是 GUI 还是 npm 的。
从这里下载 https://github.com/appium/appium/files/320185/webview_helpers_cordova_suppport.patch.zip,解压。
然后进入到 appium/node_modules/appium-android-driver/ 这个目录下,进行补丁:
patch -p1 lib/webview-helpers.js /path/to/patch/file/webview_helpers_cordova_suppport.patch
打好补丁后,重新把 appium-android-driver build 一下:
npm install
从 https://github.com/piotrekkmt/chromedriver-appium/blob/master/chromedriver 下载打过补丁的 chromedriver。
将这个目录下 appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/
下的 chromedriver 替换成打过补丁的。
import os
import unittest
from appium import webdriver
from time import sleep
pkg_name = 'com.xxx.bbb'
desird_caps={}
desird_caps['platformName'] = 'Android'
desird_caps['deviceName'] = 'Samsung'
desird_caps['udid'] = '2bcf97ef'
desird_caps['appPackage'] = pkg_name
desird_caps['appActivity'] = ‘com.xxx.bbb.activity.SplashActivity'
desird_caps['platformVersion'] = '5.1.1'
ANDROID_DEVICE_SOCKET = pkg_name + "_devtools_remote"
desird_caps['androidDeviceSocket'] = ANDROID_DEVICE_SOCKET
chromeOptions = {}
chromeOptions['androidDeviceSocket'] = ANDROID_DEVICE_SOCKET
desird_caps['chromeOptions'] = chromeOptions;
driver = webdriver.Remote('http://localhost:4723/wd/hub',desird_caps)
运行过程中会返回一个没有名字的 webview:
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Applications/android-sdk/platform-tools/adb with args: ["-P",5037,"-s","2bcf97ef","shell","cat","/proc/net/unix"]
[debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_"]
[MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_"]
[HTTP] <-- GET /wd/hub/session/077ca253-cd31-41da-8ce1-7c2bf0cbb107/contexts 200 80 ms - 97
[BaseDriver] Shutting down because we waited 60 seconds for a command
居然已经有解决方案了。
#4 楼 @orange_chen 你报个问题,系统版本,手机型号,无线类型都不说,让大家猜测。
我不会啊
干货满满
学会发问前搜索,https://testerhome.com/topics/1943
解决方法是在 AndroidManifest.xml 文件中将 Activity 设置成允许调用:Android:exported=” true”
新手,请自觉发帖到新手区
这不算 bug 吧?