Protocol Commands
WebdriverIO is an automation framework that relies on various of automation protocols to control a remote agent, e.g. for a browser, mobile device or television. Based on the remote device different protocols come into play. These commands are assigned to the Browser or Element Object depending on the session information by the remote server (e.g. browser driver).
Internally WebdriverIO uses protocol commands for almost all interactions with the remote agent. However additional commands assigned to the Browser or Element Object simplify the usage of WebdriverIO, e.g. getting the text of an element using protocol commands would look like this:
const searchInput = await browser.findElement('css selector', '#lst-ib')
await client.getElementText(searchInput['element-6066-11e4-a52e-4f735466cecf'])
Using the convenient commands of the Browser or Element Object this can be reduced to:
$('#lst-ib').getText()
The following section explain each individual protocol.
WebDriver Protocol
The WebDriver protocol is a web standard for automating browser. As oppose to some other E2E tools it guarantees that automation can be done on actual browser that are used by your users, e.g. Firefox, Safari and Chrome and Chromium based browser like Edge, and not only on browser engines, e.g. WebKit, which are very different.
The advantage of using the WebDriver protocol as oppose to debugging protocols like Chrome DevTools is that you have a specific set of commands that allow to interact with the browser the same way across all browser which reduces the likelihood for flakiness. Furthermore offers this protocol abilities for massive scalibility by using cloud vendors such as Sauce Labs, BrowserStack and others.