-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: dotnet Execute Script stopped working on few use cases on 4.24 and above #14720
Comments
@omer-za, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
using var driver = new ChromeDriver();
driver.ExecuteScript("console.log('Hi')"); It works to me, am I doing something wrong? @omer-za |
@nvborisenko Yes, please use the whole script i've sent above as the provided string.
|
Please verify your script manually. |
I've set up script variable like this var script = "\nchrome.webRequest.onHeadersReceived.addListener(\n function(details) {\n var responseHeaders = details.responseHeaders.map(\n (header) => {\n if (header.name === 'X-Context-Signature')\n header.value = 'bLrAdZ9t6/D//z/spDNOo2Dpjg8f/+/dLdYcXdEe8vdn05a/AqsWBfzeDvQ==';\n return header;\n });\n return { responseHeaders };\n },\n {\n urls: ['https://something/*'],\n },\n ['blocking', 'responseHeaders', 'extraHeaders']\n);\n \nfunction makeRequest (method, url) {\n return new Promise(function (resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.addEventListener('load', function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.response);\n } else {\n reject({\n status: xhr.status,\n statusText: xhr.statusText\n });\n }\n });\n xhr.onerror = function () {\n reject({\n status: xhr.status,\n statusText: xhr.statusText\n });\n };\n xhr.send();\n });\n}\nmakeRequest('GET', 'https://something');\n;"; |
And what is the issue? What exactly doesn't work? |
It just doesn't perform the request that it used to before upgrading the library, like that script is not being parsed correctly |
Just to understand whether this issue is really related to the library itself, I have to request you to collect logs https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/:
Then we will be able to compare the diff, thank you. |
Seems like there's some escaping issues introduced in 4.24. |
Chatted internally, it is not reproduced on my side. |
This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs. |
What happened?
I’m trying to perform a request using JS with the following script.
driver.ExecuteScript(script);
it doesn’t throw any error but also doesn’t perform the request like it was before upgrading selenium version from 4.23 to 4.24
How can we reproduce the issue?
Operating System
Mac
Selenium version
4.24
What are the browser(s) and version(s) where you see this issue?
Chrome latest
What are the browser driver(s) and version(s) where you see this issue?
Latest
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: