facebookarchive / WebDriverAgent

A WebDriver server for iOS that runs inside the Simulator.
Other
4.15k stars 1.38k forks source link

Test hangs sporadically when set Value is called #476

Open ptsiakos77 opened 7 years ago

ptsiakos77 commented 7 years ago

Appium 1.6.4 beta version XCode 8.2 Run on real device iphone 6s

My test suite hangs sporadically when I type values usually in search fields.(Usually it manages to type a part of value in the field and then stucks). This is not happening consistently but when it happens the logs are as follows:

[HTTP] --> POST /wd/hub/session/033fdfb0-031d-42e0-851f-db8ea44dff3d/element/049105F2-4EC2-48A5-8E24-C00271E85DA7/value {"id":"049105F2-4EC2-48A5-8E24-C00271E85DA7","value":["Dev Ops"]} [debug] [MJSONWP] Calling AppiumDriver.setValue() with args: [["Dev Ops"],"049105F2-4EC2-48A5-8E24-C00271E85DA7","033fdfb0-031d-42e0-851f-db8ea44dff3d"] [debug] [XCUITest] Executing command 'setValue' [debug] [JSONWP Proxy] Proxying [POST /element/049105F2-4EC2-48A5-8E24-C00271E85DA7/value] to [POST http://localhost:8100/session/4773D56E-0639-4FBB-A722-76C20A5648E8/element/049105F2-4EC2-48A5-8E24-C00271E85DA7/value] with body: {"value":["D","e","v"," ","O","p","s"]} [HTTP] <-- POST /wd/hub/session/033fdfb0-031d-42e0-851f-db8ea44dff3d/element/049105F2-4EC2-48A5-8E24-C00271E85DA7/value - - ms - - [HTTP] --> POST /wd/hub/session/033fdfb0-031d-42e0-851f-db8ea44dff3d/element/049105F2-4EC2-48A5-8E24-C00271E85DA7/value {"id":"049105F2-4EC2-48A5-8E24-C00271E85DA7","value":["Dev Ops"]} [debug] [MJSONWP] Calling AppiumDriver.setValue() with args: [["Dev Ops"],"049105F2-4EC2-48A5-8E24-C00271E85DA7","033fdfb0-031d-42e0-851f-db8ea44dff3d"] [debug] [XCUITest] Executing command 'setValue' [HTTP] <-- POST /wd/hub/session/033fdfb0-031d-42e0-851f-db8ea44dff3d/element/049105F2-4EC2-48A5-8E24-C00271E85DA7/value - - ms - - 04/02/17 00:17:23 Stevia [RC IOSController$$EnhancerBySpringCGLIB$$82e69aef@c6c3] ERROR - IOSLogger - Error communicating with the remote browser. It may have died. Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06' System info: host: 'Workables-iMac.local', ip: '10.9.42.250', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.3', java.version: '1.8.0_121' Driver info: driver.version: IOSDriver [HTTP] --> GET /wd/hub/session/033fdfb0-031d-42e0-851f-db8ea44dff3d/screenshot {} [MJSONWP] Driver proxy active, passing request on via HTTP proxy [debug] [XCUITest] Executing command 'proxyReqRes' [HTTP] <-- GET /wd/hub/session/033fdfb0-031d-42e0-851f-db8ea44dff3d/screenshot - - ms - - [HTTP] --> GET /wd/hub/session/033fdfb0-031d-42e0-851f-db8ea44dff3d/screenshot {} [MJSONWP] Driver proxy active, passing request on via HTTP proxy [debug] [XCUITest] Executing command 'proxyReqRes'

AND IT NEVER PROGRESSES FROM HERE...LIKE A DEADLOCK THAT NEVER EXITS This is kind of blocking because after that the suite is not finished and no results are taken

ptsiakos77 commented 7 years ago

Guys do you need any additional info for that? It's kind of blocking for our test suites since it may be sporadic but when we run the whole suite at least one test will be blocked by this cause and will block the whole suite

is it possible to be an appium problem? From what we say in release notes of appium 1.6.4 beta this version: Speed up setting the value of text fields

We are really blocked from this issue

VTINFOJames commented 7 years ago

I just reported a similar setValue() issue with Appium 1.6.4-beta for testing our native iOS app: https://github.com/facebook/WebDriverAgent/issues/480 I am running iOS 10.3 and 1.6.4-beta is the only Appium which supports iOS 10.3.

mykola-mokhnach commented 7 years ago

Possible duplicate of https://github.com/facebook/WebDriverAgent/issues/453

SatishKumarKV commented 7 years ago

Bug filed. ID : 31293498

VenkateshPS commented 7 years ago

Do we have a workaround for this yet?

I tried with Appium 1.6.5 Beta and OSCapabilities.setCapability("maxTypeFrequency",5); but issue is still reproducible.

SatishKumarKV commented 7 years ago

@VenkateshPS : Issue seems to be fixed with 1.6.4. Please use commandTimeouts capability. So far , i have not seen issue after adding this capability.

VenkateshPS commented 7 years ago

I was already using that

            iOSCapabilities.setCapability("deviceName","iPhone 6");
    iOSCapabilities.setCapability("platformVersion","10.2");
    iOSCapabilities.setCapability("bundleid", "com.vocera.vcs");
    iOSCapabilities.setCapability("app", getAppPath());
            iOSCapabilities.setCapability("udid", iOSDeviceId);
    iOSCapabilities.setCapability("automationName", "XCUITest");
    iOSCapabilities.setCapability("useNewWDA",true);
    iOSCapabilities.setCapability("newCommandTimeout",10000);
    iOSCapabilities.setCapability("maxTypeFrequency",30);
marekcirkos commented 7 years ago

@VenkateshPS Can you check if master works for you?

VenkateshPS commented 7 years ago

I tried running using master branch but it seems like missing dependency

[Xcode] 2017-06-01 12:06:22.515 xcodebuild[7485:260792] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted} [Xcode] [Xcode] TEST EXECUTE FAILED [Xcode] [Xcode] [Xcode] 2017-06-01 12:06:22.246432+0530 XCTRunner[559:145415] Running tests... [Xcode] 2017-06-01 12:06:22.489902+0530 XCTRunner[559:145415] The bundle “WebDriverAgentRunner” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. [Xcode] 2017-06-01 12:06:22.490142+0530 XCTRunner[559:145415] (dlopen_preflight(/var/containers/Bundle/Application/076C1D30-6AEA-4090-98B9-2669985A511E/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner): Library not loaded: @rpath/RoutingHTTPServer.framework/RoutingHTTPServer [Xcode] Referenced from: /private/var/containers/Bundle/Application/076C1D30-6AEA-4090-98B9-2669985A511E/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib [Xcode] Reason: no suitable image found. Did find: [Xcode] /private/var/containers/Bundle/Application/076C1D30-6AEA-4090-98B9-2669985A511E/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer: code signature invalid for '/private/var/containers/Bundle/Application/076C1D30-6AEA-4090-98B9-2669985A511E/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer' [Xcode] ) [Xcode] [XCUITest] xcodebuild exited with code '65' and signal 'null' [debug] [BaseDriver] Event 'wdaStartFailed' logged at 1496298982572 (12:06:22 GMT+0530 (IST)) [debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65 [debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying [XCUITest] Shutting down sub-processes [XCUITest] Shutting down iproxy process (pid 7484) [debug] [XCUITest] iproxy exited with code 'null' [debug] [XCUITest] Removing WDA application from device [debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1496298993036 (12:06:33 GMT+0530 (IST)) [XCUITest] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj' [debug] [XCUITest] Capability 'useNewWDA' set, so uninstalling WDA before proceeding [debug] [XCUITest] Removing WDA application from device [debug] [XCUITest] Error : Command 'ios-deploy --uninstall_only --id e72a1083c25ebf44c861e994e7b805258cf88344 --bundle_id com.apple.test.WebDriverAgentRunner-Runner' exited with code 253 [XCUITest] Error: Could not remove app: 'Command 'ios-deploy --uninstall_only --id e72a1083c25ebf44c861e994e7b805258cf88344 --bundle_id com.apple.test.WebDriverAgentRunner-Runner' exited with code 253' at IOSDeploy.remove$ (../../lib/ios-deploy.js:25: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 throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at process._tickCallback (internal/process/next_tick.js:109:7) Error: Could not remove app: 'Command 'ios-deploy --uninstall_only --id e72a1083c25ebf44c861e994e7b805258cf88344 --bundle_id com.apple.test.WebDriverAgentRunner-Runner' exited with code 253' at IOSDeploy.remove$ (../../lib/ios-deploy.js:25: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 throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at process._tickCallback (internal/process/next_tick.js:109:7) [debug] [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on. [debug] [iOSLog] Stopping iOS log capture [MJSONWP] Encountered internal error running command: Error: Could not remove app: 'Command 'ios-deploy --uninstall_only --id e72a1083c25ebf44c861e994e7b805258cf88344 --bundle_id com.apple.test.WebDriverAgentRunner-Runner' exited with code 253' at IOSDeploy.remove$ (../../lib/ios-deploy.js:25: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 throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at process._tickCallback (internal/process/next_tick.js:109:7) [HTTP] <-- POST /wd/hub/session 500 66735 ms - 320

VenkateshPS commented 7 years ago

I am unable to run using the default web driver Agent project which comes with Appium 1.6.5 beta was working fine till I made changes

I get the same error as, I already ran ./Scripts/bootstrap.sh why I update code,can‘t run in real devices #214

@diaojunxian please tell where did you added .framework

VenkateshPS commented 7 years ago

OK, I resolved the issue it was because of signing. @marekcirkos , I have given Automation run using Master branch...will update my findings.

VenkateshPS commented 7 years ago

@marekcirkos, Have not seen any hangs till now, keyboard issue coming though after upgrading to Xcode 8.3.2 and iOS 10.3.2 from Xcode 8.2.1 and iOS 10.2

prmrathod commented 7 years ago

Any updates on the issue? Can anyone suggest a temporary workaround, please?

OSCapabilities.setCapability("maxTypeFrequency",5) suggested above has been deprecated.

marekcirkos commented 7 years ago

@prmrathod Do you use latest WDA and Appium? Stuff seems to be working on our side.

VenkateshPS commented 7 years ago

I have seen this issue happening on latest Appium 1.7.0 with Xcode 9 and Xcode 8.

prmrathod commented 7 years ago

Yes @marekcirkos , I'm using the latest version. Appium 1.7.0, Xcode 9, MacOS Sierra 10.12.6, XCUITest Driver 2.49.0 (which came with Appium installation) and Real device iPhone 6/6plus.

prmrathod commented 7 years ago

Link to logs:

appiumlogs.docx

PrasadMadge commented 7 years ago

Hi Issac, so how can I update my webdriveragent to get the above new fix ? Is issac-wda branch stable ?