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

HTML5 specialized text fields not recognized as text fields #546

Closed
ombre42 opened this issue Dec 10, 2015 · 5 comments · Fixed by #817
Closed

HTML5 specialized text fields not recognized as text fields #546

ombre42 opened this issue Dec 10, 2015 · 5 comments · Fixed by #817

Comments

@ombre42
Copy link
Contributor

ombre42 commented Dec 10, 2015

HTML5 introduced several new input types, several of which are specialized text inputs including email, number, url, search, and tel. These input types are not recognized by Page Should Contain Textfield, Page Should Not Contain Textfield, Textfield Should Contain, or Textfield Value Should Be.
The cause is that these keywords use the constraint 'text field' and ElementFinder will filter out any input elements that do not have type 'text'. Since these inputs are still text inputs, they should be treated as such. The number type may render a spinbox control in some browsers, but still behaves like a text-type input.

Here is a test that should pass, but fails with:
Value of text field 'name=email' should have been 'selenium@xxx.yyy' but was 'None'

Open Browser    http://www.the-art-of-web.com/html/html5-form-validation/   gc
Input Text  name=email  selenium@xxx.yyy
Textfield Value Should Be   name=email  selenium@xxx.yyy

With minor modifications to elementfinder, I was able to get the above to pass.

This is being entered as a result of this: http://stackoverflow.com/questions/34169390/how-to-find-value-of-email-field-using-selenium2library

@aaltat
Copy link
Contributor

aaltat commented Dec 11, 2015

Have not looked the HTML 5 specification but sounds like a good idea to me. Would you like to make a pull request for it?

@aaltat aaltat added the bug label Dec 11, 2015
@aaltat
Copy link
Contributor

aaltat commented May 23, 2016

There has not been activity for this issue for long time and we are planning to close the old issues if they are not anymore valid ones. If you feel that this is still valid issue, could you send an update. If update is not received in a month, we will assume that this is not anymore an issues and we will close this issue.

@niwic
Copy link

niwic commented Jun 3, 2016

I am currently having this same problem. A similar issue has been discussed here:
SeleniumHQ/selenium-google-code-issue-archive#7291

I have a field such as:

<input name="numeric" type="number" value="123"/>

Selecting it using jquery:

Textfield Should Contain  jquery=input[name="numeric"]  123

Does not find the field, and i get the error:
TypeError: argument of type 'NoneType' is not iterable

If i remove the type attribute from the name tag i don't get any error.

@rapturemachine
Copy link

rapturemachine commented Jun 8, 2016

I am also getting this error with a field that has <input type="tel" inputmode="numeric"> attributes. This is my workaround:

Verify Phone Number
    [Arguments]    ${textfield}    ${expected phone number}
    ${actual phone number}=    Get Value    ${textfield}
    Should Be Equal    ${expected phone number}    ${actual phone number}

It would be good to get this issue fixed so that the workaround isn't necessary.

@sirex
Copy link

sirex commented Aug 23, 2016

Same here. Here is my workaround:

${elem} =    Get WebElement    locator
Textfield Value Should Be    ${elem}    ${value}

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

Successfully merging a pull request may close this issue.

6 participants