The ACT Test Object Model

I l @ ve RuBoard

Building your own tests from scratch would be a lot of work, for two simple reasons: the ACT test development environment does not support IDE niceties such as IntelliSense, which we all know and love, and Web tests can get really complicated. The best way to develop your own tests is to record your test scripts first and then customize them.

Of course, to do all of that, you need to become familiar with the ACT Test Object Model, which is depicted in Figure B-8. This isn't really all that difficult. The classes and relationships are well designed ”you just need some time to get familiar with them. Believe me, the time spent on learning this will pay for itself in the end.

Figure B-8. The ACT Test Object Model.

graphics/f0bpn08.jpg

Tables B-1 through B-4 provide a quick reference to the ACT Test Object Model objects shown in Figure B-8.

Table B-1. Methods and Property of the Test Object

Method

Description

CreateConnection

Creates a new connection to the server.

CreateRequest

Creates a new Request object that can be sent using the Connection.Send method.

GetCurrentUser

Gets the current user for the test.

GetGlobalIndex

Gets the value of a global index variable that is stored between iterations of the test.

GetGlobalVariable

Gets a previously assigned global variable or creates a new one if necessary.

GetNextUser

Gets the next user object for the test and makes it the active account.

IncrementGlobalIndex

Increments or decrements the value of a global index variable.

SendRequest

Sends a URL request to the server and returns the server response.

SetGlobalIndex

Sets the value of a global index variable that is stored between iterations of the test.

SetGlobalVariable

Sets a global variable that is stored between iterations of the test.

Sleep

Pauses the test for the specified number of milliseconds .

StopTest

Stops the current test.

Trace

Adds an entry to the ACTTrace.log file.

Property

Description

TraceLevel

Gets or sets the amount of detail stored in the ACTTrace.log file.

Table B-2. Properties of the Request Object

Property

Description

Body

Gets or sets the HTTP request body.

CodePage

Gets or sets the code page for the request body.

EncodeBody

Specifies whether ACT automatically URL-encodes the request body. The default value is True .

EncodeQueryAsUTF8

Specifies whether ACT automatically UTF-8-encodes the request's query string. The default value is False .

Headers

Gets the HTTP Headers collection object.

HTTPVersion

Gets or sets the HTTP version.

Path

Gets or sets the HTTP path.

ResponseBufferSize

Gets or sets the size of the buffer used to store the response body.

Verb

Gets or sets the HTTP method verb.

Table B-3. Properties and Methods of the Connection object

Property

Description

IsOpen

Checks whether the connection is open .

Port

Gets the port number used by the connection.

RedirectDepth

Gets or sets the number of HTTP header redirections that are ­followed.

Server

Gets the host name or IP address of the server the client is ­connected to.

UseSSL

Checks whether the HTTP connection between the client and the server is using the SSL protocol (that is, whether the protocol is HTTPS).

Method

Description

Close

Closes the connection if it is open. Does not return an error if the connection is already closed.

Send

Sends an HTTP request to the server.

Table B-4. Properties of the Response Object

Property

Description

Body

Gets the body of the HTTP response. Returns only the portion of the body stored in the response buffer.

BytesRecv

Gets the number of bytes the client received in the response.

BytesSent

Gets the number of bytes sent in the HTTP request.

CodePage

Gets or sets the code page used for setting the body of the HTTP response.

ContentLength

Gets the size, in bytes, of the response body.

Headers

Gets a collection of headers in the response.

HeaderSize

Gets the combined size, in bytes, of all the response headers.

HTTPVersion

Gets the HTTP version used by the server for this response.

Path

Gets the path that was requested .

Port

Gets the server port used for the request.

ResultCode

Gets the server's response status code.

Server

Gets the name of the server that sent the response.

TTFB

Gets the number of milliseconds that elapsed before the first byte of the response was received.

TTLB

Gets the number of milliseconds that elapsed before the last byte of the response was received.

UseSSL

Checks whether the server and client used an SSL connection for the request and response.

I l @ ve RuBoard


Designing Enterprise Applications with Microsoft Visual Basic .NET
Designing Enterprise Applications with Microsoft Visual Basic .NET (Pro-Developer)
ISBN: 073561721X
EAN: 2147483647
Year: 2002
Pages: 103

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net