[Webtest] Run webtests under HTTPS - message 3

Tim Pezarro Tim Pezarro" <Tim_Pezarro@pmc-sierra.com
Sat, 7 May 2011 19:22:15 -0700


Gert,

I finally got a chance to look at your stack trace. I have been really =
busy and not had time to look at it.

I am sorry that I do not understand the error.

Is this still a problem for you or did you work it out?

If it is still a problem maybe add a "storeHeader" step to see what =
htmunit is getting from the https request?

Cheers,

Tim Pezarro
Manager, Web Services
Corporate Marketing
tim_pezarro@pmc-sierra.com
Phone: +1-604-415-6044
Cell: +1-604-762-1000
Fax: +1-604-415-6602
PMC-Sierra, Inc.
8555 Baxter Place
Burnaby, BC, Canada
V5A 4V7



-----Original Message-----
From: webtest-admin@lists.canoo.com on behalf of Gert Pauwels
Sent: Wed 4/20/2011 6:04 AM
To: webtest@lists.canoo.com
Subject: RE: [Webtest] Run webtests under HTTPS - message 3
=20
Tim,
greatly appreciated your solution. I tried your webtest - replacing your =
steps with mine, but keeping the properties - and all I can see is that =
although Canoo seems to be using the correct protocol and url, it still =
somehow fails on me, resulting in this stack trace:
=20
Unexpected exception caught: java.net.UnknownHostException
at com.canoo.webtest.steps.StepUtil.handleException(StepUtil.java:120)
at com.canoo.webtest.steps.Step.handleException(Step.java:387)
at com.canoo.webtest.steps.Step.execute(Step.java:118)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at =
com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java=
:43)
at =
com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:31=
)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at com.canoo.webtest.ant.WebtestTask.executeSteps(WebtestTask.java:236)
at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:208)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at =
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleChec=
kExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at =
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleChec=
kExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at =
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecuto=
r.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.net.UnknownHostException: GertPauwels.server.be (fake =
name)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
at =
com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown =
Source)
at =
com.gargoylesoftware.htmlunit.ssl.InsecureSSLProtocolSocketFactory.create=
Socket(InsecureSSLProtocolSocketFactory.java:82)
at =
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707=
)
at =
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConn=
ectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at =
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMet=
hodDirector.java:387)
at =
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethod=
Director.java:171)
at =
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:39=
7)
at =
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:34=
6)
at =
com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnec=
tion.java:97)
at =
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(=
WebClient.java:1430)
at =
com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:13=
69)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:326)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:403)
at =
com.canoo.webtest.steps.request.TargetHelper.getResponse(TargetHelper.jav=
a:69)
at =
com.canoo.webtest.steps.request.AbstractTargetAction.getResponse(Abstract=
TargetAction.java:66)
at =
com.canoo.webtest.steps.request.InvokePage.findTarget(InvokePage.java:160=
)
at =
com.canoo.webtest.steps.request.AbstractTargetAction.doExecute(AbstractTa=
rgetAction.java:72)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
... 57 more
--- Nested Exception ---
java.net.UnknownHostException: GertPauwels.server.be (fake name)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
at =
com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown =
Source)
at =
com.gargoylesoftware.htmlunit.ssl.InsecureSSLProtocolSocketFactory.create=
Socket(InsecureSSLProtocolSocketFactory.java:82)
at =
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707=
)
at =
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConn=
ectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at =
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMet=
hodDirector.java:387)
at =
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethod=
Director.java:171)
at =
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:39=
7)
at =
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:34=
6)
at =
com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnec=
tion.java:97)
at =
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(=
WebClient.java:1430)
at =
com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:13=
69)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:326)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:403)
at =
com.canoo.webtest.steps.request.TargetHelper.getResponse(TargetHelper.jav=
a:69)
at =
com.canoo.webtest.steps.request.AbstractTargetAction.getResponse(Abstract=
TargetAction.java:66)
at =
com.canoo.webtest.steps.request.InvokePage.findTarget(InvokePage.java:160=
)
at =
com.canoo.webtest.steps.request.AbstractTargetAction.doExecute(AbstractTa=
rgetAction.java:72)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at =
com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java=
:43)
at =
com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:31=
)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at com.canoo.webtest.ant.WebtestTask.executeSteps(WebtestTask.java:236)
at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:208)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at =
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleChec=
kExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at =
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleChec=
kExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at =
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:10=
5)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at =
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecuto=
r.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

