Giter Site home page Giter Site logo

Comments (7)

mykola-mokhnach avatar mykola-mokhnach commented on September 23, 2024

The above exception is expected for older Xcuitest driver versions. Please provide the log from the recent one.

from appium.

KazuCocoa avatar KazuCocoa commented on September 23, 2024

Hm, I haven't checked well yet but possibly some error handling with usePreinstalledWDA...? The caps gave usePreinstalledWDA but no the app on the device.

[XCUITestDriver@848b (903fdf45)] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[XCUITestDriver@848b (903fdf45)] Trying to start WebDriverAgent once since at least one of webDriverAgentUrl,usePreinstalledWDA capabilities is provided
[XCUITestDriver@848b (903fdf45)] Event 'wdaStartAttempted' logged at 1715599585109 (18:26:25 GMT+0700 (Western Indonesia Time))
[XCUITestDriver@848b (903fdf45)] The bundle id 'com.facebook.WebDriverAgentRunner.xctrunner' did not exist
[XCUITest] Getting bundle ID from app '/Users/devicefarm/Documents/WDA/Bibit/WDA16/WebDriverAgentRunner-Runner.app': 'com.bibit.WebDriverAgentRunner.xctrunner'
[XCUITestDriver@848b (903fdf45)] Installing prebuilt WDA at '/Users/devicefarm/Documents/WDA/Bibit/WDA16/WebDriverAgentRunner-Runner.app'. Bundle identifier: com.bibit.WebDriverAgentRunner.xctrunner.
[XCUITestDriver@848b (903fdf45)] Installing '/Users/devicefarm/Documents/WDA/Bibit/WDA16/WebDriverAgentRunner-Runner.app' on the device with UUID '00008110-00165C180E9A201E'...
[XCUITestDriver@848b (903fdf45)] Using 'serial' app deployment strategy. You could change it by providing another value to the 'appInstallStrategy' capability
[XCUITestDriver@c7b5 (bb241dbd)] A new application installation is going to be performed. Will timeout in 466640.697167 ms
[XCUITest] Getting bundle ID from app '/Users/devicefarm/Documents/WDA/Bibit/WDA16/WebDriverAgentRunner-Runner.app': 'com.bibit.WebDriverAgentRunner.xctrunner'
[XCUITest] Successfully scanned the tree structure of '/Users/devicefarm/Documents/WDA/Bibit/WDA16/WebDriverAgentRunner-Runner.app'
[XCUITest] Got 27 folders and 39 files to push

I wonder if the caps needs to have appium:updatedWDABundleId with com.bibit.WebDriverAgentRunner
https://appium.github.io/appium-xcuitest-driver/latest/guides/run-preinstalled-wda/

from appium.

fatahillahardhi avatar fatahillahardhi commented on September 23, 2024

Hmm, I tried using my old WebDriverAgent (WDA) for iOS 16 (which I generated last year) and it worked well without terminating Appium, but I encountered other issues.

As I mentioned earlier, I was running with 6 devices, and each device encountered different errors (though other devices worked well without errors).

The errors were:

  1. org.openqa.selenium.NoSuchSessionException: A session is either terminated or not started
  2. org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent. Original error: Failed to start the preinstalled WebDriverAgent in 90000 ms. The WebDriverAgent might not be properly built or the device might be locked. The 'appium:wdaLaunchTimeout' capability modifies the timeout. Make sure the application com.bibit.WebDriverAgentRunner.xctrunner exists and is launchable. Refer to https://appium.github.io/appium-xcuitest-driver/latest/preparation/real-device-config/ for assistance with completing the preparation.
  3. org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot read properties of null (reading 'executeAtom')

I tried running with appium:updatedWDABundleId, but the result remained the same. Additionally, I upgraded both Appium to v2.5.4 and XCUITest to v7.15.2.

But mostly, the error encountered was number 1 (session terminated).

Here's the log:

