Re: print result.text
Alan Jackson <pure_jax-/[email protected]> Fri, 2 Sep 2016 08:25:36 +0000 (UTC)
| Newsgroups | gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <[email protected]> |
--===============0110408934715133569==
Content-Type: multipart/alternative;
boundary="----=_Part_311840_1838607870.1472804736584"
Content-Length: 9618
------=_Part_311840_1838607870.1472804736584
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=20
----- Forwarded Message -----
From: Alan Jackson <pure_jax-/[email protected]>
To: grinder-use <[email protected]>=20
Sent: Friday, September 2, 2016 9:23 AM
Subject: Re: [Grinder-use] print result.text
=20
Unfortunately not maybe I am going about this the wrong way.
The main aim is to get a response back from a URL however currently even if=
the DB is unavailable the response code comes back 200 OK
From: Joan Picanyol i Puig <[email protected]>
To: [email protected]=20
Sent: Thursday, September 1, 2016 5:32 PM
Subject: Re: [Grinder-use] print result.text
=20
* 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: -
> # =C2=A0 =C2=A0 =C2=A0 tests[2].POST(searchUrl + sessionCookie,=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 result =3D tests[14].POST('http://cathp60:7002//search-cu=
stomer.do' + sessionCookie,=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ( NVPair('mpn=
', '07935139299'),=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NVPair('account=
Id', ''),=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NVPair('contactType', 'U=
ser'), ))=C2=A0 =C2=A0 =C2=A0 =C2=A0 print result.text=C2=A0 =C2=A0 =C2=A0 =
=C2=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?
=C2=A0 =C2=A0 from net.grinder.script.Grinder import grinder
=C2=A0 =C2=A0 grinder.logger.info(result.text)
http://grinder.sourceforge.net/g3/script-gallery.html#helloworld.py
http://grinder.sourceforge.net/g3/logging.html
qvb
--=20
pica
---------------------------------------------------------------------------=
---
_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use
=20
=20
------=_Part_311840_1838607870.1472804736584
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html><head></head><body><div style=3D"color:#000; background-color:#fff; f=
ont-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, =
sans-serif;font-size:13px"><div id=3D"yui_3_16_0_ym19_1_1472762342338_28878=
"><span></span></div><div class=3D"qtdSeparateBR"><br><br></div><div class=
=3D"yahoo_quoted" id=3D"yui_3_16_0_ym19_1_1472762342338_28882" style=3D"dis=
play: block;"> <div style=3D"font-family: HelveticaNeue, Helvetica Neue, H=
elvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;" id=3D"yui_3_1=
6_0_ym19_1_1472762342338_28881"> <div style=3D"font-family: HelveticaNeue, =
Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16p=
x;" id=3D"yui_3_16_0_ym19_1_1472762342338_28880"> <div dir=3D"ltr" id=3D"yu=
i_3_16_0_ym19_1_1472762342338_28879"> <font size=3D"2" face=3D"Arial" id=3D=
"yui_3_16_0_ym19_1_1472762342338_28893"> <br>----- Forwarded Message -----<=
br> <b><span style=3D"font-weight:bold;">From:</span></b> Alan Jackson <=
pure_jax-/[email protected]><br> <b><span style=3D"font-weight: bold;">To:</span>=
</b> grinder-use <[email protected]> <br> <b><span st=
yle=3D"font-weight: bold;">Sent:</span></b> Friday, September 2, 2016 9:23 =
AM<br> <b><span style=3D"font-weight: bold;">Subject:</span></b> Re: [Grind=
er-use] print result.text<br> </font> </div> <div class=3D"y_msg_container"=
id=3D"yui_3_16_0_ym19_1_1472762342338_28895"><br><div id=3D"yiv7180003968"=
><div id=3D"yui_3_16_0_ym19_1_1472762342338_28897"><div style=3D"color:#000=
;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica=
, Arial, Lucida Grande, sans-serif;font-size:13px;" id=3D"yui_3_16_0_ym19_1=
_1472762342338_28896"><div id=3D"yiv7180003968yui_3_16_0_ym19_1_14727623423=
38_26372"><span id=3D"yiv7180003968yui_3_16_0_ym19_1_1472762342338_26521">U=
nfortunately not maybe I am going about this the wrong way.</span></div><di=
v id=3D"yiv7180003968yui_3_16_0_ym19_1_1472762342338_26372"><span><br clear=
=3D"none"></span></div><div id=3D"yiv7180003968yui_3_16_0_ym19_1_1472762342=
338_26372"><span id=3D"yiv7180003968yui_3_16_0_ym19_1_1472762342338_26522">=
The main aim is to get a response back from a URL however currently even if=
the DB is unavailable the response code comes back 200 OK</span></div><div=
id=3D"yiv7180003968yui_3_16_0_ym19_1_1472762342338_26372"><br clear=3D"non=
e"></div><div class=3D"yiv7180003968qtdSeparateBR" id=3D"yui_3_16_0_ym19_1_=
1472762342338_28898"><br clear=3D"none"><br clear=3D"none"></div><div class=
=3D"yiv7180003968yqt5283414433" id=3D"yiv7180003968yqt71214"><div class=3D"=
yiv7180003968yahoo_quoted" id=3D"yiv7180003968yui_3_16_0_ym19_1_14727623423=
38_26417" style=3D"display:block;"> <div id=3D"yiv7180003968yui_3_16_0_ym1=
9_1_1472762342338_26416" style=3D"font-family:HelveticaNeue, Helvetica Neue=
, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"> <div id=3D"=
yiv7180003968yui_3_16_0_ym19_1_1472762342338_26415" style=3D"font-family:He=
lveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;fo=
nt-size:16px;"> <div dir=3D"ltr" id=3D"yiv7180003968yui_3_16_0_ym19_1_14727=
62342338_26414"> <font id=3D"yiv7180003968yui_3_16_0_ym19_1_1472762342338_2=
6413" size=3D"2" face=3D"Arial"> </font><hr id=3D"yiv7180003968yui_3_16_0_y=
m19_1_1472762342338_26412" size=3D"1"> <b><span style=3D"font-weight:bold;"=
>From:</span></b> Joan Picanyol i Puig <[email protected]><br c=
lear=3D"none"> <b id=3D"yui_3_16_0_ym19_1_1472762342338_28917"><span style=
=3D"font-weight:bold;" id=3D"yui_3_16_0_ym19_1_1472762342338_28916">To:</sp=
an></b> [email protected] <br clear=3D"none"> <b><span styl=
e=3D"font-weight:bold;">Sent:</span></b> Thursday, September 1, 2016 5:32 P=
M<br clear=3D"none"> <b id=3D"yui_3_16_0_ym19_1_1472762342338_28970"><span =
style=3D"font-weight:bold;" id=3D"yui_3_16_0_ym19_1_1472762342338_28969">Su=
bject:</span></b> Re: [Grinder-use] print result.text<br clear=3D"none"> <=
/div> <div class=3D"yiv7180003968y_msg_container" id=3D"yiv7180003968yui_3_=
16_0_ym19_1_1472762342338_26418"><br clear=3D"none">* Alan Jackson <<a r=
el=3D"nofollow" shape=3D"rect" id=3D"yiv7180003968yui_3_16_0_ym19_1_1472762=
342338_26540" ymailto=3D"mailto:pure_jax-/[email protected]" target=3D"_blank" href=
=3D"mailto:pure_jax-/[email protected]">pure_jax-/[email protected]</a>> [20160901 17:11]:=
<div class=3D"yiv7180003968yqt7101044159" id=3D"yiv7180003968yqtfd00013"><b=
r clear=3D"none">> Hi,<br clear=3D"none">> Can anyone help me write t=
he output of a URL to the out.log file or another log file<br clear=3D"none=
">> Currently I have: -<br clear=3D"none">> # te=
sts[2].POST(searchUrl + sessionCookie, result =
=3D tests[14].POST('<a rel=3D"nofollow" shape=3D"rect" target=3D"_blank" on=
click=3D"return theMainWindow.showLinkWarning(this)" href=3D"http://cathp60=
:7002//search-customer.do'">http://cathp60:7002//search-customer.do' </a>+ =
sessionCookie, ( NVPair('mpn', '079351392=
99'), NVPair('accountId', ''),&nbs=
p; NVPair('contactType', 'User'), ))&nbs=
p; print result.text #Write=
ToFile(result.text)<br clear=3D"none">> The print result.text will outpu=
t the result on the command line however I need to record this result into =
the log file.<br clear=3D"none">> I tried WriteToFile(result.text) howev=
er this just returned an error.<br clear=3D"none">> Can someone please a=
dvise?</div><br clear=3D"none"><br clear=3D"none">Doesn't logging it do wha=
t you want?<br clear=3D"none"><br clear=3D"none"> from net.gri=
nder.script.Grinder import grinder<br clear=3D"none"> grinder.=
logger.info(result.text)<br clear=3D"none"><br clear=3D"none"><a rel=3D"nof=
ollow" shape=3D"rect" target=3D"_blank" href=3D"http://grinder.sourceforge.=
net/g3/script-gallery.html#helloworld.py" id=3D"yui_3_16_0_ym19_1_147276234=
2338_28971">http://grinder.sourceforge.net/g3/script-gallery.html#helloworl=
d.py</a><br clear=3D"none"><br clear=3D"none"><a rel=3D"nofollow" shape=3D"=
rect" target=3D"_blank" href=3D"http://grinder.sourceforge.net/g3/logging.h=
tml">http://grinder.sourceforge.net/g3/logging.html</a><br clear=3D"none"><=
br clear=3D"none">qvb<br clear=3D"none">-- <br clear=3D"none">pica<br clear=
=3D"none"><br clear=3D"none">----------------------------------------------=
--------------------------------<br clear=3D"none">________________________=
_______________________<br clear=3D"none">grinder-use mailing list<br clear=
=3D"none"><a rel=3D"nofollow" shape=3D"rect" ymailto=3D"mailto:grinder-use@=
lists.sourceforge.net" target=3D"_blank" href=3D"mailto:[email protected]=
ourceforge.net">[email protected]</a><br clear=3D"none"><a =
rel=3D"nofollow" shape=3D"rect" target=3D"_blank" href=3D"https://lists.sou=
rceforge.net/lists/listinfo/grinder-use">https://lists.sourceforge.net/list=
s/listinfo/grinder-use</a><br clear=3D"none"><br clear=3D"none"></div> </di=
v> </div> </div></div></div></div></div><br><br></div> </div> </div> </di=
v></div></body></html>
------=_Part_311840_1838607870.1472804736584--
--===============0110408934715133569==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
--===============0110408934715133569==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use
--===============0110408934715133569==--