Not recording pop up alert

Cchatgpt wants me to use the command acceptalert but it does not exist. When I start recording in UI.Vision nothing happens with the pop-up window, and I need to accept to continue.

I’ve read all the alert topics, but nothing seems to work.

somehow I need another step between these 2 commands.

Thanks in advance
Steve

PS. The website is confidential (healthcare related) so cannot share.

{
“Command”: “click”,
“Target”: “xpath=/html/body”,
“Value”: “”,
“Targets”: [
“xpath=/html/body”,
“xpath=//body”,
“css=body”
],
“Description”: “”
},
{
“Command”: “click”,
“Target”: “linkText=Save”,
“Value”: “”,
“Targets”: [
“linkText=Save”,
“id=createFindCasePanel-saveCaseButton”,
“xpath=//*[@id="createFindCasePanel-saveCaseButton"]”,
“xpath=//a[@id=‘createFindCasePanel-saveCaseButton’]”,
“xpath=//span/a[2]”,
“css=#createFindCasePanel-saveCaseButton”
],
“Description”: “”
},

I tested it on a (test) website, and all works fine. Can you run the below macro and see if it works for you?

For simple confirmation dialogs (= OK/Cancel dialogs), chooseOkOnNextConfirmation was used in the old Selenium IDE. It is no longer needed in Ui.Vision, as this behavior is now built-in => Ui.Vision clicks OK automatically:

{
  "Name": "popup1",
  "CreationDate": "2025-2-2",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://testpages.herokuapp.com/styled/alerts/alert-test.html",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "id=confirmexample",
      "Value": "",
      "Description": "Opens dialog, but uivision catches it and closes it"
    },
    {
      "Command": "storeText",
      "Target": "id=confirmexplanation",
      "Value": "a",
      "Description": "Extract result text from website"
    },
    {
      "Command": "echo",
      "Target": "text=${a}",
      "Value": "green",
      "Description": ""
    }
  ]
}

This does not work for me. It will click [Cancel]. I copied your script exactly as shown and the result shows clearly “Clicked Cancel”. I think it’s a bug.

Note: I just found it it works when the page loads first with the script (pressing OK) but if you refresh the same page within the browser manually it will click [Cancel]