cc @mykola-mokhnach and @KazuCocoa

from appium.

mykola-mokhnach avatar mykola-mokhnach commented on September 23, 2024

Sorry, it is impossible to parse the large log. Please report each issue separately according to the provided template.

from appium.

KazuCocoa avatar KazuCocoa commented on September 23, 2024

Ok case, maybe for ios 16.

3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] Executing xcrun devicectl device process signal --device 00008030-001419043428C02E --signal 2 --pid 1429 --quiet --json-output -
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] CFBundleIdentifier: "com.bibit.WebDriverAgentRunner.xctrunner"
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] Installing prebuilt WDA at '/Users/devicefarm/Documents/WDA/Bibit/WDA17/WebDriverAgentRunner-Runner.app'. Bundle identifier: com.bibit.WebDriverAgentRunner.xctrunner.
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] Installing '/Users/devicefarm/Documents/WDA/Bibit/WDA17/WebDriverAgentRunner-Runner.app' on the device with UUID '00008030-001419043428C02E'
3|appium bibit  | [XCUITest] Successfully scanned the tree structure of '/Users/devicefarm/Documents/WDA/Bibit/WDA17/WebDriverAgentRunner-Runner.app'
3|appium bibit  | [XCUITest] Got 15 folders and 15 files to push
3|appium bibit  | [XCUITest] Successfully created the remote folder structure (16 items)
3|appium bibit  | [XCUITest] Proceeding to parallel files push (max 8 writers)
3|appium bibit  | [XCUITest] Successfully pushed 15 folders and 15 files within 312ms
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] An upgrade of the existing application is going to be performed. Will timeout in 479578 ms
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] The installation of 'com.bibit.WebDriverAgentRunner.xctrunner' succeeded after 1622ms
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] The app has been installed successfully.
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] Launching WebDriverAgent on the device without xcodebuild
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] Executing xcrun devicectl device process launch --device 00008030-001419043428C02E --terminate-existing --environment-variables '{"USE_PORT":"51338","WDA_PRODUCT_BUNDLE_IDENTIFIER":"com.bibit.WebDriverAgentRunner.xctrunner","MJPEG_SERVER_PORT":"51350"}' com.bibit.WebDriverAgentRunner.xctrunner
3|appium bibit  | No tvOS simulators found!

Maybe this is ios 17 case only for the launching WDA? If this was only for iOS 17, I assume the built WDA is not good for iOS 17. e.g. The WDA was not prepared as https://appium.github.io/appium-xcuitest-driver/latest/guides/run-preinstalled-wda/#additional-requirement-for-ios-17tvos17

