Trouble with Comment Box

I’m trying to get Ui.Vision to enter text in a comment box and then click the post button. However, click and clickAt don’t trigger the comment box to expand and reveal the post button. So even it inputs the desired text, the post button doesn’t pop up and the macro fails.

Any suggestions?

Heres an image of it unclicked then physically clicked:

Screen Shot 2020-08-02 at 1.45.30 AM Screen Shot 2020-08-02 at 1.45.37 AM

Use XClick instead of Click. XClick simulates real (native) mouse clicks instead of the Javascript events that are triggered by Click/Clickat. Javascript events sometimes do not work.

1 Like

Thanks Ulrich,
Unfortunately I’m now running into the unsolved issue of Xclick failing to hit the red selector box upon clicks. It seem that the selector box finds the chosen image just fine but the physical click seems to register about 2 inches above the box. I’ve scoured the forums and the problem occurs for many other users but there doesn’t seem to be a solution.

You can do an XClick | x,y or compensate for it being off.

1 Like

Thanks User9898. I’m not sure how to script the coordinate compensation if you could give me a hint.

Do you have examples of such posts? Is this on the Mac? A screenshot would be helpful.

In any case, if such shift happens, 3 workarounds:

  • Sometimes a shift happens because the page is not finished scrolling, so the button still moves after UI.Vision found it! => Wait for page to finish scrolling, then click.

If this is not the case, and we have a real shift (bug!?), then this helps:

  • Use desktop automation mode

  • OR: Shift the y coordinates for click manually:

    • visualAssert | buttonimage.png (= find the image and get its x,y)
    • executeScript_Sandbox | return ${!imagey}- YYY | ynew (now substract the YYY offset)
    • xclick | ${!imagex}, ${ynew} (click on the new coordinates, as suggested by @User9898)

You can use this small program to help you calculate the offset:

I appreciate the help!

Any chance you could write this in the source view (JSON) format?
I’m having zero luck trying to reverse engineer these commands.

Right now I have Xclick set up targeting an image but I’m not sure where to write the coordinates and both target and value result in errors saying the variables are not defined.

It’s XClick | x,y

{
“Command”: “XClick”,
“Target”: “x,y”,
“Value”: “”
}

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

Thank you! Got it to work finally!!