Appium (and desktop) unable to launch wda session since xCode13 and iOS15 - selenium-webdriver

Since my xCode got (automatically...) updated to 13 and all my simulators moved from iOS 14.5 to 15. with the same setup / commands I'm unable to launch the WDA from both the desktop app, and the node ( selenium server grid/node setup)
The issue exists for all simulators.
I can still use real device..
(the actual ports in errors might differ, the first one is from the actual automation where it fails, the 2nd and 3rd is from the desktop app -where it still fails with the same error. the root issue is still the same on both)
The error logs I get:
In short:
org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8205
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'Janoss-MacBook-Pro.local', ip: 'fe80:0:0:0:18e4:52:307c:8c7b%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '11.5', java.version: '11.0.11'
Driver info: driver.version: IOSDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8205
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:380:37)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'Janoss-MacBook-Pro.local', ip: 'fe80:0:0:0:18e4:52:307c:8c7b%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '11.5', java.version: '11.0.11'
Driver info: driver.version: IOSDriver
The longer error from the server:
[iOSSim] Got Simulator UI client PID: 11815
[iOSSim] Both Simulator with UDID 'F5A500AB-FAA5-41A0-A009-E5A8EDB8643A' and the UI client are currently running
[BaseDriver] Event 'simStarted' logged at 1632487969688 (14:52:49 GMT+0200 (Central European Summer Time))
[WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[DevCon Factory] Requesting connection for device F5A500AB-FAA5-41A0-A009-E5A8EDB8643A on local port 8100
[DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for F5A500AB-FAA5-41A0-A009-E5A8EDB8643A:8100
[XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:8100
[WebDriverAgent] WDA is not listening at 'http://127.0.0.1:8100/'
[WebDriverAgent] WDA is currently not running. There is nothing to cache
[XCUITest] Trying to start WebDriverAgent 2 times with 10000ms interval
[XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[BaseDriver] Event 'wdaStartAttempted' logged at 1632487969773 (14:52:49 GMT+0200 (Central European Summer Time))
[WebDriverAgent] Launching WebDriverAgent on the device
[WebDriverAgent] WebDriverAgent does not need a cleanup. The sources are up to date (1620631774000 >= 1620631774000)
[WebDriverAgent] Killing running processes 'xcodebuild.*F5A500AB-FAA5-41A0-A009-E5A8EDB8643A, F5A500AB-FAA5-41A0-A009-E5A8EDB8643A.*XCTRunner, xctest.*F5A500AB-FAA5-41A0-A009-E5A8EDB8643A' for the device F5A500AB-FAA5-41A0-A009-E5A8EDB8643A...
[WebDriverAgent] 'pgrep -if xcodebuild.*F5A500AB-FAA5-41A0-A009-E5A8EDB8643A' didn't detect any matching processes. Return code: 1
[WebDriverAgent] 'pgrep -if F5A500AB-FAA5-41A0-A009-E5A8EDB8643A.*XCTRunner' didn't detect any matching processes. Return code: 1
[WebDriverAgent] 'pgrep -if xctest.*F5A500AB-FAA5-41A0-A009-E5A8EDB8643A' didn't detect any matching processes. Return code: 1
[WebDriverAgent] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=F5A500AB-FAA5-41A0-A009-E5A8EDB8643A IPHONEOS_DEPLOYMENT_TARGET=15.0 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent'
[WebDriverAgent] Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability
[WebDriverAgent] Waiting up to 60000ms for WebDriverAgent to start
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:8100
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:8100
Then a long waiting with only the ECONNREFUSED error and finally failing:
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:8100
[XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8100). Retrying...
[XCUITest] UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8100
[XCUITest] at JWProxy.command (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:274:13)
[XCUITest] at runMicrotasks ()
[XCUITest] at processTicksAndRejections (internal/process/task_queues.js:85:5)
[XCUITest] Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8100
[XCUITest] Quitting and uninstalling WebDriverAgent
[WebDriverAgent] Shutting down sub-processes
[iOSSim] Building bundle path map
[iOSSim] The simulator has '1' bundles which have 'WebDriverAgentRunner-Runner' as their 'CFBundleName':
[iOSSim] 'com.jano.facebook.WebDriverAgentRunner.xctrunner'
[WebDriverAgent] Uninstalling WDAs: 'com.jano.facebook.WebDriverAgentRunner.xctrunner'
[XCUITest] {}
[DevCon Factory] Releasing connections for F5A500AB-FAA5-41A0-A009-E5A8EDB8643A device on any port number
[DevCon Factory] Found cached connections to release: ["F5A500AB-FAA5-41A0-A009-E5A8EDB8643A:8100"]
[DevCon Factory] Cached connections count: 0
[XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[IOSSimulatorLog] Stopping iOS log capture
[BaseDriver] Event 'newSessionStarted' logged at 1632488146662 (14:55:46 GMT+0200 (Central European Summer Time))
[MJSONWP] Encountered internal error running command: Error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8100
[MJSONWP] at quitAndUninstall (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:544:15)
[MJSONWP] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:610:11
[MJSONWP] at wrapped (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:60:13)
[MJSONWP] at retry (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:43:13)
[MJSONWP] at retryInterval (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:70:10)
[MJSONWP] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:559:7
[HTTP] <-- POST /wd/hub/session 500 177858 ms - 388
[HTTP]
[HTTP] --> DELETE /wd/hub/session

To solve this issue,
We need to update our appkum on the computer ( should be 1.22.0 or above)
To see your version:
appium -v
To install / Update your appium:
npm install -g appium
This fixed the simulator part. to fix the appium desktop, you also have to update the desktop app, but now it's moved on as 2 separate app.
One for the server
https://github.com/appium/appium-desktop/releases/
And one for the inspector https://github.com/appium/appium-inspector/releases

I had a similar problem with the old appium (where the server and the inspector were combined), and with the new version, where they were taken out separately.
I solved it by adding server Capabilities:
serverCapabilities.setCapability("wdaStartupRetries", "4");
serverCapabilities.setCapability("iosInstallPause","8000" );
serverCapabilities.setCapability("wdaStartupRetryInterval", "20000");
after that, the wda session became stable

I had the same problem
I solved it by adding appium desired capabilities and I reduced the time from 120 to 60 for newCommandTimeout capabilities
my appium capabilities' last status
"newCommandTimeout": 60,
"wdaStartupRetries": 3,
"wdaStartupRetryInterval": 20000

Related

Selenium server times out waiting for chromedriver - but everything's started

i've tried version 75, 74 and 73 of both chrome and driver. i've tried adding all the selenium jars that come with the server and language bindings to soapuis /bin/ext directory, and then removed them. I've set the server.jar file to chown 7777 (yeah i know i know!). I've installed Xvfb, even Xorg desktop... I've also tried different version of java, all java version 8
sh /home/venerable/SmartBear/SoapUI-5.5.0/bin/testrunner.sh -c 'tester2' -s 'Regression' "/home/venerable/projects/opengoogle" -t "/home/venerable/soapui-settings.xml" -f "/home/venerable/logs" -r -I
code it calls is
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
import org.openqa.selenium.WebDriver
System.setProperty("webdriver.chrome.driver","/home/venerable/driver/chromedriver")
System.setProperty("webdriver.chrome.logfile","/home/venerable/driver/chromedriver.log")
log.info '############ creating proxy info ##########'
import org.openqa.selenium.Proxy
Proxy proxy = new Proxy()
proxy.setAutodetect(false)
proxy.httpProxy = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue("proxy")
proxy.sslProxy = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue("proxy")
proxy.socksUsername = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "adUser" )
proxy.socksPassword = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "adPass" )
log.info 'from system: User is '+proxy.socksUsername
log.info 'from system: '+ System.getProperty("webdriver.chrome.driver")
log.info proxy
ChromeOptions chromeOptions = new ChromeOptions()
chromeOptions.proxy = proxy
chromeOptions.addArguments("--headless")
chromeOptions.addArguments("--no-sandbox")
chromeOptions.addArguments("--disable-dev-shm-usage")
chromeOptions.addArguments("--disable-gpu")
chromeOptions.addArguments("--disable-features=NetworkService")
chromeOptions.addArguments("--window-size=1920x1080")
chromeOptions.setBinary("/usr/bin/google-chrome-stable")
log.info '################# starting driver #################'
WebDriver driver = new ChromeDriver(chromeOptions)
log.info '================ driver started ================'
driver.get("http://www.google.com")
log.info ":):):):):):):):):)closing driver:(:(:(:(:(:(:(:(:(:("
driver.close()
driver.quit()
return
stack trace i get
================================
=
= SOAPUI_HOME = /home/venerable/SmartBear/SoapUI-5.5.0
= JAVA = /home/venerable/SmartBear/SoapUI-5.5.0/jre/bin/java
=
================================
2019-06-10 18:35:29,621 [main] WARN com.eviware.soapui.SoapUI - Could not find jfxrt.jar. Internal browser will be disabled.
SoapUI 5.5.0 TestCase Runner
####stack was too long so its been ommitted, this is where it counts tho
18:35:33,693 INFO [PluginManager] 5 plugins loaded in 2346 ms
18:35:33,693 INFO [DefaultSoapUICore] All plugins loaded
18:35:34,851 INFO [WsdlProject] Loaded project from [file:/home/venerable/projects/opengoogle]
18:35:34,861 INFO [SoapUITestCaseRunner] Running SoapUI tests in project [tester]
18:35:34,861 INFO [SoapUITestCaseRunner] Running TestCase [tester2]
18:35:34,866 INFO [SoapUITestCaseRunner] Running SoapUI testcase [tester2]
18:35:34,866 INFO [SoapUITestCaseRunner] running step [Groovy Script]
18:35:35,184 INFO [log] from system: /home/venerable/driver/chromedriver
18:35:35,202 INFO [log] ################# starting driver #################
Starting ChromeDriver 75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770#{#40}) on port 14279
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
18:35:55,406 ERROR [SoapUI] An error occurred [Timed out waiting for driver server to start.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'ebu-venerable', ip: '10.33.134.55', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.12.2.el7.x86_64', java.version: '1.8.0_212'
Driver info: driver.version: ChromeDriver], see error log for details
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'ebu-venerable', ip: '10.33.134.55', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.12.2.el7.x86_64', java.version: '1.8.0_212'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:202)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:188)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:157)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at Script1.run(Script1.groovy:16)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:90)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:76)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:594)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runTestCase(SoapUITestCaseRunner.java:573)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:405)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:202)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:137)
at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:112)
at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:122)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:14279/status] to be available after 20002 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100)
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:197)
... 33 more
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:205)
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:156)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
... 34 more
18:35:55,416 ERROR [SoapUITestCaseRunner] Groovy Script failed, exporting to [/home/venerable/logs/Regression-tester2-Groovy_Script-0-FAILED.txt]
18:35:55,426 INFO [SoapUITestCaseRunner] Finished running SoapUI testcase [tester2], time taken: 20542ms, status: FAILED
18:35:55,427 INFO [SoapUITestCaseRunner] TestCase [tester2] finished with status [FAILED] in 20542ms
I've followed these instructions, i see all the bits run individually. The thing is this code works on my windows machine no hassle
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start. Build info: version: 'unknown', revision: 'unknown'
and
Selenium Chrome Browser org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start
could this be a known issue? https://github.com/SeleniumHQ/selenium/issues/6160
Adding the below it finally worked
chromeOptions.addArguments("--headless")
chromeOptions.addArguments("--no-sandbox")
chromeOptions.addArguments("--disable-dev-shm-usage")
chromeOptions.addArguments("--disable-gpu")
chromeOptions.addArguments("--disable-features=NetworkService")
chromeOptions.addArguments("--window-size=1920x1080")
chromeOptions.addArguments("--disable-features=VizDisplayCompositor")
I now have to setup the proxy settings manually too:
Proxy proxy = new Proxy()
proxy.setAutodetect(false)
proxy.httpProxy = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue("proxy")
proxy.sslProxy = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue("proxy")
proxy.socksUsername = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "adUser" )
proxy.socksPassword = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "adPass" )

