Closed spooning closed 9 years ago
Originally submitted to Google Code by @yanne on 6 Aug 2012
Start Selenium Server already accepts *params, which can be used to pass arbitrary command line options to Selenium Server startup.
Is there a reason you cannot use that?
Originally submitted to Google Code by chmielsster on 6 Aug 2012
As I understant *params provides custom command line options to Selenium server and I need a custom options to java process which runs Selenium server: java <my options> -jar jarpath + _server_startup_params(params)
which can be seen at the bottom of my patch above. I needed this to route all traffic through proxy to log all HTTP requests and responses.
Originally submitted to Google Code by chmielsster on 6 Aug 2012
Correct patch: --- SeleniumLibrary/init.py (wersja 15373) +++ SeleniumLibrary/init.py (kopia robocza) @@ -82,7 +82,10 @@ if not jarpath: jarpath = SELENIUM_SERVER_PATH params = _add_default_user_extension(jarpath, list(params))
java_opts=[]
return ['java'] + java_opts + [ '-jar', jarpath] + _server_startup_params(params)
def _add_default_user_extension(jarpath, params):
Originally submitted to Google Code by @yanne on 6 Aug 2012
You are correct, I read the patch too fast.
I still do not think that configuring some things via keyword arguments and others via environment variables is the best possible approach.
Unfortunately, it is also quite difficult to change the signature of start_selenium_server without backwards incompatibility issues. One option could be to accept some special name in *params, but that's quite obscure too.
I'll think about this a bit, but something will definitely be done.
Originally submitted to Google Code by @yanne on 27 Aug 2012
Going to fix this by adding special check in Start Selenium Server for argument named JVM.
So, after the fix, this will work:
Start Selenium Server JVM=-Dsomething --ensureCleanSession
which translates to
java -Dsomething selenium-server.jar -ensureCleanSession
Originally submitted to Google Code by @yanne on 27 Aug 2012
This issue was updated by revision 5dbeb11bdbd9.
Please add ability to provide custom options to java process which runs Selenium Server.
Proposed patch - it uses environment variable. I've used SELENIUM_JAVA_OPTS for environment variable name because JAVA_OPTS may be too generic.
Index: SeleniumLibrary/init.py
--- SeleniumLibrary/init.py (wersja 15373) +++ SeleniumLibrary/init.py (kopia robocza) @@ -82,7 +82,10 @@ if not jarpath: jarpath = SELENIUM_SERVER_PATH params = _add_default_user_extension(jarpath, list(params))
return ['java'] + java_opts + [ '-jar', jarpath] + _server_startup_params(params)
def _add_default_user_extension(jarpath, params):