- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试通过 Appium 自动化混合 phonegap 应用程序。当这个应用程序在手机上运行时,我可以通过 Chrome 浏览器远程访问它。当我使用 Appium 时,它不显示 webview 上下文,只显示 native 上下文。有没有办法访问 webview 上下文,我做错了什么?
var dirs = Directory.GetFiles("out", "*.apk");
var app = Path.GetFullPath(dirs[0]);
DesiredCapabilities cap = new DesiredCapabilities();
cap.SetCapability("fastReset", "True");
cap.SetCapability("platformName", "Android");
cap.SetCapability("automationName", "Appium");
cap.SetCapability("app", app);
cap.SetCapability("deviceName", "emulator-5554");
cap.SetCapability("autoGrantPermissions", "true");
AppiumDriver<AppiumWebElement> driver1 = new AndroidDriver<AppiumWebElement>(new Uri("http://192.168.1.138:4723/wd/hub"),cap);
Thread.Sleep(15000);
var contexts = driver1.Contexts;
foreach(string context in contexts)
{
if (context.Contains("WEBVIEW"))
{
driver1.Context = context;
break;
}
}
driver = driver1
同时添加一个日志文件:
[Appium] Welcome to Appium v1.6.4
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android","app":"locationApk.apk","deviceName":"emulator-5554","autoGrantPermissions":true},"capabilities":{"firstMatch":[{"platformName":"Android","app":"locationApk.apk","deviceName":"emulator-5554","autoGrantPermissions":true}]}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","app":locationApk.apk","deviceName":"emulator-5554","autoGrantPermissions":true},null,{"firstMatch":[{"platformName":"Android","app":locationApk.apk","deviceName":"emulator-5554","autoGrantPermissions":true}]},null,null]
[BaseDriver] Event 'newSessionRequested' logged at 1493796219386 (09:23:39 GMT+0200 (W. Europe Daylight Time))
[Appium] Creating new AndroidDriver (v1.17.1) session
[Appium] Capabilities:
[Appium] platformName: 'Android'
[Appium] app: locationApk.apk'
[Appium] deviceName: 'emulator-5554'
[Appium] autoGrantPermissions: true
[AndroidDriver] AndroidDriver version: 1.17.1
[BaseDriver] Session created with session id: dd34fa43-e463-489b-9e47-567f20c36c5d
[AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_131
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Android\sdk\platform-tools\adb.exe
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[AndroidDriver] Using device: emulator-5554
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Android\sdk\platform-tools\adb.exe
[ADB] Setting device id to emulator-5554
[BaseDriver] Using local app 'locationApk.apk'
[AndroidDriver] Checking whether app is actually present
[AndroidDriver] Starting Android session
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","wait-for-device"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","echo","ping"]
[Logcat] Starting logcat capture
[AndroidDriver] Pushing settings apk to device...
[ADB] Getting install status for io.appium.settings
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","list","packages","io.appium.settings"]
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","list","packages","io.appium.settings"]
[ADB] App is installed
[ADB] Getting package info for io.appium.settings
[ADB] Getting connected devices...
[ADB] Checking whether aapt is present
[ADB] Using aapt.exe from C:\Android\sdk\build-tools\25.0.2\aapt.exe
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","dumpsys","package","io.appium.settings"]
[ADB] Cannot read version codes of C:\Users\xxx\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\io.appium.settings\app\build\outputs\apk\settings_apk-debug.apk and/or io.appium.settings. Assuming correct app version is already installed
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.sdk"]
[ADB] Device API level: 25
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","dumpsys","package","io.appium.settings"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","dump","io.appium.settings"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";"]
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";"]
[AndroidDriver] Pushing unlock helper app to device...
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","install","C:\\Users\\xxx\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\appium-unlock\\bin\\unlock_apk-debug.apk"]
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","install","C:\\Users\\xxx\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\appium-unlock\\bin\\unlock_apk-debug.apk"]
[ADB] Application 'C:\Users\xxx\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-unlock\bin\unlock_apk-debug.apk' already installed. Continuing.
[ADB] Device API level: 25
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","appops","set","io.appium.settings","android:mock_location","allow"]
[ADB] Getting device platform version
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.release"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","wm","size"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.product.model"]
[ADB] Current device property 'ro.product.model': Android SDK built for x86
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.product.manufacturer"]
[ADB] Current device property 'ro.product.manufacturer': unknown
[AndroidDriver] Parsing package and activity from app manifest
[ADB] Checking whether aapt is present
[ADB] Using aapt.exe from C:\Android\sdk\build-tools\25.0.2\aapt.exe
[ADB] Extracting package and launch activity from manifest
[ADB] badging package: nl.app.mobile
[ADB] badging act: nl.app.mobile.appMobile
[AndroidDriver] Parsed package and activity are: nl.app.mobile/nl.app.mobile.appMobile
[AndroidDriver] Remote apk path is /data/local/tmp/85f78b66b0710f626eacb402acfd93d2.apk
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ls","/data/local/tmp/85f78b66b0710f626eacb402acfd93d2.apk"]
[AndroidDriver] Checking if app is installed
[ADB] Getting install status for nl.app.mobile
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","list","packages","nl.app.mobile"]
[ADB] App is installed
[AndroidDriver] Apk is already on remote and installed, resetting
[AndroidDriver] Running fast reset (stop and clear)
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","am","force-stop","nl.app.mobile"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","clear","nl.app.mobile"]
[ADB] Device API level: 25
[ADB] Checking whether aapt is present
[ADB] Using aapt.exe from C:\Android\sdk\build-tools\25.0.2\aapt.exe
[ADB] Extracting package and launch activity from manifest
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","dump","nl.app.mobile"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","grant","nl.app.mobile","android.permission.ACCESS_FINE_LOCATION",";","pm","grant","nl.app.mobile","android.permission.WRITE_EXTERNAL_STORAGE",";","pm","grant","nl.app.mobile","android.permission.ACCESS_COARSE_LOCATION",";","pm","grant","nl.app.mobile","android.permission.RECORD_AUDIO",";","pm","grant","nl.app.mobile","android.permission.READ_PHONE_STATE",";","pm","grant","nl.app.mobile","android.permission.CAMERA",";","pm","grant","nl.app.mobile","android.permission.READ_EXTERNAL_STORAGE",";"]
[AndroidDriver] Extracting strings from apk locationApk.apk undefined C:\Users\xxx\AppData\Local\Temp\nl.app.mobile
[ADB] Extracting strings for language: default
[ADB] Device API level: 25
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","persist.sys.locale"]
[ADB] Current device property 'persist.sys.locale':
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.product.locale"]
[ADB] Current device property 'ro.product.locale': en-US
[ADB] No strings.xml for language 'en', getting default strings.xml
[ADB] Reading strings from converted strings.json
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","push","C:\\Users\\xxx\\AppData\\Local\\Temp\\nl.app.mobile\\strings.json","/data/local/tmp"]
[AndroidBootstrap] Watching for bootstrap disconnect
[ADB] Forwarding system: 4724 to device: 4724
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","forward","tcp:4724","tcp:4724"]
[UiAutomator] Starting UiAutomator
[UiAutomator] Moving to state 'starting'
[UiAutomator] Parsing uiautomator jar
[UiAutomator] Found jar name: 'AppiumBootstrap.jar'
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","push","C:\\Users\\xxx\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\appium-android-bootstrap\\bootstrap\\bin\\AppiumBootstrap.jar","/data/local/tmp/"]
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting all processes with uiautomator
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ps"]
[ADB] No uiautomator process found to kill, continuing...
[UiAutomator] Starting UIAutomator
[ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","nl.app.mobile","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false]
[UiAutomator] Moving to state 'online'
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] Android bootstrap socket is now connected
[ADB] Getting connected devices...
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","dumpsys","window"]
[AndroidDriver] Screen already unlocked, doing nothing
[ADB] Device API level: 25
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","am","start","-W","-n","nl.app.mobile/nl.app.mobile.appMobile","-S"]
[ADB] Waiting for pkg: 'nl.app.mobile' and activity: 'nl.app.mobile.appMobile' to be focused
[ADB] Possible activities, to be checked: nl.app.mobile.appMobile, nl.app.mobile.nl.app.mobile.appMobile
[ADB] Getting focused package and activity
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","dumpsys","window","windows"]
[ADB] Found package: 'nl.app.mobile' and fully qualified activity name : 'nl.app.mobile.appMobile'
[Appium] New AndroidDriver session created successfully, session dd34fa43-e463-489b-9e47-567f20c36c5d added to master session list
[BaseDriver] Event 'newSessionStarted' logged at 1493796234555 (09:23:54 GMT+0200 (W. Europe Daylight Time))
[MJSONWP] Responding to client with driver.createSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","app":"locationApk.apk","deviceName":"emulator-5554","autoGrantPermissions":true},"platformName":"Android","app":"locationApk.apk","deviceName":"emulator-5554","autoGrantPermissions":true,"deviceUDID":"emulator-5554","platformVersion":"7.1.1","deviceScreenSize":"1080x1920","deviceModel":"Android SDK built for x86","deviceManufacturer":"unknown","appPackage":"nl.app.mobile","appWaitPackage":"nl.app.mobile","appActivity":"nl.app.mobile.appMobile","appWaitActivity":"nl.app.mobile.appMobile"}
[HTTP] <-- POST /wd/hub/session 200 15181 ms - 1018
[HTTP] --> GET /wd/hub/session/dd34fa43-e463-489b-9e47-567f20c36c5d/contexts {}
[MJSONWP] Calling AppiumDriver.getContexts() with args: ["dd34fa43-e463-489b-9e47-567f20c36c5d"]
[AndroidDriver] Getting a list of available webviews
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","cat","/proc/net/unix"]
[AndroidDriver] Found webviews: []
[AndroidDriver] Available contexts: ["NATIVE_APP"]
[MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP"]
[HTTP] <-- GET /wd/hub/session/dd34fa43-e463-489b-9e47-567f20c36c5d/contexts 200 93 ms - 86
[HTTP] --> POST /wd/hub/session/dd34fa43-e463-489b-9e47-567f20c36c5d/elements {"using":"xpath","value":"//*[contains(@id,'TutorialModeLogin')]"}
[MJSONWP] Calling AppiumDriver.findElements() with args: ["xpath","//*[contains(@id,'TutorialModeLogin')]","dd34fa43-e463-489b-9e47-567f20c36c5d"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[contains(@id,'TutorialModeLogin')]","context":"","multiple":true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[contains(@id,'TutorialModeLogin')]","context":"","multiple":true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//*[contains(@id,'TutorialModeLogin')]' using 'XPATH' with the contextId: '' multiple: true
[HTTP] <-- POST /wd/hub/session/dd34fa43-e463-489b-9e47-567f20c36c5d/elements - - ms - -
[HTTP] --> DELETE /wd/hub/session/dd34fa43-e463-489b-9e47-567f20c36c5d {}
[MJSONWP] Calling AppiumDriver.deleteSession() with args: ["dd34fa43-e463-489b-9e47-567f20c36c5d"]
[BaseDriver] Event 'quitSessionRequested' logged at 1493796309733 (09:25:09 GMT+0200 (W. Europe Daylight Time))
[AndroidDriver] Shutting down Android driver
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","am","force-stop","nl.app.mobile"]
[ADB] Pressing the HOME button
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","input","keyevent",3]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//*[contains(@id,'TutorialModeLogin')]' using 'XPATH' with the contextId: '' multiple: true
[AndroidBootstrap] Sending command to android: {"cmd":"shutdown"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":[]}
[AndroidBootstrap] Received command result from bootstrap
[AndroidBootstrap] Received command result from bootstrap
[UiAutomator] Shutting down UiAutomator
[UiAutomator] Moving to state 'stopping'
[MJSONWP] Responding to client with driver.findElements() result: []
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"shutdown"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
[UiAutomator] UiAutomator shut down normally
[UiAutomator] Moving to state 'stopped'
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting all processes with uiautomator
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ps"]
[ADB] No uiautomator process found to kill, continuing...
[UiAutomator] Moving to state 'stopped'
[Logcat] Stopping logcat capture
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","am","force-stop","io.appium.unlock"]
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[Appium] Removing session dd34fa43-e463-489b-9e47-567f20c36c5d from our master session list
[BaseDriver] Event 'quitSessionFinished' logged at 1493796311072 (09:25:11 GMT+0200 (W. Europe Daylight Time))
[MJSONWP] Received response: null
[MJSONWP] But deleting session, so not returning
[MJSONWP] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/dd34fa43-e463-489b-9e47-567f20c36c5d 200 1340 ms - 76
[BaseDriver] Shutting down because we waited 60 seconds for a command
[AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was 'New Command Timeout of 60 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'
[Appium] Removing session dd34fa43-e463-489b-9e47-567f20c36c5d from our master session list
[AndroidDriver] Called deleteSession but bootstrap wasn't active
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","am","force-stop","io.appium.unlock"]
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
找到了它没有检测到 webview 的原因。该应用程序使用 phonegap 构建并使用人行横道。这会导致 Appium(在正常情况下)找不到 webview 的问题。
最佳答案
尝试打印所有可用的上下文。有时拼写或大小写可能不同。以下是伪代码。
foreach(string context in contexts)
{
print(context)
}
同时检查您是否在代码中启用了 webview 调试。
要做到这一点,请使用
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
}
关于c# - 无法检测到 webview Appium,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43681654/
Webview shouldInterceptRequest方法总是返回null。我去了adblocking的use方法。我尝试了很多adblock方法,但是总是需要这个shouldIntercept
在我的 Native React 项目中,我想使用 WebView。 HTML是指外部的css文件,css文件是指一些自定义字体。 鉴于此层次结构: app/ app/index.ios.js app
我在一个页面上有多个 webview,当应用程序加载时,主页面卡住了将近 8-10 秒,我猜测这是所有 webview 加载各自网站所花费的时间,为什么 Ui 卡住了,我怎么能使 webview 加载
nativescript 中的 webview 是否有“导航”事件? 我已经在 Xamarin (c#) 中用 完成了 Browser.Navigating += Myfunction natives
我的浏览器 (webview) 以 HTML 页面开头 FILEJAVA.class.getResource ("FILEHTML.html")。 ToExternalForm () 每当我访问谷歌时
我们正在开发一个 JavaFX 2.x 应用程序,它需要提供一些 GIS 支持。我们得出的结论是,通过嵌入式 WebView 使用 GoogleMaps 是最快的选择。它的问题在于每次我们的应用程序启
有没有办法销毁 WebView 实例?如果页面加载,并说视频开始播放,我希望能够,当我隐藏 WebView 时,基本上可以销毁它,或者至少重置它。 我知道我可以听 visibleProperty 并执
有没有办法在不启用远程模块的情况下在 webview 和主窗口之间进行通信? When this attribute is false the guest page in webview will
我使用以下代码来拦截Web View 中的对话框,但看不到内容或无法与之交互: Element webview= querySelector("#webview"); Map map=new
我正在创建一个页面,该页面将在 Java 的 WebView 中打开,或在外部浏览器中手动打开。如果页面是从 Java 加载的——我需要它来执行特定的回调,因为 Java 被用作一种后端,但如果页面是
我有一个 React Native WebView ,它运行一个小的 HTML 文档。该文档显示了一些图像。 我希望显示位于应用程序的 Documents 文件夹中的图像,即图像不是静态 Assets
我正在使用 JavaFX webview 开发一个网络爬虫。出于抓取目的,我不需要加载图像。当页面被加载时,Webkit 会产生很多 UrlLoader 线程。所以我认为最好禁用图像,这样我会节省很多
这个问题在这里已经有了答案: Android webview launches browser when calling loadurl (11 个答案) 关闭 7 年前。 我花了两天的时间来寻找一
我正在加载一个网页,我想使用基本身份验证登录,我有使用 Swift 的经验并且能够像下面那样执行基本身份验证,但我无法为我的应用程序的 Flutter 版本实现基本身份验证。 ---- swift 代
我用 webview 创建了应用程序,我想在 webview 中加载所有内部链接并在 android 浏览器中加载外部链接。现在的问题是我正在使用 html 广告,当我点击广告时我想打开外部浏览器,但
我需要在父背景图案上显示我的 webview 内容。有没有直接的方法来做到这一点? 最佳答案 这可能有用 final com.sun.webkit.WebPage webPage = com.sun.
是否可以从 webview 中加载的页面读取 http 请求和响应数据。我想要做的是在用户单击 webview 中页面内的链接后从响应中获取二进制数据。任何帮助或线索将不胜感激 最佳答案 创建您自己的
我有一个简单的WebView在 Android 上运行 Web 应用程序。问题是当我旋转手机以将其更改为横向 webview重新加载并回到开头。 我怎样才能防止这种行为? 罗恩 最佳答案 从 Andr
我创建了一个带有 webview 标签的自定义浏览器。当我在 google.it(或 google.com)中导航时,有时会出现一条消息说 chrome 已过时。我的应用版本是: Node.js 8.
我正在使用 Electron 创建简单的网络浏览器。我的用例是我需要通过不同/各自的代理 IP 路由每个 URL。如果用户输入 google.com,则必须通过 123.123.122.1:8081
我是一名优秀的程序员,十分优秀!