Reputation:
I am trying to clean up the process around our UI Automation testing.
Right now we have a console application that we run on a server that listens for RPC calls using Apache Thrift, depending on the test being run this application will either launch Selenium with the browser the user has specified (Chrome, IE, Firefox) or it will launch our WPF desktop application.
My goal is to allow this console application to be run as a windows service for a couple puposes:
So my question is provided a server with no active user sessions and this service running, is it possible for the service to spin up both Selenium with a web browser and the WPF application and be able to drive them still.
If it isn't possible, what about programatically logging into the server?
Upvotes: 3
Views: 1916
Reputation: 29669
The only way you can do this is by using PhantomJS ( or some other headless browser ). Windows services do NOT have access to running browsers on a desktop (although they used to back in the Windows XP and Windows 2000 Server days). Since then Microsoft has locked down those permissions even though you see a 'interact with desktop' checkbox on the service, I don't think it will work.
Also, Selenium Grid servers MUST run in the foreground on a remote server (for the same reasons). The only exception is, using PhantomJS on the Grid, your grid servers can run as a service to start headless browsers. Of course, running Grid node as a service and grid hub as a service is not a trivial thing to configure (using YAJSW) but its doable. Your milage may vary if you go that route as I have not actually tried it. The idea is that you could write batch DOS scripts to start/register YAJSW to run grid as a service.
Upvotes: 2