So something appears to have change in the latest Chrome release that broke a function that was working before.
We have a function on our web page that allows us to track an internal session ID that we then send to our database so that we can correlate various things with a given user’s session.
Up until this point, I was able to use the following code in order to return the value of this internal parameter to Katalon, but Chrome appears to have cracked down on this and no longer allows this form of value returning:
Can you please help clarify more on this? Do you receive any warning / error log or just literally the value not returned? It seems like Chrome has tightened security restrictions around accessing certain internal properties. I guess this
Not sure what you are referring to by ID, can you clarify please?
As far as the error message, this is what is being returned from the console when I try the call manually, and I suspect it’s the same error Katalon’s getting:
ID is internal session ID I mean. Illegal return statement means a syntax error or is attempting to return a value from a context where it’s not allowed. Can you please double-check _myUtil.sessionID correctly or able to be called?
I am able to correctly call it in the console and have it return a value with the statement _myUtil.sessionID, but that statement only returns null when used from Katalon, not sure if it’s because Katalon requires a return statement (which apparently Chrome no longer allows) or not.
Additional details:
Here’s where I use the command in the console and get a return value:
Code snippet where I’m calling this function in a loop in order to allow time for the page to load the function library:
yes it requires a return. If your session ID can be located somewhere on the page, I suggest you should use findwebElement() or read more about the examples of executeJavaScript () here [WebUI] Execute JavaScript | Katalon Docs
Was able to resolve the issue buy uninstalling and reinstalling Chrome, then updating to the latest ChromeDriver. Appreciate everyone who was working with me on this!