#electron #webdriver
#электрон #веб-драйвер
Вопрос:
Кто-нибудь пробовал работать с electron и webdriverio? Я использую последнюю версию electron 16 с «wdio-chromedriver-service»: «^7.2.2» и версией chromedriver «96.0.0». Я получаю следующую ошибку:
$ npx wdio run ./wdio.conf.js --spec welcome-test.e2e.js Execution of 1 workers started at 2021-11-30T11:14:38.431Z 2021-11-30T11:14:38.516Z INFO @wdio/cli:launcher: Run onPrepare hook 2021-11-30T11:14:38.517Z INFO chromedriver: Start Chromedriver (C:Projectsabcnode_moduleschromedriverlibchromedriverchromedriver.exe) with args --silent --port=9515 --url-base=/ 2021-11-30T11:14:38.652Z INFO @wdio/cli:launcher: Run onWorkerStart hook 2021-11-30T11:14:38.657Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,./wdio.conf.js,--spec,welcome-test.e2e.js [0-0] 2021-11-30T11:14:39.340Z INFO @wdio/local-runner: Run worker command: run [0-0] RUNNING in chrome - C:Projectsabctestspecswelcome-test.e2e.js [0-0] 2021-11-30T11:14:40.069Z INFO webdriver: Initiate new session using the WebDriver protocol [0-0] 2021-11-30T11:14:40.136Z INFO webdriver: [POST] http://localhost:9515/session [0-0] 2021-11-30T11:14:40.137Z INFO webdriver: DATA { [0-0] capabilities: { [0-0] alwaysMatch: { [0-0] browserName: 'chrome', [0-0] acceptInsecureCerts: true, [0-0] 'goog:chromeOptions': [Object] [0-0] }, [0-0] firstMatch: [ {} ] [0-0] }, [0-0] desiredCapabilities: { [0-0] browserName: 'chrome', [0-0] acceptInsecureCerts: true, [0-0] 'goog:chromeOptions': { [0-0] binary: 'C:/Projects/abc/node_modules/electron/dist/electron.exe', [0-0] args: [Array] [0-0] } [0-0] } [0-0] } [0-0] 2021-11-30T11:14:45.557Z WARN webdriver: Request failed with status 500 due to unknown error: Chrome failed to start: exited normally. [0-0] (chrome not reachable) [0-0] (The process started from chrome location C:/Projects/abc/node_modules/electron/dist/electron.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Мой wdio.conf.js файл выглядит так:
capabilities: [{ // maxInstances can get overwritten per capability. So if you have an in-house Selenium // grid with only 5 firefox instances available you can make sure that not more than // 5 instances get started at a time. maxInstances: 1, browserName: 'chrome', acceptInsecureCerts: true, 'goog:chromeOptions': { binary: 'C:/Projects/abc/node_modules/electron/dist/electron.exe', // Path to your Electron binary. args: ['app=C:/Projects/abc', '--no-sandbox', '--headless'], // Optional, perhaps 'app=' /path/to/your/app/ }, // If outputDir is provided WebdriverIO can capture driver session logs // it is possible to configure which logTypes to include/exclude. // excludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs // excludeDriverLogs: ['bugreport', 'server'], }],
Любая помощь будет признательна.
Комментарии:
1. Не могли бы вы разобраться в этом? Я все еще борюсь
2. Оказалось, что это скорее проблема, связанная с конкретным проектом, а не с общим кодом. Эта настройка будет отлично работать в новом проекте.