Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Ask general questions here.
User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by Aracknid » Thu Feb 16, 2023 6:25 pm

Hi,

I'm very confused. I don't understand what you mean in you release notes for 10.5.2...

I saw that you released a new version of Ranorex with a fix(?) to ExecuteScript.... and the release notes talk about this:
Ranorex 10.5.2 Release (February 13, 2023 )

Bugs

- Users execute Javascript using ExecuteScript() successfully on an element
- We publish Ranorex Chrome Extension that uses Manifest V3.

Note: A key security improvement in Chrome Extension Manifest V3 is that extensions cannot load remote code like JavaScript or Wasm files. This may limit how you use “executescript” in your tests.
You can read more about the Manifest V3 feature summary here. The phasing out of Manifest V2 in January 2023 has been paused. You can read more about Manifest V2 here.
Are you saying that ExecuteScript is now working, but there may be some issues? Or are you saying that it doesn't work anymore because you are using Manifest V3 in your new Ranorex Chrome Extension?

Where is the new Ranorex Chrome Extension? Do you mean the browser add-in? I have version 1.3.1 dated Dec 2022...

With all this above, I still get the same error I was getting before (See previous post visual-studio-2022-support-with-ranorex ... 335d99d01a). All I'm doing is:
MyDom.ExecuteScript("return window.sno;")
sno is a guid for the session number for the logged in user.

Help please.

Aracknid

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by IvanF » Fri Feb 17, 2023 5:12 pm

Hi,

For the "where to get the latest extension" part of the question, you can use the last link on this page - https://chrome.google.com/webstore/search/ranorex?hl=en

1.3.1 with V2 and 1.4.0 with V3 are kept separately right now in case users don't want to switch to V3 at this time.

If you could please try running your code with 1.4.0 and reporting back here with results, that would be great.

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by Aracknid » Fri Feb 17, 2023 6:11 pm

I always use the Instrumentation Wizard... so I guess it just doesn't install the latest one?

I removed the current one (1.3.1) using the Instrumentation Wizard, then I manually went to the site you provided to get 1.4 and installed it. But I keep getting the 'Ranorex technology limitation' error for the ChromeAddon.

I tried to restart the machine , uninstall and reinstall the add-in, etc.. nothing works.

As an aside, I hate messing with these add-ins. They always mess up and cause issues and it takes so many tries to get things working....

What do I need to do?

Thanks for your help

Aracknid

dhale
Posts: 84
Joined: Thu Feb 27, 2014 7:33 pm

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by dhale » Mon Feb 20, 2023 5:11 pm

The other day when I saw 10.5.2 was released, I temporarily updated to it to see if the ExecuteScript issue I was having was fixed. When I upgraded I manually uninstalled the Chrome extension, (and uninstalled the Microsoft Edge extension) then installed 10.5.2, and used the instrumentation wizard to install the extension to Edge and Chrome. I didn't seem to have any issues with the extensions after the update. But again, I was just temporarily testing out 10.5.2.

I also was confused by their release notes - what they stated didn't make sense to me regarding if ExecuteScript was ever going to actually work again or not.

My only usage of ExecuteScript usage is to delete a specific browser cookie:

Code: Select all

.ExecuteScript("function delete_cookie(name) {document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; " +
	                                            "location.reload(); return true;}; return delete_cookie('contactinfo');");
Which, I found worked again for me in 10.5.2 - but since I don't use this feature for anything else at the moment, this is all I can attest to.

And now that they released 10.5.3 just a few days later - I'm going to have to test that out before we plan to update.

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by IvanF » Mon Feb 20, 2023 8:02 pm

dhale, thank you for that information. Aracknid, if you could please try disabling of 1.4.0 extension for now and reinstalling the whole Studio from one of the latest releases, that would be great (reinstall/reinstrumentation will get 1.3.1 extension version, but that's fine for this check).

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by Aracknid » Tue Feb 21, 2023 3:16 pm

No sure why you are asking me to do this, but I did it and it still is not working.

I uninstalled Ranorex 10.5.3. I uninstalled the 1.4 add-in for chrome. I restarted the machine. I re-installed 10.5.3. It put the 1.3.1 add-in back into Chrome automatically. I run my script. When I get to the ExecuteScript part, it throws the error.

Aracknid

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by IvanF » Tue Feb 21, 2023 8:53 pm

There was a hypothesis that the previous Studio installation got some files corrupted, which prevented the proper update of the extension. Doesn't look like that was the case. Will keep investigating other options.

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by IvanF » Wed Feb 22, 2023 4:57 pm

Still investigating a few things related to Chrome, would it be possible for you to try in Firefox?

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by Aracknid » Wed Feb 22, 2023 7:03 pm

Yes, it is working with Firefox 102.8 ESR (this is the latest ESR version. I have to test on the ESR versions).

It's also working in IE Mode of Edge.

It's not working with Edge or Chrome (basically the same thing now)

Aracknid.

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by IvanF » Wed Feb 22, 2023 8:47 pm

Understood, thanks for checking, will keep you posted once i learn more about the Chrome solutions.

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by Aracknid » Wed Feb 22, 2023 9:14 pm

What I'm wondering is what dhale above said.... Did you get ExecuteScript it to work with Chrome and 10.5.2 and the 1.3.1 Chrome add-in? Because obviously I cannot (but using 10.5.3). I'm just wondering if it's working for dhale, why is it not working for me?

Aracknid

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by IvanF » Thu Feb 23, 2023 3:30 pm

The underlying challenge is with permissions for custom scripts, Firefox can still "power" through, but Chrome/Edge stop the execution as soon as there are any permission issues.

I'm not yet sure exactly why your script is considered more custom than the one dhale shared, my guess would be "MyDom." part.

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by Aracknid » Mon Mar 20, 2023 2:17 pm

Is there a way to put some sort of exclusions in the manifest.json file, to allow it to work with my web site?

IvanF
Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by IvanF » Mon Mar 20, 2023 3:49 pm

Doesn't look like actions on the client side could help resolve the issue, it just comes down to evaluating permission changes, etc. on the extension side.

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Clarity required on ExecuteScript, Ranorex 10.5.2, and Manifest V3

Post by Aracknid » Mon Mar 20, 2023 3:51 pm

So, am I waiting for Ranorex to solve this or come up for a solution or workaround, or am I supposed to log an issue with them?