Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:46
    DudaGod synchronize #7753
  • 17:59

    dependabot[bot] on npm_and_yarn

    (compare)

  • 17:59

    christian-bromann on main

    Bump devtools-protocol from 0.0… (compare)

  • 17:59
    christian-bromann closed #7766
  • 17:57

    dependabot[bot] on npm_and_yarn

    (compare)

  • 17:57
    dependabot[bot] closed #7765
  • 17:57
    dependabot[bot] edited #7765
  • 17:57
    dependabot[bot] commented #7765
  • 17:57
    dependabot[bot] edited #7765
  • 17:57

    dependabot[bot] on npm_and_yarn

    (compare)

  • 17:57
    dependabot[bot] labeled #7766
  • 17:57
    dependabot[bot] opened #7766
  • 17:57

    dependabot[bot] on npm_and_yarn

    Bump devtools-protocol from 0.0… (compare)

  • 17:56

    christian-bromann on main

    Bump jest from 27.3.1 to 27.4.0… (compare)

  • 17:56
    christian-bromann closed #7764
  • 17:56
    dependabot[bot] labeled #7765
  • 17:56
    dependabot[bot] opened #7765
  • 17:56

    dependabot[bot] on npm_and_yarn

    Bump jest-circus from 27.3.1 to… (compare)

  • 17:56
    dependabot[bot] labeled #7764
  • 17:56

    dependabot[bot] on npm_and_yarn

    Bump jest from 27.3.1 to 27.4.0… (compare)

Erwin Heitzman
@erwinheitzman
@siggerzz not sure about that, are you sure those are hooks and not just the start of the session for example?
Phil Merwin
@pmerwin

hey guys I am trying to get multi remote working, I am passing my caps as:

class MultiChromeCapabilities {
    constructor(cliOptions) {
        this.myChromeBrowser1 = {
            capabilities: {
                browserName: 'chrome'
            }
        },
        this.myChromeBrowser2 = {
            capabilities: {
                browserName: 'chrome'
            }
        }
    }
}

module.exports = MultiChromeCapabilities;

or

class MultiChromeCapabilities {
    constructor(cliOptions) {
        this.capabilities = {
            myChromeBrowser1 = {
                capabilities: {
                    browserName: 'chrome'
                }
            },
            myChromeBrowser2 = {
                capabilities: {
                    browserName: 'chrome'
                }
            }
        }

    }
}

module.exports = MultiChromeCapabilities;

Neither appears to be working:

ERROR @wdio/runner: Error: Couldn't identify browserName "undefined"

however browser is defined when I console log the caps:

myChromeBrowser1: { capabilities: { browserName: 'chrome' } },
myChromeBrowser2: { capabilities: { browserName: 'chrome' } }

Any ideas on what I may be doing wrong? Trying a vanilla install of wdio with just multi remote caps now...

devTayls
@devtayls
Hey all- I have a silly question:
This is failing and I don't understand why
2021-04-08_10-52.png

Expect $(Products) to be visible

Expected: "visible"
Received: "not visible"

Christian Bromann
@christian-bromann
is Products selecting an element <Products />
devTayls
@devtayls
No- it was supposed to grabbing the text Products
But I think I resolved the issue
Thanks
Orozbek Askarov
@Askarov5
Hi, Configuration for logs('outputDir': 'logs'): in 'logs' folder I'm seeing files like wdio-0-0.log or wdio-0-1.log and it looks like webdriverio creates a log file for each test file. Is there a way to add test file name to the log file name???
Veena Vijayan
@veenaMSL_gitlab

Hi, I added takeScreenshot() in config file's afterTest setting. I got a large data value in the onTestEnd() event handler. I tried to convert that value to image. But couldn't. How to generate image file from that value?
wdio.conf.js

afterTest: async function (
    test,
    context, {
      error,
      result,
      duration,
      passed,
      retries
    }
  ) {
    if (!passed) {
      await browser.takeScreenshot();
    }
  }

customreporter.js

import WDIOReporter from '@wdio/reporter';

export default class CustomReporter extends WDIOReporter {
  constructor(options) {
    /*
      * make reporter to write to the output stream by default
      */
    options = Object.assign(options, {
      stdout: true
    });
    super(options);
  }

  onTestEnd(test) {
    if (test.state === 'failed') {
      //conversion code
    }
  }
}
Marijana Rukavina
@mareru

