Hi Brian,

For POST statements in invokes you must use the content field in the
invoke to specify your data. I included a brief random example from one
of my tests below.                      

<storeProperty name="tsearchXml" value="..." />
<invoke description="desc1"
        url="#{URL}"
          method="POST"
          content="#{tsearchXml}"/>

This example happens to be a SOAP call so the value of my stored
property is XML and it is posted to the given url which you can find
through the html or outside program like HttpWatch if you don't already
know it.

Let me know if that was confusing and I can clarify.

Thanks,
Sachin

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brian Matzon
Sent: Tuesday, August 21, 2007 4:25 AM
To: [email protected]
Subject: [Webtest] Using POST with invoke


I am trying to post a request with some fields, but I have so far been
unsuccessful. 
The page I am invoking, does not have any html files - it's merely a
script that takes some arguments via post, and then outputs ok.
Bob Baird originally did something similar here:
http://webtest-community.canoo.com/jira/browse/WT-83
and it was closed with the following comment: "This should now work with
the method="post" attribute of <invoke>"
Another comment by the closer of the bug, read the following: 
"what about extending existing <invoke../> with a method parameter and
the nested body/parameters?
I think that it would be a natural place and would avoid to create an
additional special step."

So I thought I could do something like this:

<invoke url="createsession.php"/>
<storeRegEx text=".*.*" property="sessionid"/> <invoke method="post"
url="launch.php">
  <setInputField name="sessionid" value="#{sessionid}"/> </invoke>
<verifyText text="ok"/>

But this fails.

Whats the proper way to post to a script, without having an existing
form?

/matzon

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to