question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML5 specialized text fields not recognized as text fields

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sirexcommented, Aug 23, 2016

Same here. Here is my workaround:

${elem} =    Get WebElement    locator
Textfield Value Should Be    ${elem}    ${value}
0reactions
rapturemachinecommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

In Javascript, my text field does not recognize special symbols ...
Try using BLOB as the datatype for that specific column, It allows special characters. Also if your browser is having issues displaying that ......
Read more >
The HTML5 input types - Learn web development | MDN
Phone number field. A special field for filling in phone numbers can be created using tel as the value of the type attribute:....
Read more >
Working with HTML5 form inputs | Kentico 11 Documentation
The HTML5 input form control supports most available HTML Input Types, with exceptions for types that are not compatible with Kentico forms.
Read more >
HTML Input Attributes - W3Schools
A read-only input field cannot be modified (however, a user can tab to it, highlight it, and copy the text from it). The...
Read more >
Input Pattern: Use It To Add Basic Data Validation In HTML5 »
But you have to consider these as primarily helpful to the user, and remember that they do not provide any security against bad...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found