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

Pete St Martin
Pete St Martin
418 Points

Form.submit() did not work for me. Anyone else have this issue?

When I tried to enter form.submit() instead of for.findElement(By.css("button")).click();

I received this error:

(node:21635) UnhandledPromiseRejectionWarning: UnknownCommandError: unknown command: Cannot call non W3C standard command while in W3C mode at Object.throwDecodedError (/Users/petestmartin/prime/Practice Projects/selenium-basics/node_modules/selenium-webdriver/lib/error.js:550:15) at parseHttpResponse (/Users/petestmartin/prime/Practice Projects/selenium-basics/node_modules/selenium-webdriver/lib/http.js:563:13) at Executor.execute (/Users/petestmartin/prime/Practice Projects/selenium-basics/node_modules/selenium-webdriver/lib/http.js:489:26) at process._tickCallback (internal/process/next_tick.js:68:7) (node:21635) 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: 3)

Can you provide a link to the video?

1 Answer

I think there is missing information... Is your form properly defined before?

Either way, can you show us your code?

// if you were working with <form id="registrar">
const form = driver.findElement(By.id("registrar")); 
// now that form is defined, we can call the submit() method
form.submit();

Does this help?