I get this error: Error: The "from" argument must be of type string. Received undefined. From the stack trace I can see that it is related to cucumber somehow.
This is the stack trace:

2021-04-08T18:29:37.403Z ERROR @wdio/runner: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
    at validateString (internal/validators.js:120:11)
    at Object.relative (path.js:437:5)
    at getDefinitionLineAndUri (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\build_helpers.js:184:27)
    at buildStepDefinitionConfig (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\build_helpers.js:124:7)
    at SupportCodeLibraryBuilder.defineStep (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\index.js:51:79)
    at Object.<anonymous> (C:\my-project\src\step_definitions\/accountSummary_steps.js:6:1)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Module._compile (C:\my-project\node_modules\pirates\lib\index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Object.newLoader [as .js] (C:\my-project\node_modules\pirates\lib\index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.hookedLoader [as _load] (C:\my-project\node_modules\mockery\mockery.js:111:12)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at C:\my-project\node_modules\@wdio\cucumber-framework\build\index.js:204:13

In my steps.js file I only have:

When(/^I click on My account details link$/, function () {
    loggedInHeaderModule.openAccountSummary();
});

This is my package.json dependencies:

"dependencies": {
    "@babel/cli": "^7.2.3",
    "@babel/plugin-proposal-export-default-from": "^7.5.2",
    "@babel/preset-env": "^7.4.2",
    "@babel/register": "^7.4.0",
    "@types/cucumber": "^7.0.0",
    "@wdio/cli": "^7.3.1",
    "@wdio/config": "^7.3.1",
    "@wdio/cucumber-framework": "^7.3.1",
    "@wdio/local-runner": "^7.3.1",
    "@wdio/selenium-standalone-service": "^7.3.1",
    "@wdio/spec-reporter": "^7.3.1",
    "@wdio/sync": "^7.3.1",
    "chai": "^4.3.4",
    "cucumber": "^6.0.5",
    "eslint-plugin-wdio": "^7.0.0",
    "file-system": "^2.2.2",
    "mjpeg-consumer": "^2.0.0",
    "node-fetch": "^2.6.1",
    "webdriverio": "^7.3.1",
    "yarn": "^1.22.10"
  },
  "devDependencies": {
    "@babel/core": "^7.4.0",
    "@wdio/allure-reporter": "^7.3.1",
    "@wdio/browserstack-service": "^7.3.1",
    "@wdio/junit-reporter": "^7.3.1",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.23.0",
    "eslint-plugin-import": "^2.22.1",
    "forever": "^3.0.4",
    "jest": "^26.6.3",
    "npm-run-all": "^4.1.5"
  }

I don't have clue what could be wrong. Anybody has any idea? Thanks!

1 reply
devTayls
@devtayls
Is there a simple way to check that browser.url() resolved correctly?
techyguy78
@techyguy78
@christian-bromann hey , do we have any equivalent events in WDIO v7 for V4 events "start" & "end" ? . WDIO v7 events "runnerStart" and "runnerEnd" is not fulfilling our custom report logic ?
ilovepumpkin
@ilovepumpkin
Hello, I am doing login step in beforeSuite hook, but for some reasons, the login step may fail some times, to make the whole wdio test fail earlier, is there any way to skip all the tests if any error occurs in beforeSuite hook?
mansiKulkarni39
@mansiKulkarni39
Hello, I am trying to execute test script on headless emulator, but it is giving locator not found, whereas same test script run on emulator is able to find locator. And idea, whether I am missing any thing? Or anything need to add in capabilities?
Federico Francia
@federicoitaly:matrix.org
[m]
Hi everybody,
I often get this error: ERROR webdriver: RequestError: read ECONNRESET. it's probably due to the cloud farm,
is there a way to trap it and make the webdriverIO quit gracefully?
shoaibAutomationEngineer
@shoaibAutomationEngineer
Hi can anyone share how to use xpath in appium with webdriverio ?
Christian Bromann
@christian-bromann
@shoaibAutomationEngineer the same way you use xpath with any other environment
shoaibAutomationEngineer
@shoaibAutomationEngineer
@christian-bromann Thanks
Anudbeg-clarivate
@Anudbeg-clarivate
Unable to parse cucumberjs output into json: '%s' /var/lib/jenkins/workspace/ui-smoketests SyntaxError: /var/lib/jenkins/workspace/: Unexpected end of JSON input
Does anybody know how to fix this error? HTML report is not generating and hence getting this error message post build run
Muralijc
@Muralijc

Hi,

We are working on the WDIO-7 upgrade for our mobile framework and we noticed that our perfecto authentication invokes with token in WDIO-5. Now WDIO-7 required user and key for authentication as per the docs [ https://webdriver.io/docs/options/#user ] but its not working as expected when we tried.

Kindly assist

Christian Bromann
@christian-bromann
@Muralijc I check their docs and it seems they pass in user and password as part of the capabilities which is invalid to the WebDriver spec. I would reach out to them and notify about their platform incompatibility.
pfoucray
@pfoucray

Hi,
Using WDIO V7, Typescript, Cucumber FK.
I've been looking and searching around, gave a call to a friend" for a clue (a developper in the project).
We must have missed something that should be more than obvious...

Question is : how do you access cucumbers World (this.) into the beforeScenario Hook of WDIO ?

Christian Bromann
@christian-bromann
@pfoucray I recommend to ask the channel rather than individual contributors ;-)
1 reply
pfoucray
@pfoucray
Additionnaly,
We succeded in adding data to cucumber "World" through "beforeStep" with the "context" parameter.
But inside beforeScenario, is there any similar way to achieve that ?
techyguy78
@techyguy78
@techyguy78
Hey guys, Having some challenge with wdio upgrade from v4 to v7.
our custom report dependent with wdio v4 events "start" & "end" to generate one master report for all runners. WDIO v7 has no more support for "start" and "end" events, so having challenge in generating report for retry logic.
can someone guide me how to handle this or any equivalent for v4 events "start" and "end" in v7 ? Appreciate your support on this , Thanks!
Erwin Heitzman
@erwinheitzman
sounds like you need the onPrepare and onComplete hooks @techyguy78
there you can see all the events you can use
seems like onRunnerStart and onRunnerEnd should do the trick
Eric Saari
@esaari
Hi all - does the Cucumber test runner no longer support the --dry-run option?
Looks like v5 had it in the docs but then disappeared in v6
techyguy78
@techyguy78
Thanks @erwinheitzman! RunnerStart and RunnerEnd generates report at spec file level, for 100 spec file in suite its challenge to get consolidated results
Erwin Heitzman
@erwinheitzman
@techyguy78 I think the idea is that you push the results in an array and then use the sync command to create/push your results
you can use this as a reference
or checkout any of the other reporters
another example, taken from the junit reporter:
    onRunnerEnd (runner: RunnerStats) {
        const xml = this._buildJunitXml(runner)
        this.write(xml)
    }
I should create my own reporter sometime soon so I can explain it well in the future hehe
techyguy78
@techyguy78
ah :-) , let me look into this @erwinheitzman Thank you!
bdlight2
@bdlight2

hello all,
when running the example wdio project generated through wdio config using selenium-standalone, jasmine framework, and running commands synchronous (making no changes) i get the following warning when each test starts and completes:

DEPRECATION: An asynchronous before/it/after function took a done callback but also returned a promise. This is not supported and will stop working in the future. Either remove the done callback (recommended) or change the function to not return a promise.

npm init and wdio config output: https://paste.gg/p/anonymous/c39026f3328645189ac202818f56102b
npm t output: https://paste.gg/p/anonymous/1d1a08a0a8804b1e9da6ef9437cd09b3

any idea what this is about? is this something i can fix or ignore?

an-austin-jones
@an-austin-jones
Hi I have a table where I scrollIntoView a cell, but it is sometimes covered by the header nav bar at the top. I know this is probably not the best way to do it but I want to overwrite the scrollIntoView command to use it, check if the element is clickable, if not, press up a few times on the browser to get it into view. My issue is I don't know how to get the element reference inside the function I pass into overwriteCommand in order to check isClickable. The examples I've seen do not have references to the element. How do I do that?
cpeck-bi
@cpeck-bi
@an-austin-jones have you looked into passing arguments to the scrollIntoView() function? I like to use scrollIntoView({block: "center"}) to vertically center the target element in view
Samavedam Bharadwaj
@bharadwajsamavedam:matrix.org
[m]
Unable to load spec files quite likely because they rely on browser object that is not fully initialised. I am getting err
error*
Any idea
Christian Bromann
@christian-bromann
@bharadwajsamavedam:matrix.org you have to provide the full error message