question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XCUITest driver not found

See original GitHub issue

The problem

When trying to run ios tests on simulator i am getting a failed to create session as it thinks xcuitest driver isn’t installed

Environment

  • Appium version (or git revision) that exhibits the issue: 2.0.0-beta.44
  • Desktop OS/version used to run Appium: Mac M1
  • Node.js version (unless using Appium.app|exe): v14.15.4
  • Npm or Yarn package manager: 8.19.2
  • Mobile platform/version under test: iOS
  • Real device or emulator/simulator: Simulator
  • Appium CLI or Appium.app|exe: Appium 2 cli

Details

Using these capabilities

{
  "platformName": "iOS",
  "appium:deviceName": "iPhone 8",
  "appium:platformVersion": "15.0",
  "appium:noReset": true,
  "appium:automationName": "xcuitest"
}

Link to Appium logs

Failed to create session. An unknown server-side error occurred while processing the command. Original error: Could not find a driver for automationName 'xcuitest' and platformName iOS'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error: ENOENT: no such file or directory, open '/Users/user/.appium/node_modules/appium-xcuitest-driver/build/index.js')

2022-09-21 19:48:28:039 - [debug] [AppiumDriver@adfa] Event 'newSessionRequested' logged at 1663789708039 (20:48:28 GMT+0100 (British Summer Time))
2022-09-21 19:48:28:040 - [Appium] Attempting to find matching driver for automationName 'xcuitest' and platformName 'iOS'
2022-09-21 19:48:28:040 - [Appium] The 'xcuitest' driver was installed and matched caps.
2022-09-21 19:48:28:040 - [Appium] Will require it at /Users/user/.appium/node_modules/appium-xcuitest-driver
2022-09-21 19:48:28:040 - [debug] [Appium] Requiring driver at /Users/user/.appium/node_modules/appium-xcuitest-driver
2022-09-21 19:48:28:046 - [debug] [AppiumDriver@adfa] Event 'newSessionStarted' logged at 1663789708046 (20:48:28 GMT+0100 (British Summer Time))
2022-09-21 19:48:28:047 - [debug] [AppiumDriver@adfa] Encountered internal error running command: Error: Could not find a driver for automationName 'xcuitest' and platformName iOS'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error: ENOENT: no such file or directory, open '/Users/user/.appium/node_modules/appium-xcuitest-driver/node_modules/appium/driver.js')
2022-09-21 19:48:28:048 - [debug] [AppiumDriver@adfa]     at DriverConfig.findMatchingDriver (/usr/local/lib/node_modules/appium/lib/extension/driver-config.js:174:13)
2022-09-21 19:48:28:048 - [debug] [AppiumDriver@adfa]     at AppiumDriver.createSession (/usr/local/lib/node_modules/appium/lib/appium.js:264:29)
2022-09-21 19:48:28:048 - [debug] [AppiumDriver@adfa]     at commandExecutor (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/driver.js:73:9)
2022-09-21 19:48:28:048 - [debug] [AppiumDriver@adfa]     at AppiumDriver.executeCommand (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/basedriver/driver.js:90:15)
2022-09-21 19:48:28:048 - [debug] [AppiumDriver@adfa]     at runMicrotasks (<anonymous>)
2022-09-21 19:48:28:048 - [debug] [AppiumDriver@adfa]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
2022-09-21 19:48:28:048 - [debug] [AppiumDriver@adfa]     at defaultBehavior (/usr/local/lib/node_modules/appium/lib/appium.js:669:16)
2022-09-21 19:48:28:048 - [debug] [AppiumDriver@adfa]     at ImageElementPlugin.handle (/Users/user/.appium/node_modules/@appium/images-plugin/lib/plugin.js:77:12)
2022-09-21 19:48:28:048 - [debug] [AppiumDriver@adfa]     at /usr/local/lib/node_modules/appium/lib/appium.js:726:16
2022-09-21 19:48:28:049 - [debug] [AppiumDriver@adfa]     at AppiumDriver.executeWrappedCommand (/usr/local/lib/node_modules/appium/lib/appium.js:763:16)
2022-09-21 19:48:28:049 - [debug] [AppiumDriver@adfa]     at AppiumDriver.executeCommand (/usr/local/lib/node_modules/appium/lib/appium.js:685:17)
2022-09-21 19:48:28:049 - [debug] [AppiumDriver@adfa]     at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:346:19)

Code To Reproduce Issue [ Good To Have ]

No installed drivers, then appium driver install xcuitest , then Attempt to run test, get the above output.

/Users/user/.appium/node_modules/appium-xcuitest-driver/node_modules DOES NOT have the expected within /appium/driver.js

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jlippscommented, Sep 21, 2022

do you have an old appium home structure? try to rm -rf ~/.appium then try the whole thing again. otherwise, do you have an APPIUM_HOME variable set? and otherwise, paste the full set of logs

0reactions
jlippscommented, Sep 22, 2022

yeah i think the way appium home is used changed between beta 37 and 40. glad it worked!

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebDriverAgent directory is not created after installing ...
Check whether you have done that step. Xcode ->Preferences -> Go to Accounts tab -> Make sure Apple id is set up ->...
Read more >
Not able to setup Appium XCUItest framework for iOS device
Hi Guys, I am trying to setup my real ios device with appium (version 1.20.0) for which i installed appium via npm i...
Read more >
WebDriverAgent folder missing appium 1.15.1 - Stack Overflow
I have installed appium 1.15. 1 to mac catalina 10.15. 2. I couldn't find WebDriverAgent folder inside appium-xcuitest-driver.
Read more >
appium-xcuitest-driver - npm
Appium XCUITest Driver is a combined solution, which allows performing automated black-box testing of iOS and tvOS native applications and WebKit web views....
Read more >
Can not find WebdriverAgent in Appium 1.15.0 and above?
Today i have updated my Appium from version 1.14.0 to 1.15.0 and guess what…..Webdriveragent folder was vanished from its location so i was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found