How can I run Selenium Server Standalone 2 as a windows service in Windows XP?
相关问题
- Inheritance impossible in Windows Runtime Componen
- Selecting an item from a combo box selenium driver
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- Selenium in Java is not finding element when using
http://brantleytec.blogspot.com/2012/11/selenium-hub-and-node-as-windows-service.html
That link describes the process I used to set up and use Selenium hub and node as a service using native Microsoft programs. I was able to get this running locally on my work PC as well as on a remote server which runs my tests after every build.
If this is for your local PC though, I might suggest using the ChromeDriver instead of the RemoteWebDriver. It's less setup and allows new hires to start using your tests without any extra setup.
And here is link to more durable solution - first create the BAT files as in my other answer. Second read this article - Its about creating the service. I would reccomend pointing out to the BAT files in the options.
I never created a service, so that help page is as much as I can offer
I've had a lot of luck with the Non-Sucking Service Manager. It's a standalone executable that creates and a windows service and works much better than any alternatives I've ever used (I'm thinking about srvany.exe). The usage instructions are pretty straightforward.
Here's how I used it:
If you want to run as just a hub or a node, then add in the -role hub or -role node to the last parameter in step #2, e.g. "-jar C:\Selenium\selenium-server-standalone-2.21.0.jar -role hub". You can specify any other parameters for Selenium here as well.
If you need to adjust the parameters later, you can do this through Regedit under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\\Parameters. Specifically, the AppParameters Key contains the parameters you pass to Selenium.
Checkout the following project... I've used it to setup my Minecraft Server (java project) as a windows service.
http://yajsw.sourceforge.net/
Good Luck
Or if you want it start at startup, you can do this:
Create file
01_start_hub.bat
which will contain this command:Create file
02_start_node.bat
which will contain this command:Place both bat files into Startup folder
C:\Documents and Settings\UserName\Start Menu\Programs\Startup
Yes you will have two "ugly" dos prompts after startup, but this is quickwin solutin