Re: print result.text
Joan Picanyol i Puig <[email protected]> Thu, 1 Sep 2016 18:32:07 +0200
| Newsgroups | gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <[email protected]> |
* Alan Jackson <pure_jax-/[email protected]> [20160901 17:11]: > Hi, > Can anyone help me write the output of a URL to the out.log file or anoth= er log file > Currently I have: - > # =A0 =A0 =A0 tests[2].POST(searchUrl + sessionCookie,=A0 =A0 =A0 =A0 res= ult =3D tests[14].POST('http://cathp60:7002//search-customer.do' + sessionC= ookie,=A0 =A0 =A0 =A0 =A0 ( NVPair('mpn', '07935139299'),=A0 =A0 =A0 =A0 = =A0 =A0 NVPair('accountId', ''),=A0 =A0 =A0 =A0 =A0 =A0 NVPair('contactType= ', 'User'), ))=A0 =A0 =A0 =A0 print result.text=A0 =A0 =A0 =A0 #WriteToFile= (result.text) > The print result.text will output the result on the command line however = I need to record this result into the log file. > I tried WriteToFile(result.text) however this just returned an error. > Can someone please advise? Doesn't logging it do what you want? from net.grinder.script.Grinder import grinder grinder.logger.info(result.text) http://grinder.sourceforge.net/g3/script-gallery.html#helloworld.py http://grinder.sourceforge.net/g3/logging.html qvb -- = pica ---------------------------------------------------------------------------= ---