Appium - Unable to launch WebDriverAgent because of xcodebuild failure: Scripts/bootstrap.sh code 1

I am using webdriver.IO together with Appium to test an iOS hybrid App.
I get the following error before each test when it tries to spin up the iOS App:
Unable to launch WebDriverAgent because of xcodebuild failure: "Command 'Scripts/bootstrap.sh -d' exited with code 1"."
Here are the logs:
[debug] [XCUITest] The app has been installed successfully.
[debug] [BaseDriver] Event 'appInstalled' logged at 1545635044697 (02:04:04 GMT-0500 (Eastern Standard Time))
[XCUITest] Using WDA path: '/Users/MY_USER_NAME/Documents/CODE/ACTIVE/APPIUM/asialgearoid/mine2/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/Users/MY_USER_NAME/Documents/CODE/ACTIVE/APPIUM/asialgearoid/mine2/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[debug] [XCUITest] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [XCUITest] WDA is not listening at 'http://localhost:8100/'
[debug] [XCUITest] WDA is currently not running. There is nothing to cache
[debug] [XCUITest] Trying to start WebDriverAgent 2 times with 10000ms interval
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1545635044905 (02:04:04 GMT-0500 (Eastern Standard Time))
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: '/Users/MY_USER_NAME/Documents/CODE/ACTIVE/APPIUM/asialgearoid/mine2/node_modules/.bin/carthage'
[debug] [XCUITest] Running WebDriverAgent bootstrap script to install dependencies
[XCUITest] [1mFetching dependencies
[XCUITest] Error: Command "bootstrap" does not exist.
...
[debug] [BaseDriver] Event 'wdaStartFailed' logged at 1545635057640 (02:04:17 GMT-0500 (Eastern Standard Time))
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: "Command 'Scripts/bootstrap.sh -d' exited with code 1".
Any idea of how to solve?
After further digging I found out how to reproduce the error:
$ cd /myTestingProject/node_modules/appium-xcuitest-driver/WebDriverAgent
$ ./Scripts/bootstrap.sh
Output:
Fetching dependencies
Error: Command "bootstrap" does not exist.
I do not know if this was your problem at the time of writing, but I had this same issue and looked up the latest update documentation. The file bootstrap.sh has been changed to build.sh
This works for me:
cd /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent
./Scripts/build.sh -d
I tested by wiping my simulator so I could test this with a completely clean slate. I ran the above commands, relaunched the simulator, dropped a .app file onto the simulator, and the WebDriverAgent installed completely fine without any manual work opening Xcode.

Unable to launch appium configuration on iphone from Xcode

We are trying to launch a WebDriverAgent and its getting stuck at the following step (Extract of log):
[MJSONWP] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p exited with code 49
The app is getting installed on the phone.The error is only while attempting to launch from Xcode and works fine when run directly from the phone.
Code:
public void setup() throws MalformedURLException, InterruptedException { System.out.println("====Setting capabilities===="); DesiredCapabilities cap = new DesiredCapabilities(); // cap.setCapability("appium-version", "1.6.4"); cap.setCapability("platformVersion", "10.3"); // cap.setCapability("deviceName", "iPhone 6"); cap.setCapability("deviceName", "astha’s iPhone"); cap.setCapability("platformName", "iOS"); cap.setCapability("automationName", "XCUITest"); cap.setCapability("showXcodeLog", "true"); cap.setCapability("udid", "86c8805d20315df3c4f707e25ee4327a12106260"); //cap.setCapability("desiredCapabilities", "optional"); // cap.setCapability("udid","80072f1273b0ac59431f70934d9d5eec38de8a3a");
cap.setCapability("keychainPath", "/Users/atulmhetre/Documents/Certificates.p12"); //cap.setCapability("keychainPath", "/Users/atulmhetre/Library/Keychains/MyKeychain.keychain");
cap.setCapability("keychainPassword", "<password>"); /// Users/atulmhetre/Library/Keychains/ //// Users/atulmhetre/Documents/MyPrivateKey.p12 File app = new File("/Users/atulmhetre/Desktop/Sample Application/UiKitCatalog.app"); cap.setCapability("app",
"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app"); // cap.setCapability("app","/Users/atulmhetre/Library/Developer/Xcode/DerivedData/UIKitCatalog-akevtpkxonmoyogdvhqvrqlkacji/Build/Products/Debug-iphoneos/UIKitCatalog.app");
cap.setCapability("bundleId", "com.nihilent.IntegrationApp"); // cap.setCapability("bundleId","com.example.nihilent.UIKitCatalogMob");
cap.setCapability("noReset", true); System.out.println("====after setting===="); driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap); driver.findElementByName("Alerts").click();
Appium Logs:
[Appium] Welcome to Appium v1.6.4 [Appium] Non-default server args: [Appium] address: 127.0.0.1 [Appium] Appium REST http interface listener started on 127.0.0.1:4723 [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app","showXcodeLog":"true","noReset":true,"platformVersion":"10.3","automationName":"XCUITest","keychainPath":"/Users/atulmhetre/Documents/Certificates.p12","bundleId":"com.nihilent.IntegrationApp","keychainPassword":"republic123","platformName":"iOS","udid":"86c8805d20315df3c4f707e25ee4327a12106260","deviceName":"astha’s iPhone"},"requiredCapabilities":{},"capabilities":{"desiredCapabilities":{"app":"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app","showXcodeLog":"true","noReset":true,"platformVersion":"10.3","automationName":"XCUITest","keychainPath":"/Users/atulmhetre/Documents/Certificates.p12","bundleId":"com.nihilent.IntegrationApp","keychainPassword":"republic123","platformName":"iOS","udid":"86c8805d20315df3c4 [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app","showXcodeLog":"true","noReset":true,"platformVersion":"10.3","automationName":"XCUITest","keychainPath":"/Users/atulmhetre/Documents/Certificates.p12","bundleId":"com.nihilent.IntegrationApp","keychainPassword":"republic123","platformName":"iOS","udid":"86c8805d20315df3c4f707e25ee4327a12106260","deviceName":"astha’s iPhone"},{},{"desiredCapabilities":{"app":"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app","showXcodeLog":"true","noReset":true,"platformVersion":"10.3","automationName":"XCUITest","keychainPath":"/Users/atulmhetre/Documents/Certificates.p12","bundleId":"com.nihilent.IntegrationApp","keychainPassword":"republic123","platformName":"iOS","udid":"86c8805d20315df3c4f707e25ee4327a12106260","deviceName":"astha’s iPhone"},"requiredCapabilities":{},... [BaseDriver] Event 'newSessionRequested' logged at 1494757197935 (15:49:57 GMT+0530 (IST)) [Appium] Creating new XCUITestDriver (v2.27.2) session [Appium] Capabilities: [Appium] app: '/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app' [Appium] showXcodeLog: 'true' [Appium] noReset: true [Appium] platformVersion: '10.3' [Appium] automationName: 'XCUITest' [Appium] keychainPath: '/Users/atulmhetre/Documents/Certificates.p12' [Appium] bundleId: 'com.nihilent.IntegrationApp' [Appium] keychainPassword: 'republic123' [Appium] platformName: 'iOS' [Appium] udid: '86c8805d20315df3c4f707e25ee4327a12106260' [Appium] deviceName: 'astha’s iPhone' [XCUITest] XCUITestDriver version: 2.27.2 [BaseDriver] Capability 'showXcodeLog' changed from string to boolean. This may cause unexpected behavior [BaseDriver] Session created with session id: 8ffef180-184b-436c-8648-e4af5805b9d4 [XCUITest] Xcode version set to '8.3.2' (tools v8.1.0.0.1.1476494586) [XCUITest] iOS SDK Version set to '10.3' [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1494757198121 (15:49:58 GMT+0530 (IST)) [XCUITest] Available devices: 86c8805d20315df3c4f707e25ee4327a12106260 [XCUITest] Creating iDevice object with udid '86c8805d20315df3c4f707e25ee4327a12106260' [XCUITest] Determining device to run tests on: udid: '86c8805d20315df3c4f707e25ee4327a12106260', real device: true [BaseDriver] Using local app '/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app' [BaseDriver] Event 'appConfigured' logged at 1494757198383 (15:49:58 GMT+0530 (IST)) [XCUITest] Checking whether app '/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app' is actually present on file system [XCUITest] App is present [BaseDriver] Event 'resetStarted' logged at 1494757198385 (15:49:58 GMT+0530 (IST)) [XCUITest] Reset: fullReset not set. Leaving as is [BaseDriver] Event 'resetComplete' logged at 1494757198386 (15:49:58 GMT+0530 (IST)) [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog' [BaseDriver] Event 'logCaptureStarted' logged at 1494757198552 (15:49:58 GMT+0530 (IST)) [XCUITest] Setting up real device [XCUITest] Installing '/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app' on device with UUID '86c8805d20315df3c4f707e25ee4327a12106260'... [XCUITest] The app has been installed successfully. [BaseDriver] Event 'appInstalled' logged at 1494757201209 (15:50:01 GMT+0530 (IST)) [BaseDriver] Event 'wdaStartAttempted' logged at 1494757201211 (15:50:01 GMT+0530 (IST)) [XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj' [XCUITest] Launching WebDriverAgent on the device [XCUITest] Carthage found: '/usr/local/bin/carthage' [XCUITest] Killing hanging processes [XCUITest] Setting security for iOS device [BaseDriver] Event 'wdaStartFailed' logged at 1494757201483 (15:50:01 GMT+0530 (IST))
[XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49 [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying [XCUITest] Shutting down sub-processes [XCUITest] Removing WDA application from device [BaseDriver] Event 'wdaStartAttempted' logged at 1494757211928 (15:50:11 GMT+0530 (IST)) [XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj' [XCUITest] Launching WebDriverAgent on the device [XCUITest] Carthage found: '/usr/local/bin/carthage' [XCUITest] Killing hanging processes [XCUITest] Setting security for iOS device [BaseDriver] Event 'wdaStartFailed' logged at 1494757212093 (15:50:12 GMT+0530 (IST))
[XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49 [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying [XCUITest] Shutting down sub-processes [XCUITest] Removing WDA application from device [XCUITest] Error: Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49
at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:374:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7) Error: Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49
at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:374:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7) [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on. [iOSLog] Stopping iOS log capture [MJSONWP] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49
at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:374:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7) [HTTP] <-- POST /wd/hub/session 500 24471 ms - 317
Appreciate your responses in advance.

Getting "Error: read ECONNRESET" on reseting and launching the app

I am getting the following error on resetting the app [driver.resetApp()] and on launching the app on Appium (version: 1.4.16.1). I am using Java.
Eclispe console
org.openqa.selenium.WebDriverException: chrome not reachable
(Session info: chrome=50.0.2661.86)
(Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.08 seconds
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'IN2084073W1', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21'
*** Element info: {Using=id, value=password}
Session ID: 2968b7e9-948e-4b75-94ed-838d10a08c82
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{platform=LINUX, app=C:/apk/appname.apk, javascriptEnabled=true, appActivity=.MainActivity, browserName=, networkConnectionEnabled=true, desired={newCommandTimeout=120, app=C:/apk/surveyorapp.apk, platformVersion=5.1, deviceName=TA93303Q2F, platformName=Android, appActivity=.MainActivity, browserName=, appPackage=com.axa.surveyorapp}, locationContextEnabled=false, appPackage=com.axa.surveyorapp, newCommandTimeout=120, platformVersion=5.1, databaseEnabled=false, deviceName=TA93303Q2F, platformName=Android, webStorageEnabled=false, warnings={}, takesScreenshot=true}]
Appium Log
error: Could not proxy command to remote server. Original error: Error: read ECONNRESET
error: Chromedriver: Chromedriver exited unexpectedly with code 3221225477, signal null
info: Chromedriver: Changed state to 'stopped'
warn: Chromedriver for context WEBVIEW_com.clientname.appname stopped unexpectedly
error: Chromedriver quit unexpectedly during session
Update
Thanks for the update Emna. I have tried your option.
Can you please let me know how exactly I need to add this. I am using AndroidDriver not AppiumDriver. I have tried with both, but I'm getting below error.
Try to use :
(AppiumDriver)driver.resetApp();
Instead of :
driver.resetApp();
You can have a look into this link: Appium java-client
and use this link also to download ;)

Protractor - Safari - Timed out awaiting response to command "sendKeysToElement"

One of my E2E Test is failing only on Safari browser, when trying to send Text to an inputBox.
element(by.css('#content')).clear();
element(by.css('#content')).sendKeys("%20%DCben%20von%20Xylophonmusik%20qu%E4lt%20jeden%20gr%F6%DFeren%20Zwerg%20El%20ping%FCino%20Wenceslao%20hizo%20kil%F3metros%20bajo%20exhaustiva%20ll"); //UTF Text
Seeing following error in Webdriver manager console
18:40:12.150 INFO - Executing: [send keys: 16 [[SafariDriver: safari
on MAC (null)] -> css selector: #contentText],
[Falsches%20%DCben%20von%20Xylophonmusik%20qu%E4lt%20jeden%20gr%F6%DFeren%20Zwerg%20El%20ping%FCino%20Wenceslao%20hizo%20kil%F3metros%20bajo%20exhaustiva%20lluvia%20y%20%0A%200c%F4t%E9%20de%20l%27alc%F4ve%20ovo%EFde%2C%20o%F9%20les%20b%FBche%u0E40%u18:40:42.663
WARN - Exception thrown org.openqa.selenium.TimeoutException: Timed
out awaiting response to command "sendKeysToElement" after 30004 ms
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 30.02 seconds Build info: version:
'2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50' System
info: host: 'vq-mac-dt-036.local', ip: '10.21.134.62', os.name: 'Mac
OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version:
'1.8.0_31' Driver info: org.openqa.selenium.safari.SafariDriver
Capabilities [{browserName=safari, takesScreenshot=true,
javascriptEnabled=true, version=7.0.6, cssSelectorsEnabled=true,
platform=MAC, secureSsl=true}] Session ID: null at
sun.reflect.GeneratedConstructorAccessor57.newInstance(Unknown Source)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowa18:40:42.664
WARN - Exception: Timed out awaiting response to command
"sendKeysToElement" after 30004 ms (WARNING: The server did not
provide any stacktrace information) Command duration or timeout: 30.02
seconds
This test is working in Firefox, Chrome Browsers. I can't find any open issue related to safari driver.
Could you please advise, how to resolve this.
Thanks in advance.
Try chaining the clear, click and sendKeys functions on the input box to send the value. I don't think the UTF8 text should cause any problem. Here's how to do it -
var ele = element(by.css('#content'));
ele.clear().then(function(){
ele.click().then(function(){
ele.sendKeys("%20%DCben%20von%20Xylophonmusik%20qu%E4lt%20jeden%20gr%F6%DFeren%20Zwerg%20El%20ping%FCino%20Wenceslao%20hizo%20kil%F3metros%20bajo%20exhaustiva%20ll"); //UTF Text
});
});
Hope this helps.

Resources