title: Handle Calendar With Robot Framework
body: <p>I'm trying to automate a scenario with Robot Framework where I want to click on past or future dates based on the current date. Somehow I'm not able to achieve it due to the element exception.</p>
  <p>The code looks something like this:</p>
  <pre><code>*** Settings ***
  Library  SeleniumLibrary
  Library  DateTime
  Library  String
  
  *** Variables ***
  ${FLIGHTS}  //span[.='Flights']
  ${SEARCH_BTN}   //button[.='Search']
  ${BASEURL}  https://www.orbitz.com/
  ${ROUNDTRIP}    //span[.='Roundtrip']
  ${DEPARTURE_FROM}   //button[@aria-label=&quot;Leaving from&quot;]
  ${ARRIVAL_TO}    //button[@aria-label=&quot;Going to&quot;]
  ${DEPARTURE_TXT_BOX}    location-field-leg1-origin
  ${ARRIVAL_TXT_BOX}    location-field-leg1-destination
  ${DEPARTURE_DATE}   //button[@id=&quot;d1-btn&quot;]
  ${ARRIVAL_DATE}    //button[@id=&quot;d2-btn&quot;]
  ${DEPARTURE_CITY}   //span[.='San Francisco (SFO - San Francisco Intl.)']
  ${ARRIVAL_CITY}    //span[.='New York (NYC - All Airports)']
  ${CHOOSE_DEPARTING_FLIGHT}  (//span[.='Choose departing flight'])[2]
  ${NONSTOP}  //*[@name=&quot;fs0&quot; or @name='stops']
  
  *** Keywords ***
  Select Date    [Arguments]    ${year}    ${month}    ${date}
      ${currentdate}    Get Current Date    result_format=datetime
      Convert To Integer    ${year}
      Convert To Integer    ${month}
      Convert To Integer    ${date}
      ${month-diff}    Evaluate    ${month}-${currentdate.month}
      ${year-diff}    Evaluate    ${year}-${currentdate.year}
      ${move}    Evaluate    ${year-diff}*12+${month-diff}
  
      ${shiftforward}    Set Variable If
      ...    ${move}&gt;0    1
      ...    ${move}&lt;0    0
  
      ${move}    Set Variable If
      ...    ${move}&gt;0    ${move}
      ...    ${move}&lt;0    ${move}*-1
  
      FOR    ${var}    IN RANGE    ${move}
          Run Keyword If    ${shiftforward}==0    Click Element    (//button[@data-stid=&quot;date-picker-paging&quot;])[1]
          Run Keyword If    ${shiftforward}==1    Click Element    (//button[@data-stid=&quot;date-picker-paging&quot;])[1]
      END
  
      Execute JavaScript    window.scrollTo(0,300)
      Sleep   10s
      Click Element     //td[@class='uitk-date-picker-day-number start startSelected' or @class='uitk-date-picker-day-number']//button[@type=&quot;button&quot; and @data-day=&quot;${date}&quot;]  
  
  Convert Date    [Arguments]     ${days}
      ${cd}   Get Current Date
      ${add_t}   Add Time To Date   ${cd}    ${days}    result_format=%Y%m%d
      ${res}    Remove String   ${add_t}    [    '    ]
      ${dt1}    Get Substring    ${res}    -2
      ${num1}    Convert To Integer    ${dt1}
      ${mt}    Get Substring    ${res}    -4   -2
      ${num2}    Convert To Integer    ${mt}
      ${yr}    Get Substring    ${res}    -8   -4
      ${num3}    Convert To Integer    ${yr}
  
      Set Suite Variable    ${num1}
      Set Suite Variable    ${num2}
      Set Suite Variable    ${num3}
  
  
  *** Test Cases ***
  Click Date
      Open Browser    https://www.orbitz.com/    chrome
      maximize browser window
      Set Selenium Implicit Wait  3s
      Set Selenium Speed  1s
      Click Element   ${FLIGHTS}
      Wait Until Page Contains Element    ${ROUNDTRIP}
      Click Element   ${DEPARTURE_FROM}
      Wait Until Keyword Succeeds    60s    2s    Input Text  ${DEPARTURE_TXT_BOX}   San Franc
      Click Element   ${DEPARTURE_CITY}
      Click Element   ${ARRIVAL_TO}
      Wait Until Keyword Succeeds    60s    2s    Input Text  ${ARRIVAL_TXT_BOX}   New yor
      Click Element   ${ARRIVAL_CITY}
      Wait Until Keyword Succeeds    60s    2s    Click Element   d1-btn
      Convert Date    21 days
      Select Date    ${num3}    ${num2}    ${num1}
  </code></pre>
  <p>The error that I'm getting is:
  <strong>ElementClickInterceptedException: Message: element click intercepted: Element  is not clickable at point (783, 180). Other element would receive the click: ...</strong></p>
  <p>Is there a better way to do this?</p>