Hi guys,
I am using selenium-rc frame to test our website. Now I encounter a problem.
I run selenium under -proxyInjectionMode and- trustAllSSLCertificates and set -Dhttp.proxyHost=proxy -Dhttp.proxyPort=80 for JVM.
While I visit website through HTTP, it's fine and work well.
When I visit HTTPS pages, it is blocked .
The page is shown in the browser window but without injected javascripts. Thus the selenium could not go on.
Selenium-rc version: nightbuild
Browser: IE 6
System:Windows XP
Network:Internet access through a proxy server
Process:
start selenium server with:
>java -Dhttp.proxyHost=proxy -Dhttp.proxyPort=80 -jar Selenium-Server.jar -interactive -proxyInjectionMode -trustAllSSLCertificates
>cmd=getNewBrowserSession&1=*piiexplore&2=http://www.google.com/
>cmd=open&1=http://www.google.com
//this command works fine
>cmd=open&1=https://www.google.com/accounts/Login?continue=http://www.google.com/
//this will block the test process
Is this a bug or the limit of injection mode?
Any advice or suggestion will be appreciated.
Thank you.
gloomymoon
2008-12-22
Hi,
Can you try with *iehta instead of *iexplore.
Thanks pvtrao.
I tried *ietha mode and it did not work. Browser return HTTP ERROR: 400 Bad Request
gloomymoon
Why you have used the below SRC params ?
-Dhttp.proxyHost=proxy -Dhttp.proxyPort=80 -jar Selenium-Server.jar -interactive -proxyInjectionMode -trustAllSSLCertificates
You can also achieve the same by the following SRC server params -
java -jar Selenium-Server.jar -interactive -multiWindow
and the run the following commands
cmd=getNewBrowserSession&1=*iehta&2=http://www.google.com/ ( Use *iehta experimental browser becasue domin has been changed from http to https)
cmd=open&1=http://www.google.com
cmd=open&1=https://www.google.com/accounts/Login?continue=http://www.google.com/
Above command works fine for me .
Thanks
-Amit
Sorry Amit,
We have to use a proxy to access the internet because of corp security policy as i mentioned in the main thread.
-proxyInjectionMode is the only way i can find to meet every our need.
Thank you all the same.
gloomymoon
Hey you can use your old same param with server
-Dhttp.proxyHost=proxy -Dhttp.proxyPort=80 -jar Selenium-Server.jar -interactive -proxyInjectionMode -trustAllSSLCertificates
and the run the following commands
cmd=getNewBrowserSession&1=*iehta&2=http://www.google.com/ ( Use *iehta experimental browser becasue domin has been changed from http to https)
cmd=open&1=http://www.google.com
cmd=open&1=https://www.google.com/accounts/Login?continue=http://www.google.com/
Above command works fine for me .
In case the above cmd doesn't work then run the SRC server with the following param -
-Dhttp.proxyHost=proxy -Dhttp.proxyPort=80 -jar Selenium-Server.jar -interactive -multiWindow -trustAllSSLCertificates
and use the above cmmd
Note - use the *iehta browser (its a experimental browser for https )
Thanks
-Amit
Hi Gloomymoon,
Setting -Dhttp.proxyHost and -Dhttp.proxyPort will not help you. Selenium always sets itself to act as Proxy Server so I believe this option will not work.
Hi Gloomymoo,
Gloomymoon wrote:
Hi guys,
I am using selenium-rc frame to test our website. Now I encounter a problem.
I run selenium under -proxyInjectionMode and- trustAllSSLCertificates and set -Dhttp.proxyHost=proxy -Dhttp.proxyPort=80 for JVM.
While I visit website through HTTP, it's fine and work well.
When I visit HTTPS pages, it is blocked .
The page is shown in the browser window but without injected javascripts. Thus the selenium could not go on.
Process:
start selenium server with:
>java -Dhttp.proxyHost=proxy -Dhttp.proxyPort=80 -jar Selenium-Server.jar -interactive -proxyInjectionMode -trustAllSSLCertificates
>cmd=getNewBrowserSession&1=*piiexplore&2=http://www.google.com/
>cmd=open&1=http://www.google.com
//this command works fine
>cmd=open&1=https://www.google.com/accounts/Login?continue=http://www.google.com/
//this will block the test process
Is this a buy or the limit of injection mode?
Any advice or suggestion will be appreciated.
Thank you.
gloomymoon
2008-12-22
You are setting the HTTP proxy correctly. The problem is that the JVM use distinct system properties for http and https proxies. For https you will also need set the https proxy host and port. For instance:
Which should do the trick.
Have fun with Selenium and let me know if that works for you,
Cheers,
- Philippe Hanrigou
Hi kaps,
kapil_athalye wrote:
Hi Gloomymoon,
Setting -Dhttp.proxyHost and -Dhttp.proxyPort will not help you.
This is incorrect. These properties do set the HTTP proxy that will be used by the Remote Control process to issue all its http requests.
Selenium always sets itself to act as Proxy Server so I believe this option will not work.
It is true that Selenium Remote Control (most of the time) is acting as a proxy server. But RC is acting as a proxy for the browser (to workaround the single origin policy). In constrast the http.proxy* system properties are setting the http proxy used by the RC process to do its job. In a more graphic way, this is how a http://google.com would end up being loading in the browser:
Browser -----> RC ------------------> Internet
http.proxyHost
http.proxyPort
I hope it all makes sense,
Cheers,
- Philippe Hanrigou
Thank you Philippe and Kaps.
I have tried -Dhttps before and it results just the same as i said in main thread.
While visit a HTTPS page using a proxy server, the page content could be displayed in the browsers but without the JavaScripts whitch should be injected in the page under proxyInjectionMode.
The screen shows a server exception: time out waiting for window '' to appearon session xxxx.
That means I have lost the control to continue my testcase.
Amit is right. It works under *iehta. But we are eager to test our site under other browsers except for ie.
BTW, thank you all for your help.
gloomymoon
. But we are eager to test our site under other browsers except for ie.
You can also use other browser like *chrome(Its a proxy firefox) etc .for your testing .
Please take a look on 'Support for HTTPS' section on this page 'http://seleniumhq.org/documentation/tutorials/'
Please check the below link too -
http://seleniumhq.org/about/platforms.html#browsers
Thanks
-Amit
