Open GT-VMC876 opened 9 months ago
@GT-VMC876, thank you for creating this issue. We will troubleshoot it as soon as we can.
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template
label.
If the issue is a question, add the I-question
label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted
label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-*
label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
@GT-VMC876 - I have a fun question. If you don't install geckodriver at all and run it like this, what happens? (I think Selenium Manager, part of selenium-webdriver, should do a lot of this work for us now).
I just did a full win11 reinstall. If I run the selenium-side-runner **.side command right after 'npm install -g selenium-side-runner' I get the same error, unfortunately.
@GT-VMC876 Strange as it sounds, I have a Windows 11 machine and installed node, npm, chromedrivers (in my case) and had the same failure.
node version: 20.11.0 npm version: 10.2.4
After I run the command: selenium-side-runner --filter "1 THE-DT-myTest-Create-Project" "C:\Users\computer\Documents\the-dt-test-suites-main\Instrument\myTest\myTest Automated Test.side"
The output is: C:\Users\computer>selenium-side-runner --filter "1 THE-DT-myTest-Create-Project" "C:\Users\computer\Documents\the-dt-test-suites-main\Instrument\myTest\myTest Automated Test.side" console.info
Project Create myTest Test Project doesn't have any suites matching filter 1 THE-DT-myTest-Create-Project,
attempting to iterate all tests in project
at src/main.test.ts:169:15
at Array.forEach (<anonymous>)
info: Running test 1 THE-DT-myTest-Create-Project info: Building driver for chrome FAIL AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js Running project Create myTest Test Project ร Running test 1 THE-DT-myTest-Create-Project (122 ms)
โ Running project Create myTest Test Project โบ Running test 1 THE-DT-myTest-Create-Project
Unable to obtain browser driver.
For more information on how to install drivers see
https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/. Error: Error executing command for C:\Users\computer\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\selenium-webdriver\bin\windows\selenium-manager.exe with --browser,chrome,--output,json: undefined
at getPath (node_modules/selenium-webdriver/common/driverFinder.js:35:11)
at Function.createSession (node_modules/selenium-webdriver/chromium.js:696:45)
at Function.createSession (node_modules/selenium-webdriver/chrome.js:223:13)
at createDriver (node_modules/selenium-webdriver/index.js:152:33)
at Builder.build (node_modules/selenium-webdriver/index.js:680:16)
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:170:10)
at Playback.init (node_modules/@seleniumhq/side-runtime/src/playback.ts:140:25)
at Playback.play (node_modules/@seleniumhq/side-runtime/src/playback.ts:162:46)
at src/run.ts:157:11
Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 1.905 s, estimated 2 s Ran all test suites within paths "C:\Users\computer\AppData\Roaming\npm\node_modules\selenium-side-runner\dist\main.test.js".
It works fine on my windows 10 pro machine.
I just reinstalled a Win10 machine, unfortunately the same behavior. The problem really occurred only when I started to reinstall a machine. I still have one working WIN11 set-up left which was installed in November/December.
@lino76 Did you recently install side runner on your win10 machine or a few weeks ago?
@GT-VMC876 I actually installed it yesterday.
Windows 10 pro node version: 16.14.0 npm version: 9.5.0 selenium-side-runner: 4.0.0-alpha.63 Java Version: java 11.0.16.1 2022-08-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.16.1+1-LTS-1) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.16.1+1-LTS-1, mixed mode) FYI both machines Windows 11 and Windows 10 have the same java versions
On my Windows 11 machine, its fails when it try to run the AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js
Okay, so this happens, and a question that commonly arises for me is like "how can i tell where the problem is coming from in this ecosystem". I think I need to add a command to selenium-side-runner to debug this sort of thing. Let me add a command onto selenium-side-runner focused on debugging ability to connect to a driver instance or something.
@toddtarsi sounds good! Looking forward testing that version.
Okay, there is a new flag in the latest version (x.64) going out '-X'. Using this will attempt to connect, and if it fails, give you a code snippet to try executing that will help decide if the source issue is in the ide or in selenium core.
@toddtarsi hereby the output of a fresh installed WIN11 Pro machine (Azure VM Standard D2as v4).
Installed latest firefox, NodeJS LTS & NPM side-runner as mentioned in the first post.
The below output is the same before and after running 'npm install -g geckodriver'.
////////
C:\Users\QQQ>selenium-side-runner -c "browserName=firefox" Desktop\YYY.side -X console.log Beginning test session
at Object.<anonymous>.exports.default (src/connect.ts:9:11)
console.info Building driver for firefox
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:165:19)
FAIL AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js ร Testing driver connection (88 ms)
โ Testing driver connection
Unable to obtain browser driver.
For more information on how to install drivers see
https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/. Error: Error executing command for C:\Users\QQQ\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\selenium-webdriver\bin\windows\selenium-manager.exe with --browser,firefox,--output,json: undefined
at getPath (node_modules/selenium-webdriver/common/driverFinder.js:35:11)
at Function.createSession (node_modules/selenium-webdriver/firefox.js:603:45)
at createDriver (node_modules/selenium-webdriver/index.js:152:33)
at Builder.build (node_modules/selenium-webdriver/index.js:688:16)
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:170:10)
at Object.<anonymous>.exports.default (src/connect.ts:10:16)
at Object.<anonymous> (src/main.test.ts:130:25)
Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 0.996 s, estimated 2 s Ran all test suites within paths "C:\Users\QQQ\AppData\Roaming\npm\node_modules\selenium-side-runner\dist\main.test.js".
@GT-VMC876 - If you tack on a -X
to the arguments in your CLI command, do you get a really long error message asking you to run a code snippet?
@toddtarsi the above output is a 100% copy paste of what I see in CMD (I only obscured the username and filename). The -X was already added to the command in the example above. Am I missing something?
@GT-VMC876 - Oh, I'm a goof, I didn't see that (the text got formatted a bit funny). Can you try this command?
selenium-side-runner -Xc "browserName=firefox" Desktop\YYY.side
Sometimes it can be finicky about order of args
@toddtarsi Hereby. I removed the indentions, perhaps this makes it more readable.
-Xc felt weird to me so I tried -X -c as well. Same output on both cases. I doubled checked the version as well, to take away any doubts (if any).
////////
C:\Users\QQQ>selenium-side-runner --version 4.0.0-alpha.64
C:\Users\QQQ>selenium-side-runner -Xc "browserName=firefox" Desktop\YYY.side console.log Beginning test session
at Object.
console.info
Building driver for firefox at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:165:19)
FAIL AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js ร Testing driver connection (74 ms)
โ Testing driver connection
Unable to obtain browser driver. For more information on how to install drivers see https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/. Error: Error executing command for C:\Users\QQQ\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\selenium-webdriver\bin\windows\selenium-manager.exe with --browser,firefox,--output,json: undefined
at getPath (node_modules/selenium-webdriver/common/driverFinder.js:35:11)
at Function.createSession (node_modules/selenium-webdriver/firefox.js:603:45)
at createDriver (node_modules/selenium-webdriver/index.js:152:33)
at Builder.build (node_modules/selenium-webdriver/index.js:688:16)
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:170:10)
at Object.
Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 0.914 s, estimated 1 s Ran all test suites within paths "C:\Users\QQQ\AppData\Roaming\npm\node_modules\selenium-side-runner\dist\main.test.js".
โน๏ธ I'm not sure whats going on here. It's supposed to have a try catch block and return some text like this if it fails:
Failed to build driver for safari
Supplied capabilities: {}
Server: none
Error: SessionNotCreatedError: Could not create a session: You must enable the 'Allow Remote Automation' option in Safari's Develop menu to control Safari via WebDriver.
OS: darwin
Node: v20.6.0
Selenium-Webdriver: 4.16.0
This is breaking at the boundary of the following code in selenium-webdriver:
// BEGIN SELENIUM-WEBDRIVER CODE
const webdriver = require('selenium-webdriver')
const driver = new webdriver.Builder()
.withCapabilities('{}')
.forBrowser('safari')
.build()
// END SELENIUM-WEBDRIVER CODE
To ensure the bug is in selenium IDE, please attempt to run the above code in a script or node REPL.
If you are unable to proceed further, please raise a bug here:
https://github.com/SeleniumHQ/selenium/issues/new?assignees=&labels=I-defect%2Cneeds-triaging&projects=&template=bug-report.yml&title=%5B%F0%9F%90%9B+Bug%5D%3A+
If this code works in selenium-webdriver, but not the IDE or side-runner, please raise a bug here:
https://github.com/SeleniumHQ/selenium-ide/issues/new?assignees=&labels=&projects=&template=bug.md
I'll have to look into it tonight
@toddtarsi Good to know what to expect. That is indeed not what I get :)
For what it is worth, I copy-pasted the script from your message to a new file and ran it with NodeJS.
I have included the %PATH% as well, just for context (I did not manually add/alter anything after the fresh install):
///////////
C:\Users\QQQ>echo %PATH% C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Users\QQQ\AppData\Local\Microsoft\WindowsApps;C:\Users\QQQ\AppData\Roaming\npm
C:\Users\QQQ>node Desktop\script.js node:internal/modules/cjs/loader:1147 throw err; ^
Error: Cannot find module 'selenium-webdriver' Require stack:
Node.js v20.11.0
Hm, I'll have to look tonight. This is meant to be a bit of a living document. Ultimately, I think what you're hitting is a bug in selenium-core. I want to keep refining this so that:
@toddtarsi For what its worth, I did the same thing as @GT-VMC876.
Ran the command selenium-side-runner -Xc "browserName=chrome" --filter "Test1" "C:\temp\mytest.side" Results: console.log Beginning test session
at Object.<anonymous>.exports.default (src/connect.ts:9:11)
console.info Building driver for chrome
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:165:19)
FAIL AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js ร Testing driver connection (111 ms)
โ Testing driver connection
Unable to obtain browser driver.
For more information on how to install drivers see
https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/. Error: Error executing command for C:\Users\me\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\selenium-webdriver\bin\windows\selenium-manager.exe with --browser,chrome,--output,json: undefined
at getPath (node_modules/selenium-webdriver/common/driverFinder.js:35:11)
at Function.createSession (node_modules/selenium-webdriver/chromium.js:696:45)
at Function.createSession (node_modules/selenium-webdriver/chrome.js:223:13)
at createDriver (node_modules/selenium-webdriver/index.js:152:33)
at Builder.build (node_modules/selenium-webdriver/index.js:680:16)
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:170:10)
at Object.<anonymous>.exports.default (src/connect.ts:10:16)
at Object.<anonymous> (src/main.test.ts:130:25)
Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 1.785 s, estimated 2 s Ran all test suites within paths "C:\Users\me\AppData\Roaming\npm\node_modules\selenium-side-runner\dist\main.test.js".
And when I can the javascript code the results were: C:\temp>node selem.js node:internal/modules/cjs/loader:1147 throw err; ^
Error: Cannot find module 'selenium-webdriver' Require stack:
Node.js v20.11.0
@lino76 - Thank you for testing as well. I didn't get around to fixing this last night, but knowing what you two are seeing consistently means that this is my first priority this week.
Coming back to this, I have no idea why you all aren't getting this. I just installed latest selenium-side-runner, and got this terminal output:
(base) โ selenium-ide git:(trunk) โ selenium-side-runner -Xc "browserName=safari" ./tests/examples/blank.side
console.log
Beginning test session
at Object.<anonymous>.exports.default (src/connect.ts:9:11)
console.info
Building driver for safari
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:176:19)
console.info
Driver attributes:{ capabilities: {}, server: '', browserName: 'safari' }
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:178:21)
console.error
Failed to build driver for safari
Supplied capabilities: {}
Server: none
Error: SessionNotCreatedError: Could not create a session: You must enable the 'Allow Remote Automation' option in Safari's Develop menu to control Safari via WebDriver.
OS: darwin
Node: v20.6.0
Selenium-Webdriver: 4.17.0
This is breaking at the boundary of the following code in selenium-webdriver:
// BEGIN SELENIUM-WEBDRIVER CODE
const webdriver = require('selenium-webdriver')
const driver = new webdriver.Builder().withCapabilities({}).forBrowser('safari').build()
// END SELENIUM-WEBDRIVER CODE
To ensure the bug is in selenium IDE, please attempt to run the above code in a script or node REPL.
You may have to npm install selenium-webdriver first.
If you are unable to proceed further, please raise a bug here:
https://github.com/SeleniumHQ/selenium/issues/new?assignees=&labels=I-defect%2Cneeds-triaging&projects=&template=bug-report.yml&title=%5B%F0%9F%90%9B+Bug%5D%3A+
If this code works in selenium-webdriver, but not the IDE or side-runner, please raise a bug here:
https://github.com/SeleniumHQ/selenium-ide/issues/new?assignees=&labels=&projects=&template=bug.md
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:200:19)
at Object.<anonymous>.exports.default (src/connect.ts:10:3)
at Object.<anonymous> (src/main.test.ts:130:5)
FAIL ../../.nvm/versions/node/v20.6.0/lib/node_modules/selenium-side-runner/dist/main.test.js
โ Testing driver connection (369 ms)
โ Testing driver connection
SessionNotCreatedError: Could not create a session: You must enable the 'Allow Remote Automation' option in Safari's Develop menu to control Safari via WebDriver.
at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:524:15)
at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:605:13)
at Executor.execute (node_modules/selenium-webdriver/lib/http.js:533:28)
I wish I understood better what was going on here ๐
@toddtarsi
So here's what I did just now after you commented.
I reinstalled selenium-side-runner by typing the following: npm install selenium-side-runner and received the same error as I report a few days ago.
Then I tried the following right after "npm install -g selenium-side-runner" for chrome and received the following response...
changed 392 packages in 23s
45 packages are looking for funding
run npm fund
for details
I then type C:\temp>selenium-side-runner -Xc "browserName=chrome" "mytest.side" console.log Beginning test session
at Object.<anonymous>.exports.default (src/connect.ts:9:11)
console.info Building driver for chrome
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:176:19)
console.info Driver attributes:{ capabilities: {}, server: '', browserName: 'chrome' }
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:178:21)
RUNS ../Users/me/AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js console.info Driver has been built for chrome
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:192:21)
console.log Test session created
at Object.<anonymous>.exports.default (src/connect.ts:16:11)
console.log Session ID: cf19b129d0b75c4e4bcd05baadd1ee19
at Object.<anonymous>.exports.default (src/connect.ts:18:11)
PASS ../Users/me/AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js (20.656 s) โ Testing driver connection (19173 ms)
Test Suites: 1 passed, 1 total Tests: 1 passed, 1 total Snapshots: 0 total Time: 20.833 s Ran all test suites within paths "C:\Users\me\AppData\Roaming\npm\node_modules\selenium-side-runner\dist\main.test.js".
My chrome diver connection on my system passed.
I was not able to run your script code because the command I typed above ran through really quick. Is there a way I can run the "// BEGIN SELENIUM-WEBDRIVER CODE const webdriver = require('selenium-webdriver') const driver = new webdriver.Builder().withCapabilities({}).forBrowser('safari').build() // END SELENIUM-WEBDRIVER CODE"
Or is that only if I failed the driver conection test?
Ah, nah thats alright. It's good enough to me that the connection test ran for the moment. Thank you!
Hi @toddtarsi, how are you doing? Do you need any more input to reproduce this issue?
Ah, no, I think I got my context here scrambled a bit. So at this point, chrome is able to connect, but firefox isn't able to via the side-runner, is that correct?
@toddtarsi & @GT-VMC876 Just for the record... I am able to run my test code (.side) using selenium-side-runner (4.0.0-alpha.66) with Chrome (version 121.0.6167.161).
@lino76 - Thank you for testing!
@GT-VMC876 - Yeah, the fact that the chrome connection test succeeded gave me the sense that the issue was resolved, so I actually hadn't kept pursuing here. If something here still isn't working, I'll keep looking!
@toddtarsi I just spinned up a fresh VM, installed all latest versions as described at the beginning of this topic and: the test passed in Forefox as well! However, it throws a bunch of red highlighed errors before it executes the test:
C:\Users\Administrator>selenium-side-runner -c "browserName=firefox" Desktop\test.side console.warn Failed to run project test
at src/main.test.ts:202:15
at Array.forEach (<anonymous>)
at Object.<anonymous> (src/main.test.ts:134:18)
console.error
Error: Returning a Promise from "describe" is not supported. Tests must be defined synchronously.
at Object.describe (C:\Users\Administrator\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\jest-each\build\index.js:57:42)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\selenium-side-runner\src\main.test.ts:161:22
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\jest-each\build\bind.js:81:13
at _dispatchDescribe (C:\Users\Administrator\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\jest-circus\build\index.js:91:26)
at describe (C:\Users\Administrator\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\jest-circus\build\index.js:55:5)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\jest-each\build\bind.js:47:15
at Array.forEach (
at src/main.test.ts:203:15
at Array.forEach (<anonymous>)
at Object.<anonymous> (src/main.test.ts:134:18)
info: Running test testscript info: Building driver for firefox info: Driver has been built for firefox info: echo: >> test echo info: Finished test testscript Success PASS AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js (16.098 s) Running project test Running suite Default Suite โ Running test testscript (14837 ms)
Test Suites: 1 passed, 1 total Tests: 1 passed, 1 total Snapshots: 0 total Time: 16.238 s Ran all test suites within paths "C:\Users\Administrator\AppData\Roaming\npm\node_modules\selenium-side-runner\dist\main.test.js".
Oh gosh! This is my fault. I just added an async handler here to do something ๐ฌ . I'll roll that back tonight, easy fix!
@GT-VMC876 - Sorry about the delay, rollback is done and the latest version is pretty darn good if I do say so myself ๐
@toddtarsi Yes, it runs the test successfully and no errors are thrown (Firerfox, Win)! Thanks Todd!
What happened?
Unable to get side runner working on any new machine or -reinstalled- machine where side runner was working on before reinstallation.
How can we reproduce the issue?
Relevant log output
Operating System
Windows 11 Pro (up-to-date)
Selenium version
selenium-side-runner: 4.0.0-alpha.63. .side file is created with IDE (firefox) plugin
What are the browser(s) and version(s) where you see this issue?
all (in example above Firtefox 121.0.1 was used)
What are the browser driver(s) and version(s) where you see this issue?
geckodriver 0.34.0
Are you using Selenium Grid?
no