selenium - How to set Proxy Configuration in java code -
i'm trying program in java class start selenium server in case down reason. found here: http://www.testingexcellence.com/how-to-start-selenium-server-with-java-code/
i see if configuration parameters can set using class remotecontrolconfiguration , methods such setport, setlogoutfilename, settimeoutinseconds, ...
the problem selenium server connects proxy in way:
java -jar selenium-server.jar -dhttp.proxyhost=my.proxy.com -dhttp.proxyport=8080 unfortunately, haven't found how put java code. question is: possible set proxyhost , proxyport values in java?
thanks time =)
}panacea{
the easiest way set them globally within jvm
system.setproperty("http.proxyhost", "yourproxyurl.com"); system.setproperty("http.proxyport", "80"); http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
however affects entire instance of jvm, other outgoing connections try use proxy. that's fine in case, if need more isolated scope can use url.openconnection(proxy).
Comments
Post a Comment