[Webtest] Re: Test of JSP-pages (Marc Guillemot)

Uhlig Alexander Uhlig Alexander" <Alexander.Uhlig-extern@messe-muenchen.de
Wed, 16 Apr 2008 11:59:42 +0200


=20

Hello Marc,

the webtest report noticed broken links and most of this broken links =
are *.jsp-files. But the files are working. So what's the matter ?

Greetings=20

Alex


Date: Tue, 15 Apr 2008 21:41:01 +0200
From: Marc Guillemot <mguillemot@yahoo.fr>
To: webtest@lists.canoo.com
Subject: Re: [Webtest] Test of JSP-pages
Reply-To: webtest@lists.canoo.com
Reply-To: Marc Guillemot <mguillemot@yahoo.fr>

Hi,

why can't you do that? verifyLinks checks the links, no matter what the
file extension of the targeted page is.

Cheers,
Marc.
--=20
Blog: http://mguillem.wordpress.com

Uhlig Alexander wrote:
> Hi all,
>=20
> my problem is that I cannot check with verifyLinks homepages with the
> ending *.jsp. Can anybody help me ?
>=20
> Thanks
>=20
> Alex
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>=20


--__--__--

Message: 4
Date: Tue, 15 Apr 2008 21:45:25 +0200
From: Marc Guillemot <mguillemot@yahoo.fr>
To: webtest@lists.canoo.com
Subject: Re: [Webtest] How to store the source code from a response =
page.
Reply-To: webtest@lists.canoo.com
Reply-To: Marc Guillemot <mguillemot@yahoo.fr>

If you get

> Exception
> groovy.lang.MissingMethodException
> Message
> No signature of method
com.gargoylesoftware.htmlunit.xml.XmlPage.asXml() is
> applicable for argument types: () values: {}

this means that the content of your current page is not html but xml. Is
it really what you expected?

More generally, I doesn't make so much sense to validate the html
generated by HtmlPage.asXml() as it is already the result of a parse
operation with tag balancing, etc. It would make more sense to check the
 original response from the server that can be accessed with
step.context.currentResponse.webResponse.contentAsString

Cheers,
Marc.
--=20
Blog: http://mguillem.wordpress.com


