The goal: obtain a result of chromium command execution, e.g. Profiler report data
What I've done: I'm able to call chrome devtools command using browser.driver.sendChromiumCommand
.
E.g. await browser.driver.sendChromiumCommand('Page.reload', {})
reloads page, so I can confirm that this is working.
The problem: the result of any command execution is always null
Here is my code
describe('Protractor Demo App', function() {
it('whatever', async function() {
await browser.get('http://juliemr.github.io/protractor-demo/');
const data = await browser.driver.sendChromiumCommand('Page.reload', {
scriptToEvaluateOnLoad: `(function(){return '123 })()`
});
console.log(data); // expected '123' but got 'null'
});
});
Note: the issue isn't connected to a particular command, all of the devtools commands return null