How to run Windows service outside Session 0

1.2k Views Asked by At

I have a Selenium Grid configured with its hub and nodes(VMs) started automatically as Windows services. Sometimes I would like to visually inspect how a test runs within a browser on a specific node but nothing actually appears on the screen. After some research the reason seem to be that Windows services run in Session 0 which is a special session where Windows services run in isolation.

My question is whether there any way to start Windows service outside Session 0 so I will be able to see the actual test?

P.S. I am using Windows 7 on all machines.

1

There are 1 best solutions below

0
Akshay barahate On

Session 0 is the problem when you want to run your selenium grid using task-scheduler and services.

I handle this by first creating .bat file for hub,node and then running that .bat using .vbs in background.

.Vbs will help you run the setup in background in same user session but running the .vbs in startup is challenge.

Batch script.

hub.bat

java -jar selenium-server-standalone-3.14.0.jar -role hub

hub.vbs

createobject("WScript.Shell").run "hub.bat",false

Create same setup .vbs and batch for your nodes.

for Session-0 Insight refer my ans