Open jackchuong opened 7 months ago
@jackchuong, 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!
FAIL ../AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js (31.04 s) ร Testing driver connection (30086 ms)
It could be due to your network connection causing the driver to take a long time to download & build
Can you also try to pre-run npm install -g chromedriver
once to initialize the driver separately?
If it still fails, try to find any process in Windows Task Manager that keeps chromedriver.exe
running before, kill it, and rerun.
Also, I don't know -X
is represent for which config. However without -X
I had a run successfully as below
PS D:\Code\GitHub\selenium-ide> selenium-side-runner test3.side
info: Running test test3
RUNS C:/Users/ndviet/AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js
info: Finished test test3 Success
PASS C:/Users/ndviet/AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js (15.546 s)
Running project test3
Running suite Default Suite
โ Running test test3 (14573 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 15.655 s
Can you also try to pre-run
npm install -g chromedriver
once to initialize the driver separately?
Yes
C:\Users\jack.chuong\Downloads>npm install -g chromedriver
changed 63 packages in 17s
2 packages are looking for funding
run `npm fund` for details
C:\Users\jack.chuong\Downloads>chromedriver --version
ChromeDriver 123.0.6312.105 (399174dbe6eff0f59de9a6096129c0c827002b3a-refs/branch-heads/6312@{#761})
If it still fails, try to find any process in Windows Task Manager that keeps
chromedriver.exe
running before, kill it, and rerun.
There is no process in Windows Task Manager that keeps chromedriver.exe
running before.
Also, I don't know
-X
is represent for which configC:\Users\jack.chuong\Downloads>selenium-side-runner --help Usage: bin [options] your-project-glob-here-*.side [variadic-project-globs-*.side]
Options: -V, --version output the version number --base-url [url] Override the base URL that was set in the IDE -c, --capabilities [list] Webdriver capabilities -j, --jest-options [list] Options to configure Jest, wrap in extra quotes to allow shell to process (default: "\"\"") -s, --server [url] Webdriver remote server -r, --retries [number] Retry tests N times on failures, thin wrapper on jest.retryTimes (default: 0) -f, --filter [string] Run suites matching name, takes a regex without slashes, eg (^(hello|goodbye).*$) -w, --max-workers [number] Maximum amount of workers that will run your tests, defaults to number of cores -t, --timeout [number] The maximimum amount of time, in milliseconds, to spend attempting to locate an element. (default: 15000) (default: 15000) -T, --jest-timeout [number] The maximimum amount of time, in milliseconds, to wait for a test to finish. (default: 60000) (default: 60000) -x, --proxy-type [type] Type of proxy to use (one of: direct, manual, pac, socks, system) -y, --proxy-options [list] Proxy options to pass, for use with manual, pac and socks proxies -n, --config-file [filepath] Use specified YAML file for configuration. (default: .side.yml) -o, --output-directory [directory] Write test results as json to file in specified directory. Name will be based on timestamp. -z, --screenshot-failure-directory [directory] Write screenshots of failed tests to file in specified directory. Name will be based on test + timestamp. -f, --force Forcibly run the project, regardless of project's version -d, --debug Print debug logs -D, --debug-startup Print debug startup logs -X, --debug-connection-mode Debug driver connection mode -h, --help display help for command
Without `-X` I get error as below
C:\Users\jack.chuong\Downloads>selenium-side-runner test3.side info: Running test test3 FAIL ../AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js (31.115 s) Running project test3 Running suite Default Suite ร Running test test3 (30011 ms)
โ Running project test3 โบ Running suite Default Suite โบ Running test test3
Driver took too long to build. This is likely an issue with the browser or driver.
at Timeout._onTimeout (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:200:13)
Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 31.24 s, estimated 32 s Ran all test suites within paths "C:\Users\jack.chuong\AppData\Roaming\npm\node_modules\selenium-side-runner\dist\main.test.js".
I tried with another Windows 11 , still same error.
Oh ok, based on few info in your logs
OS: win32 Node: v20.12.2 Selenium-Webdriver: 4.19.0 chromedriver --version ChromeDriver 123.0.6312.105 (399174dbe6eff0f59de9a6096129c0c827002b3a-refs/branch-heads/6312@{#761})
If accessing these 2 links directly, how long it takes to complete the download? is it within 30s? If no, need to figure out a config to extend that timeout (something needs to be asked in project selenium-ide)
Another Windows 11 with the same error, is it also win32? If yes, can you also try a machine win64 to see. If win64 can work, then the driver has something wrong with win32 that needs to ask chromedriver team
Another trick you can try to change the policy that will allow to run the PowerShell script (open PS run as administrators), then exec selenium-side-runner
in PowerShell instead of CMD to see any helps
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -Force
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
@VietND96 My both Windows 10 & 11 are 64 bit OS.
I tried PowerShell as administrators and still get same error
PS C:\Windows\system32> Get-ExecutionPolicy
RemoteSigned
PS C:\Windows\system32> Get-ExecutionPolicy -Scope Process
Bypass
And yes, it takes more then 30s to complete the download, my average download speed is 2.87 MB/s , so it takes about 50s for each file.
Can you try this command selenium-side-runner -D -d -X --proxy-type direct test3.side
By running this command, I saw a log appear very fast (in case run successfully) that it tried to connect to 127.0.0.1:51xxx
, it looks like the port is random each run to launch the chromedriver.
If it stops with more logs helpful, let's check if it could be due to the firewall or something else can block the port or process of chromedriver.exe
I print as much information as possible here:
PS C:\Users\jack.chuong\Downloads> selenium-side-runner -D -d -X --proxy-type direct test3.side
Configuration: {
baseUrl: '',
capabilities: { browserName: 'chrome', proxy: { proxyType: 'direct' } },
debug: true,
debugConnectionMode: true,
debugStartup: true,
filter: '.*',
force: undefined,
maxWorkers: 8,
screenshotFailureDirectory: undefined,
projects: [ 'C:\\Users\\jack.chuong\\Downloads\\test3.side' ],
proxyOptions: {},
proxyType: 'direct',
retries: 0,
runId: '15affc13ff18577918a97e64c972172b',
path: 'C:\\Users\\jack.chuong\\AppData\\Roaming\\npm\\node_modules\\',
server: '',
jestTimeout: 60000,
timeout: 15000
}
Jest command: node C:\Users\jack.chuong\AppData\Roaming\npm\node_modules\selenium-side-runner\node_modules\jest\bin\jest.js [
'--config=C:\\Users\\jack.chuong\\AppData\\Roaming\\npm\\node_modules\\selenium-side-runner\\runner.jest.config.js',
'--maxConcurrency=8',
'--runTestsByPath',
'C:\\Users\\jack.chuong\\AppData\\Roaming\\npm\\node_modules\\selenium-side-runner\\dist\\main.test.js'
] {
ALLUSERSPROFILE: 'C:\\ProgramData',
APPDATA: 'C:\\Users\\jack.chuong\\AppData\\Roaming',
ChocolateyInstall: 'C:\\ProgramData\\chocolatey',
ChocolateyLastPathUpdate: '133386376887221046',
CommonProgramFiles: 'C:\\Program Files\\Common Files',
'CommonProgramFiles(x86)': 'C:\\Program Files (x86)\\Common Files',
CommonProgramW6432: 'C:\\Program Files\\Common Files',
ComSpec: 'C:\\Windows\\system32\\cmd.exe',
DriverData: 'C:\\Windows\\System32\\Drivers\\DriverData', ',
HOMEDRIVE: 'C:',
HOMEPATH: '\\Users\\jack.chuong',
LOCALAPPDATA: 'C:\\Users\\jack.chuong\\AppData\\Local',
NUMBER_OF_PROCESSORS: '8',
OS: 'Windows_NT',
Path: 'C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\CLI2\\wbin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\Program Files\\Git\\cmd;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\nodejs\\;C:\\Users\\jack.chuong\\scoop\\shims;C:\\Users\\jack.chuong\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files\\Azure Data Studio\\bin;C:\\Users\\jack.chuong;C:\\Users\\jack.chuong\\AppData\\Roaming\\Python\\Python310\\Scripts\\;C:\\Users\\jack.chuong\\AppData\\Roaming\\npm',
PATHEXT: '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL',
PROCESSOR_ARCHITECTURE: 'AMD64',
PROCESSOR_IDENTIFIER: 'Intel64 Family 6 Model 142 Stepping 11, GenuineIntel',
PROCESSOR_LEVEL: '6',
PROCESSOR_REVISION: '8e0b',
ProgramData: 'C:\\ProgramData',
ProgramFiles: 'C:\\Program Files',
'ProgramFiles(x86)': 'C:\\Program Files (x86)',
ProgramW6432: 'C:\\Program Files',
PSModulePath: 'C:\\Users\\jack.chuong\\Documents\\WindowsPowerShell\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files\\SharePoint Online Management Shell\\',
PUBLIC: 'C:\\Users\\Public',
SystemDrive: 'C:',
SystemRoot: 'C:\\Windows',
TEMP: 'C:\\Users\\JACK~1.CHU\\AppData\\Local\\Temp',
TMP: 'C:\\Users\\JACK~1.CHU\\AppData\\Local\\Temp',
windir: 'C:\\Windows',
ZES_ENABLE_SYSMAN: '1',
__PSLockDownPolicy: '0',
SE_CONFIGURATION: '{"baseUrl":"","capabilities":{"browserName":"chrome","proxy":{"proxyType":"direct"}},"debug":true,"debugConnectionMode":true,"debugStartup":true,"filter":".*","maxWorkers":8,"projects":["C:\\\\Users\\\\jack.chuong\\\\Downloads\\\\test3.side"],"proxyOptions":{},"proxyType":"direct","retries":0,"runId":"15affc13ff18577918a97e64c972172b","path":"C:\\\\Users\\\\jack.chuong\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\","server":"","jestTimeout":60000,"timeout":15000}'
}
console.log
Beginning test session
at Object.<anonymous>.exports.default (src/connect.ts:9:11)
console.info
Building driver for chrome
at WebDriverExecutor.getDriverSync (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:172:14)
console.info
Driver attributes:{
capabilities: { proxy: { proxyType: 'direct' } },
server: '',
browserName: 'chrome'
}
at WebDriverExecutor.getDriverSync (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:173:14)
console.error
Failed to build driver for chrome
Supplied capabilities: {"proxy":{"proxyType":"direct"}}
Server: none
Error: Error: Driver took too long to build. This is likely an issue with the browser or driver.
OS: win32
Node: v20.12.2
Selenium-Webdriver: 4.19.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({"proxy":{"proxyType":"direct"}}).forBrowser('chrome').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.getDriver (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:216:17)
at WebDriverExecutor.init (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:259:21)
at Object.<anonymous>.exports.default (src/connect.ts:10:3)
at Object.<anonymous> (src/main.test.ts:130:5)
FAIL ../AppData/Roaming/npm/node_modules/selenium-side-runner/dist/main.test.js (31.007 s)
ร Testing driver connection (30058 ms)
โ Testing driver connection
Driver took too long to build. This is likely an issue with the browser or driver.
at Timeout._onTimeout (node_modules/@seleniumhq/side-runtime/src/webdriver.ts:200:13)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 31.129 s
Ran all test suites within paths "C:\Users\jack.chuong\AppData\Roaming\npm\node_modules\selenium-side-runner\dist\main.test.js".
Can you try running this and posting the output?
npm install selenium-webdriver && node -e "const webdriver = require('selenium-webdriver'); const driver = new webdriver.Builder().withCapabilities({'proxy':{'proxyType':'direct'}}).forBrowser('chrome').build();"
There is no output at console but it creates some files and folders , I attached them below.
PS C:\Windows\system32> cd C:\Users\jack.chuong\Downloads
PS C:\Users\jack.chuong\Downloads> npm install selenium-webdriver && node -e "const webdriver = require('selenium-webdriver'); const driver = new webdriver.Builder().withCapabilities({'proxy':{'proxyType':'direct'}}).forBrowser('chrome').build();"
At line:1 char:32
+ npm install selenium-webdriver && node -e "const webdriver = require( ...
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
PS C:\Users\jack.chuong\Downloads> npm install selenium-webdriver
added 16 packages in 3s
PS C:\Users\jack.chuong\Downloads> node -e "const webdriver = require('selenium-webdriver'); const driver = new webdriver.Builder().withCapabilities({'proxy':{'proxyType':'direct'}}).forBrowser('chrome').build();"
PS C:\Users\jack.chuong\Downloads>
node-output.zip It's .7z file but I have to change file extension to .zip so I can upload it.
Ah, windows, my mistake. Can you try the following two commands instead?
npm i -g selenium-webdriver;
node -e "const webdriver = require('selenium-webdriver'); const driver = new webdriver.Builder().withCapabilities({'proxy':{'proxyType':'direct'}}).forBrowser('chrome').build();"
EDIT: Oh, nice. Thanks for splitting that. Okay, reading a bit closer.
What happens if you do this?
node -e "const webdriver = require('selenium-webdriver'); const driver = new webdriver.Builder().withCapabilities({'proxy':{'proxyType':'direct'}}).forBrowser('chrome').build(); driver.get('https://www.google.com').then(() => setTimeout(() => driver.close(), 3000));"
Does a Chrome browser window appear for you for 3 seconds and then disappear?
@toddtarsi
PS C:\Users\jack.chuong\Downloads> node -e "const webdriver = require('selenium-webdriver'); const driver = new webdriver.Builder().withCapabilities({'proxy':{'proxyType':'direct'}}).forBrowser('chrome').build(); driver.get('https://www.google.com').then(() => setTimeout(() => driver.close(), 3000));"
No, nothing happens. I have also noticed this behavior, I watched some tutorials on youtube before trying selenium ide and selenium-side-runner :)
C:\Users\jack.chuong\Downloads>selenium-side-runner test3.side
should open my chrome browser and do steps in .side file , but I get error instead
Yes, okay. If this doesn't occur in selenium-webdriver, this won't work here as it extends that tool. Can you use this code as your point of conversation there? This is getting to a spot where the Selenium core team would be an order of magnitude more helpful than I am.
Use the code to drive discussions in the main channel of the Selenium user group.
https://www.selenium.dev/support/
They'll help you with this there. I want to help, but this is not an IDE / runner problem. This gets into driver setup and Windows, two areas where I am a very poor resource.
I had exactly the same problem, on Windows 11, but with the geckodriver. I just made some updates, and hit the same problem : "Driver took too long to build. This is likely an issue with the browser or driver." after 30 seconds. It was working with the exact same version of selenium-side-runner (4.0.5) and geckodriver (4.3.3) downloaded two months ago.
I finally found the culprit : it is Node version 20.12.2 ! With the previous version, v20.12.1, or version v20.11.0 it works again ... Here is the last working version : https://nodejs.org/download/release/v20.12.1
Maybe something linked to this ? https://nodejs.org/en/blog/release/v20.12.2
[69ffc6d50d] - src: disallow direct .bat and .cmd file spawning (Ben Noordhuis)
@tharfy - You are amazing, thank you. Will review tonight.
I uninstalled node and npm , reinstall node v19.9.0 and npm 9.6.3 , selenium-side-runner worked.
Thank you again @jackchuong. ๐ฎโ๐จ I think I might hold off on fixing this until this weekend. For a number of reasons, I've needed to get a cheapy windows notebook and to iterate this without will probably be a nightmare for Windows users, so I'll get a notebook and do it this weekend.
This appears to still be an issue in the latest version of Node: 22.4.1. Installing v 19.9.0 fixed the issue for me as well.
@kaslin - Thanks for letting me know about this.
I plan to catch up on issues this weekend, but I can't guarantee I'll get to this yet. It's top of my list though.
Hi everyone, I tried your solution using node 19.9.0, but the situation does not change on my side. In my local environment, everything works well despite some slowness since this downgrade. Wouldn't this be an unopened port problem ?
I tried this script in order to open a chrome navigator.
node -e "const webdriver = require('selenium-webdriver'); const driver = new webdriver.Builder().withCapabilities({}).forBrowser('chrome').build();"
but it returns a timeout error.
Error: Timed out waiting for the WebDriver server at http://127.0.0.1:35647/
(the port number change at each time)
What happened?
Hi all, On my Windows 10, I have Chrome browser Version 123.0.6312.123 (Official Build) (64-bit) with Selenium IDE extension installed. I recorded a simple test like access to https://opensource-demo.orangehrmlive.com/ --> login --> logout , saved as test3.side I can run test with Selenium IDE successfully.
I installed nodejs and npm
Then I use npm to install selenium-side-runner and chromedriver
When I tried to run test3.side with selenium-side-runner I got error as below
How can we reproduce the issue?
Relevant log output
Operating System
Windows 10
Selenium version
Node: v20.12.2 Selenium-Webdriver: 4.19.0
What are the browser(s) and version(s) where you see this issue?
Chrome browser Version 123.0.6312.123 (Official Build) (64-bit)
What are the browser driver(s) and version(s) where you see this issue?
Version 123.0.6312.123 (Official Build) (64-bit)
Are you using Selenium Grid?
no