3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)] Failed to get the status endpoint in 90000 ms. The last error while accessing http://127.0.0.1:51330/: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up. Original error:: Condition unmet after 90006 ms. Timing out..
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)] Event 'wdaStartFailed' logged at 1715624718264 (01:25:18 GMT+0700 (Western Indonesia Time))
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)] Error: Failed to start the preinstalled WebDriverAgent in 90000 ms. The WebDriverAgent might not be properly built or the device might be locked. The 'appium:wdaLaunchTimeout' capability modifies the timeout.
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)]     at WebDriverAgent.launchWithPreinstalledWDA (/Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/lib/webdriveragent.js:420:13)
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)]     at runMicrotasks (<anonymous>)
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)]     at WebDriverAgent.launch (/Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/lib/webdriveragent.js:462:14)
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)]     at /Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:825:34
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)]     at wrapped (/Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/node_modules/asyncbox/lib/asyncbox.js:93:13)
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)]     at retry (/Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/node_modules/asyncbox/lib/asyncbox.js:66:13)
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)]     at retryInterval (/Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/node_modules/asyncbox/lib/asyncbox.js:103:10)
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)]     at /Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:815:7
3|appium bibit  | No tvOS simulators found!
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)] The executable name for the bundle id 'com.bibit.WebDriverAgentRunner.xctrunner' was 'WebDriverAgentRunner-Runner'
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)] Calling devicectl to kill the process
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)] Executing xcrun devicectl device info processes --device 00008101-001D491A2146001E --quiet --json-output -
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)] The process of the bundle id 'com.bibit.WebDriverAgentRunner.xctrunner' was not running
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] Trying to start WebDriverAgent once since at least one of webDriverAgentUrl,usePreinstalledWDA capabilities is provided
3|appium bibit  | [XCUITestDriver@55fc (5f5a4a3e)] Event 'wdaStartAttempted' logged at 1715624720966 (01:25:20 GMT+0700 (Western Indonesia Time))
3|appium bibit  | [XCUITestDriver@ddd1 (52fbd0ca)] {}
3|appium bibit  | [DevCon Factory] Releasing connections for 00008101-001D491A2146001E device on any port number
3|appium bibit  | [DevCon Factory] Found cached connections to release: ["00008101-001D491A2146001E:51330"]
3|appium bibit  | [DevCon Factory] Releasing the listener for '00008101-001D491A2146001E:51330'
3|appium bibit  | [iProxy@00008101:51330] Closing the connection
3|appium bibit  | [DevCon Factory] Cached connections count: 5
3|appium bibit  | [iProxy@00008101:51330] The connection has been closed
3|appium bibit  | [AppiumDriver@1092] Event 'newSessionStarted' logged at 1715624720967 (01:25:20 GMT+0700 (Western Indonesia Time))
3|appium bibit  | [device-farm] 📱 Device UDID 00008101-001D491A2146001E unblocked. Reason: Session failed to create
3|appium bibit  | [AppiumDriver@1092] Encountered internal error running command: Error: Unable to launch WebDriverAgent. Original error: Failed to start the preinstalled WebDriverAgent in 90000 ms. The WebDriverAgent might not be properly built or the device might be locked. The 'appium:wdaLaunchTimeout' capability modifies the timeout.. Make sure the application com.bibit.WebDriverAgentRunner.xctrunner exists and it is launchable. https://appium.github.io/appium-xcuitest-driver/latest/preparation/real-device-config/ may help to complete the preparation.
3|appium bibit  | [AppiumDriver@1092]     at /Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:848:19
3|appium bibit  | [AppiumDriver@1092]     at wrapped (/Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/node_modules/asyncbox/lib/asyncbox.js:93:13)
3|appium bibit  | [AppiumDriver@1092]     at retry (/Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/node_modules/asyncbox/lib/asyncbox.js:66:13)
3|appium bibit  | [AppiumDriver@1092]     at retryInterval (/Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/node_modules/asyncbox/lib/asyncbox.js:103:10)
3|appium bibit  | [AppiumDriver@1092]     at /Users/devicefarm/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:815:7

Yes, it would be helpful to split issues

from appium.

fatahillahardhi avatar fatahillahardhi commented on September 23, 2024

@KazuCocoa In the first attempt, Appium usually breaks. I tried using the pm2 library so that when it breaks, it will restart Appium. Here, sometimes it continues successfully, but mostly it ends up with an error like org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are an invalid address of the remote server or browser startup failure.

However, when I tried with just one device, Appium did break initially, but when Appium attempted to resume, it started running again and succeeded. However, when I tried with 3 devices, all of them running iOS 17, it still did not succeed and encountered errors

Perhaps these logs can help provide more clarity and insight into the issue.
https://gist.github.com/fatahillahardhi/35039c38eda85876aa5c785640d3f2eb

You can examine lines 1252 and 1253 in the provided log, where it shows that RemoteDebugger and XCUITest are running, but suddenly stop, and then pm2 restarts Appium because it has stopped

from appium.

KazuCocoa avatar KazuCocoa commented on September 23, 2024

I haven no idea what could cause the kill. Perhaps you could collect possible JavaScript info like #18566 (in case it could be memory related)

from appium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.