3

During execution spectron opens two terminal windows that are blank. First window is the application as I wanted it to be, other windows look like terminals without anything inside.

Currently i focus to the first window using focus().

Github issue link : https://github.com/electron/spectron/issues/60

Does anyone have any idea what's going on ? is it a ChromeDriver issue?

Bharath Kumar S
  • 1,332
  • 2
  • 8
  • 25

3 Answers3

1

I've had the same issue (just to clarify, on Windows only).

Apparently, was introduced as a workaround for Spectron on Windows:

The launcher binary written in go was frequently marked as a trojan or virus. A simple bat file should seen as more innocuous. See #93 for the problem as well as this bat file.

Unfortunately, a consequence of using a .bat file is the unavoidable spawning of these extra empty consoles.

The only known workaround is using .focus() like you mentioned.

Scott Rippey
  • 14,881
  • 5
  • 68
  • 83
1

A combination of focus() with setAlwaysOnTop(true) helps.

 chaiAsPromised.transferPromiseness = app.transferPromiseness;
    return app.start().then( async () => {
      await app.browserWindow.focus();
      await app.browserWindow.setAlwaysOnTop(true);
    });
  });
Bharath Kumar S
  • 1,332
  • 2
  • 8
  • 25
0

Maybe rework launcher.bat to use the start command? something like:

Start "" "%SPECTRON_NODE_PATH%" "%SPECTRON_LAUNCHER_PATH%" %*

Just eyeballing it.

Not sure about managing the exit fail codes but IIRC that does not leave up shell. Full disclosure, I do not have this app and this is a drive-by answer. Hope it helps.

twobob
  • 284
  • 4
  • 19