Closed anggastika closed 2 years ago
Can you provide some logs that WebdriverIO generates?
How to generate logs from WebdriverIO ? sorry I am newbie
@christian-bromann
Hi @anggastika
There are a few things:
logLevel
in your main config-file to logLevel: 'debug'
, this will produce more logs in the console.config.specs = [
// From
// './tests/specs/**/app*.spec.ts',
// to
'./tests/specs/**/app.login.spec.ts',
];
or by using npm run android.app -- --spec=./test/specs/app.login.spec.ts
Based on the three things above you should be able to or run your tests, or be able to provide some logs.
Hope this helps
Hi Team,
I am facing the same problem as well. My node version is 16*
I am facing the same problem as well. My node version is 16*
Have you looked into the wdio logs what the issue could be?
Hi @christian-bromann ,
Now it's running. I ran the appium server locally and all good now. may be the appium-service isn't able to spin up the server. Had to add this line :
However, I am interested to know how the context switching works as I am facing similar issue on my repo, unfortunately this repo is also giving me the same error.
Wondering if this works on your system.
Maybe Appium expects Chromedriver to be available in your $PATH
or the Chromedriver you have has an invalid version.
Okay, That may be the thing. In that case, could you update the Readme with this info.
could you update the Readme with this info
Well I am not quite sure which scenario applies here. If you know please go ahead and raise a PR with a docs fix. Thank you!
There are two things here @samaysimantbarik
You added a basePath option in your config, that is not needed because WDIO and the Appium service start with basePath /
instead of /wd/hub
Secondly, Appium comes with the latest version of ChromeDriver, but your devices/emulator could have an older version of Chrome (Chrome and ChromeDriver versions are tied together). Appium can automatically determine the version of ChromeDriver it needs to have and also download it for you if you let is automatically download it for you, that's why you need to start the Appium Server with relaxedSecurity: true
I'ld suggest to create a FAQ document and document these issues with their solutions, then we can close this issue.
It's in here @christian-bromann https://github.com/webdriverio/appium-boilerplate#automating-chrome-or-safari
There is no information about this relaxedSecurity
thingy. Again, thinking about how we can close the issue I thought maybe we create a FAQ and document some of these problem solutions. Maybe folks will stumble upon this through Google. I just wonder what's left for us to do here?!
Hi @wswebcreation ,
Thanks for your response. I am using the latest version of everything( Appium, emulator and chrome). Still, if I don't explicitly install chromedriver and specify the path, my tests are failing, even with relaxed security.
My service definition:
Desired caps:
If I remove the chromeDriverExecutablePath, then I get the error, "No chromedriver ..... " .
Can you run the current master against latest appium and emulators(chrome 101) and check if you aren't getting any errors.
Thanks, Samay
Hi @samaysimantbarik
Can you run your test with
config.services = (config.services ? config.services : []).concat([
[
"appium",
{
// This will use the globally installed version of Appium
command: "appium",
args: {
// This is needed to tell Appium that we can execute local ADB commands
// and to automatically download the latest version of ChromeDriver
relaxedSecurity: true,
address: "localhost",
log: "./appium.log",
},
},
],
]);
and share the appium.log
file in a Gist. I want to see what is happening there because it works on my machine (sorry to say that)
Hi @wswebcreation ,
Thanks heaps.
The above works like a charm.
A quick question: Do we have a generic way that works on existing and new appium server ?
The above snippet spins up an appium server and works great for execution.
However, if I want to use Appium inspector and for that I need to use the local appium desktop server, this setup complains.
Log:
2022-05-23 03:22:20:826 [Appium] Welcome to Appium v1.22.3 2022-05-23 03:22:20:827 [Appium] Non-default server args: 2022-05-23 03:22:20:827 [Appium] address: localhost 2022-05-23 03:22:20:827 [Appium] basePath: / 2022-05-23 03:22:20:828 [Appium] logFile: ./appium.log 2022-05-23 03:22:20:828 [Appium] relaxedSecurityEnabled: true 2022-05-23 03:22:20:852 [HTTP] Could not start REST http interface listener. The requested port may already be in use. Please make sure there is no other instance of this server running already.
Hi @samaysimantbarik
Thanks for your response, but what did you change to make it work now? Your code and my code look the same, except for the log
-property.
The new Appium Inspector uses a different basePath then a normal Appium server (Appium 1.x versions) would spin up. By default Appium Server uses /wd/hub/
, but it needs to be /
.
If you've installed Appium globally then you can then start a server with this
appium --base / --relaxed-security --log-timestamp
Where:
appium
is the start-server command--base /
tells Appium to use /
instead of the default /wd/hub
basePath--relaxed-security
means to automatically download the ChromeDriver (amongst other things, see this)--log-timestamp
adds a nice timestamp to the logsRunning this will give this give the following logs
appium --base / --relaxed-security --log-timestamp
2022-05-23 05:17:02:697 - [Appium] Welcome to Appium v1.22.3
2022-05-23 05:17:02:699 - [Appium] Non-default server args:
2022-05-23 05:17:02:699 - [Appium] basePath: /
2022-05-23 05:17:02:700 - [Appium] logTimestamp: true
2022-05-23 05:17:02:700 - [Appium] relaxedSecurityEnabled: true
2022-05-23 05:17:02:725 - [Appium] Appium REST http interface listener started on 0.0.0.0:4723
As you can see it will automatically start on port 4723, also the port that Appium Inspector uses.
I'm going to close this issue now because this is not related to this boilerplate anymore, but it's still open for conversation
I'd like to reopen the ticket because I'm having the same problem, even though I've tried your solutions and the error persists.
exports.config = {
runner: 'local',
port: 4723,
specs: [
'./features/Android/*.feature'
],
exclude: [
// 'path/to/excluded/files'
],
maxInstances: 10,
capabilities: [{
'appium:acceptInsecureCerts': true,
"appium:platformName": "Android",
"appium:platformVersion": "10",
"appium:deviceName": "deviceId",
'appium:app': '...apk',
'appium:appPackage': 'app',
'appium:appActivity': 'Launch',
'appium:automationName': 'UiAutomator2',
'appium:language': 'en',
'appium:locale': 'UK',
'appium:newCommandTimeout': 240,
'appium:fullReset': true,
'appium:autoAcceptAlerts': true,
'appium:autoGrantPermissions': true,
'appium:deviceOrientation': 'portrait',
'appium:unicodeKeyboard': true,
'appium:resetKeyboard': true,
'appium:ignoreHiddenApiPolicyError': true,
'appium:fullContextList': true,
'appium:networkSpeed': 'full',
'appium:chromedriverExecutableDir': './node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/',
'appium:chromeOptions': {
args: [
'--disable-popup-blocking',
'--disable-notifications'
],
'w3c': false
},
}, ],
// Level of logging verbosity: trace | debug | info | warn | error | silent
logLevel: 'info',
//
// Set specific log levels per logger
// loggers:
// - webdriver, webdriverio
// - @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service
// - @wdio/mocha-framework, @wdio/jasmine-framework
// - @wdio/local-runner
// - @wdio/sumologic-reporter
// - @wdio/cli, @wdio/config, @wdio/utils
// Level of logging verbosity: trace | debug | info | warn | error | silent
// logLevels: {
// webdriver: 'info',
// '@wdio/appium-service': 'info'
// },
bail: 0,
baseUrl: 'http://localhost',
waitforTimeout: 12000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: [
[
'appium',
//'chromedriver',
{
command: "appium",
args: {
address: 'localhost',
baseUrl: '/wd/hub',
port: 4723,
relaxedSecurity: true,
log: "./appium.log",
},
},
],
],
//services: ['appium', 'chromedriver'],
// services: ['appium'], // Framework you want to run your specs with. // The following are supported: Mocha, Jasmine, and Cucumber // see also: https://webdriver.io/docs/frameworks // // Make sure you have the wdio adapter package for the specific framework installed // before running any tests. framework: 'cucumber',
// specFileRetries: 1,
// specFileRetriesDelay: 0,
reporters: ['spec'],
cucumberOpts: {
// <string[]> (file/dir) require files before executing features
require: ['./step-definitions/Android/*.js'],
// <boolean> show full backtrace for errors
backtrace: false,
// <string[]> ('extension:module') require files with the given EXTENSION after requiring MODULE (repeatable)
requireModule: [],
dryRun: false,
failFast: false,
snippets: true,
source: true,
strict: false,
tagExpression: '',
timeout: 60000,
ignoreUndefinedDefinitions: false
},
the error in question
ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4723
[0-0] at ClientRequest.
Hello, I have done :
But :
This is My wdio.android.app.conf.ts
Environment (please complete the following information):
Please help and give me best practice to run test
Thank You