mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.83k stars 274 forks source link

Error: Request for inputText failed, because of XCUITest server got crashed/exit #1483

Open rvarner opened 1 year ago

rvarner commented 1 year ago

I'm having trouble performing an inputText command, but taps seem to work just fine. I'm doing:

tapOn: "email" seems to work just fine. When It reaches the inputText line, I get: ℹ️ Retrying connection to the XCUITest server for 1... ℹ️ Retrying connection to the XCUITest server for 2... ℹ️ Retrying connection to the XCUITest server for 3... ℹ️ Retrying connection to the XCUITest server for 4... ℹ️ Retrying connection to the XCUITest server for 5... Error: ⚠️ Error: An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance. ⚠️ Error: An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance. Error: Request for inputText failed, because of XCUITest server got crashed/exit, body: {"errorMessage":"An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance.","code":"network-error"} ℹ️ Retrying connection to the XCUITest server for 1... Exception in thread "main" NetworkError(errorResponse=Request for inputText failed, because of XCUITest server got crashed/exit, body: {"errorMessage":"An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance.","code":"network-error"}) at xcuitest.XCTestDriverClient.handleExceptions(XCTestDriverClient.kt:272) at xcuitest.XCTestDriverClient.processResponse(XCTestDriverClient.kt:250) at xcuitest.XCTestDriverClient.executeJsonRequest(XCTestDriverClient.kt:232) at xcuitest.XCTestDriverClient.inputText(XCTestDriverClient.kt:144) at ios.xctest.XCTestIOSDevice$input$1.invoke(XCTestIOSDevice.kt:119) at ios.xctest.XCTestIOSDevice$input$1.invoke(XCTestIOSDevice.kt:117) at ios.xctest.XCTestIOSDevice.execute(XCTestIOSDevice.kt:222) at ios.xctest.XCTestIOSDevice.input(XCTestIOSDevice.kt:117) at ios.LocalIOSDevice.input(LocalIOSDevice.kt:82) at maestro.drivers.IOSDriver$inputText$1.invoke(IOSDriver.kt:378) at maestro.drivers.IOSDriver$inputText$1.invoke(IOSDriver.kt:378) at maestro.drivers.IOSDriver.runDeviceCall(IOSDriver.kt:480) at maestro.drivers.IOSDriver.inputText(IOSDriver.kt:378) at maestro.Maestro.inputText(Maestro.kt:452) at maestro.orchestra.Orchestra.inputTextCommand(Orchestra.kt:718) at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:265) at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:209) at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:119) at maestro.orchestra.Orchestra.runFlow$default(Orchestra.kt:83) at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:185) at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:54) at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:51) at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:145) at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:51) at maestro.cli.command.TestCommand$call$1.invoke(TestCommand.kt:177) at maestro.cli.command.TestCommand$call$1.invoke(TestCommand.kt:136) at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:101) at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58) at maestro.cli.command.TestCommand.call(TestCommand.kt:136) at maestro.cli.command.TestCommand.call(TestCommand.kt:46) at picocli.CommandLine.executeUserObject(CommandLine.java:1933) at picocli.CommandLine.access$1200(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332) at picocli.CommandLine$RunLast.handle(CommandLine.java:2326) at picocli.CommandLine$RunLast.handle(CommandLine.java:2291) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159) at maestro.cli.DisableAnsiMixin$Companion.executionStrategy(DisableAnsiMixin.kt:22) at picocli.CommandLine.execute(CommandLine.java:2058) at maestro.cli.AppKt.main(App.kt:117)

Thanks in advance for your help.

2023-09-22_155503.zip

okwast commented 1 year ago

Having the exact same issue. Even with an email input field. @rvarner did you ever find a solution for that?

okwast commented 1 year ago

Haha, restarting the iOS Simulator seemed to help. Not sure what happened. Probably an issue of the Simulator.

rvarner commented 1 year ago

@okwast as you pointed out, restarting the simulator worked. It is not a great workaround though. Tests should have the capability of being automated without any babysitting.

kii-lvgs commented 10 months ago

I had the same event happen to me.

barbaramartina commented 3 months ago

The same is happening to me... so far resetting the simulator did not work

barbaramartina commented 3 months ago

None of these workarounds worked:

Yesterday everything was running, today it stopped working, I updated maestro

kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@6e18d57
Caused by: NetworkError(errorResponse=Request for inputText failed, because of XCUITest server got crashed/exit, body: {"errorMessage":"An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance.","code":"network-error"})
    at xcuitest.XCTestDriverClient.handleExceptions(XCTestDriverClient.kt:280)
    at xcuitest.XCTestDriverClient.processResponse(XCTestDriverClient.kt:258)
    at xcuitest.XCTestDriverClient.executeJsonRequest(XCTestDriverClient.kt:240)
    at xcuitest.XCTestDriverClient.inputText(XCTestDriverClient.kt:152)
    at ios.xctest.XCTestIOSDevice$input$1.invoke(XCTestIOSDevice.kt:119)
    at ios.xctest.XCTestIOSDevice$input$1.invoke(XCTestIOSDevice.kt:117)
    at ios.xctest.XCTestIOSDevice.execute(XCTestIOSDevice.kt:227)
    at ios.xctest.XCTestIOSDevice.input(XCTestIOSDevice.kt:117)
    at ios.LocalIOSDevice.input(LocalIOSDevice.kt:82)
    at maestro.drivers.IOSDriver$inputText$1.invoke(IOSDriver.kt:388)
    at maestro.drivers.IOSDriver$inputText$1.invoke(IOSDriver.kt:388)
    at maestro.drivers.IOSDriver.runDeviceCall(IOSDriver.kt:499)
    at maestro.drivers.IOSDriver.inputText(IOSDriver.kt:388)
    at maestro.Maestro.inputText(Maestro.kt:480)
    at maestro.orchestra.Orchestra.inputTextCommand(Orchestra.kt:752)
    at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:259)
    at maestro.orchestra.Orchestra.executeSubflowCommands(Orchestra.kt:605)
    at maestro.orchestra.Orchestra.runSubFlow(Orchestra.kt:646)
    at maestro.orchestra.Orchestra.runFlowCommand(Orchestra.kt:514)
    at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:270)
    at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:201)
    at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:111)
    at maestro.orchestra.Orchestra.runFlow$default(Orchestra.kt:75)
    at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:185)
    at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:54)
    at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:51)
    at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:145)
    at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:51)
    at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:291)
    at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:249)
    at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:106)
    at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58)
    at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:249)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
barbaramartina commented 3 months ago

The last error I posted was solved for me, doing xcode-select -s ... and selecting the current xcode version... It had stopped working when I switched to xcode beta. I added a message to the slack channel. I hope there are no issues with the new version of Xcode or that any issues can be looked into before September.

https://mobile-dev-inc.slack.com/archives/C041FU72T54/p1722327307261019