Appium :: org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话

时间:2019-12-06 13:57:44

标签: selenium-webdriver appium ios-ui-automation macos-catalina appium-desktop

  1. 已更新为MacOS catalina
  2. 更新的appium桌面1.15.1

以下是appium服务器上的例外情况

  

[Appium] Appium v​​1.15.1创建新的XCUITestDriver(v2.133.1)会话[Appium]根据服务器命令行参数,将宽松的安全性应用于“ XCUITestDriver”。除非被--de​​ny-insecure [BaseDriver]明确禁用,否则将启用所有不安全的功能[BaseDriver]提供了MJSONWP所需的功能[BaseDriver]使用W3C功能创建会话:{[BaseDriver]“ alwaysMatch”:{[BaseDriver]“ platformName” :“ ios”,[BaseDriver]“ appium:automationName”:“ XCUITest”,[BaseDriver]“ appium:bundleId”:“ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ”,[BaseDriver]“ appium:deviceName”:“ iPhone7_Hml”,[BaseDriver]“ appium: newCommandTimeout“:160,[BaseDriver]” appium:noReset“:true,[BaseDriver]” appium:platformVersion“:” 13.2“,[BaseDriver]” appium:udid“:” 89c4364185f2f1dba22992faaae1179e32a4eb41“,[BaseDriver]” appium:xcodeOr :“ XXXXXXXXXXXXXXXXXXXX”,[BaseDriver]“ appium:xcodeSigningId”:“ iPhone开发人员” [BaseDriver]},[BaseDriver]“ firstMatch”:[[BaseDriver] {} [BaseDriver]] [BaseDriver]} [BaseDriver]使用会话ID:ee9f8be2-da63-44d3-9f8a-0d433ea9f2f8 [XCUITest]当前用户:'Yayati'[XCUITest]可用设备:8 9c4364185f2f1dba22992faaae1179e32a4eb41,ccfe00fee87aa9140b71a98eedc18c88a214121d,3bdf2f4113dfccd88c17e26b56dc2e03b53f2812,9f993665a8a2abf6b22fec56e576487a4b40a818 [XCUITest]创建的iDevice与UDID '89c4364185f2f1dba22992faaae1179e32a4eb41'[XCUITest]对象确定装置上运行测试:UDID: '89c4364185f2f1dba22992faaae1179e32a4eb41',实际的设备:真[BaseDriver]事件 'xcodeDetailsRetrieved' 记录在1575638568501(18 :52:48 GMT + 0530(IST))[BaseDriver]事件'appConfigured'记录在1575638568501(18:52:48 GMT + 0530(IST))[BaseDriver]事件'resetStarted'记录在1575638568501(18:52:48 GMT + 0530(IST))[XCUITest]重置:未设置完全重置。保留为[BaseDriver]事件'resetComplete',记录为1575638568501(18:52:48 GMT + 0530(IST))[XCUITest]继续进行,但未捕获设备日志:拒绝连接到端口53356 [XCUITest]设置真实设备[XCUITest ]错误:在Usbmux.connect(/Applications/Appium.app/Contents/Resources/app/node_modules/appium-ios-device/lib/usbmux/index.js:183:13)上,拒绝连接到端口53359 [XCUITest] [DevCon Factory]在任何端口号上释放89c4364185f2f1dba22992faaae1179e32a4eb41设备的连接[DevCon Factory]找不到缓存的连接[BaseDriver]事件'newSessionStarted'记录在1575638608946(18:53:28 GMT + 0530(IST))[W3C]内部错误运行命令:错误:Usbmux.connect(/Applications/Appium.app/Contents/Resources/app/node_modules/appium-ios-device/lib/usbmux/index.js在端口53359 [W3C]的连接被拒绝: 183:13)[HTTP] <-POST / wd / hub / session 500 40502 ms-702

注意:在更新之前,它可以正常工作。

下面是我在Eclipse控制台上获取的日志::

FAILED CONFIGURATION: @BeforeTest beforeTest
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: Connection was refused to port 53359
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'M16IMACHDMGG7J.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.1', java.version: '12.0.1'
Driver info: driver.version: IOSDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Connection was refused to port 53359
    at getResponseForW3CError (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9)
    at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:388:37)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'M16IMACHDMGG7J.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.1', java.version: '12.0.1'
Driver info: driver.version: IOSDriver
    at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
    at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
    at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
    at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41)
    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
    at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
    at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:323)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
    at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:37)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:86)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:96)
    at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:92)
    at utils.Capability.capability_phone(Capability.java:53)
    at testcases.search.beforeTest(search.java:74)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
    at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
    at org.testng.TestRunner.beforeRun(TestRunner.java:529)
    at org.testng.TestRunner.run(TestRunner.java:497)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
    at org.testng.SuiteRunner.run(SuiteRunner.java:364)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
    at org.testng.TestNG.runSuites(TestNG.java:1049)
    at org.testng.TestNG.run(TestNG.java:1017)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
    ... 39 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Connection was refused to port 53359
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'M16IMACHDMGG7J.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.1', java.version: '12.0.1'
Driver info: driver.version: IOSDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Connection was refused to port 53359
    at getResponseForW3CError (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9)
    at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:388:37)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
    at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
    at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
    at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
    at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
    at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
    ... 44 more

Capability which I am using are as follows :

 public static IOSDriver capability_phone() throws MalformedURLException {
 final String URL_STRING = "http://0.0.0.0:4723/wd/hub";
 url = new URL(URL_STRING);
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("deviceName","iPhone7_Hml");
cap.setCapability("udid","89c4364185f2f1dba22992faaae1179e32a4eb41");
cap.setCapability("platformVersion","13.2");
cap.setCapability("platformName","IOS");
cap.setCapability("automationName", "XCUITest");
cap.setCapability("bundleId","com.hungama.myplay");
cap.setCapability("noReset",true);
cap.setCapability("xcodeSigningId", "iPhone Developer");
 cap.setCapability("xcodeOrgId", "XXXXXXXXXXXXXXXXXXXX");
 cap.setCapability("newCommandTimeout", 160);
 we = new IOSDriver(url, cap);
 we.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
System.out.println(" ~~~ !!! Setting the capabilities !!! ~~~ ");
 return we;
        }

[XCUITest]继续而不捕获设备日志:连接被拒绝到端口57483 [XCUITest]设置真实设备 [XCUITest]错误:连接被拒绝到端口57486 [XCUITest]位于Usbmux.connect(/Applications/Appium.app/Contents/Resources/app/node_modules/appium-ios-device/lib/usbmux/index.js:183:13) [DevCon Factory]在任何端口号上释放f29645da08dedad0760f2efa2e451949ea4124d2设备的连接 [DevCon Factory]找不到缓存的连接 [BaseDriver]事件“ newSessionStarted”记录在1576053574827(14:09:34 GMT + 0530(IST)) [W3C]遇到内部错误运行命令:错误:连接被拒绝到端口57486 [W3C]位于Usbmux.connect(/Applications/Appium.app/Contents/Resources/app/node_modules/appium-ios-device/lib/usbmux/index.js:183:13) [HTTP] <-POST / wd / hub / session 500 80492 ms-702

0 个答案:

没有答案