SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.8k stars 762 forks source link

Wrong chromedriver executable for the Selenium.IDE-4.0.0-alpha.X.AppImage? #1740

Closed blutorange closed 10 months ago

blutorange commented 10 months ago

I tried to run several versions of the Selenium.IDE-4.0.0-alpha.X.AppImage on Ubuntu, which always failed with the error below. When I check the the bundled chromedriver executable, it reports it as a Mach-O 64-bit x86_64 executable. As far as I can tell, this is used by Mac-OS / iOS

user@mobil:~/Downloads/selenium-ide$ file /home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar.unpacked/node_modules/electron-chromedriver/bin/chromedriver 
/home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar.unpacked/node_modules/electron-chromedriver/bin/chromedriver: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS>

When I then replace that file selenium-ide/squashfs-root/resources/app.asar.unpacked/node_modules/electron-chromedriver/bin/chromedriver with the proper chromedriver executable from

https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.71/linux64/chromedriver-linux64.zip

Then the app starts up. The logs then also reports that chromedriver was started:

DevTools listening on ws://127.0.0.1:8315/devtools/browser/816d2a96-105a-4f71-8f09-b73b45c2dcca
webdriver: 'Starting ChromeDriver 120.0.6099.71 (9729082fe6174c0a371fc66501f5efc5d69d3d2b-refs/branch-heads/6099_56@{#13}) on port 9516\n' +
  'Only local connections are allowed.\n' +
  'Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.\n' +
  'ChromeDriver was started successfully.\n'
webdriver: 'Driver has initialized!'

Not sure if this was intentional, but isn't the AppImage meant for Linux systems?

user@mobil:~/Downloads/selenium-ide$ ./Selenium.IDE-4.0.0-alpha.59.AppImage  --appimage-extract

user@mobil:~/Downloads/selenium-ide$ squashfs-root/AppRun 
13:36:22.191 › Missing method for path plugins.projectCreate, using passthrough
13:36:22.193 › Missing method for path plugins.projectDelete, using passthrough
13:36:22.193 › Missing method for path plugins.projectEdit, using passthrough
13:36:22.193 › Missing method for path recorder.getLocatorOrder, using passthrough
13:36:22.193 › Missing method for path recorder.selectElement, using passthrough
13:36:22.194 › Missing method for path recorder.setWindowHandle, using passthrough
13:36:22.194 › Missing method for path state.set, using passthrough
13:36:22.194 › Missing method for path state.setActiveSuite, using passthrough
13:36:22.194 › Missing method for path state.setActiveTest, using passthrough
13:36:22.194 › Missing method for path state.setCopiedCommands, using passthrough
13:36:22.195 › Missing method for path state.toggleBreakpoint, using passthrough
13:36:22.195 › Missing method for path state.toggleSuiteMode, using passthrough
13:36:22.195 › Missing method for path state.toggleUserPrefDisableCodeExportCompat, using passthrough
13:36:22.195 › Missing method for path state.updateStepSelection, using passthrough
13:36:22.195 › Missing method for path state.updateTestSelection, using passthrough
13:36:22.195 › Missing method for path suites.addTests, using passthrough
13:36:22.195 › Missing method for path suites.delete, using passthrough
13:36:22.195 › Missing method for path suites.removeTests, using passthrough
13:36:22.195 › Missing method for path suites.reorderTests, using passthrough
13:36:22.195 › Missing method for path suites.update, using passthrough
13:36:22.195 › Missing method for path tests.delete, using passthrough
13:36:22.196 › Missing method for path tests.removeSteps, using passthrough
13:36:22.196 › Missing method for path tests.rename, using passthrough
13:36:22.196 › Missing method for path tests.reorderSteps, using passthrough
13:36:22.196 › Missing method for path tests.toggleStepDisability, using passthrough
13:36:22.196 › Missing method for path tests.updateStep, using passthrough

DevTools listening on ws://127.0.0.1:8315/devtools/browser/80d27e35-5098-49e9-8671-634ac589e8c2
webdriver-error: '/home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar.unpacked/node_modules/electron-chromedriver/bin/chromedriver: 1: Syntax error: word unexpected (expecting ")")\n'
13:36:22.310 › Failed to start chromedriver process /home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar.unpacked/node_modules/electron-chromedriver/bin/chromedriver: 1: Syntax error: word unexpected (expecting ")")

