I have a specific problems while entering date using sendKeys in Selenium WebDriver



  • My date field accepts the value MM/DD/YYYY. Here, as soon as enter MM, it introduces / and then as I enter DD, it again introduces / and then I will enter YYYY. If I use selenium sendKeys, it is not entering properly as the application introduces / automatically. How to resolve this?



  • If the application is adding the slashes automatically, I would just send MMDDYYYY. If it's not, try sending 3 times. The first, MM, then DD, and finally YYYY. If you are then verifying, just build a string from those values that will add the slashes between the values.


Log in to reply
 

Suggested Topics