Closed giuliohome closed 1 year ago
Hm! That's strange to me. What version of yarn / NodeJS are you building on? We specifically build using the 'nohoist' flag from yarn here.
This should keep these packages from getting lifted up to the parent directory, but I've messed many things up before haha.
Hm, interesting. After a quick glance at the source, it seems you check the driver path here:
which is resolving to
and I suspect it simply points to the the node_modules
in the packages/selenium-ide
at runtime (irrespectively of nohoist in yarn workspaces... and btw nohoist is deprecated in yarn3).
My proposed fix
$ git diff packages/selenium-ide/
diff --git a/packages/selenium-ide/src/main/session/controllers/Driver/start.ts b/packages/selenium-ide/src/main/session/controllers/Driver/start.ts
index 85a96393..c86b7e81 100644
--- a/packages/selenium-ide/src/main/session/controllers/Driver/start.ts
+++ b/packages/selenium-ide/src/main/session/controllers/Driver/start.ts
@@ -35,7 +35,7 @@ const getDriver = ({ browser, version }: BrowserInfo) =>
? path.resolve(
path.join(
__dirname,
- '..',
+ '..','..','..',
'node_modules',
'electron-chromedriver',
'bin',
@giuliohome - Oh holy shit I'm using yarn v1 locally haha. 🤦 💀
I can't change the path to this exactly yet though because we also do asarUnpack flags here:
And since this builds out of the CI, I worry merging this will actually fully break the latest binary in alpha. I know I need more testing via spectron on this stuff btw. I intend to write a sanity test or two soon. Currently I'm using the example side files to do focused testing.
By the way, if I go to selenium-ide/packages/side-runner
and I run
pnpm start -- /.../myexample/selenium-ide.side
it first complains Error: The ChromeDriver could not be found on the current PATH.
If I put /selenium-ide/packages/selenium-ide/node_modules/electron-chromedriver/bin/
then the above error is solved but I still have a problem:
SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 100
Current browser version is 106.0.5249.91 with binary path /usr/bin/google-chrome
Of course I can do instead
wget https://chromedriver.storage.googleapis.com/106.0.5249.61/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
And voilà ... my test starts also from side-runner (I don't understand how to set timeout, ignore ssl cert errors.. pass headless as arg.. but ok atm I'm temporary deleting the timeout at code level to manually ignore the certificate errors and I don't need headless now)
If that is the way to link the chromedriver (i.e. wget), then perfect, all is working as expected (in regard to side-runner). Out of my curiosity: am I using the ChromeDriver version 100 when I am recording the .side test? Is it coherent with the runtime version of side-runner?
With regard to the side runner, yeah whatever works is good. That's one of those tools that is meant to be driver-ambiguous. The expected workflow tends to be something like this:
npm i -g @seleniumhq/side-runner
selenium-side-runner -c "goog:chromeOptions.args=[headless,no-sandbox] browserName=chrome" -t 15000 ./project.side
Honestly, at some point I might rename the side-runner bin to like selenium-side-runner-4 or something like that, because Github installs selenium-side-runner v3 as a global bin and the name conflicts make it hard as hell to use v4
I am doing the following (*) from packages/side-runner but I think the capabilities are not passed (e.g. I see chrome in XLaunch, it is not headless)
pnpm start -- -c "goog:chromeOptions.args=[headless,no-sandbox] browserName=chrome" /home/giulio/dso-demo/selenium-ide.side
> @seleniumhq/side-runner@4.0.0-alpha.15 start /home/giulio/selenium-ide/packages/side-runner
> node dist/bin.js "--" "-c" "goog:chromeOptions.args=[headless,no-sandbox] browserName=chrome" "/home/giulio/dso-demo/selenium-ide.side"
and I see a different result here with reference to what happens in packages/selenium-ide, that's why I was asking whether the different version of the chromedriver 100 vs 106 could be causing the mismatch...
Anyway, you confirmed this is the expected workflow: fair enough, that's it, thank you.
Edit
(*) Never mind the --
before the args was wrong! my fault!
The following takes effect now:
$ pnpm start -c "browserName=chrome acceptInsecureCerts=true acceptSslCerts=true" /home/giulio/dso-demo/selenium-ide.side
@giuliohome - Awesome! Glad it's working for you, imo the double hyphens are the worst!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I followed the readme instruction on Ubuntu in Windwos WSL 2.
But I had to do the following
(i.e. to copy the
electron-chromedriver
folder from the root'snode_modules
to thenode_modules
in thepackages/seleniumide
)to make it work!