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

findFormButton() is case sensitive when search for attributes #89

Open
beckenkamp opened this issue Oct 30, 2014 · 2 comments
Open

findFormButton() is case sensitive when search for attributes #89

beckenkamp opened this issue Oct 30, 2014 · 2 comments
Labels

Comments

@beckenkamp
Copy link

When getFormField() tries to find form button with findFormButton() it throws ElementNotFoundException. This happens when the button have type attribute setted as "Submit" instead of "submit".

I understand that it is a stupid thing set element attributes like that example, but I gues I should report this anyway...

foreach ($xpath->query('descendant::input | descendant::button', $root) as $node) {
    if ('button' == $node->nodeName || in_array($node->getAttribute('type'), array('submit', 'button', 'image'))) {
        return $node;
    }
}

When I added "Submit" at the in_array() function, showed above, to test, it worked. Maybe we can add a strtolower() in $node->getAttribute('type') to solve this.

@aik099
Copy link
Member

aik099 commented Oct 30, 2014

I can confirm that at least canSubmitForm method of the driver doesn't do case-insensitive type attribute check.

@aik099
Copy link
Member

aik099 commented Oct 30, 2014

Can you please send a PR, where all usages of type attribute in the driver would be lowercased before doing any comparisons?

And another PR should go to Mink repository to update test fixtures to have type attributes with different case to catch that problem in all drivers at once.

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

No branches or pull requests

2 participants