#63 clickSubmit should work without label

open
nobody
Web tester (21)
5
2009-10-18
2009-10-18
Anonymous
No

I want to write a web test can submit the following form:

<form action='./' method='post'>
Account: <input type='text' class='text' name='login_act' value=''>
Passwort: <input type='password' class='password' name='login_pwd'>
<input type='submit' class='submit stdbtn' value='Anmelden'>
</form>

To submit this form, I can use the following code:

$this->clickSubmit('Anmelden');

As the submit button has neither an id nor a name, I have to use the label. Unfortunately, the site's language can be changed in it's configuration; then the label would be "Login", and my test would break. It would be nice if one could just call clickSubmit() and this would use the first submit button it can find.

Discussion