Won't Fix
Last Updated: 26 Oct 2022 12:26 by ADMIN
Nishana
Created on: 07 Oct 2022 09:04
Type: Feature Request
0
Html5 date picker control records a 'click' instead of 'enter text' step

Sample date picker used here

Steps to reproduce:

  1. Start recording session and try to enter date into the date input

Expected: To record a step to 'Enter Text'
Actual: A 'Click' step gets recorded and no date entered is registered in the test. 

Workaround:

  1. Navigate to the page where is the date picker - I used this sample
  2. Add the date input field into the test elements (the Elements Explorer) - for this you can either use the recorded click step, or highlight the element and choose to add it to the element repository. 
  3. Once the element is into the project, you can add steps for it from the Step Builder - that includes the 'Enter text' action as well (from the Quick Actions section). 
  4. Type the date you want to enter without using the slashes - for example 1072022 for today's date. 
  5. Execute this step - you can use the partial test run options to execute only that step. Check what happens upon execution.
    Note: The Enter text step consists of few actions one after the other - these include a click action, which is being sent by default in the absolute center of the input field. Depending on the date picker implementation that could bring some inconsistency when entering the date - for example the month doesn't get changed at all. Actually if you manually click in the center of the input (even if this is not that precise) and enter the date, you will see the same behavior. If you click over the month, though, in the left part of the input you can then enter the date correctly. 
    If this is the case, you will need the adjustments described in the next steps. These will actually change the click action so that it clicks on the left side of the input.
  6. The 'Enter text' step needs to be converted to code in order to modify the properties of the click action. When the step is edited in code you can see the MouseClick() method is the default one and doesn't use any parameters. You can directly choose any of the methods overloads and specify a click point in the input field. 
  7. If you are not proficient in code writing and need some assistance to identify the right method to specify the location, you can use the following approach - while recording add a mouse click step through the Advanced Recording tools and choose the option to click on specific point from the target element. 
  8. Once you have that step, you can convert it to code - that way you can see the MouseClick() method and what attributes it uses to click on a specific point. You can copy that line of code and replace the click action in the 'Enter text' step sequence. 
  9. Then, remove or uncheck from the test the help mouse click step used to sort out the code.
0 comments