Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$I->selectOption() fails if two submit buttons present #1304

Closed
fdjohnston opened this issue Aug 14, 2014 · 1 comment
Closed

$I->selectOption() fails if two submit buttons present #1304

fdjohnston opened this issue Aug 14, 2014 · 1 comment

Comments

@fdjohnston
Copy link
Contributor

I have created the following simple markup:

<form method="post" action="/test/create">
    <button type="submit" >Save</button>
    <select name="sandwichselect" id="sandwichselect">
        <option value="1">Sandwich</option>
        <option value="2">Better Sandwich</option>
    </select>
    <button type="submit" >Save</button>
</form>

When I run the following simple test

$I->selectOption("form select[name='sandwichselect']", "1");

It fails with the following error:

InvalidArgumentException: Input "sandwichselect" cannot take "" as a value (possible values: 1, 2).

Removing the second submit button fixes the problem.
I have tried using different names and Ids for the submit buttons, but that has not helped.

fdjohnston added a commit to fdjohnston/Codeception that referenced this issue Aug 14, 2014
I believe this fix addresses the problem outline in Codeception#1304.  Loop was
matching against nodes incorrectly in the case of more than 1 submit.
fdjohnston added a commit to fdjohnston/Codeception that referenced this issue Aug 15, 2014
Wrote two tests (select by text and select by CSS) for Codeception#1304
DavertMik added a commit that referenced this issue Aug 16, 2014
@fdjohnston
Copy link
Contributor Author

A fix for this issue has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant