PerfJankie:Error: The environment you requested is

2019-06-12 10:55发布

问题:

I am trying to run PerfJankie(wrapper over Browser-Perf) to measure performance of my app.

 perfjankie({
                    suite: 'X',
                    url: 'http://localhost:8081',
                    name: job.component,
                    run: job.version,
                    prescript: function (browser) {
                        browser.driver.manage().window().maximize();
                    },
                    time: new Date().getTime(),
                    callback: function (err, res) {
                        if (err) {
                            //console.error(err);
                            throw err;
                        }
                        runQueue(i + 1);
                    },
                    repeat: 1,
                    selenium: 'http://localhost:4444/wd/hub',
                    couch: COUCH,
                    browsers: [{ // This can also be a ["chrome", "firefox"] or "chrome,firefox"
                        browserName: 'chrome',
                        chromeOptions: {                            
                        }
                    }],
                    actions: function (browser) {
                        //some actions    
                    }
                });

It gives the following error signature:

C:\Users\...\node_modules\perfjankie\node_modules\q\q.js:155
                throw e;
                      ^
Error: [init({"browserName":"chrome","chromeOptions":{"perfLoggingPrefs":{"traceCategorie
s":",blink.console,disabled-by-default-devtools.timeline,benchmark"}},"loggingPr
efs":{"performance":"ALL"}})] The environment you requested was unavailable.

My attempts of isolation: Expected result: this should launch Chrome and validate my app Observation: Does not launch chrome Isolation:

  1. This launches firefox(if I specify browser:firefox) but not chrome or PhatomJS(chrome is my default browser).
  2. Tried specifying binary path for Chrome(as it was suggested in some link i goggled)
    1. Selenuim version: 2.20.0(Below: 2.34.0- i read some link that showed the issue gets resolved below these versions)

Not sure what am I missing.

P.S. I am not sure what tags to add. If someone could help update right tags, that would be great.

回答1:

I was having a similar issue, try adding this to the capabilities enablePerformanceLogging: true.



回答2:

This was related to webdriver-manager installation under node modules. I deleted the entire repo, created a fresh copy and this seems to work. Also perf jankie does not work with protractor-perf