XClickText misses vertical offset/ get networkerror

Hello everyone,

I have created a basic macro to select the vehicle category on a car rental website.
However, I am facing two issues:

  1. When running the macro on my PC the OCR seems to identify the correct category, but the XClickText command clicks the row below.

  2. When executing the macro on a Windows Server 2019 machine, I encounter an error (NetworkError: Failed to execute ‘importScripts’ on ‘WorkerGlobalScope’: The script at ‘chrome-extension://gcbalfbdmfieckjlnblleoemohcganoc/lib/tesseract/core/tesseract-core-lstm.wasm.js’ failed to load.)

Below the macro (some commands are disabled with comment).

{
“Name”: “Upr99-ScSegmFORUM”,
“CreationDate”: “2025-4-30”,
“Commands”: [
{
“Command”: “open”,
“Target”: “Noleggio a Lungo Termine per Aziende e P.Iva | UnipolRental”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “${!cmd_var1}”,
“Value”: “Segm”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “${!cmd_var2}”,
“Value”: “Param”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “Monovolume”,
“Value”: “Segm”,
“Description”: “”
},
{
“Command”: “if”,
“Target”: “${Param}=="CANC"”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “xpath=//div[13]/button[2]/span[2]”,
“Value”: “”,
“Targets”: [
“xpath=//[@id="__next"]/div/div/div[3]/div/div[13]/button[2]/span[2]",
“xpath=//div[13]/button[2]/span[2]”,
“css=#__next > div > div > div.undefined > div:nth-child(1) > div.ProdottiListing_selectedFilters__5uAu3 > button.Button_button__rfKht.Button_button–ghost__liNbO.Button_button–md__hlsv8.undefined.Button_button–icon-left__7jHyC > span.Button_label__aY_y3”
],
“Description”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “”,
“Target”: “”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “xpath=//div[12]/div/button”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “visionLimitSearchArea”,
“Target”: “area=150,150,700,700”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “XClickText”,
“Target”: “${Segm}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: "xpath=//
[@id="__next"]/div/div/div[3]/div/div[12]/div/button/span”,
“Value”: “”,
“Description”: “”
}
]
}

Thanks for your help


I have no idea why everyone is using xclick. That is the most unreliable way to automate a website. The best way it to use xpath to detect buttons. (I know there is a little learning curve, it you never heard of it)

wrote a quick script using xpath instead of xclick and it worked for me:

{
“Name”: “test 1”,
“CreationDate”: “2025-4-30”,
“Commands”: [
{
“Command”: “open”,
“Target”: “Noleggio a Lungo Termine per Aziende e P.Iva | UnipolRental”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “xpath=(//span[text()=‘Categoria veicolo’])[4]”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “xpath=(//span[text()=‘City Car (3)’])”,
“Value”: “”,
“Description”: “”
}
]
}

Hello Hendrik, thank you very much for your assistance.

Today, the number of “City Cars” changed from 3 to 4, requiring me to modify the macro. Since this number varies daily, is it possible to use wildcards?

To address your question:

  1. Uivision emphasize its distinctive “visual” approach, as it is sometimes the only method that works, which is why I requested a solution to the issue.
  2. The Xpath recorded by Uivision differs in syntax compared to yours. For example: xpath=//*[@id=“__next”]/div/div/div[3]/div/div[12]/div/div/button[3]/span/svg
    instead of your xpath=(//span[text()=‘City Car (4)’]),
    which is far easier to read.

I would like to learn more about this. Do you have suggestions? Thank you.