Skip to content

Latest commit

 

History

History

submit-a-form

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Submit a Form

Test Code: submit-a-form.js

This example shows how to submit a form with DOM API. To run code in the browser, the test uses a client function. The test runs against the TestCafe example page.

During the test, the t.typeText action types the developer name into the corresponding field. Then, the test calls the submitForm client function that submits the form with HTMLFormElement.requestSubmit. Finally, the t.expect.contains assertion method verifies that the Thank you page opens and displays the entered developer name.

TestCafe API in This Example