appium / appium/java-client

Could not start a new session. Response code 400. Message: Bad capabilities. appium 8.3.0

Open
#2,089 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Description

Starting winapp driver session fails after we upgraded Selenium to 4.8.1 and appium to 8.3.0. I am trying to launch windows desktop application.
I followed documentation: appium migrate 7 -> 8

public void winAppInitialization() {
	if (winAppSession != null && winAppSession.getSessionId() != null) {
		return;
	}
	try {
		BaseOptions capabilities = new BaseOptions();
		capabilities.setCapability("app", appLocation);

		AppiumServiceBuilder serviceBuilder = new AppiumServiceBuilder();
		serviceBuilder.withCapabilities(capabilities).usingAnyFreePort().withTimeout(Duration.ofSeconds(10));
		AppiumDriverLocalService appiumDriverLocalService = AppiumDriverLocalService.buildService(serviceBuilder);

		appiumDriverLocalService.start();

		WindowsDriver driver = new WindowsDriver(new URL("http://localhost:" + appiumDriverLocalService.getUrl().getPort() + "/wd/hub"), capabilities);
		driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));

	} catch (Exception e) {
		throw new InitializationException("Error at initializing win app driver, win driver location: "
				+ winDriverURL + " and app location: " + appLocation);
	}
}

Error

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 400. Message: Bad capabilities. Specify either app or appTopLevelWindow to create a session Build info: version: '4.8.1', revision: '8ebccac989' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_391' Driver info: io.appium.java_client.windows.WindowsDriver Command: [null, newSession {capabilities=[{platformName=WINDOWS, appium:deviceName=WindowsPC, appium:automationName=Windows, appium:app=C:\Program Files (x86)\Trizetto\Facets\System\Bin\ceraexe0.exe}], desiredCapabilities=Capabilities {appium:app: C:\Program Files (x86)\Triz..., appium:automationName: Windows, appium:deviceName: WindowsPC, platformName: WINDOWS}}] Capabilities {appium:app: C:\Program Files (x86)\Triz..., appium:automationName: Windows, appium:deviceName: WindowsPC, platformName: WINDOWS}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the winAppInitialization method and the Appium 7-to-8 migration guide linked in the report. Compare the capabilities passed to WindowsDriver with the capabilities shown in the 400 response, then verify the result by attempting to create a Windows desktop session with the configured app path.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.