I created a working macro for you. As you said, the xpath for the credit card number field was not found. My solution is to use the visual XClick and XType commands for these fields instead. So I chagned the recorded macro in the following way:
- Commented out the recorded SelectFrame and Type command
- Replaced them with visual XClickText to click (= set the focus) on the “Number” field name
- and then send keystrokles with XType
This works:
{
"Name": "fill credit card",
"CreationDate": "2023-11-25",
"Commands": [
{
"Command": "open",
"Target": "https://secure.avaaz.org/campaign/en/donate/",
"Value": "",
"Description": ""
},
{
"Command": "select",
"Target": "name=paymentType",
"Value": "label=Credit card",
"Description": ""
},
{
"Command": "comment",
"Target": "selectFrame // index=8",
"Value": "",
"Description": "frame commands are not needed for visual XClick"
},
{
"Command": "comment",
"Target": "type // name=cardnumber",
"Value": "3456 6",
"Description": ""
},
{
"Command": "XClickText",
"Target": "number",
"Value": "",
"Description": ""
},
{
"Command": "XType",
"Target": "3456 6",
"Value": "",
"Description": ""
},
{
"Command": "comment",
"Target": "selectFrame // relative=top",
"Value": "",
"Description": "frame commands are not needed for visual XClick"
},
{
"Command": "comment",
"Target": "selectFrame // index=9",
"Value": "",
"Description": "frame commands are not needed for visual XClick"
},
{
"Command": "comment",
"Target": "type // name=exp-date",
"Value": "11 / 11",
"Description": "this line was recorded, but xpath was not found -> replace with XClick andXType"
},
{
"Command": "XType",
"Target": "${KEY_TAB}${KEY_TAB}",
"Value": "",
"Description": "tab into the next line and enter the expiration date"
},
{
"Command": "XType",
"Target": "1128",
"Value": "",
"Description": ""
}
]
}