Button with javascript does not trigger since 7.0.11

I hope you can replicate this.

  1. I have a button with < a JavaScript> inside and looks like it’s clicked with Kantu but does not trigger anything.
  2. It works if I click it manually.
  3. Also When I record the click, the kantu script generated does not work either.

The Kantu scripts I tried and none of them are working:
{
“Command”: “click”,
“Target”: “xpath=//*[@id=“duel_select_0_right”]/img”,
“Value”: “–> [ > ] < --”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “xpath=//div[@class=“zen-mbs text”]”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “xpath=//a[@id=“duel_select_0_right”]”,
“Value”: “”,
“Description”: “”
}

The button:

< div class=“zen-mbs text”>
< a href=“javascript:if%20%28%21document.getElementById%28%27duel_select_0%27%29.disabled%26%26%20%21document.getElementById%28%27duel_select_1%27%29.disabled%29%20%7Bduel_select_0Var.beforeMoveRight%28%29%3B%3Bwindow.editPage_DLBEInstance.instMoveOption%28document.editPage.duel_select_0%2C%20document.editPage.duel_select_1%2Cwindow.editPage_DLBEInstance.emptyLabel%2C%20%5B%5D%2C%20null%2Cwindow.editPage_DLBEInstance.emptyLabel%2Cfalse%2Cnull%2C%27editPage_duel_errorMsg%27%29%3B%7D”
id=“duel_select_0_right”>
< img src="/img/s.gif" alt=“Add” class=“rightArrowIcon” title=“Add”/>
< /div>

image

Can you find a similar issue on a public page? Just from this code it is impossible to tell what goes wrong.

Another test and possible workaround: What if you use XClick instead of Click, does it work then?

Please try these 2 options:

  • XClick | Xpath here (same as for click)
  • XClick | Image_Of_Button.png
  1. If I find one I will do.
  2. I added a screen shot from our website where that button appears that does not work. I found another website with the same button in our environment with the same issue.
    3.xClick seems to be a work around, that you for that hint.

just found out xClick is not an option because the click is within a loop and used more that 20 times. Without a license I can’t use xCllick

Understand. We would love to tweak the standard Click command to work, too - but for that we need a test case with a public website.

If you or anyone else finds one, pls let us know.

I will try to create a scratch box for you with a login where you can access and see the particular button that is not working. I keep you posted. :slight_smile:

Hi,
we are setting you up an environment where you can see the issue with the button. It’s an Salesforce environment but I need an email from you so you can verify your browser.
Can you provide an email and I can give you access to the page that has the issue.

Thank you
Hendrik Kupfernagel

Thanks, please use team AT ui.vision

Hi,

I change the email in the Salesforce profile to team@ui.vision

  1. You should get an email to confirm the change. Please do so.

Then:

  1. Open https://ucsf-4f-dev-ed.my.salesforce.com/006/e?retURL=%2F006%2Fo
  2. Login with username “XXXX” & Password “YYYY”
  3. Check your email from noreply@salesforce.com with a verification code
    → Now your browser is registered
  4. Deny to switch to Lighting Experience. Click [No Thanks]
  5. “Kantu Test” section shows the section with the [>] Button issue

{
“Command”: “addSelection”,
“Target”: “id=00N8a000007HxTB_unselected”,
“Value”: “label=Option 1”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “id=00N8a000007HxTB_right_arrow”,
“Value”: “DOES NOT WORK!”,
“Description”: “”
},
{
“Command”: “comment”,
“Target”: “XClick // id=00N8a000007HxTB_right_arrow”,
“Value”: “”,
“Description”: “WORKS”
}

You should see a website like that:

The script will try to press the button shown here

image

Also, I will be out on vacation today for two weeks back on the 13th of June. So won’t be able to answer any questions till the. I hope the description above is efficient enough to reproduce the bug.

Thank you so much for looking into this.
Hendrik

Thanks for the great test case. It helped us to recreate the issue. Have a nice vacation :slight_smile: - Hopefully the bug is fixed by the time you return.

PS: Please leave the SF account enabled, we need it for debugging.

I’m glad you guys got in.
The environment should be available for several weeks.
Thank you for looking into this issue.

By the way, I’m from Berlin but moved to San Francisco a long time ago. And I’m heading back to Berlin to visit family. I think you guys are also from Germany. :slight_smile:
But I won’t make it to Heidelberg though ;).

1 Like

This here is maybe the same issue: 7.07 - 7.09 xpath is not working in Chrome (while 6.3.3 in Edge is doing well)

Hi, I hope you are doing well. Just checked with the new version 7.0.13 the issue with the button click still seems not to be fixed.Just to let you know.
Any ETA when this is fixed?

Thank you
Hendrik Kupfernagel

We debugged this. The behavior is because of this error happens on the page:

  • Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-dz5/ViEzJ5z9SAauMGaoy7r82pLlnkS8ZdM1Dpx1ZcE='), or a nonce ('nonce-...') is required to enable inline execution.
  • Salesforce page has the CSP
    image

Somehow content script of 6.2.8 (manifest 2) could work around that, but manifest 3 can’t.

=>

Solution: Your best option is to use XClick. If you simply replace the one “do nothing CLICK” with XClick it works great.

PS: You can contact me at team AT ui.vision and I can provide you with a free license key as “thank you” for this good test case.

1 Like

You guys are great. I will send you an email shortly.
–Hendrik

xClick stopped working on this as well.
To get around this I had to put a “Breakpoint” in my script to click the button now manually and then resume the script :(.

I have several other pages where xclick and click does not work anymore. This is not pretty. Sorry.

For the XClick issue: Is this the same website as before? Then we can test it. Can you please resend the login details? Thanks!

Yes, this is the same website before we had set up for you for testing. Unfortunately I can’t find the email I sent you before anymore with the access data and the URL for the website. Also I’m not sure that website is still active as it was a testing account usually expires after few months. Unfortunately, we don’t have the resources here at UCSF right now to set up another testing environment for you.

It’s ok because xClick is a less reliable workaround I did not prefer anyway. The website needed to stay on focus to make this work. The real issue to get this resolved with “click” command as it used to work in the older version 6 was never addressed.
We here at UCSF need more reliable automation solutions as we have seen till in version 6. We also dealing with issues where the scripts suddenly stops executing for now reason with no warning messages or disconnects more frequently from the browser tab and stops.

Anyway, I always appreciated your quick response to issues reported.

I thought I mentioned it already in an email to you, but maybe not? The challenge is that the “old” Click approach works only with Chrome manifest V2. This is no longer technically with the manifest V3 changes in Chrome. This is beyond our control. Of course, until early(?) 2023 you are welcome to use the old version. Just at some point Google (not we!) will turn it off.

As for the browser having to stay in the foreground for XClick. That is true. If this is a problem, we usually recommend to run the RPA automation in a virtual machine. Even a small and free Linux Virtual Box would do.

We also dealing with issues where the scripts suddenly stops executing for now reason with no warning messages or disconnects more frequently from the browser tab and stops.

That is something we are investigating. If this is an issue for you, I recommend you stay on V6.2.8 for now, or add some retry logic to the calling script. I totally agree, this issue must be fixed.