XClick not working on modal

Case

  1. I’m opening the LinkedIn page showing all the invites sent
  2. I’m able to click on the button RETIRAR which means [cancel invite]
  3. a modal appears and i have to confirm the action

Problem
I have tried several ways to click on the button of the modal but none of them work.

  1. I tried entering the coordinates but it does nothing
    I know it does nothing because if it were clicking outside the modal because of an error calculating the coordinates, it would disappear
  2. I also tried using XClick with an image
  3. and with ocr

Not even the “XType”, “${KEY_ESC}” is closing the modal if it fails

Can you give me any advice? Below you’ll find the JSON and a video recording

JSON

    {
  "Name": "Retirar invitacion",
  "CreationDate": "2020-7-8",
  "Commands": [
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "https://www.linkedin.com/mynetwork/invitation-manager/sent/",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "//*[text()[contains(.,'Retirar')]]",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": ""
    },
    {
      "Command": "XClick",
      "Target": "752,348",
      "Value": ""
    },
    {
      "Command": "XClick",
      "Target": "ocr=[Retirar]",
      "Value": ""
    },
    {
      "Command": "XClick",
      "Target": "a retirar.png",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_ESC}",
      "Value": ""
    }
  ]
}

Video Recording

1 Like

Try other xpaths every element can have more different xpaths, I usually try more xpath and i find a good xpath easy to detect.

Ui visioin save multiple xpath and there are more addons to detect advanced xpaths.

If you can not find a solution use Xclick with image recognition that working always (need focus on screen) (remember Xclick require focus on screen can not work without active focus)

https://ui.vision/rpa/docs/xclick

If Xclick | image does not work, check this:

  • Is the modal visible on the _lastscreenshot.png in the Screenshots tab? This shows what UIvision sees.

  • Try switching to desktop mode, this should work for sure. To do this, add XDesktopAutomation | true

For me, Xclick is not working on a modal in desktop mode.

Without desktop mode I can’t even use the “select” tool on the modal. That part works in desktop, but still, no clicking or other actions on the modal are possible.