This Question is Possibly Answered

1 "correct" answer available (4 pts) 1 "helpful" answer available (2 pts)
10 Replies Last post: Dec 30, 2008 11:17 PM by Amit  
Gloomymoon Beginner 4 posts since
Dec 21, 2008
Currently Being Moderated

Jan 3, 2009 11:55 PM

Test HTTPS site through proxy

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

pvtrao Pro 105 posts since
Oct 24, 2008
Currently Being Moderated
1. Dec 23, 2008 2:24 AM in response to: Gloomymoon
Re: Test HTTPS site through proxy

Hi,

 

Can you try with *iehta instead of *iexplore.

Amit Expert 196 posts since
Apr 26, 2006
Currently Being Moderated
3. Dec 28, 2008 11:50 PM in response to: Gloomymoon
Re: Test HTTPS site through proxy

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

Amit Expert 196 posts since
Apr 26, 2006
Currently Being Moderated
5. Dec 29, 2008 7:38 AM in response to: Gloomymoon
Re: Test HTTPS site through proxy

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

kaps Beginner 2 posts since
Dec 30, 2008
Currently Being Moderated
6. Dec 30, 2008 7:49 AM in response to: Gloomymoon
Re: Test HTTPS site through proxy

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.

Philippe Hanrigou Expert 259 posts since
Oct 26, 2007
Currently Being Moderated
7. Dec 30, 2008 2:19 PM in response to: Gloomymoon
Re: Test HTTPS site through proxy

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:

 

java -Dhttp.proxyHost=proxy -Dhttp.proxyPort=80 -Dhttps.proxyHost=proxy -Dhttps.proxyPort=80 -jar Selenium-Server.jar -interactive -proxyInjectionMode

 

Which should do the trick.

 

Have fun with Selenium and let me know if that works for you,

Cheers,

- Philippe Hanrigou

  http://ph7spot.com

Philippe Hanrigou Expert 259 posts since
Oct 26, 2007
Currently Being Moderated
8. Dec 30, 2008 2:31 PM in response to: kaps
Re: Test HTTPS site through proxy

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

  http://ph7spot.com

Amit Expert 196 posts since
Apr 26, 2006
Currently Being Moderated
10. Dec 30, 2008 11:17 PM in response to: Gloomymoon
Re: Test HTTPS site through proxy

. 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

More Like This

  • Retrieving data ...