dariusch wrote:
> Hi,
>=20
> if i use these code snippel:
>=20
> <groovy description=3D"Store the html of the page">
> 	    def document =3D step.context.currentResponse.asXml()
> 	    def props =3D step.getWebtestProperties( =
step.PROPERTY_TYPE_DYNAMIC ) ;
> 	    props.putAt("htmlPage",document)
> </groovy>
>=20
> i get this error message:
>=20
> Exception
> groovy.lang.MissingMethodException
> Message
> No signature of method =
com.gargoylesoftware.htmlunit.xml.XmlPage.asXml() is
> applicable for argument types: () values: {}
>=20
> Is htmlPage a dynamic property? I saw something here:
>=20
> http://www.nabble.com/getting-started-tt16373515.html#a16545352
>=20
> But it dosen't work.
>=20
> Thanks,
> Dariusch=20
>=20
> =20
>=20
>=20
>=20
> dariusch wrote:
>> Hi,
>>
>> if i use value=3D"#{htmlPage}", inside the inputField is the string
>> #{htmlPage} and not the html code.
>>
>> so this solution dosen't work!
>>
>> Dariusch
>>
>>
>> Florent Blondeau wrote:
>>> Hi Dariusch,
>>>
>>> if i use these groovy steps, where are the html code, inside the =
document
>>> property?
>>>
>>> Nope, it should be in the htmlPage property, so your code should be =
:
>>>
>>> <setInputField description=3D'set textarea with feeds'=20
>>>   htmlId=3D'fragment'
>>>   value=3D"#{htmlPage}"/>
>>>
>>> Florent
>>>
>>> Pingwy
>>> 27, rue des ar=C3=A8nes
>>> 49100 Angers
>>>
>>>
>>>
>>> dariusch a =C3=A9crit :
>>>> Hello,
>>>>
>>>> if i use these groovy steps, where are the html code, inside the
>>>> document
>>>> property?
>>>> I will do this:
>>>>
>>>> groovy(description:"Store the html of the page","""
>>>>    def document =3D step.context.currentResponse.asXml()
>>>>    def props =3D step.webtestProperties
>>>>    props.putAt("htmlPage",document)
>>>>     """)
>>>> <invoke description=3D"goto W3C page"=20
>>>>   url=3D"http://validator.w3.org/#validate_by_input" />
>>>> <setInputField description=3D'set textarea with feeds'=20
>>>>   htmlId=3D'fragment'
>>>>   value=3D"#{document}"/>
>>>> <clickButton description=3D"Submit the simple feedvalidation"
>>>> =
xpath=3D"//fieldset[@id=3D'validate-by-input']//input[@value=3D'Check']"/=
>
>>>>
>>>> I think, to set the value inside setInputField over the #{document} =
is
>>>> not
>>>> correct.=20
>>>>
>>>> What is my mistake?=20
>>>>
>>>> Thanks,
>>>> Dariusch
>>>> =20
>>>>
>>>>
>>>> Florent Blondeau wrote:
>>>>  =20
>>>>> Hi Dariusch,
>>>>>
>>>>> You can get the html via a groovy step
>>>>>
>>>>>               groovy(description:"Store the html of the page","""
>>>>>                        def document =3D
>>>>> step.context.currentResponse.asXml()
>>>>>                        def props =3D step.webtestProperties
>>>>>                        props.putAt("htmlPage",document)
>>>>>                     """)
>>>>>
>>>>> or
>>>>> <groovy description=3D"Store the html of the page">
>>>>>                         def document =3D
>>>>> step.context.currentResponse.asXml()
>>>>>                        def props =3D step.webtestProperties
>>>>>                        props.putAt("htmlPage",document)
>>>>> </groovy>
>>>>> in a less groovy way...
>>>>>
>>>>> Then you have your html code (cleaned up with Tidy) in the =
htmlPage
>>>>> property
>>>>>
>>>>> Hope that helps
>>>>>
>>>>> Florent
>>>>>
>>>>> Pingwy
>>>>> 27, rue des ar=C3=A8nes
>>>>> 49100 Angers
>>>>>
>>>>>
>>>>>
>>>>> dariusch a =C3=A9crit :
>>>>>    =20
>>>>>> Hi,
>>>>>>
>>>>>> if i use storexpath with =3D'/', i get the text without the =
elements,
>>>>>> but i
>>>>>> need all.
>>>>>>
>>>>>> Someone has an idea?
>>>>>>
>>>>>> Dariusch
>>>>>>
>>>>>>
>>>>>> dariusch wrote:
>>>>>>  =20
>>>>>>      =20
>>>>>>> Hello,
>>>>>>>
>>>>>>> i just want to store all source code from a response page. It is
>>>>>>> possible
>>>>>>> to do that (inside a variable)? I need this, because i will =
check
>>>>>>> these
>>>>>>> sources it is valid (the page is an rss-feed).
>>>>>>>
>>>>>>> Thanks
>>>>>>> Dariusch
>>>>>>>
>>>>>>>    =20
>>>>>>>        =20
>>>>>>  =20
>>>>>>      =20
>>>>>    =20
>>>>  =20
>>>
>>
>=20


--__--__--

Message: 5
Date: Tue, 15 Apr 2008 21:46:47 +0200
From: Marc Guillemot <mguillemot@yahoo.fr>
To: webtest@lists.canoo.com
Subject: Re: [Webtest] autorefresh vs. previousresponse
Reply-To: webtest@lists.canoo.com
Reply-To: Marc Guillemot <mguillemot@yahoo.fr>

Hi,

I don't see why it should make such a difference. If you're able to
reproduce the problem, please open an issue with the necessary =
information.

Cheers,
Marc.
--=20
Blog: http://mguillem.wordpress.com


