views:

255

answers:

3

I have a simple sequence of web pages written in ASP.Net 3.5 SP1.

  • Page1 - A Logon Form.... txtUsername, txtPassword and cmdLogon
  • Page2 - A Menu (created using DevExpress ASP.Net controls)
  • Page3 - The page redirected to by the server in the event that the user picks the right menu option in Page2

I would like to create a threaded program to simulate many users trying to use this sequence of pages.

I have managed to create a host Winforms app which Launches a new thread for each "User" I have further managed to work out the basics of WebRequest enough to perform a request which retrieves the Logon page itself.

    Dim Request As HttpWebRequest = TryCast(WebRequest.Create("http://MyURL/Logon.aspx"), HttpWebRequest)
    Dim Response As HttpWebResponse = TryCast(Request.GetResponse(), HttpWebResponse)
    Dim ResponseStream As StreamReader = New StreamReader(Response.GetResponseStream(), Encoding.GetEncoding(1252))
    Dim HTMLResponse As String = ResponseStream.ReadToEnd()
    Response.Close()
    ResponseStream.Close()

Next I need to simulate the user having entered information into the 2 TextBoxes and pressing logon.... I have a hunch this requires me to add the right sort of "PostData" to the request. before submitting.

However I'm also concerned that "ViewState" may be an issue.

Am I correct regarding the PostData? How do I add the postData to the request?

Do I need to be concerned about Viewstate?

Update: While I appreciate that Selenium or similar products are useful for acceptance testing , I find that they are rather clumsy for what amounts to load testing.

I would prefer not to load 100 instances of Firefox or IE in order to simulate 100 users hitting my site.

This was the reason I was hoping to take the ASPNet HttpWebRequest route.

A: 

Would Selinium - http://seleniumhq.org/ be useful?

waqasahmed
I will certainly take a look. Although I wonder about a system such as this working inside a browser... I hope to up the number parallel users to something like 100. Also I will need to be able to feed custom data into the Logon box for each of these users.
Rory Becker
Looks like Selenium is better for acceptance testing.... I need to write something to hammer my Server for just these few pages. If I Try to launch 100 threads under selenium, it looks like selenium will launch 100 instances of firefox... this seems like a bad idea.
Rory Becker
A: 

I'd go with Selenium. With Selenium IDE you can generate tests simply by clicking through the sequence you want.

You can also use Selenium Remote Control and program your tests yourself - or you can have them generated by Selenium IDE and paste them into your Selenium RC project.

Selenium is worth a shot! (However you could look at Watir as an alternative) enjoy!

Woodbase
Oh... One more thing - using Selenium - you won't have any viewstate issues. It'll simply do what you tell it too
Woodbase
See previous comments to @waqasahmed
Rory Becker
A: 

At my company, we are using Jmeter. JMeter can simulate web requests and gives pretty detailed statistics. Also, I noticed from one of your comments, you want to simulate multiple users, well we are in the process of configuring jmeter to do that as well.

nstehr