And although I see from the WebTestReport.xml that it Canoo settings are =
pointing towards https, I do still see a lot of references to http in =
the stacktrace...=20
I'm lost. Is there anything in the build.xml, webtest.xml or other file =
that can keep Canoo from reaching the https site?
=20
Gert
=20
> Subject: RE: [Webtest] Run webtests under HTTPS - message 3
> From: Tim_Pezarro@pmc-sierra.com
> To: webtest@lists.canoo.com; tKlein@sapient.com; =
webtest@lists.canoo.com; postino2800@hotmail.com
> Date: Tue, 19 Apr 2011 12:43:44 -0700
>=20
> Gert,
>=20
> I do extensive HTTPS testing successfully with Canoo Webtest.
>=20
> =3D=3D=3D Start Working Example =3D=3D=3D
>=20
> <?xml version=3D"1.0"?>
> <!DOCTYPE project SYSTEM "../../dtd/Project.dtd">
> <project default=3D"MyPmcAcl">
> <target name=3D"MyPmcAcl">
> <webtest name=3D"Check directory access permission results match =
${user} permission on ${http.url.domain}">
> <config
> haltonerror=3D"false"
> haltonfailure=3D"false"
> useInsecureSSL=3D"true">
> <option name=3D"ThrowExceptionOnFailingStatusCode" value=3D"false"/>
> <option name=3D"ThrowExceptionOnScriptError" value=3D"false" />
> <option name=3D"JavaScriptEnabled" value=3D"true" />
> <option name=3D"autorefresh" value=3D"true" />
> </config>=20
> <echo message=3D"prerequisite pmc user: SalesExtranetXXX" />
> <echo message=3D"prerequisite public authenticated user: not sales, =
modeln nor PM8310 NDA Audience" />
> <echo message=3D"prerequisite sales user: SalesExtranetXXX" />
> <echo message=3D"prerequisite modeln user: Modeln" />
> <echo message=3D"prerequisite nda user: pm8310 NDA Audience" />
>=20
>=20
> <echo message=3D"prerequesite protected directories:" />
>=20
> <invoke url=3D"${https.url.domain}myPMC/viewprofile.pl"/>=20
> <setInputField name=3D"mail" value=3D"${user}"/>
> <setInputField name=3D"password" value=3D"${login.ok.password}"/>
> <clickButton name=3D"Submit" />
> <verifyText text=3D"Product Access" />
>=20
> <echo message=3D"request sales" />
>=20
> <ifStep test=3D"${sales}">
> <then>
> <invoke url=3D"${https.url.domain}sales/"/>=20
> <verifyText text=3D"NDA Central" />=20
> </then>
> <else>
> <invoke url=3D"${https.url.domain}sales/"/>=20
> <verifyText text=3D"Log In or Create a New Account" />=20
> </else>
> </ifStep>
>=20
> <echo message=3D"request modeln" />
>=20
>=20
> <ifStep test=3D"${modeln}">
> <then>
> <invoke url=3D"${https.url.domain}modeln"/>=20
> <verifyText text=3D"proxy" />=20
> </then>
> <else>
> <invoke url=3D"${https.url.domain}modeln/"/>=20
> <verifyText text=3D"Log In or Create a New Account" />=20
> </else>
> </ifStep>
>=20
> <echo message=3D"request rda/pm8310/" />
>=20
> <ifStep test=3D"${pm8310access}">
> <then>
> <invoke url=3D"${https.url.domain}rda/pm8310/"/>=20
> <verifyText text=3D"PM8310 TEMUX 336 Device Register Descriptions" />=20
> </then>
> <else>
> <invoke url=3D"${https.url.domain}rda/pm8310/"/>=20
> <verifyText text=3D"Log In or Create a New Account" />=20
> </else>
> </ifStep>
>=20
> <ifStep test=3D"${pm4356access}">
> <then>
> <invoke url=3D"${https.url.domain}acl/pm4356/"/>=20
> <verifyText text=3D"PM4356 COMET DUAL" />=20
> </then>
> <else>
> <invoke url=3D"${https.url.domain}acl/pm4356/"/>=20
> <verifyText text=3D"Log In or Create a New Account" />=20
> </else>
> </ifStep>
>=20
> <ifStep test=3D"${pm4357access}">
> <then>
> <invoke url=3D"${https.url.domain}acl/pm4357/"/>=20
> <verifyText text=3D"PM4357 COMET SINGLE" />=20
> </then>
> <else>
> <invoke url=3D"${https.url.domain}acl/pm4357/"/>=20
> <verifyText text=3D"Log In or Create a New Account" />=20
> </else>
> </ifStep>
>=20
>=20
> </webtest>
> </target>
> </project>
>=20
> =3D=3D=3D End Working Example =3D=3D=3D
>=20
> Here is the property file. I specify http for the target url but our =
server automatically redirects to https. You may wish to specify your =
target domain as https://your.target.domain/
>=20
> =3D=3D=3D Start Property File =3D=3D=3D
>=20
> test.url=3Dhttp://www.pmc-sierra.com/myPMC/
> test.url.domain=3Dhttps://www.pmc-sierra.com/
> https.url.domain=3Dhttps://www.pmc-sierra.com/
> http.url.domain=3Dhttp://www.pmc-sierra.com/
> https.service=3Dtrue
>=20
> =3D=3D=3D End Property File =3D=3D=3D
>=20
> I hope that helps.
>=20
> Cheers,
>=20
> Tim Pezarro
> Manager, Web Services
> Corporate Marketing
> tim_pezarro@pmc-sierra.com
> Phone: +1-604-415-6044
> Cell: +1-604-762-1000
> Fax: +1-604-415-6602
> PMC-Sierra, Inc.
> 8555 Baxter Place
> Burnaby, BC, Canada
> V5A 4V7
>=20
>=20
>=20
> -----Original Message-----
> From: webtest-admin@lists.canoo.com on behalf of Thomas Klein
> Sent: Fri 4/15/2011 12:42 AM
> To: webtest@lists.canoo.com; Gert Pauwels
> Subject: RE: [Webtest] Run webtests under HTTPS - message 3
>=20
> Hi Gert,
>=20
> perhaps this helps?
> http://old.nabble.com/https-support-by-Canoo-Webtest.-td23153265.html
>=20
> If not then you may also google for HTTPS and "htmlunit" since its =
WebTests underlying engine for HTTP(S)...
> Sorry I have no working solution at hand.
>=20
> Cheers,
> Thomas
>=20
>=20
> Thomas Klein=20
> Manager QA | SapientNitro=20
>=20
>=20
>=20
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest