Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Quality Assurance Introduction to Selenium Automation Nation Getting Started

Ryan Giusti
Ryan Giusti
18,082 Points

Fills out the form, but doesn't submit.

I get the following output:

DevTools listening on ws://127.0.0.1:1099/devtools/browser/de612562-077c-42f1-8283-1505579ced8e (node:5664) UnhandledPromiseRejectionWarning: UnknownCommandError: unknown command: Cannot call non W3C standard command while in W3C mode at Object.throwDecodedError (C:\Users\myusername\Documents\selenium-basics\node_modules\selenium-webdriver\lib\error.js:550:15) at parseHttpResponse (C:\Users\myusername\Documents\selenium-basics\node_modules\selenium-webdriver\lib\http.js:560:13) at Executor.execute (C:\Users\myusername\Documents\selenium-basics\node_modules\selenium-webdriver\lib\http.js:486:26) at process._tickCallback (internal/process/next_tick.js:68:7) (node:5664) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)(node:5664) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

2 Answers

you need to turn w3c mode off from webdriver. try change what was:

const selenium = require("selenium-webdriver");
const driver = new selenium.Builder().forBrowser("chrome").build();

into:

const selenium = require("selenium-webdriver");
const capabilities = {
    'browserName' : 'chrome',
    'chromeOptions': {
        'w3c': false
    }
};
const browser = new selenium.Builder().withCapabilities(capabilities).forBrowser("chrome");
const driver = browser.build();

good luck.

Spent the better part of a workday looking for this answer. Thank you Jiayi Liu, you are a scholar.