TestProject Forum
Powered by leading experts in the test automation community

Running the test in TestProject is unable to type the DATE field


In one of my tests that I recorded in TestProject, there is a date field which I want that it should take the current date so I have set a parameter for it to get the current date and it is taking the current date. But the problem that I am facing is that the date field is in MM/dd/yyyy format and when the automated test is run, it clicks on only the yyyy area and try to type in the date only in yyyy which gives me the result MM/dd/9202 as shown in the screen shot below, it’s basically trying to type in 11/09/2020 but it only types 9202 in yyyy.

I tried hardcoding the date but it is still typing in the yyyy area.
I also tried to click on the calendar and selected a date from it, still it’s giving me the same result when I am running the test.
Another thing that I noticed was when I run the test step by step then it enters the date correctly, I am only facing this issue when I am trying to run the test altogether.

Please let me know what can be done in this situation. Also, is there a way that I can see what Selenium is doing behind the scenes so that I can troubleshoot these scenarios in more depth.

Thank you so much for helping.

Hi Ritika, this is probably a timing issue, the page takes another second or two to complete the loading, so the page is changing during the type text action the text is being sent to the wrong place.
You can slow the script a bit by adding verification the text field is visible before typing to it. Simply replace the Type text action with Type text (if visible). Click on the step to edit it, click the Action and area and search for it


If it doesn’t work you can add a pause to this step. Edit the step and search for Step Pause near the bottom


Thank you for your suggestions @guy.saban. I actually tried the Action “Click (using JavaScript)” and it worked using that action. I will also give a try for the one you suggested.