- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我遇到了一个我不知道如何解决的错误,问题来自这里:
[调试] [MJSONWP] 使用参数调用 AppiumDriver.timeouts():["script",11000,"bb157408-9234-4a81-a973-091bc4ccbe6d"][MJSONWP] 运行命令时遇到内部错误:错误:超时“脚本”无效
为什么将“脚本”作为第一个参数发送?
我是端到端测试的新手。
提前致谢。
这是我的配置:
e2e-test.conf.js:
exports.config = {
/*
* normally protactor run tests on localhost:4444, but we want protactor to connet
* appium wich runs on localhost:4723
*/
seleniumAddress: 'http://localhost:4723/wd/hub',
specs: ['e2e-tests/*.test.js'],
/*
* Some capabilities must be set to make sure appium can connect to your deice.
* platformVersion: this is the version of android
* deviceName: your actual device name
* browserName: leave this empty, we want protactor to use embeded webview
* autoWebView: set this to true for hybrid applications
* app: the location of the apk (must be absolute)
*/
capabilities: {
platformName: 'android',
platformVersion: '5.1.1',
deviceName: 'Nexus 4',
browserName: '',
autoWebView: true,
app: '/Users/mikel/insurance/front/insurance/platforms/android/build/outputs/apk/android-debug.apk'
},
/*
* Default android localhost url
*/
baseUrl: 'http://10.0.2.2:8000/',
// configuring wd in onPrepare
// wdBridge helps to bridge wd driver with other selenium clients
// See https://github.com/sebv/wd-bridge/blob/master/README.md
onPrepare: function () {
var wd = require('wd'),
protractor = require('protractor'),
wdBridge = require('wd-bridge')(protractor, wd);
wdBridge.initFromProtractor(exports.config);
}
};
这是 Protractor 输出日志:
(node:7447) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[17:28:30] I/launcher - Running 1 instances of WebDriver
[17:28:30] I/hosted - Using the selenium server at http://localhost:4723/wd/hub
[17:29:12] E/runner - Unable to start a WebDriver session.
[17:29:15] E/launcher - Error: WebDriverError: An unknown server-side error occurred while processing the command. Original error: Invalid timeout 'script'
at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:505:15)
at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:440:13)
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.manage().timeouts().setScriptTimeout(11000)
at WebDriver.schedule (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:816:17)
at Timeouts._scheduleCommand (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:1500:25)
at Timeouts.setScriptTimeout (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:1483:17)
at browser_.ready.browser_.ready.then.then (/usr/local/lib/node_modules/protractor/lib/runner.ts:281:49)
at ManagedPromise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1366:14)
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2970:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2953:27)
at asyncRun (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2813:27)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:676:7
at process._tickCallback (internal/process/next_tick.js:103:7)
[17:29:15] E/launcher - Process exited with error code 100
这是 Appium 输出日志:
[debug] [UiAutomator] Starting UIAutomator
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","04f4019957958336","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","com.ionicframework.insurance437011","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false]
[debug] [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
[debug] [ADB] Device API level: 22
[debug] [ADB] Getting connected devices...
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/mikel/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","04f4019957958336","shell","am","start","-W","-n","com.ionicframework.insurance437011/com.ionicframework.insurance437011.MainActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[debug] [ADB] Waiting for pkg: 'com.ionicframework.insurance437011' and activity: 'com.ionicframework.insurance437011.MainActivity' to be focused
[debug] [ADB] Possible activities, to be checked: com.ionicframework.insurance437011.MainActivity, .MainActivity, .com.ionicframework.insurance437011.MainActivity
[debug] [ADB] Getting focused package and activity
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/mikel/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","04f4019957958336","shell","dumpsys","window","windows"]
[debug] [ADB] Found package: 'com.ionicframework.insurance437011' and activity: '.MainActivity'
[Appium] New AndroidDriver session created successfully, session bb157408-9234-4a81-a973-091bc4ccbe6d added to master session list
[debug] [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","platformVersion":"5.1.1","deviceName":"Nexus 4","browserName":"","autoWebView":true,"app":"/Users/mikel/insurance/front/insurance/platforms/android/build/outputs/apk/android-debug.apk","count":1},"platformName":"android","platformVersion":"5.1.1","deviceName":"04f4019957958336","browserName":"","autoWebView":true,"app":"/Users/mikel/insurance/front/insurance/platforms/android/build/outputs/apk/android-debug.apk","count":1,"deviceUDID":"04f4019957958336","appPackage":"com.ionicframework.insurance437011","appWaitPackage":"com.ionicframework.insurance437011","appActivity":"com.ionicframework.insurance437011.MainActivity","appWaitActivity":"com.ionicframework.insurance437011.MainActivity"}
[HTTP] <-- POST /wd/hub/session 200 220004 ms - 998
[HTTP] --> POST /wd/hub/session/bb157408-9234-4a81-a973-091bc4ccbe6d/timeouts {"type":"script","ms":11000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: ["script",11000,"bb157408-9234-4a81-a973-091bc4ccbe6d"]
[MJSONWP] Encountered internal error running command: Error: Invalid timeout 'script'
at AndroidDriver.callee$0$0$ (../../../../lib/basedriver/commands/timeout.js:23:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at AndroidDriver.callee$0$0 [as timeouts] (../../../../lib/basedriver/commands/timeout.js:14:9)
at ../../../lib/basedriver/driver.js:173:24
at tryCatcher (/usr/local/lib/node_modules/appium/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/appium/node_modules/bluebird/js/main/promise.js:510:31)
at Promise._settlePromiseAt (/usr/local/lib/node_modules/appium/node_modules/bluebird/js/main/promise.js:584:18)
at Promise._settlePromiseAtPostResolution (/usr/local/lib/node_modules/appium/node_modules/bluebird/js/main/promise.js:248:10)
at Async._drainQueue (/usr/local/lib/node_modules/appium/node_modules/bluebird/js/main/async.js:128:12)
at Async._drainQueues (/usr/local/lib/node_modules/appium/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues (/usr/local/lib/node_modules/appium/node_modules/bluebird/js/main/async.js:15:14)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)
[HTTP] <-- POST /wd/hub/session/bb157408-9234-4a81-a973-091bc4ccbe6d/timeouts 500 9 ms - 195
[HTTP] --> DELETE /wd/hub/session/bb157408-9234-4a81-a973-091bc4ccbe6d {}
[debug] [MJSONWP] Calling AppiumDriver.deleteSession() with args: ["bb157408-9234-4a81-a973-091bc4ccbe6d"]
[debug] [AndroidDriver] Shutting down Android driver
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/mikel/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","04f4019957958336","shell","am","force-stop","com.ionicframework.insurance437011"]
[debug] [ADB] Pressing the HOME button
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/mikel/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","04f4019957958336","shell","input","keyevent",3]
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"shutdown"}
[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
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [UiAutomator] Shutting down UiAutomator
[debug] [UiAutomator] Moving to state 'stopping'
[debug] [UiAutomator] UiAutomator shut down normally
[debug] [UiAutomator] Moving to state 'stopped'
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/mikel/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","04f4019957958336","shell","ps"]
[ADB] No uiautomator process found to kill, continuing...
[debug] [UiAutomator] Moving to state 'stopped'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/mikel/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","04f4019957958336","shell","am","force-stop","io.appium.unlock"]
[debug] [Logcat] Stopping logcat capture
[debug] [AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[Appium] Removing session bb157408-9234-4a81-a973-091bc4ccbe6d from our master session list
[debug] [MJSONWP] Received response: null
[debug] [MJSONWP] But deleting session, so not returning
[debug] [MJSONWP] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/bb157408-9234-4a81-a973-091bc4ccbe6d 200 3740 ms - 76
最佳答案
我遇到了完全相同的问题,并通过使用 autoWebview 和 autoWebviewTimeout 功能解决了这个问题。
我目前的能力是这样的:
capabilities: {
browserName: '',
'appium-version': '1.6',
platformName: 'Android',
platformVersion: '7.0',
deviceName: '66c4518f',
app: './platforms/android/build/outputs/apk/android-debug.apk',
autoWebview: true,
autoWebviewTimeout: 20000,
newCommandTimeout: 300000
}
希望这能解决您的问题。我知道我花了很多时间才找到这个...
有关您为何应使用此功能的更多信息,请参见 here .
关于android - Appium + Protractor + Android 设备错误超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42029111/
wait() 和 wait(timeout) 之间有什么区别。无论如何 wait() 需要等待通知调用,但为什么我们有 wait(timeout)? 那么 sleep(timeout) 和 wait(
如何向以下脚本添加超时?我希望它将文本显示为“超时”。 var bustcachevar = 1 //bust potential caching of external pages after in
我正在使用 Firebase once() 方法来检索 React Native 移动应用中的值。问题是,如果手机离线,once() 永远不会返回。文档说 ref.off() 方法应该取消回调,但这似
我在一个表中有一个大型数据集(超过 200 万行,每行超过 100 列),存储在 cassandra 中,几个月前(也许是 2 个月?)我能够执行一个简单的命令来跟踪该表中的记录数量: SELECT
我使用 jquery 开发移动应用程序,下面是我的代码,当我向包含的页面添加 5 或 6 行时,一切正常。但如果我添加多行显示错误消息:Javascript 执行超时。 function succes
我正在使用一个 javascript 确认,它将在 15 分钟后重复调用。如果用户未选择确认框中的任何选项我会在等待 1 分钟后重定向他。如何实现这一目标?我的代码是这样的 var timeo
每次我在沙箱环境中运行这段代码时,我都会超时并最终崩溃。我已经通过多个 IDE 运行它,但仍然找不到任何语法错误。如果有人看到了我没有看到的东西,我将非常感谢您的意见。 //assign variab
更新联系人后我会显示一条消息,1500 毫秒后我会转到另一个页面。我是这样做的: onSubmit() { if (this.form.valid) {
从昨天开始,我拼命尝试使用最新版本的 PHPMailer 运行一个非常简单的电子邮件脚本。 最荒谬的是,同一个脚本在两台服务器上不起作用,但在另一台服务器上却起作用。 这是我的尝试(来自 PHPMai
我已阅读以下 2 篇文章并尝试实现相同的文章。 我的代码是这样的,超时发生在这里 HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);
我正在尝试连接到 wsdl 服务, 但收到此错误: wsdl 错误:获取 http://api.didww.com/api/?wsdl - HTTP 错误: header 的套接字读取超时 本地没有问
我在使用 Ansible 的 CentOs7 实例上从 Artifactory 下载 jar 文件时遇到问题。这是我第一次在 Linux 实例上这样做。 我在每个 Windows 实例上都使用了 wi
在过去的两天里,我一直在寻找原因,我在互联网上和堆栈上尝试了很多解决方案。 我有一个带有 ubuntu 16.04 和 apache2 的专用 VM -> 服务器版本:Apache/2.4.18 (U
我正处于构建 PHP 应用程序的早期阶段,其中一部分涉及使用 file_get_contents()从远程服务器获取大文件并将它们传输给用户。例如,要获取的目标文件是 200 mB。 如果下载到服务器
我正在尝试连接到本地网络内的路由器。到目前为止,我已经使用了 TcpClient。 检查我的代码: public static void RouterConnect() {
我正在尝试构建一段代码来搜索使用 Mechanize 和 Ruby 超时的页面。我的测试台包括一个专门写入超时的页面,以及 3 个正常运行的页面。这是代码: urls = ['http://examp
我是 python 的新手,也是语义网查询领域的新手。我正在使用 SPARQLWrapper 库查询 dbpedia,我搜索了库文档但未能找到从 sparqlWrapper 触发到 dbpedia 的
我正在从 GenServer 中的句柄信息功能调用 elixir genserver 以添加电话号码获取表单客户端。但是一旦调用了handle_call,所有者进程就会崩溃[超时]。请帮忙。 全局创建
假设我的 WCF 服务中有以下执行链: ServiceMethod 调用并等待 Method1,然后调用并等待 Method2,后者调用并等待 Method3。最后 ServiceMethod 在返回
目前我正在开发一个从远程服务器发送和接收文件的应用程序。为了进行网络操作,我正在使用 QNetworkAccessManager。 要上传文件,我使用 QNetworkAccessManager::p
我是一名优秀的程序员,十分优秀!