Hesteric Roman - Together SK wrote:
> Hi Marc,
>=20
> 	We are using previousresponse in macro-step "clickAllLinks" to
> check if all our links in page "work" properly ...
>=20
> Macro looks like:
>=20
> .
> .
> .
>=20
> <repeat
> =
xpath=3D"//a[contains(@href,'ID=3D')][not(contains(@href,'ID=3D&amp;'))][=
not(c
> ontains(img/@src,'fk.gif'))] bla.. bla ... " counterName=3D"curLink">
> 	<storeXPath xpath=3D"$curLink" property=3D"uri" />
> 	<invoke description=3D"Click next link" url=3D"#{uri}"/>
> 	<not description=3D"the word 'wurde in der Zwischenzeit' should
> not appear in the page">
>      		<verifyText description=3D"search for the problem, case
> insensitiv" text=3D"wurde in der Zwischenzeit" regex=3D"false"/>
>  	</not>=09
>    	<previousresponse/>
> </repeat>
>=20
> .
> .
> .
>=20
> 	After clicking and checking result, we use previousresponse to
> navigate <Back> to root page and so on - and that is problem using
> autorefresh, because in both cases we get various results because of
> redirect based on response body, IMHO.
>=20
>=20
> Roman.
>=20
>=20
> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com] On Behalf Of Marc Guillemot
> Sent: Thursday, April 10, 2008 11:50 AM
> To: webtest@lists.canoo.com
> Subject: Re: [Webtest] autorefresh vs. previousresponse
>=20
> Hi,
>=20
> at which place do you use previousResponse? Which page do you get in
> both cases?
>=20
> Cheers,
> Marc.


--__--__--

Message: 6
Date: Tue, 15 Apr 2008 21:49:31 +0200
From: Marc Guillemot <mguillemot@yahoo.fr>
To: webtest@lists.canoo.com
Subject: Re: [Webtest] DataDriven appears to lose the previously loaded =
page
 prior to its appearance
Reply-To: webtest@lists.canoo.com
Reply-To: Marc Guillemot <mguillemot@yahoo.fr>

at which place do you get this error message?

What is <previousPage/>?

Cheers,
Marc.
--=20
Blog: http://mguillem.wordpress.com


George Policello wrote:
> I forgot the error message.
>=20
> No current response available! Is previous invoke missing?
>=20
> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com] On Behalf Of George Policello
> Sent: Thursday, April 10, 2008 1:02 PM
> To: webtest@lists.canoo.com
> Subject: [Webtest] DataDriven appears to lose the previously loaded =
page
> prior to its appearance
>=20
> DataDriven appears to lose the previously loaded page prior to its
> appearance.
>=20
> See the code below for accurate description of what I want to
> accomplish.
>=20
> QUESTION:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D
> How can the following goal be accomplished?
>=20
> GOAL:
> =3D=3D=3D=3D=3D
> * Read in a gateway page.
> * Cycle through a list of XPaths that take me to lower and lower =
levels
> of the Site.=20
> * The XPaths should be externally stored (not in the test engine), and
> have a destination Title and TitleRegex associated with each one.
>=20
> Current understanding:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> * Separate <webtest> blocks are independent.
> * <dataDriven> works as below in the sense it reads the *.xls file =
just
> fine.
> * <dataDriven> does not have the previous file from the <invoke>
> available once it starts.
> * Putting in random <previousPage> tasks did not work.
>=20
> CODE
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
>   <webtest name=3D'Dig in Site: ${homePage}' >
>     <config haltonerror=3D'false' haltonfailure=3D'false' >
>       <option name=3D'ThrowExceptionOnScriptError'       =
value=3D'false' />
>       <option name=3D'ThrowExceptionOnFailingStatusCode' =
value=3D'false' />
>     </config>
>=20
>     <invoke url=3D'${homePage}' description=3D'Go to Gateway Page' />
>     <verifyTitle text=3D'MEdia' regex=3D'true' />
> <!-- <previousPage/> -->
>     <dataDriven tableContainer=3D"XPaths.xls" >
> <!-- <previousPage/> -->
>           <clickLink xpath=3D"${XPath}" description=3D"Click to =
${Title}" />
>           <verifyTitle text=3D"${TitleRegex}" regex=3D'true' />
>     </dataDriven>
>=20
>   </webtest>
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>=20



--__--__--

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest


End of WebTest Digest