08-07-26 12:14 PM
Hello, we are currently getting an Error with one of are Edge browser process's when it tries to invoke JavaScript. We are getting the error:
| ERROR: Internal : Failed to perform step 2 in Navigate Stage 'Inject and run cookie javascript' on page 'Login' - JavaScript invoker returned the following error message: Attempted to Invoke JavaScript without Web Driver |
The Web Driver, and Edge version appear to be the same version (150).
The navigation stage throwing the error itself is made up of 2 parts.
The first action is a insert JavaScript function which sets up the script we run, the second stage is a invoke JavaScript function which executes the function set in stage 1 (the script is stored in the data item [JS-MODSESSION]). They both run against the root of the website.
The Script it uses is the following (for context this script is used to grab the current session token, so we can use the website's API to carry some tasks where the website interface itself is unsuitable for spying):
function createAndPopulateMODSESSIONTextBox() {
// 1. Get the MODSESSION value
const modSessionValue = document.cookie;
// 2. Create the text box element
const modSessionTextBox = document.createElement('input');
// 3. Set attributes for the text box
modSessionTextBox.type = 'text';
modSessionTextBox.id = 'MODSESSION'; // Assign an ID for easy reference
modSessionTextBox.readOnly = true; // Make it read-only if you just want to display the value
modSessionTextBox.value = modSessionValue; // Set the retrieved value
const label = document.createElement('label');
label.htmlFor = 'MODSESSION';
label.textContent = 'MODSESSION: ';
document.body.appendChild(label);
document.body.appendChild(modSessionTextBox);
}Any help would be appreciated.
08-07-26 10:14 PM
There have been historic problems with Invoke Javascript on different versions of Blue Prism what version are you using this may be a factor to check.
There is a new function in the navigate stage called 'Invoke Javascript Event' which might work better? It seems to require less code than the traditional route. Check out the link to an article which might apply to you.
https://support.blueprism.com/en/support/solutions/articles/7000078862
Hope this helps but more detail on some of the things in the table would hopefully get you closer to a working solution.
09-07-26 08:09 AM
Hello @greggoodrem , we have a go using Invoke JavaScript event see if that helps.
We are currently using Blueprism 7.3.2, and is was working fine on that version before so I not 100% sure it would be the Manifest V3 changes, as we should of already had those changes for a while now (I could be wrong).
09-07-26 09:18 AM
@greggoodrem Hello again.
Had a go but I don't think Invoke JavaScript Event is going to work for are use case, as we are trying to run a JavaScript function and event seems to be limited to interacting with the web page as a user would.
10-07-26 10:59 AM
Hello, everyone just wanted to let you know, we have found a temporary fix.
The issue seems to be Blueprism for some reason has lost the ability to start edge with the remote debugging port enabled, even with the argument for it provided in the launch command.
Are temporary fix for now is to use Utility - Environment, to launch edge via a command line command (start msedge.exe --remote-debugging-port=9222 --user-data-dir="%TEMP%\edge-debug-profile" URL of target site), and then attach and use that intense of edge. Everything seems to work fine after that.
10-07-26 11:31 AM
Sounds good, if you have it sorted by group policy then no drama however I always add the following on a launch action
"https://website.com --hide-crash-restore-bubble --force-renderer-accessibility --start-maximized"
Stops the Restore Pages popup, maximizes the window and the force-renderer-accessibility helps UIA mode if you have to resort to that method.
Monday
Hello,
We faced the same issue with Edge 150.0.4078.83 and Blue Prism v7.3.2 with only Javascript Event was working.
We already used the explicit start of Edge with environment object so this didn't solve our issue.
After following the conversation here we tried adding --user-data-dir="..." and this eventually made Javascript work again. I didn't consider the user-data-dir parameter first since it was named 'debug' but it seems it was actually the key to solve it.
Maybe this helps
Best regards,
Walter
Monday - last edited Monday
Hi,
can you please check in Windows Event viewer why its failing, there you will find the issue ,
and to test, launch the browser using application modeller , browser will launch with your specified link , after that just type www.google.com in browser manually , and written small javascript code to enter any text in search textbox , and try invoking using blueprism and see if its working or not. if its working then probably your site is not allowing to invoke and for this you might have to see windows event viewer.
In my case, i am using Chrome and in arguments i am just passing [] (square brackets)
Tuesday
Hello @naveed_raza
Apparently you are talking about a completely different issue, which would be obvious when reading the conversation carefully.
Yes, we tested Javascript and we know it is not working since long running processes stop working.
Yes, we tried the usual fixes and workaround, otherwise our processes wouldn't have been able to run before the problem occurred anyways.
You are talking about Chrome, while the issue is with Edge and it seems with a specific version of Edge. You didn't write the version of Chrome or version of Blue Prism you are using and this problem maybe never affected Chrome (since Edge is highly customized) or maybe you use a more recent version of Chromium (as Chrome's versions are always ahead of Edge) where this was already fixed.
Best regards