appium / appium/java-client

Automation framework not launching the emulator

Open
#1,394 1 comment 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

Please describe the issue. If it is a bug, please briefly describe the steps to reproduce and the actual vs expected behavior.
If there is a feature that you would like to see added to the Appium Java client, please describe the necessity of this feature and the way that it should work.

Environment

  • Java client build version or git revision if you use some snapshot:
  • Appium server version or git revision if you use some snapshot:
  • Desktop OS/version used to run Appium if necessary:
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:
  • Mobile platform/version under test:
  • Real device or emulator/simulator:

Details

Please provide more details, if necessary.

Code To Reproduce Issue [ Good To Have ]

switch(platformName) {
case "Android":
desiredCapabilities.setCapability("automationName", props.getProperty("androidAutomationName"));
// desiredCapabilities.setCapability("appPackage", props.getProperty("androidAppPackage"));
// desiredCapabilities.setCapability("appActivity", props.getProperty("androidAppActivity"));
if(emulator.equalsIgnoreCase("true")) {
desiredCapabilities.setCapability("avd", deviceName);
desiredCapabilities.setCapability("avdLaunchTimeout", 120000);
}
desiredCapabilities.setCapability("systemPort", systemPort);
File androidAppUrl=new File("src/test/resources"+props.getProperty("androidAppLocation"));
utils.log().info("appUrl is " + androidAppUrl);
desiredCapabilities.setCapability("app", androidAppUrl.getAbsolutePath());
System.out.println(androidAppUrl.getAbsolutePath());
System.out.println(desiredCapabilities);

			driver = new AndroidDriver(url, desiredCapabilities);
			break;
		case "iOS":
			desiredCapabilities.setCapability("automationName", props.getProperty("iOSAutomationName"));
			desiredCapabilities.setCapability("bundleId", props.getProperty("iOSBundleId")); 
			desiredCapabilities.setCapability("wdaLocalPort", wdaLocalPort);
			desiredCapabilities.setCapability("webkitDebugProxyPort", webkitDebugProxyPort);
			File iOSAppUrl=new File("src/test/resources"+props.getProperty("iOSAppLocation"));
			utils.log().info("appUrl is " + iOSAppUrl);
			System.out.println(iOSAppUrl.getAbsolutePath());
			desiredCapabilities.setCapability("app", iOSAppUrl.getAbsolutePath());
			
			driver = new IOSDriver(url, desiredCapabilities);
			break;
		default:
			throw new Exception("Invalid platform! - " + platformName);
		}

Exception Stacktraces

UnknownError: An unknown server-side error occurred while processing the command. Original error: The application at '/Users/irfanmattikop/Desktop/Automation-Zenius/src/test/resources/app/Zenius-2.1.8-staging-2540.apk' does not exist or is not accessible
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:381:37)

Please create a gist with the pasted stacktrace of the exception thrown by java.

Link To Appium Logs

Calling AppiumDriver.getStatus() with args: []
[debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.18.0"}}
[HTTP] <-- GET /wd/hub/status 200 2 ms - 68
[HTTP]
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"app":"/Users/irfanmattikop/Desktop/Automation-Zenius/src/test/resources/app/Zenius-2.1.8-staging-2540.apk","avdLaunchTimeout":120000,"automationName":"UiAutomator2","platformName":"Android","udid":"emulator-5554","deviceName":"Pixel_3a_XL_API_30","avd":"Pixel_3a_XL_API_30","systemPort":"10000"},"capabilities":{"firstMatch":[{"appium:app":"/Users/irfanmattikop/Desktop/Automation-Zenius/src/test/resources/app/Zenius-2.1.8-staging-2540.apk","appium:automationName":"UiAutomator2","appium:avd":"Pixel_3a_XL_API_30","appium:avdLaunchTimeout":120000,"appium:deviceName":"Pixel_3a_XL_API_30","platformName":"android","appium:systemPort":"10000","appium:udid":"emulator-5554"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"/Users/irfanmattikop/Desktop/Automation-Zenius/src/test/resources/app/Zenius-2.1.8-staging-2540.apk","avdLaunchTimeout":120000,"automationName":"UiAutomator2","platformName":"Android","udid":"emulator-5554","deviceName":"Pixel_3a_XL_API_30","avd":"Pixel_3a_XL_API_30","systemPort":"10000"},null,{"firstMatch":[{"appium:app":"/Users/irfanmattikop/Desktop/Automation-Zenius/src/test/resources/app/Zenius-2.1.8-staging-2540.apk","appium:automationName":"UiAutomator2","appium:avd":"Pixel_3a_XL_API_30","appium:avdLaunchTimeout":120000,"appium:deviceName":"Pixel_3a_XL_API_30","platformName":"android","appium:systemPort":"10000","appium:udid":"emulator-5554"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1600336237064 (15:20:37 GMT+0530 (India Standard Time))
[Appium] Appium v1.18.0 creating new AndroidUiautomator2Driver (v1.56.1) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver] "alwaysMatch": {
[debug] [BaseDriver] "platformName": "android",
[debug] [BaseDriver] "appium:app": "/Users/irfanmattikop/Desktop/Automation-Zenius/src/test/resources/app/Zenius-2.1.8-staging-2540.apk",
[debug] [BaseDriver] "appium:automationName": "UiAutomator2",
[debug] [BaseDriver] "appium:avd": "Pixel_3a_XL_API_30",
[debug] [BaseDriver] "appium:avdLaunchTimeout": 120000,
[debug] [BaseDriver] "appium:deviceName": "Pixel_3a_XL_API_30",
[debug] [BaseDriver] "appium:systemPort": "10000",
[debug] [BaseDriver] "appium:udid": "emulator-5554"
[debug] [BaseDriver] },
[debug] [BaseDriver] "firstMatch": [
[debug] [BaseDriver] {}
[debug] [BaseDriver] ]
[debug] [BaseDriver] }
[BaseDriver] Number capability passed in as string. Functionality may be compromised.
[BaseDriver] Capability 'systemPort' changed from string ('10000') to integer (10000). This may cause unexpected behavior
[BaseDriver] Session created with session id: de53845f-b7d8-4570-a142-983f92b0ada9
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1600336237073 (15:20:37 GMT+0530 (India Standard Time))
[debug] [W3C] Encountered internal error running command: Error: The application at '/Users/irfanmattikop/Desktop/Automation-Zenius/src/test/resources/app/Zenius-2.1.8-staging-2540.apk' does not exist or is not accessible
[debug] [W3C] at /usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/helpers.js:235:13
[debug] [W3C] Destroying socket connection
[HTTP] <-- POST /wd/hub/session 500 35 ms - 809
[HTTP]

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 Java client snippet and the POST /wd/hub/session log, then compare the configured app path with the Android APK location. Check the missing Environment details and the reported Appium 1.18.0 and UiAutomator2 versions. Done means determining why the APK is inaccessible or documenting the missing reproduction details needed for a fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.