Using Chrome DevTools protocol

Both ChromeDriver and EdgeDriver expose some specific commands for working with their respective browsers.

When using ChromeDriver or EdgeDriver it is now possible to execute commands via the Chrome DevTools protocol.

Here's the full list of commands available on the .chrome namespace on the browser object:

browser.chrome:

More info:

Example

describe('Chrome DevTools Example', function() {
    it ('using CDP DOM Snapshot', async function() {
        const dom = await browser.chrome.sendAndGetDevToolsCommand('DOMSnapshot.captureSnapshot', {
            computedStyles: []
        });
        console.log('DOM', dom)
    });
});