Changing date using type - xtype

I’d like to reach this URL https://it.investing.com/equities/molmed-historical-data and click “scarica dati”. Before i ha to change start data of the period but it doesn’t work well, i think. Anyone can suggests the right code to modify start data?

Type and SendKeys do not work with this data control, but XClick and XType work fine. I made a short demo macro. It uses ${KEY_DEL} and ${KEY_BKSP} to clear the input fields.

Here is a screencast of it running:

And here is the code:

{
  "Name": "set date control",
  "CreationDate": "2019-6-28",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://it.investing.com/equities/molmed-historical-data",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "id=leftColumn",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "id=widgetFieldDateRange",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "xpath=/html/body",
      "Value": ""
    },
    {
      "Command": "XClick",
      "Target": "id=startDate",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_DEL}${KEY_DEL}${KEY_DEL}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}1/1/2019",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "xpath=/html/body",
      "Value": ""
    },
    {
      "Command": "XClick",
      "Target": "id=endDate",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_DEL}${KEY_DEL}${KEY_DEL}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}${KEY_BKSP}2/2/2019",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "link=Applica@POS=2",
      "Value": ""
    }
  ]
}
1 Like

admin , you are great!