Skip to content

TypeError: browser.init is not a function #33

Description

@hubitor

I'm seeing this error:

DEBUG @wdio/config: @wdio/sync found, running tests synchronous
mytest/node_modules/browsermob-proxy/index.js:36
            .init()
             ^

TypeError: browser.init is not a function
    at Proxy.selFunc (mytest/node_modules/browsermob-proxy/index.js:36:14)
    at mytest/node_modules/browsermob-proxy/index.js:171:31
    at mytest/node_modules/browsermob-proxy/index.js:140:25
    at IncomingMessage.<anonymous> (mytest/node_modules/browsermob-proxy/index.js:232:21)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1103:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

for every example I've tried including the example from here:

var Proxy = require('browsermob-proxy').Proxy,
    proxy = new Proxy(),
    fs = require('fs');

proxy.doHAR('http://yahoo.com', function (err, data) {
    if (err) {
        console.error('ERROR: ' + err);
    } else {
        fs.writeFileSync('yahoo.com.har', data, 'utf8');
    }
});

I start browsermob-proxy like this:
$ /bin/sh /home/user/browsermob-proxy-2.1.4/bin/browsermob-proxy

and Selenium Server like this:
./node_modules/webdriver-manager/bin/webdriver-manager start --standalone

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions