Forum Discussion

MSiddiqui's avatar
MSiddiqui
Occasional Contributor
9 years ago

Calendar Date Control Issue

Hi Guys,
I am trying to capture a Calendar Date Control on a form , When I click the Calendar control combo and try to select the today date, after Running the script I am getting the attached issue. Please see the attached "Calendar-Date-Control.png"and  "Date-Contrl-Issue.png" . Suggest me the solution.

Regards
MS

  • Is the "C1Button" the "Today" button? (If it is, you should re-name your object more logically!)

     

    Your error says the "&Today" window (another horrible object name!) is not visible. So it looks like that's the part it isn't finding. I presume thats some sort of container for the button within the calendar popup? How have you mapped it? My guess is the object properties (of the "&Today" window) are changing between runs ...

     

  • Ravik's avatar
    Ravik
    Super Contributor

    Is it possible to enter date directly into the date text box ?

     

    or try "HoverMouse( )" & then try to click on Today button.

     

    (if it is possible for you, prior to click on Today button check Calendar Date Control is visible on screen)

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      Yeah, as Ravik says, the other possibility is you are trying to click on it too quickly and the full control content has not been rendered yet.

    • MSiddiqui's avatar
      MSiddiqui
      Occasional Contributor

      Actually, Script will run on upcoming days, so by selecting today date will always select whatever is current date. thats'y I can't enter manually input to date.

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        Well, you could.

         

        You could use date/time to get the current date back and use that to drive the correct input to the calendar control.

         

        I do something similar with time sensitive tests. I have to set a time, slightly in the future, in some of my tests to trigger certain events. I use the current time, add a few seconds/minutes to it. And break the result down and enter it into an onscreen control.

         

        It's a little more work, but by no means impossible.

         

        Doing system time adjustments, which then have to revert the system back to the correct current time afterwards, is WAY more fun! :smileytongue:

         

        (I use an online API to get the correct time back and reset the computer)

         

        But going back to your problem .... if your mappings are correct, then it probably is a synchronisation problem.

         

        As a dirty verification, put a 5 or 10 second delay before you try and click the "Today" button. If that works, then you were trying to click it before it had a chance to render.

         

        But that's a dirty fix. I wouldn't use it long term. Something to verify it exists before you try to use it would be the correct way to go about it.