Open TamTamThomas opened 4 years ago
facing the same issue.
the package version of @wdio/cli in this repo is ^5.16.10 (v5) , this is working correctly but the latest version of @wdio/cli is 6.1.24 (v6) , issue starts occurring
I guess there are some breaking changes between the versions
by default wdio client expects the server to be on 4444 port, but if we want to configure we need to add port in the capabilities section .
So either start the appium sever on 4444 with out specifying any port number on wdio.conf.js or specify port property to be the port number on which appium server is running on
capabilities: [{ port: 4723, platformName: 'Android', 'appium:deviceName': 'Pixel 3a', 'appium:app': './Users/xyz/appium_js/ApiDemos-debug.apk' }],
I also had to install chai in my case.
This changes got my test cases working hope this helps @TamTamThomas
@sumanth-dnbk Worked for me adding port: 4723 in capabalities too. Thanks!
I added path to the config and port in the capabilities:
let { join } = require('path');
exports.config = {
//
//
path: '/wd/hub/',
capabilities: [{
port: 4723,
platformName: 'Android',
'appium:deviceName': 'Pixel 2 API 28',
'appium:app': join(process.cwd(), './ApiDemos-debug.apk')
}],
//
//
}
Hi,
error message is the below: ERROR webdriver: session not created: Unable to create session from { "desiredCapabilities": { "platformName": "Android", "appium:deviceName": "Pixel", "appium:app": ".\u002fUsers\u002fzsolt\u002fappium_js\u002fApiDemos-debug.apk"
However in wdio.conf.js the below is set: capabilities: [{ platformName: 'Android', 'appium:deviceName': 'Pixel', 'appium:app': './Users/zsolt/appium_js/ApiDemos-debug.apk' }],
What could be the problem? I have tried different paths, copied your wdio.conf.js file, read articles but could not figure out the root of this problem. Appium-doctor does not show any missing mandatory dependencies. Android SDK path is set, JAVA HOME path is set.
wdio.config.js:
//let {join} = require('path'); exports.config = { // // ==================== // Runner Configuration // ==================== // // WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or // on a remote machine). runner: 'local', port: 4723, services: ['appium'], // // ================== // Specify Test Files // ================== // Define which test specs should run. The pattern is relative to the directory // from which
wdio
was called. Notice that, if you are callingwdio
from an // NPM script (see https://docs.npmjs.com/cli/run-script) then the current working // directory is where your package.json resides, sowdio
will be called from there. // specs: [ './test/specs/*/.js' ], // Patterns to exclude. exclude: [ // 'path/to/excluded/files' ], // // ============ // Capabilities // ============ // Define your capabilities here. WebdriverIO can run multiple capabilities at the same // time. Depending on the number of capabilities, WebdriverIO launches several test // sessions. Within your capabilities you can overwrite the spec and exclude options in // order to group specific specs to a specific capability. // // First, you can define how many instances should be started at the same time. Let's // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec // files and you set maxInstances to 10, all spec files will get tested at the same time // and 30 processes will get spawned. The property handles how many capabilities // from the same test should run tests. // maxInstances: 1, // // If you have trouble getting all important capabilities together, check out the // Sauce Labs platform configurator - a great tool to configure your capabilities: // https://docs.saucelabs.com/reference/platforms-configurator // capabilities: [{ platformName: 'Android', 'appium:deviceName': 'Pixel', 'appium:app': './Users/zsolt/appium_js/ApiDemos-debug.apk' }], // // =================== // Test Configurations // =================== // Define all options that are relevant for the WebdriverIO instance here // // Level of logging verbosity: trace | debug | info | warn | error | silent logLevel: 'error', // // Set specific log levels per logger // loggers: // - webdriver, webdriverio // - @wdio/applitools-service, @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service // - @wdio/mocha-framework, @wdio/jasmine-framework // - @wdio/local-runner, @wdio/lambda-runner // - @wdio/sumologic-reporter // - @wdio/cli, @wdio/config, @wdio/sync, @wdio/utils // Level of logging verbosity: trace | debug | info | warn | error | silent // logLevels: { // webdriver: 'info', // '@wdio/applitools-service': 'info' // }, // // If you only want to run your tests until a specific amount of tests have failed use // bail (default is 0 - don't bail, run all tests). bail: 0, // // Set a base URL in order to shorten url command calls. If yoururl
parameter starts // with/
, the base url gets prepended, not including the path portion of your baseUrl. // If yoururl
parameter starts without a scheme or/
(likesome/path
), the base url // gets prepended directly. baseUrl: 'http://localhost', // // Default timeout for all waitFor* commands. waitforTimeout: 10000, // // Default timeout in milliseconds for request // if Selenium Grid doesn't send response connectionRetryTimeout: 90000, // // Default request retries count connectionRetryCount: 3, // // Test runner services // Services take over a specific job you don't want to take care of. They enhance // your test setup with almost no effort. Unlike plugins, they don't add new // commands. Instead, they hook themselves up into the test process. services: ['selenium-standalone'],}
package.json:
{ "name": "appium_js", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "./node_modules/.bin/wdio wdio.conf.js" }, "author": "Thomas Szabo", "license": "ISC", "dependencies": {}, "devDependencies": { "@wdio/appium-service": "^6.1.0", "@wdio/cli": "^6.1.7", "@wdio/local-runner": "^6.1.7", "@wdio/mocha-framework": "^6.1.6", "@wdio/selenium-standalone-service": "^6.0.16", "@wdio/spec-reporter": "^6.1.5", "@wdio/sync": "^6.1.7", "appium": "^1.17.0", "chai": "^4.2.0" } }
sample.test.js:
describe('Sample', () => { it('Test', () => {
})
Thank you for any help on this.
Tom