question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebDriver 5: Test fails with option manualStart=true: Cannot read property '$$' of undefined

See original GitHub issue

It seems to be a regression in WebDriver 5. It works well with WebDriver 4 unless you upgrade using npm i webdriver@5. It doesn’t depend if you change the string “WebDriverIO” => “WebDriver” (ver. 5) in config file and helper or if you keep using “WebDriverIO” (ver. 4) in your config/helper.

What are you trying to achieve?

I want to start browser manually

What do you get instead?

Provide console output if related. Use --verbose mode for more details.

$ ../../node_modules/.bin/codeceptjs run --verbose
2019-03-10T11:07:43.152Z DEBUG @wdio/config: @wdio/sync not found, running tests asynchronous
CodeceptJS v2.0.7
Using test root "/home/mira/workspace/mycodeceptjs/tests/manual"
Helpers: WebDriver, My
Plugins: screenshotOnFail

Manual --
    [1] Starting recording promises
    Emitted | suite.before ([object Object])
  test something
    Emitted | test.before ([object Object])
    [1] Error | TypeError: Cannot read property '$$' of undefined
    Emitted | test.failed ([object Object])
  ✖ "before each" hook: codeceptjs.before for "test something" in 2ms
    [1] Error | TypeError: Cannot read property '$$' of undefined
TypeError: Cannot read property '$$' of undefined
    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])

-- FAILURES:

  1) Manual
       "before each" hook: codeceptjs.before for "test something":
     Cannot read property '$$' of undefined
  ypeError: Cannot read property '$$' of undefined
      at WebDriver._before (/home/mira/workspace/mycodeceptjs/node_modules/codeceptjs/lib/helper/WebDriver.js:419:28)
      at recorder.add (/home/mira/workspace/mycodeceptjs/node_modules/codeceptjs/lib/listener/helpers.js:21:69)
      at process._tickCallback (internal/process/next_tick.js:68:7)


  FAIL  | 0 passed, 1 failed   // 8ms
    Emitted | global.result ([object Object])
    Emitted | global.after ([object Object])

Provide test source code if related


Feature("Manual");

Scenario("test something", (I) => {
    I.startBrowser();
    I.amOnPage("/");
    I.stopBrowser();
});

my_helper.js:

class My extends Helper {
    startBrowser() {
        this.helpers["WebDriver"]._startBrowser();
    }
    stopBrowser() {
        this.helpers["WebDriver"]._stopBrowser();
    }
}

module.exports = My;

Details

  • CodeceptJS version: 2.0.7
  • NodeJS Version: 10.15.1
  • Operating System: Ubuntu 18.10
  • WebDriverIO: 5.7.1
  • Configuration file:
exports.config = {
    tests: "./*_test.js",
    output: "./output",
    helpers: {
        WebDriver: {
            url: "https://codecept.io",
            browser: "chrome",
            manualStart: true
        },
        My: {
            require: "./my_helper.js",
        },
    },
    include: {
        I: "./steps_file.js"
    },
    bootstrap: null,
    mocha: {},
    name: "manual"
};

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
seganfredo63commented, Jul 19, 2021

This issue is still present on the newest version of CodeceptJS

1reaction
storenthcommented, Feb 17, 2020
webdriverio@5.18.7
codeceptjs@2.4.3

Same issue! TypeError: Cannot read property '$$' of undefined

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found