View Source Improve this doc

submitForm

Submits a form found by given selector. The submit command may also be applied to any element that is a descendant of a <form> element.

Usage

1
2
browser.submitForm(selector);

Parameters

Param Type Details
selector String form element

Example

index.html
1
2
3
4
5
6
7
<form action="/form.php" method="post" id="loginForm">
<label for="username">User:</label>
<input type="text" name="username" id="username">
<label for="password">Password:</label>
<input type="password" name="password" id="password">
<input type="submit" value="Login">
</form>
submitForm.js
1
2
3
4
5
it('should submit login form', function () {
browser.setValue('#username', 'foobar');
browser.setValue('#password', 'test123');
browser.submitForm('#loginForm');
});

Uses