Appium will not start a session without automationName
Your error
OpenQA.Selenium.WebDriverException: ''automationName' can't be blank'3 more lines it can showFix it fast
Most common cause, 1 of 3The session request has no automationName at all
Add the capability with the appium: prefix.
var options = new AppiumOptions();
options.PlatformName = "Android";
options.AutomationName = "UiAutomator2";
options.DeviceName = "emulator-5554";
options.App = "/path/to/app.apk";
var driver = new AndroidDriver(new Uri("http://127.0.0.1:4723/"), options);Short answer
Appium returns 'automationName' can't be blank on older 2.x servers, or 'automationName' is required to be present on current ones, when the session request has no appium:automationName capability. Appium 2 and later pick the driver by that name. Set it to UiAutomator2 for Android or XCUITest for iOS (C#: AppiumOptions.AutomationName) and install that driver. Applies to Appium 4.0.
Which cause do you have?
Search the test code for how the automation name is set, then list the drivers installed on the server. No hit in the code is cause 1, an AddAdditionalAppiumOption call for it is cause 2, and a name with no matching installed driver is cause 3.
grep -rn -i "automationName" --include=*.cs --include=*.py --include=*.java --include=*.js --include=*.ts .
appium driver list --installedThen find the line you see in this list and open its fix:
- 1The session request has no automationName at all
The capabilities in the code set platformName, deviceName and app, but nothing called automationName - 2C# code adds automationName as an extra option
The test fails on the client side with an ArgumentException that says to use the AutomationName property - 3No installed driver matches the name you sent
The error changes to Could not find a driver for automationName ... and appium driver list --installed does not show that driver
What does the error look like?
OpenQA.Selenium.WebDriverException: ''automationName' can't be blank''automationName' is required to be presentThere is already an option for the appium:automationName capability. Please use the AutomationName property instead.Could not find a driver for automationName 'UiAutomator2' and platformName 'Android'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see.
Cause 1 of 3
The session request has no automationName at all
You seeThe capabilities in the code set platformName, deviceName and app, but nothing called automationName
Check
Appium's server checks every new session against two required capabilities, platformName and automationName. Since Appium 2 the server picks a driver only by the automationName you send, so a request without it fails validation: older servers word it as can't be blank, current ones as is required to be present.
grep -rn -i "automationName" tests/ || echo "automationName is not set anywhere"Fix
Add the capability with the appium: prefix. The UiAutomator2 driver answers to UiAutomator2 on Android and the XCUITest driver to XCUITest on iOS. The .NET client has a typed property that sends appium:automationName for you.
var options = new AppiumOptions();
options.PlatformName = "Android";
options.AutomationName = "UiAutomator2";
options.DeviceName = "emulator-5554";
options.App = "/path/to/app.apk";
var driver = new AndroidDriver(new Uri("http://127.0.0.1:4723/"), options);Verify
The server log prints The 'uiautomator2' driver was installed and matched caps, and the test reaches its first step.
dotnet testConfirmed by appium.io
Cause 2 of 3
C# code adds automationName as an extra option
You seeThe test fails on the client side with an ArgumentException that says to use the AutomationName property
Check
AppiumOptions in the .NET client registers appium:automationName as a known capability tied to its AutomationName property. AddAdditionalAppiumOption puts appium: in front of names that have no colon and then checks the name, so passing automationName that way throws before any request leaves the machine.
grep -rn "AddAdditionalAppiumOption(\"automationName\"\|AddAdditionalAppiumOption(\"appium:automationName\"" --include=*.cs .Fix
Delete that call and set the property instead. Keep AddAdditionalAppiumOption for capabilities that have no typed property, such as driver-specific settings.
// remove:
// options.AddAdditionalAppiumOption("automationName", "UiAutomator2");
options.AutomationName = "UiAutomator2";
options.AddAdditionalAppiumOption("noReset", true);Verify
The ArgumentException is gone and the session request reaches the server.
dotnet test --filter FullyQualifiedName~SmokeConfirmed by raw.githubusercontent.com
Cause 3 of 3
No installed driver matches the name you sent
You seeThe error changes to Could not find a driver for automationName ... and appium driver list --installed does not show that driver
Check
Since Appium 2, installing the server installs no drivers at all. Once automationName is present, the server looks for an installed driver that declares that automation name and platform; when none is found it raises the 'Could not find a driver' error and suggests listing installed drivers.
appium driver list --installedFix
Stop the Appium server, install the driver for your platform and start the server again. The install output prints the automationName the driver expects, which must match your capability.
appium driver install uiautomator2 # Android only
appium setup mobile # UiAutomator2, Espresso, and XCUITest on macOS
appiumVerify
appium driver list --installed shows the driver with automationName UiAutomator2 or XCUITest, and a new session starts.
appium driver list --installedConfirmed by appium.io
How do I stop it coming back?
- Keep one shared capabilities builder for the whole test suite so platformName and automationName are set in one place.
- Install drivers in the CI image or a setup script with appium driver install, and print appium driver list --installed in the job log.
- Use the typed properties of AppiumOptions for standard capabilities and keep AddAdditionalAppiumOption for driver extras.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: QistLock, Nuclear Home Video, Raheeb.