4 messages in com.canoo.lists.webtest[Webtest] how to change user-agent in...
FromSent OnAttachments
Sanju Nath27 Mar 2006 16:48 
Marc Guillemot27 Mar 2006 23:08 
Sanju Nath28 Mar 2006 17:01 
Marc Guillemot28 Mar 2006 22:51 
Subject:[Webtest] how to change user-agent inside groovy code
From:Sanju Nath (sanj@gmail.com)
Date:03/27/2006 04:48:55 PM
List:com.canoo.lists.webtest

In the example given in the manual for groovy, it shows how to initialize config properties using configs_map.

def config_map = [:] ['protocol','host','port','basepath','resultfile', 'resultpath', 'summary', 'saveresponse','defaultpropertytype'].each{ config_map[it] = System.properties['webtest.'+it] }

However, a typical usage of <config> element is like this (including the <header> sub-tag:

<config host="${webtest.host}" port="${webtest.port}" protocol="${webtest.protocol}" basepath="${webtest.basepath}" summary="${webtest.summary}" saveresponse="${webtest.saveresponse}" resultpath="${basedir}/${webtest.resultpath}" resultfile="${webtest.resultfile}" haltonerror="${webtest.haltonerror}" errorproperty="${webtest.errorproperty}" haltonfailure="${webtest.haltonfailure}" failureproperty="${webtest.failureproperty}" defaultpropertytype="${webtest.defaultpropertytype}" showhtmlparseroutput="${webtest.showhtmlparseroutput}" autorefresh="${webtest.autorefresh}" > <header name="User-Agent" value="${User-Agent}"/> </config>

How do I code the <header> element to change the User-Agent from its default value?

Thanks, Sanju.