初学者第一次发文,有什么建议直接说
Windows 8.1
Appium v1.4.16
error: Using local app, but didn't end in .zip, .ipa or .apk
是指我的名子有错误吗?
@Before
public void setUp() throws Exception {
// set up appiup
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "src\\java\\apps\\ContactManager");
File app = new File(appDir, "ContactManager.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName","TEST");
capabilities.setCapability("platformVersion", "4.4.2");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("app", "D:\\new project\\Appium_test20170303\\demotest\\src\\main\\java\\apps");
capabilities.setCapability("appPackage", "com.example.android.contactmanager");
capabilities.setCapability("appActivity", ".ContactManager");
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
這是 appium 日誌
> info: --> POST /wd/hub/session {"capabilities":{"desiredCapabilities":{"app":"D:\\new project\\Appium_test20170303\\demotest\\src\\main\\java\\apps","appPackage":"com.example.android.contactmanager","appActivity":".ContactManager","platformName":"Android","deviceName":"TEST","platformVersion":"4.4.2"},"requiredCapabilities":{}},"desiredCapabilities":{"app":"D:\\new project\\Appium_test20170303\\demotest\\src\\main\\java\\apps","appPackage":"com.example.android.contactmanager","appActivity":".ContactManager","platformName":"Android","deviceName":"TEST","platformVersion":"4.4.2"},"requiredCapabilities":{}}
> info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_112-release)
> error: Using local app, but didn't end in .zip, .ipa or .apk
> info: [debug] Got configuration error, not starting session
> info: [debug] Cleaning up appium session
> error: Failed to start an Appium session, err was: Error: Bad app: D:\new project\Appium_test20170303\demotest\src\main\java\apps. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Using local app, but didn't end in .zip, .ipa or .apk
> info: [debug] Error: Bad app: D:\new project\Appium_test20170303\demotest\src\main\java\apps. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Using local app, but didn't end in .zip, .ipa or .apk
> at [object Object].<anonymous> (D:\appium\Appium\node_modules\appium\lib\devices\android\android-common.js:56:13)
> at [object Object].Device.configureLocalApp (D:\appium\Appium\node_modules\appium\lib\devices\device.js:100:5)
> at [object Object].Device.configureApp (D:\appium\Appium\node_modules\appium\lib\devices\device.js:68:10)
> at [object Object].androidCommon.configureApp (D:\appium\Appium\node_modules\appium\lib\devices\android\android-common.js:76:35)
> at [object Object].androidCommon.configure (D:\appium\Appium\node_modules\appium\lib\devices\android\android-common.js:37:10)
> at [object Object].Appium.configure (D:\appium\Appium\node_modules\appium\lib\appium.js:250:15)
> at [object Object].<anonymous> (D:\appium\Appium\node_modules\appium\lib\appium.js:118:10)
> at [object Object].Appium.start (D:\appium\Appium\node_modules\appium\lib\appium.js:129:5)
> at exports.createSession (D:\appium\Appium\node_modules\appium\lib\server\controller.js:188:16)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
> at Route.dispatch (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:100:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at D:\appium\Appium\node_modules\appium\lib\server\controller.js:39:7
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at Route.dispatch (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at methodOverride (D:\appium\Appium\node_modules\appium\node_modules\method-override\index.js:79:5)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at trim_prefix (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at logger (D:\appium\Appium\node_modules\appium\node_modules\morgan\index.js:136:5)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at trim_prefix (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at D:\appium\Appium\node_modules\appium\node_modules\body-parser\lib\read.js:111:5
> at done (D:\appium\Appium\node_modules\appium\node_modules\body-parser\node_modules\raw-body\index.js:248:14)
> info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Bad app: D:\\new project\\Appium_test20170303\\demotest\\src\\main\\java\\apps. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Using local app, but didn't end in .zip, .ipa or .apk)","origValue":"Bad app: D:\\new project\\Appium_test20170303\\demotest\\src\\main\\java\\apps. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Using local app, but didn't end in .zip, .ipa or .apk"},"sessionId":null}
> error: Unexpected error: Error: Can't set headers after they are sent.
> at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
> at ServerResponse.header (D:\appium\Appium\node_modules\appium\node_modules\express\lib\response.js:695:10)
> at ServerResponse.send (D:\appium\Appium\node_modules\appium\node_modules\express\lib\response.js:146:12)
> at ServerResponse.json (D:\appium\Appium\node_modules\appium\node_modules\express\lib\response.js:235:15)
> at ServerResponse.send (D:\appium\Appium\node_modules\appium\node_modules\express\lib\response.js:134:21)
> at D:\appium\Appium\node_modules\appium\lib\server\helpers.js:42:21
> at safely (D:\appium\Appium\node_modules\appium\lib\server\helpers.js:306:5)
> at module.exports.catchAllHandler (D:\appium\Appium\node_modules\appium\lib\server\helpers.js:41:3)
> at Layer.handle_error (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:58:5)
> at trim_prefix (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:300:13)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:100:14)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:84:5)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
> at Route.dispatch (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:100:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at D:\appium\Appium\node_modules\appium\lib\server\controller.js:39:7
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at Route.dispatch (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
> info: <-- POST /wd/hub/session 500 29.669 ms - 674
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at methodOverride (D:\appium\Appium\node_modules\appium\node_modules\method-override\index.js:79:5)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at trim_prefix (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at logger (D:\appium\Appium\node_modules\appium\node_modules\morgan\index.js:136:5)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at trim_prefix (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13) context: [POST /wd/hub/session {"capabilities":{"desiredCapabilities":{"app":"D:\\new project\\Appium_test20170303\\demotest\\src\\main\\java\\apps","appPackage":"com.example.android.contactmanager","appActivity":".ContactManager",]
> TypeError: Cannot set property 'onResetTimeout' of null
> at [object Object].Appium.configure (D:\appium\Appium\node_modules\appium\lib\appium.js:252:30)
> at [object Object].<anonymous> (D:\appium\Appium\node_modules\appium\lib\appium.js:118:10)
> at [object Object].Appium.start (D:\appium\Appium\node_modules\appium\lib\appium.js:129:5)
> at exports.createSession (D:\appium\Appium\node_modules\appium\lib\server\controller.js:188:16)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
> at Route.dispatch (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:100:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at D:\appium\Appium\node_modules\appium\lib\server\controller.js:39:7
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
> at Route.dispatch (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at methodOverride (D:\appium\Appium\node_modules\appium\node_modules\method-override\index.js:79:5)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at trim_prefix (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at logger (D:\appium\Appium\node_modules\appium\node_modules\morgan\index.js:136:5)
> at Layer.handle [as handle_request] (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
> at trim_prefix (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13)
> at D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
> at Function.proto.process_params (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
> at next (D:\appium\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
> at D:\appium\Appium\node_modules\appium\node_modules\body-parser\lib\read.js:111:5
> at done (D:\appium\Appium\node_modules\appium\node_modules\body-parser\node_modules\raw-body\index.js:248:14)
> at IncomingMessage.onEnd (D:\appium\Appium\node_modules\appium\node_modules\body-parser\node_modules\raw-body\index.js:294:7)
> at IncomingMessage.g (events.js:199:16)
> at IncomingMessage.emit (events.js:104:17)
> at _stream_readable.js:908:16
> at process._tickDomainCallback (node.js:381:11)