Skip to content

Commit de0c5f5

Browse files
committed
fix binary driver issue
1 parent 59229ca commit de0c5f5

File tree

4 files changed

+30
-26
lines changed

4 files changed

+30
-26
lines changed

packages/selenium-ide/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-ide",
3-
"version": "4.0.1-alpha.69",
3+
"version": "4.0.1-alpha.70",
44
"private": false,
55
"description": "Selenium IDE electron app",
66
"author": "Todd <[email protected]>",

packages/selenium-ide/src/main/session/controllers/Driver/start.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,13 @@ export const port = app.isPackaged ? 9516 : 9515
3131
*/
3232

3333
const electronBinary = `chromedriver${os.platform() === 'win32' ? '.exe' : ''}`
34-
const ourElectronPath = app.isPackaged
35-
? path.resolve(
36-
path.join(
37-
__dirname,
38-
'..',
39-
'node_modules',
40-
'electron-chromedriver',
41-
'bin',
42-
electronBinary
43-
)
44-
)
45-
: __non_webpack_require__.resolve(
46-
path.join(
47-
'electron-chromedriver',
48-
'bin',
49-
electronBinary
50-
)
51-
)
34+
const ourElectronPath = __non_webpack_require__.resolve(
35+
path.join(
36+
'electron-chromedriver',
37+
'bin',
38+
electronBinary
39+
)
40+
)
5241

5342
const getDriver = ({ browser, version }: BrowserInfo) =>
5443
(browser === 'electron'

packages/selenium-ide/src/main/session/controllers/System/index.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,28 @@ export default class SystemController extends BaseController {
5656
loggerWindow.show()
5757
// If automated, assume we already have a chromedriver process running
5858
if (!isAutomated) {
59-
const startupError = await this.session.driver.startProcess(
60-
this.session.store.get('browserInfo')
61-
)
62-
if (startupError) {
63-
await this.crash(
64-
`Unable to startup due to chromedriver error: ${startupError}`
59+
try {
60+
await this.session.driver.startProcess(
61+
this.session.store.get('browserInfo')
6562
)
63+
} catch (e) {
64+
console.warn(`
65+
Failed to locate non-electron driver on startup,
66+
Resetting to electron driver.
67+
`)
68+
await this.session.store.set('browserInfo', {
69+
browser: 'electron',
70+
useBidi: false,
71+
version: '',
72+
})
73+
const startupError = await this.session.driver.startProcess(
74+
this.session.store.get('browserInfo')
75+
)
76+
if (startupError) {
77+
await this.crash(
78+
`Unable to startup due to chromedriver error: ${startupError}`
79+
)
80+
}
6681
}
6782
}
6883
await this.session.projects.select(firstTime)

packages/selenium-ide/src/main/store/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default () => {
3333
const store = new Store<StorageSchema>({
3434
defaults: {
3535
browserInfo: {
36-
browser: 'chrome',
36+
browser: 'electron',
3737
useBidi: false,
3838
version: '',
3939
},

0 commit comments

Comments
 (0)