AW: [Webtest] Strange property expansion

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Mon, 08 Aug 2011 09:58:50 +0200


Hi Carsten,

I don't think that the Java version matters but perhaps does it come 
from the Ant version. Which one do you use?

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


Le 08/08/2011 09:23, Carsten Thielecke a écrit :
> Hi. Marc,
> this already was intended as a demo setup and is as simple as can be. Everything was originally extracted from a running project.
> I'm reading a properties file with dynamic properties like this one:
>
> base.url=http://www.heise.de/ct/
>
> In the test a call of<invoke url=#{base.url}/>  expands to something as in the log file:
>
> ...
> [storeProperty] DEBUG (com.canoo.webtest.steps.Step) - setWebtestProperty: base.url=http://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="http://localhost/#{base.url}", GET, EncodingType[name=application/x-www-form-urlencoded], [], {Accept=*/*}, 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 enterprise and I installed the Java SDK with the windows install script. That was all except for system path and  build.xml.
> Cheers
> Carsten
>
> -----Ursprüngliche Nachricht-----
> Von: webtest-admin@lists.canoo.com [mailto:webtest-admin@lists.canoo.com] Im 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 écrit :
>> Hi there,
>> I am experiencing a strange behaviour with webtest properties. It seems webtest 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 ist #{heise.suchbegriff} which will get inserted literally in com.canoo.webtest.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=/kiosk/suche/?sort=d) [setInputField] DEBUG
>> (com.canoo.webtest.steps.form.AbstractSetFieldStep) - Found matching
>> form HtmlForm[<form id="kiosk_searchbox" action="/kiosk/suche/?sort=d"
>> method="get" accept-charset="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="text" name="q" value=""
>> class="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="text" name="q" value="#{heise.suchbegriff}"
>> class="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 finished project at a customer site worked like a charm but is unaccessible for now.
>> I'm really stuck, any help is appreciated.
>>
>> Regards
>> Carsten