HTTP test and .NET viewstate

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
shawnpronet
Posts: 2
Joined: Wed Dec 05, 2007 5:13 pm

HTTP test and .NET viewstate

Post by shawnpronet »

I am trying to configure a HTTP test to send POST data (login information for forms based authentication) and check for specific contents. I configure the test with the correct URL and post data. I logged into the site and grabbed a string to check the contents for but when I run the test it comes back as bad contents.

The site is .NET so does anyone have any experience with this? I verify the text is there when I log in with IE (I view the source, not just check whats displayed).

Also, is there any way to see the exact contents returned?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Re: HTTP test and .NET viewstate

Post by KS-Soft Europe »

shawnpronet wrote:I am trying to configure a HTTP test to send POST data (login information for forms based authentication) and check for specific contents. I configure the test with the correct URL and post data. I logged into the site and grabbed a string to check the contents for but when I run the test it comes back as bad contents.
1. You should enable "Follow redirect" option.
2. Into the "URL" box you have to provide the first part of the url, e.g. http://www.some_server.com/some_form.aspx
3. Into the "Post Data" you have to provide the data, you want to POST to the server, delimited by '&', e.g username=some_user&password=some_password&other_field=some_other_data
4. Probably, the form requires some additional headers, like: enctype="multipart/form-data". You may specify this information into "Optional Headers" area.
shawnpronet wrote:Also, is there any way to see the exact contents returned?
Sure. You may use %HttpPage% variable. Quote from the manual:
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
========================================
%HttpPage%
Represents contents of the monitored web page (first 32768 (32K) characters of the web page if test was performed by HostMonitor; first 2048 (2K) characters of the page if test was performed by RMA).
Variable may be empty if you setup URL test item to check HTTP response only, without checking content or CRC of the page. HTTP test returns an empty string if a HEADER request is used. It also returns an empty string when a monitored web server does not respond.
========================================
For instance, you may assign an action profile with "Send email action" to this test and include %HttpPage% variable into the mail body template.

Regards,
Max
shawnpronet
Posts: 2
Joined: Wed Dec 05, 2007 5:13 pm

Post by shawnpronet »

I have set all the options; I looked through the html output and found the three fields I need to set (custid, loginname, and password) and set those in the postdata.

I have follow redirect set and allow per-session cookies set.

This is my post data (example):
custid=12345&loginname=me&password=password

These are my optional headers:
Content-Type: application/x-www-form-urlencoded
enctype: multipart/form-data


If I go to the site and enter those three forms and submit; the next page echos my customer id at the top; so i have that in check contents.

I configured host monitor to send the content to my email and it matches the page before i log in; but it should give me the page after i log in.

Im wondering if ASP.NET validation needs some other post data.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

shawnpronet wrote:I configured host monitor to send the content to my email and it matches the page before i log in; but it should give me the page after i log in.
So, what exact URL do you use? If you look through the html output, you should see the <FORM tag. The "Form" tag has an "action" attribute. Into the "URL" box you have to set the page, specified in "action" attribute. Have you specified the proper page? For instance, you see the following code <FORM action="some_form_srv.aspx" method="POST">
So, into "URL" input box, you have to specify the following:
http://www.some_server.com/some_form_srv.aspx
shawnpronet wrote:Im wondering if ASP.NET validation needs some other post data.
I do not think so. HTTP protocols does not depend on implementation.
Could you provide use URL and login credentials for testing? You may send necessary info to support@ks-soft.net

Regards,
Max
Post Reply