api: 'Dispatch event' 'system.onLog' [
  'error',
  '[\n' +
    "  'Failed to start chromedriver process',\n" +
    `  '/home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar.unpacked/node_modules/electron-chromedriver/bin/chromedriver: 1: Syntax error: word unexpected (expecting ")")\\n'\n` +
    ']'
]
webdriver-error: 'driver has exited with code 2'
api: 'Received API Request' 'plugins.list' []
api: 'Resolved API Request' 'plugins.list' []
api: 'Received API Request' 'plugins.listPreloadPaths' []
api: 'Resolved API Request' 'plugins.listPreloadPaths' []
api: 'Listener added' 'system.onLog'
api: 'Received API Request' 'state.getUserPrefs' []
api: 'Resolved API Request' 'state.getUserPrefs' {
  disableCodeExportCompat: 'No',
  insertCommandPref: 'After',
  themePref: 'System',
  camelCaseNamesPref: 'No',
  ignoreCertificateErrorsPref: 'No'
}
13:36:29.234 › [PROCESS] Unhandled Promise Rejection
api: 'Dispatch event' 'system.onLog' [ 'info', "[ '[PROCESS] Unhandled Promise Rejection' ]" ]
13:36:29.235 › - - - - - - - - - - - - - - - - - - -
api: 'Dispatch event' 'system.onLog' [ 'info', "[ '- - - - - - - - - - - - - - - - - - -' ]" ]
13:36:29.236 › Error: Unable to startup due to chromedriver error: /home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar.unpacked/node_modules/electron-chromedriver/bin/chromedriver: 1: Syntax error: word unexpected (expecting ")")

    at c.startupError [as crash] (/home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar/build/webpack:/src/main/session/controllers/System/index.ts:92:11)
    at c.startup (/home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar/build/webpack:/src/main/session/controllers/System/index.ts:56:13)
    at App.<anonymous> (/home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar/build/webpack:/src/main/index.ts:39:5)
api: 'Dispatch event' 'system.onLog' [
  'info',
  '[\n' +
    '  Error: Unable to startup due to chromedriver error: /home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar.unpacked/node_modules/electron-chromedriver/bin/chromedriver: 1: Syntax error: word unexpected (expecting ")")\n' +
    '  \n' +
    '      at c.startupError [as crash] (/home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar/build/webpack:/src/main/session/controllers/System/index.ts:92:11)\n' +
    '      at c.startup (/home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar/build/webpack:/src/main/session/controllers/System/index.ts:56:13)\n' +
    '      at App.<anonymous> (/home/user/Downloads/selenium-ide/squashfs-root/resources/app.asar/build/webpack:/src/main/index.ts:39:5)\n' +
    ']'
]
13:36:29.236 › - -
api: 'Dispatch event' 'system.onLog' [ 'info', "[ '- -' ]" ]
Segmentation fault (core dumped)
toddtarsi commented 10 months ago

@blutorange - Hm, it sounds like I need to change the github build command to maybe do a matrix of builds. Currently, it builds using electron-builder on MacOS with the -mwl flags to publish to all platforms. However, some Windows users have had issues, and now I'm hearing about linux as well. I only have a mac so I'm shooting in the dark, but I'll look into changing the build system to do a matrix (windows/linux on one, mac on the other) later tonight.

blutorange commented 10 months ago

Yes I know how that is, whenever you develop software for one system, it refuses to work on other systems. Feel free to ask if you need somebody to test the changes on linux ; )

toddtarsi commented 10 months ago

@blutorange - Thank you for the excellent stack trace and help. I'll update you once I have the next version rolling out via matrix jobs.

toddtarsi commented 10 months ago

@blutorange - Okay, we now run a native build for each platform:

https://github.com/SeleniumHQ/selenium-ide/releases

Please test and let me know how things look 🤞

blutorange commented 10 months ago

@toddtarsi Looks good to me! I downloaded the app image from here, made it executable, started it and Selenium was up and running. I created a simple test, worked as well :+1: Can't test on Windows, but on Ubuntu it works now.

image

jiakai-1 commented 9 months ago

Hi, I had a similar problem with windwos,The downloaded selenset.ide.setup.4.0.1-alpha.*.exe will prompt you on startup: Unable to startup due to chromedriver error: Missing executable at path mypath\selenium-ide\resource..chromedriver-v.exe. I am concerned that this issue is specific to Ubuntu and I would like to ask if the windows issue is fixed

blutorange commented 9 months ago

As far as I understand it, the build setup was changed so that it now produces a build specifically for Windows; but nobody had a Windows system to test the resulting executable. One thing though, this path seems very wrong:

mypath\selenium-ide\resource..chromedriver-v.exe.

There's no dot at the end I suppose? Are there really 2 dots .. between resource and chromdriver? I also wonder why it's called chromedriver-v.exe and not just chromedriver.exe. If the full path was just cut off, perhaps run in on the CLI to get the full path.

Have you checked if you can find a chromedriver.exe or similar file anywhere in the install directory? Then perhaps it's just the wrong path.

jiakai-1 commented 9 months ago

As far as I understand it, the build setup was changed so that it now produces a build specifically for Windows; but nobody had a Windows system to test the resulting executable. One thing though, this path seems very wrong:

mypath\selenium-ide\resource..chromedriver-v.exe.

There's no dot at the end I suppose? Are there really 2 dots .. between resource and chromdriver? I also wonder why it's called chromedriver-v.exe and not just chromedriver.exe. If the full path was just cut off, perhaps run in on the CLI to get the full path.

Have you checked if you can find a chromedriver.exe or similar file anywhere in the install directory? Then perhaps it's just the wrong path.

I have the same question and I checked that my chromedriver.exe is the same version as my chrome browser. I used file search and did not find chromedriver-v.exe under resource

jiakai-1 commented 9 months ago

After much trial and error, I placed the default seleniumide folder on drive D and saw a detailed error that the chromedriver-v.exefile was missing in selenium-ide\resources\app.asar.unpacked\files image I moved chromedriver.exe to the corresponding directory and changed the name to chromedriver-v.exe. seleniumide started normally。 Although the problem has been solved, I am still wondering why the chromedriver-v.exe message is missing。

github-actions[bot] commented 8 months ago

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.