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

fix click on links with only numbers DOM Exception 12 #3865

Merged
merged 1 commit into from Jan 20, 2017

Conversation

Projects
None yet
3 participants
@gimler
Contributor

gimler commented Dec 22, 2016

When you try to click on a link that has only numbers $I->click('222') you get a invalid css selector exception.

Exception

[Facebook\WebDriver\Exception\InvalidElementStateException] {"errorMessage":"SyntaxError: DOM Exception 12","request":{"headers":{"Accept":"application/json","Content-Length":"38","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:8910"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"css selector\",\"value\":\"217\"}","url":"/elements","urlParsed":{"anchor":"","query":"","file":"elements","directory":"/","path":"/elements","relative":"/elements","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/elements","queryKey":{},"chunks":["elements"]},"urlOriginal":"/session/d2fe7e50-c80e-11e6-afe3-9d1eec0f3e94/elements"}}

The Problem is that phantom think it is a id and ids are not allowed to start with numbers.

See also
http://phptest.club/t/i-click-on-link-that-is-a-number-webdriver/261
http://stackoverflow.com/questions/7315162/syntax-err-dom-exception-12-hmmm

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Dec 22, 2016

Member

Thanks, looks good. Could you write corresponding test to https://github.com/Codeception/Codeception/blob/2.2/tests/web/WebDriverTest.php ?

Member

DavertMik commented Dec 22, 2016

Thanks, looks good. Could you write corresponding test to https://github.com/Codeception/Codeception/blob/2.2/tests/web/WebDriverTest.php ?

@gimler

This comment has been minimized.

Show comment
Hide comment
@gimler

gimler Dec 23, 2016

Contributor

Yes i will write one.

Contributor

gimler commented Dec 23, 2016

Yes i will write one.

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Jan 14, 2017

Member

@gimler also you promised to write a test for this change.

Member

Naktibalda commented Jan 14, 2017

@gimler also you promised to write a test for this change.

@DavertMik

yes, test is important here so we knew exactly what issue does it solve

@DavertMik DavertMik merged commit f6d75bf into Codeception:2.2 Jan 20, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Jan 20, 2017

Member

Thanks, I will write the test by myself. Thanks for all your WebDriver PRs, there are so much of them and this is really highly appreciated.

Member

DavertMik commented Jan 20, 2017

Thanks, I will write the test by myself. Thanks for all your WebDriver PRs, there are so much of them and this is really highly appreciated.

DavertMik added a commit that referenced this pull request Jan 20, 2017

@DavertMik DavertMik referenced this pull request Jan 20, 2017

Merged

Webdriver test #3937

@gimler

This comment has been minimized.

Show comment
Hide comment
@gimler

gimler Jan 20, 2017

Contributor

@DavertMik thank for writing the test. I did not find the time for it. Looks perfect

Contributor

gimler commented Jan 20, 2017

@DavertMik thank for writing the test. I did not find the time for it. Looks perfect

@gimler gimler deleted the gimler:dom_exception_12 branch Jan 20, 2017

chris1312 added a commit to chris1312/Codeception that referenced this pull request Jun 16, 2017

chris1312 added a commit to chris1312/Codeception that referenced this pull request Jun 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment