AW: [Webtest] Strange property expansion

Carsten Thielecke Carsten Thielecke <Carsten.Thielecke@sqs.com>
Mon, 8 Aug 2011 07:23:44 +0000


Hi. Marc,
this already was intended as a demo setup and is as simple as can be. Every=
thing was originally extracted from a running project. =

I'm reading a properties file with dynamic properties like this one:

base.url=3Dhttp://www.heise.de/ct/

In the test a call of <invoke url=3D#{base.url}/> expands to something as i=
n the log file:

...
[storeProperty] DEBUG (com.canoo.webtest.steps.Step) - setWebtestProperty: =
base.url=3Dhttp://www.heise.de/ct/ [dynamic]
...
DEBUG (com.canoo.webtest.ant.TestStepSequence) - Executing step invoke org.=
apache.tools.ant.UnknownElement@15b44d6
   [invoke] DEBUG (com.canoo.webtest.ant.WebtestPropertyHelper) - Notifying=
 listeners of properties expansion: #{base.url} -> http://www.heise.de/ct/
   [invoke]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: invoke =
"Webseite der c't aufrufen" (3/24)
   [invoke]  INFO (com.canoo.webtest.steps.request.TargetHelper) - getting =
response for url: http://localhost/#{base.url}
   [invoke] DEBUG (com.gargoylesoftware.htmlunit.WebClient) - Get page for =
window named '', using WebRequest[<url=3D"http://localhost/#{base.url}", GE=
T, EncodingType[name=3Dapplication/x-www-form-urlencoded], [], {Accept=3D*/=
*}, null>]
   [invoke] DEBUG (com.gargoylesoftware.htmlunit.WebClient) - Load response=
 for GET http://localhost/#%7Bbase.url%7D
...

The test execution report is similarly strange:

3	ok	invoke
	Webseite der c't aufrufen
		Resulting page	=

			-> complete url	http://localhost/#{base.url}
					url	http://www.heise.de/ct/

I suspect some configuration (ANT, Java) problem. My environment is win7 en=
terprise and I installed the Java SDK with the windows install script. That=
 was all except for system path and  build.xml.
Cheers
Carsten

-----Urspr=FCngliche Nachricht-----
Von: webtest-admin@lists.canoo.com [mailto:webtest-admin@lists.canoo.com] I=
m Auftrag von Marc Guillemot
Gesendet: Montag, 8. August 2011 08:08
An: webtest@lists.canoo.com
Betreff: Re: [Webtest] Strange property expansion

This looks strange. Are you able to reproduce it with a minimal example?

Cheers,
Marc.
--
HtmlUnit support & consulting from the source
Blog: http://mguillem.wordpress.com

Le 05/08/2011 15:56, Carsten Thielecke a =E9crit :
> Hi there,
> I am experiencing a strange behaviour with webtest properties. It seems w=
ebtest knows the property and its value but in the steps they don't expand.=
 I will include a debug console output to clarify this. The example prop is=
t #{heise.suchbegriff} which will get inserted literally in com.canoo.webte=
st.steps.form.SetInputField below:
>
> [setInputField] DEBUG (com.canoo.webtest.ant.WebtestPropertyHelper) - =

> Notifying listeners of properties expansion: #{heise.suchbegriff} ->  =

> gepardenforelle [setInputField]  INFO (com.canoo.webtest.steps.Step) ->>>=
>  Start Step: setInputField "Suchbegriff eingeben" (10/24) [setInputField]=
 DEBUG (com.canoo.webtest.util.FormUtil) - Looking for form with text field=
 named "q"
> [setInputField] DEBUG (com.canoo.webtest.util.FormUtil) - No given =

> form or given form not suitable, trying others [setInputField] DEBUG =

> (com.canoo.webtest.util.FormUtil) - No current form or current form =

> not suitable, trying others [setInputField]  INFO =

> (com.canoo.webtest.engine.WebClientContext) - Current form set to =

> (action=3D/kiosk/suche/?sort=3Dd) [setInputField] DEBUG =

> (com.canoo.webtest.steps.form.AbstractSetFieldStep) - Found matching =

> form HtmlForm[<form id=3D"kiosk_searchbox" action=3D"/kiosk/suche/?sort=
=3Dd" =

> method=3D"get" accept-charset=3D"utf-8">] [setInputField] DEBUG =

> (com.canoo.webtest.steps.form.SetInputField) - Found 0 textarea =

> field(s) [setInputField] DEBUG =

> (com.canoo.webtest.steps.form.AbstractSetFieldStep) - Considering =

> element HtmlTextInput[<input type=3D"text" name=3D"q" value=3D"" =

> class=3D"textfield">] [setInputField] DEBUG =

> (com.canoo.webtest.steps.form.AbstractSetFieldStep) - Found 1 field(s) =

> [setInputField]  INFO =

> (com.canoo.webtest.steps.form.AbstractSetFieldStep) - Found 1 suitable =

> fields, considering only the first one [setInputField] DEBUG =

> (com.canoo.webtest.steps.form.SetInputField) - Set text for =

> HtmlTextInput[<input type=3D"text" name=3D"q" value=3D"#{heise.suchbegrif=
f}" =

> class=3D"textfield">] to value #{heise.suchbegriff} [setInputField] =

> DEBUG (com.canoo.webtest.steps.Step) - Completed Step: setInputField =

> "Suchbegriff eingeben" (10/24) [setInputField] DEBUG =

> (com.canoo.webtest.steps.Step) - Step didn't produce results, no need =

> to notifying listeners [setInputField] DEBUG =

> (com.canoo.webtest.steps.Step) -<<<<  Successful Step: setInputField =

> "Suchbegriff eingeben" (10/24)
>
> I'm using webtest build R_1811 and JDK SE 6 Update 26, a recently finishe=
d project at a customer site worked like a charm but is unaccessible for no=
w.
> I'm really stuck, any help is appreciated.
>
> Regards
> Carsten
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest