core data types of silktest

34
(¯`•._.•[Jagan’s]•._.•´¯) ************************************************************************ SILK TEST 7.5 ************************************************************************ The following topics are discussed in this document. 1. Types of TestCases 2. Types of Testing 3. Client/server testing challenges 4. Networking protocols used by SilkTest 5. Parallel processing statements and how they work 6. Core Data Types in Silk Test ************************************************************************ 1. Types of testcases There are two basic types of testcases: Level 1 tests, often called smoke tests or object tests, verify that an application’s GUI objects function properly. For example, they verify that text fields can accept keystrokes and check boxes can display a check mark. Level 2 tests verify an application feature. For example, they verify that an application’s searching capability can correctly find different types of search patterns. You typically run Level 1 tests when you receive a new build of your application, and do not run Level 2 tests until your Level 1 tests achieve a specific pass/fail ratio. The reason for this is that unless your application’s graphical user interface works, you cannot actually test the application itself. ************************************************************************ 2. Types of Testing Functional testing Before you test the multi-user aspects of a client/server application, you should verify the functional operation of a single instance of the application. This is the same kind of testing that you would do for a non-distributed application. Once you have written scripts to test all the operations of the application as it runs on one platform, you can modify the scripts as needed for all other platforms on which the

Upload: api-3698888

Post on 11-Apr-2015

1.798 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

************************************************************************

SILK TEST 7.5 ************************************************************************ The following topics are discussed in this document.

1. Types of TestCases 2. Types of Testing 3. Client/server testing challenges 4. Networking protocols used by SilkTest 5. Parallel processing statements and how they work 6. Core Data Types in Silk Test

************************************************************************ 1. Types of testcases There are two basic types of testcases:

• Level 1 tests, often called smoke tests or object tests, verify that an application’s

GUI objects function properly. For example, they verify that text fields can accept

keystrokes and check boxes can display a check mark.

• Level 2 tests verify an application feature. For example, they verify that an

application’s searching capability can correctly find different types of search

patterns.

You typically run Level 1 tests when you receive a new build of your application, and do

not run Level 2 tests until your Level 1 tests achieve a specific pass/fail ratio. The reason

for this is that unless your application’s graphical user interface works, you cannot

actually test the application itself.

************************************************************************ 2. Types of Testing

Functional testing

Before you test the multi-user aspects of a client/server application, you should verify the

functional operation of a single instance of the application. This is the same kind of

testing that you would do for a non-distributed application.

Once you have written scripts to test all the operations of the application as it runs on one

platform, you can modify the scripts as needed for all other platforms on which the

Page 2: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

application runs. Testing multiple platforms thus becomes almost trivial. Moreover, many

of the tests you script for functional testing can become the basis of your other types of

testing. For example, you can easily modify the functional tests (or a subset of them) to

use in load testing.

Configuration testing

A client/server application typically runs on multiple different platforms and utilizes a

server that runs on one or more different platforms. A complete testing program needs to

verify that every possible client platform can operate with every possible server platform.

This implies the following combinations of tests:

• Test the client application and the server application when they are running on the

same machine—if that is a valid operational mode for the application. This testing

must be repeated for each platform that can execute in that mode.

• Test with the client and server on separate machines. This testing should be

repeated for all different platform combinations of server and client

Concurrency testing

Test two clients using the same server. This is a variation of functional testing that

verifies that the server can properly handle simultaneous requests from two clients. The

simplest form of concurrency testing just verifies that two clients can make multiple non-

conflicting server requests during the same period of time. This is a very basic sanity test

for a client/server application.

To test for problems with concurrent access to the same database record, you need to

write specific scripts that synchronize two clients to make requests of the same records in

your server’s database(s) at the same time. Your goal is to encounter faulty read/write

locks, software deadlocks, or other concurrency problems.

Stress testing

Stress testing verifies that running a particular command or set of commands a large

number of times does not break the software. For example, stress testing discovers a

failure to release resources. This is no different than stress testing for a non-distributed

application, but as with functional testing, you need to discover whether the application

functions properly with a remote server under stress conditions. You can do this type of

stress testing with a single client.

You can create stress tests by repeating the same commands a large number of times.

Usually, the 4Test code looks like this:

for i = 1 to 50

DoSomeCommands ()

Page 3: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

For example, you can stress-test remote logins or you can stress-test all application

operations that allocate significant amounts of memory (to see if they release that

memory). One simple form of stress testing is to set up your functional tests to repeat

indefinitely and then run them night and day over a two- to four-day period.

Load testing

Load testing verifies that running a large number of concurrent clients does not break the

server or client software. For example, load testing discovers deadlocks and problems

with queues. SilkTest’s unique architecture provides built-in load testing. You can

implement your functional tests using multi-application techniques and then, after

completing functional testing on a single machine, you can run them on multiple targets.

Unlike simulated load testing tools, SilkTest allows you to create a real-life scenario that

can determine the actual impact of multi-machine operation on your application, the

server, the network, and all related elements.

There are two variations of load testing:

1. Peak load (sometimes called stress testing in the client/server environment)

Peak load testing Peak load testing is placing a load on the server for a short time to emulate the

heaviest demand that would be generated at peak user times—for example, credit

card verification between noon and 1 PM on Christmas Eve. This type of test

requires a significant number of client systems. If you submit complex

transactions to the server from each client in your test network, using minimal

user setup, you can emulate the typical load of a much larger number of clients.

Your testbed may not have sufficient machines to place a heavy load on your

server system — even if your clients are submitting requests at top speed. In this

case it may be worthwhile to reconfigure your equipment so that your server is

less powerful. An inadequate server configuration should enable you to test the

server’s management of peak server conditions.

2. Volume

Volume testing Volume testing is placing a heavy load on the server, with a high volume of data

transfers, for 24 to 48 hours. One way to implement this is to use one set of clients

to generate large amounts of new data and another set to verify the data (and

delete data to keep the size of the database at an appropriate level). You would

need to synchronize the verification scripts to wait for the generation scripts. The

4Test script language makes this easy. You would not normally need a very large

testbed to drive this type of server load, but again, if you under-configure your

Page 4: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

server you will probably be able to exercise the sections of the software that

handle the outer limits of data capacity.

Performance testing

We believe that the most accurate determination of a system’

s performance is achieved by actually testing the system in a real-world environment,

rather than through simulation. However, if it is impractical to test the full scope of the

system (500 users, for instance), you will typically have a better understanding of the

load on your system at this usage level by projecting the actual system performance based

on the real-world testing of a subset of systems. Typically, the performance trend is

reached long before all users have been added, and the mathematical projection is a

simple one:

Increase the rate of server requests submitted until the trend is isolated and then project

the remainder. From the response times at different request rates, you can calculate the

expected performance for different numbers of users submitting requests at a normal rate.

The result of this method is frequently more accurate than simulation can provide,

because a simulation cannot produce the same complex interactions as these scenarios.

Although you probably cannot establish a 500-user testbed that runs a realistic workload

(which might average two server requests per client per hour), you can design an artificial

workload that submits sequential requests as fast as the response to the previous request

is received. If you cannot generate a sufficient load using SilkTest’s GUI-driving scripts,

use the Extension Kit (EK) to drive the application’s API directly. Using either method,

you can drive the server with different rates of received requests and chart the response

times for different numbers of representative users. You can then repeat the test with a

more (or less) powerful server. See the Extension Kit Guide for more information.

************************************************************************

3. Client/server testing challenges

SilkTest provides powerful support for testing client/server applications and/ or databases

in a networked environment. Testing multiple remote applications raises the level of

complexity of QA engineering above that required for stand-alone application testing.

Here are just a few of the testing methodology challenges raised by client/server testing:

• Managing simultaneous automatic regression tests on different configurations

and/or platforms.

• Ensuring the reproducibility of client/server tests that modify a server database.

• Verifying the server operations of a client application’s independently, without

relying on the application under test.

• Testing the concurrency features of a client/server application.

Page 5: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

• Testing the intercommunication capabilities of networked applications.

• Closing down multiple failed applications and bringing them back to a particular

base state (recovery control).

• Testing the functioning of the server application when driven at peak request rates

and at maximum data rates (peak load and volume testing).

• Automated regression testing of multi-tier client/server architectures.

************************************************************************

4. Networking protocols used by SilkTest

SilkTest runs on many platforms, but only three different protocols are used. This means

that a SilkTest script on one platform can drive the Agent on a target platform, as long as

both the host and Agent platforms are running an appropriate protocol for the platform

and both are running the same protocol (regardless of the protocols used by the

applications under test). The table lists the protocols available for each platform.

Platform TCP/IP NetBIOS/ NetBEUI Windows • •

Solaris •

SunOS •

HP-UX •

AIX •

IRIX •

Suppose you are running SilkTest under Windows 95 and testing an application that

requires TCP/IP communications in order to communicate with a server on a Sun Sparc

station. SilkTest’s Windows machine can run NetBIOS for the host and the application’s

Windows machine must then run NetBIOS for the Agent as well as TCP/IP for the

application under test. Running NetBIOS will have no impact on your TCP/ IP

connections but will allow SilkTest to communicate with the Agent. Alternatively, since

the application is already running TCP/IP, you can choose to use TCP/IP for SilkTest and

its Agents as well.

There is no limit on the protocol or API that an application under test may use. Just make

sure that the protocol required by SilkTest and the protocol required by your application

are running at the same time.

************************************************************************

5. Parallel processing statements and how they work

Page 6: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

You create and manage multiple threads using combinations of the 4Test statements

parallel, spawn, rendezvous, and critical .

In 4Test, all running threads (those not blocked) have the same priority with respect to

one another. 4Test executes one instruction for a thread, then passes control to the next

thread. The first thread called is the first run, and so on.

All threads run to completion unless they are deadlocked. 4Test will detect a script

deadlock and raise an exception. Note that the 4Test exit statement terminates all threads

immediately when it is executed by one thread.

parallel statement

A parallel statement spawns a statement for each machine specified and blocks the

calling thread until the threads it spawns have all completed. It condenses the actions of

spawn and rendezvous and can make code more readable.

The parallel statement executes a single statement for each thread. Thus if you wish to

run complete tests in parallel threads, use the invocation of a test function (which may

execute many statements) with the parallel statement, or use a block of statements with

spawn and rendezvous.

To use the parallel statement, you have to specify the machines for which threads are to

be started. You can follow the parallel keyword with a list of statements, each of which

specifies a different Agent name. For example:

parallel

DoSomething ("Client1")

DoSomething ("Client2")

The DoSomething function then typically issues a SetMachine(sMachine) call to direct

its machine operations to the proper Agent.

spawn statement

A spawn statement begins execution of the specified statement or block of statements in a

new thread. Since the purpose of spawn is to initiate concurrent test operations on

multiple machines, the structure of a block of spawned code is typically:

· A SetMachine command, which directs subsequent machine operations to the

specified Agent.

· A set of machine operations to drive the application.

· A verification of the results of the machine operations.

You can use spawn to start a single thread for one machine, and then use successive

spawn statements to start threads for other machines being tested. SilkTest scans for all

Page 7: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

spawn statements preceding a rendezvous statement and starts all the threads at the same

time. However, the typical use of spawn is in a loop, as follows:

for each sMachine in lsMachine

spawn // start thread for each sMachine

SetMachine (sMachine)

DoSomething ()

rendezvous

The above example could achieve the same result when written as follows:

for each sMachine in lsMachine

spawn

[sMachine]DoSomething ()

Rendezvous

rendezvous statement

A rendezvous statement blocks execution of the calling thread until all threads that were

spawned by the calling thread have completed. When the last child thread exits, it

unblocks the parent thread. The rendezvous statement is unnecessary if it is the last

statement at the end of the testcase. If the calling thread has no child threads, rendezvous

does nothing.

critical statement

A critical statement guarantees that no other thread will execute until the specified

statement or indented block of code has executed and passed control to the next statement

at the level of the critical statement. Only one thread can have critical status at any time.

************************************************************************

6. CORE DATA TYPES

AGENTOPTION data type

Agent options control various aspects of agent operations. When you want to get or set

the value of an agent option, you use the appropriate constant from the AGENTOPTION

data type to identify the option. For example, the option value identified by

OPT_KEYBOARD_DELAY specifies the time the agent waits between each keystroke

submitted from a script. You can access the values of options by passing the constants

defined for this data type to the GetOption method and SetOption method of the

AgentClass class. For information about specific options, see Agent options.

4Test defines this enumerated data type as follows:

Page 8: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

type AGENTOPTION is enum

OPT_BITMAP_MATCH_COUNT

OPT_BITMAP_MATCH_INTERVAL

OPT_BITMAP_MATCH_TIMEOUT

OPT_BITMAP_PIXEL_TOLERANCE

OPT_CLASS_MAP

OPT_COMPATIBLE_TAGS

OPT_COMPRESS_WHITESPACE

OPT_CLOSE_CONFIRM_BUTTONS

OPT_CLOSE_DIALOG_KEYS

OPT_CLOSE_WINDOW_BUTTONS

OPT_CLOSE_WINDOW_MENUS

OPT_DEBUG

OPT_FORCE_MODAL_UPDATES

OPT_KEYBOARD_DELAY

OPT_KEYBOARD_LAYOUT

OPT_MATCH_ITEM_CASE

OPT_MENU_INVOKE_POPUP

OPT_MENU_PICK_BEFORE_GET

OPT_MENU_PICK_WITH_KEYS

OPT_MOUSE_DELAY

OPT_POWER_BUILDER

OPT_RADIO_LIST

OPT_REL1_CLASS_LIBRARY

OPT_REQUIRE_ACTIVE

OPT_TEXT_NEW_LINE

OPT_TRANSLATE_TABLE

OPT_TRAP_FAULTS

OPT_TRAP_FAULTS_FLAGS

OPT_TRIM_ITEM_SPACE

OPT_VERIFY_ACTIVE

OPT_VERIFY_COORD

OPT_VERIFY_CTRLTYPE

OPT_VERIFY_ENABLED

OPT_VERIFY_EXPOSED

OPT_VERIFY_RESPONDING

OPT_VERIFY_UNIQUE

OPT_VISUAL_BASIC

OPT_WINDOW_MOVE_TOLERANCE

OPT_WINDOW_RETRY

OPT_WINDOW_SIZE_TOLERANCE

OPT_WINDOW_TIMEOUT

AGENTSWITCH data type

Page 9: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

4Test defines this enumerated data type as follows:

type AGENTSWITCH is enum

[ ] AS_SHOW_ALL_CLASSES

[ ] AS_SHOW_ALL_METHODS

ANYTYPE data type Description

A variable of type ANYTYPE stores data of any type, including user-defined types.

Note Be careful when you give a variable type ANYTYPE, because 4Test does not

perform compile-time type checking on it. However, type checking does occur at

runtime.

APPID data type Description

An identification code that uniquely identifies a process.

4Test defines this alias data type as follows:

type APPID is INTEGER

ARRAY data type Description

Used to declare an array variable.

Syntax 1

ARRAY [dimension] [, dimension ]... OF data-type array-id

Syntax 2

data-type array-id [dimension] [, dimension]...

Syntax 3

ARRAY [dimension] OF ARRAY [dimension] OF data-type array-id

Variable Description

dimension An INTEGER expression that specifies the size of the array. The

expression is evaluated at runtime.

data-type The data type you want the elements in the array to have.

Page 10: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

array-id An identifier that specifies the name of the array.

Notes

Often you need to group several pieces of data together. 4Test uses the ARRAY and

LIST compound data types to do this. Use the ARRAY data type to group together data

values, all of which must have the same type. Specify the type and number of elements

when you declare the array.

Arrays are made up of elements that are grouped in a hierarchy. Each level of the

hierarchy is called a dimension. Each dimension holds a fixed number of either elements

or sub-arrays. The leaf nodes of the hierarchy, which are in the last dimension specified,

contain elements; the other dimensions hold sub-arrays. Consider the following array

specification:

ARRAY[2][3][4] OF INTEGER MyArray

In this array there are two sub-arrays at level one, three sub-arrays at level two, and 4

elements in each of the level two sub-arrays. Since each of the level-one sub-arrays

contains three sub-arrays, and each of these six level-two sub-arrays contains four

elements, MyArray contains 24 elements.

Array size must be between 1 and 2147483647 (MAXINT).

To refer to an element in a one-dimensional array, use the array name and an expression

in square brackets that evaluates to the position of the element in the array.

To refer to an element in a multi-dimensional array, use the array name followed by two

or more expressions in brackets.

· The last expression refers to the element.

· The preceding expressions refer to the arrays and subarrays containing the

element.

· A reference to an array must account for each of the specified dimensions.

For example, array2[2,10,5] refers to an element in a three-dimensional array.

Alternatively, array2[2][10][5] refers to the same element. 4Test treats each dimension of

a multi-dimensional array as a subarray of the larger array.

You can initialize an array using the LIST constructor ({}). When you use braces in a

declaration of an array object, 4Test implicitly casts the generated list as an array. You

cannot modify an existing array using braces—you can only initialize a new array.

Examples

ARRAY[50] OF STRING array1

ARRAY[20][20][20] OF INTEGER array2

testcase array_example ()

// 39th element in one-dimensional array

Page 11: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

array1[39] = "alphabet soup"

// 5th element in 10th second-plane sub-array of 2nd

// first-plane sub-array of 3-dimensional array

array2[2, 10, 5] = 99

// these two statements access the same element

array2[2, 4, 2] = 5

Print (array2[2][4][2]) //prints 5

// initialize an array, starting with element 1

// and overwriting any elements previously set

array1 = {...}

"foo"

"bar"

// an alternative initialization

array1 = {"foo", "bar"}

BOOLEAN data type

Description

A variable of type BOOLEAN stores either TRUE or FALSE.

BROWSERLOCATION data type

BROWSERLOCATION is the alias data type for the string or window that identifies a

browser page. 4Test defines this data type as follows:

type BROWSERLOCATION is STRING, WINDOW

BROWSERTYPE data type

Description

SilkTest supports different Web browsers and uses "browser specifiers" so that you can

explicitly specify a particular browser in a script. The following table lists the most

commonly used browser specifiers. Consult the release notes for information about

additional supported browsers.

For the full list of browser specifiers see the 4test.inc file in your

<SilkTestInstallDirectory> and search for the word "browsertype".

Browser specifier Browser AOL_IE embedded IE browser for America Online

explorer4 Internet Explorer 4.0

Page 12: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

explorer5 Internet Explorer 5.x for Virtual Object extension

explorer5_DOM Internet Explorer 5.x for DOM extension

explorer6 Internet Explorer 6 VO

explorer6_DOM Internet Explorer 6.x DOM

explorer4up Internet Explorer 4.x and up for VO: explorer4, explorer5,

explorer6

explorer_DOM Internet Explorer for the DOM: explorer5_DOM, explorer6_DOM

explorer5s Internet Explorer 5.x and up (both DOM and VO): explorer5,

explorer5_DOM, explorer6, explorer6_DOM

explorer Internet Explorer: explorer3, explorer4, explorer5,

explorer5_DOM, explorer6, explorer6_DOM

netscape4 Netscape Navigator 4

netscape7_DOM Netscape Navigator 7 DOM

netscape6_DOM Netscape Navigator 6 DOM

netscape4x Netscape Navigator 4 and up: netscape4, netscape6_DOM,

netscape7_DOM

netscape Netscape: netscape3, netscape4, netscape6_DOM,

netscape7_DOM

Notes

You can use a browser specifier in a script in two ways:

· You can use a browser specifier in a script or include file to indicate that a

particular line applies only to particular browsers.

· You can pass a browser specifier to the SetBrowserType or

SetDefaultBrowserType function to specify a browser that you want your test to run

against. (You cannot use the browser specifiers explorer and netscape this way.)

You set the browser in the Runtime Options dialog or by calling the SetBrowserType or

SetDefaultBrowserType function, each of which takes an argument of type

BROWSERTYPE. If you don’

t set a browser type explicitly in a script, SilkTest will use the browser specified in the

Runtime Options dialog.

If you try to use a browser specifier instead of a GUI specifier to specify a window,

SilkTest will generate an error. The primary use of browser specifiers is to address

differences in window declarations between different browsers. Each Agent connection

maintains its own browser type, allowing different threads to interact with different

browsers.

Syntax

A browser specifier has the following syntax:

[[browser-type [, browser-type]...] | [! browser-type]]

For example, you can specify one or more browser types separated by commas, such as:

Page 13: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

netscape4, explorer4

You can also specify all but one browser, such as the following, which indicates that

what follows applies to all browsers except Internet Explorer 3:

! explorer3

Example 1

In the following code fragment, netscape and explorer browser specifiers are used to

indicate that the tag for the BrowserAuthentication window differs in the two browsers.

Note that browser specifiers can be used in conjunction with GUI specifiers as well.

window DialogBox BrowserAuthentication

netscape tag "Username and Password Required"

explorer, msw98 tag "Enter Network Password"

explorer, mswnt tag "Authentication"

explorer, mswdos tag "Basic Authentication"

Example 2

The testcase in the next example (GetItemCount) takes an argument of type

BROWSERTYPE, allowing you to pass browser specifiers at runtime. (The testcase uses

the recovery system and assumes that wMainWindow is set to the GMO Web

application's Welcome page, whose identifier is GMO.)

This example uses the main function to pass the arguments. For more information on

passing data to a testcase, see the chapter on generalizing testcases.

main ()

LIST OF BROWSERTYPE lbtType

BROWSERTYPE btType

lbtType = {explorer4, netscape4}

for each btType in lbtType

GetItemCount (btType)

testcase GetItemCount (BROWSERTYPE btType)

GMO.About.Click ()

INTEGER iCount

iCount = AboutPage.UsedList.GetItemCount ()

Print (btType)

Print ("Item count: {iCount}")

// Results:

// Testcase GetItemCount (explorer4) - Passed

Page 14: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

// Internet Explorer 4.0

// Item count: 9

// Testcase GetItemCount (netscape4) - Passed

// Netscape Navigator 4.0

// Item count: 9

Note In the preceding testcase, you don’t have to call SetBrowserType to set the

browser type. That’s because if a BROWSERTYPE argument is passed to a testcase, the

recovery system automatically calls SetBrowserType with the argument.

CALL data type

One entry in a CALL_LIST datatype. 4Test defines this enumerated data type as follows:

type CALL is record

STRING sFunction

STRING sModule

INTEGER iLine

CALL_LIST data type

The data type returned by the ExceptCalls function. 4Test defines this alias data type as

follows:

type CALL_LIST is LIST OF CALL

COLOR data type

Describes the RGB values of a color, as returned by the GetBackgroundColor method.

4Test defines this enumerated data type as follows:

type COLOR is record

INTEGER red

INTEGER green

INTEGER blue

CURSOR data type

A data type that identifies the kind of cursor represented by an instance of the

CursorClass class. 4Test defines this alias data type as follows:

type CURSOR is STRING

DATACLASS data type

Description

Page 15: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

The legal values of the DATACLASS type are the names of all the 4Test classes,

including user-defined classes-for example, MainWin, ChildWin, and CursorClass.

Identifiers in window class declarations and the return value from the ClassOf function

are both of type DATACLASS.

DATASETSIZES data type

Description

Describes the units for a byte-based size value, such as for disk free space or file size.

The unit specifier is an optional parameter for the SYS_GetFreeDiskSpace function and

SYS_GetDirContents functions. 4Test defines this enumerated data type as follows:

type DATASETSIZES is enum

DS_BYTES

DS_KILOBYTES

DS_MEGABYTES

DS_GIGABYTES

DS_TERABYTES

corresponding to bytes, kilobytes, megabytes, gigabytes and terabytes.

DATATYPE data type

Description

The legal values of the DATATYPE type are the names of data types, for example

INTEGER and BOOLEAN. The return value from the TypeOf function is of type

DATATYPE.

DATETIME data type

Description

A variable of type DATETIME stores a date plus a time calculated to microseconds. The

DATETIME data type represents values from 4713 B.C.E. (B.C.) to 19999 C.E. (A.D.).

Notes

You can use relational operators between two variables of type DATETIME. You can

cast a variable of type DATETIME to or from a type DATE or a type TIME by means of

explicit type casting. You can implicitly cast a STRING as a DATETIME as described in

the table below.

Page 16: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

You can generate a DATETIME constant by specifying a date and time as a string and

then casting the string as a DATETIME data type. The string must have the following

format:

YYYY-MM-DD HH:MM:SS.MSMSMS.

Rules covering type casting

The following tables describes the rules for type casting:

Cast Rules DATETIME to DATE The time information is lost. Use explicit type casting

([DATE])

DATETIME to TIME The date information is lost. Use explicit type casting

([TIME])

DATE to DATETIME The time is set to midnight. Use explicit type casting

([DATETIME])

TIME to DATETIME The date is set to the current date. Use explicit type casting

([DATETIME])

STRING to DATETIME The string must have the ISO format: YYYY-MM-DD

HH:MM:SS.MSMSMSYou can truncate the string at any

point, as long as the last field is complete. Use implicit type

casting (DATETIME)

Example

The example below is artificially contrived to show the following:

· The creation of a DateTime constant by implicitly casting a string as a

DATETIME.

· The conversion, by explicit casting, of the DATETIME to a DATE (this drops the

time portion of the DATETIME).

· The explicit casting of the DATE value to a DATETIME (so that it can be

formatted) and the formatting of the DATETIME.

· Printing the formatted DATETIME. Note that the time value changes to midnight.

Rules govern the various ways in which you can convert dates and times using casting.

DATETIME GrandOpening = "2003-01-02 09:00"

DATE OpenDate = [DATE] GrandOpening

STRING sOpening

sOpening = FormatDateTime ([DATETIME] OpenDate,

"mmmm, d, yyyy hh:nn AM/PM")

// Print: "Grand Opening on January 2, 2003 12:00 AM."

Page 17: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

Print ("Grand Opening on {sOpening}.")

DATETIMEPART data type

Description

4Test defines this enumerated data type as follows:

type DATETIMEPART is enum

DTP_YEAR

DTP_MONTH

DTP_DAY

DTP_DAYOFYEAR

DTP_DAYOFWEEK

DTP_HOUR

DTP_MINUTE

DTP_SECOND

DTP_MICROSEC

EKSERVICE data type

4Test defines this enumerated data type as follows:

type EKSERVICE is enum

[ ] EKS_CB

[ ] EKS_CHK

[ ] EKS_LB

[ ] EKS_LV

[ ] EKS_PL

[ ] EKS_PB

[ ] EKS_PGL

[ ] EKS_PROP

[ ] EKS_RB

[ ] EKS_SCL

[ ] EKS_TBL

[ ] EKS_TF

[ ] EKS_TV

[ ] EKS_UD

[ ] EKS_UWIN

[ ] EKS_WIN

EXCEPTION data type

4Test defines this enumerated data type as follows:

type EXCEPTION is enum

Page 18: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

[ ] // 4TEST

[ ]

[ ] E_ABORT = -10100

[ ] E_ACCESS = -10200

[ ] E_AGENT = -10300

[ ] E_ARRAY_SIZE = -10400

[ ] E_ASSERT_FAILED = -10500

[ ] E_ASSIGN = -10600

[ ] E_BAD_ARG = -10700

[ ] E_BAD_INDEX = -10800

[ ] E_BUSY = -10900

[ ] E_CLASS_MISMATCH = -11000

[ ] E_CONST = -11100

[ ] E_DATABASE = -11200

[ ] E_DEADLOCK = -11300

[ ] E_DISABLED = -11400

[ ] E_DIVIDE_BY_ZERO = -11500

[ ] E_FILE = -11600

[ ] E_HALT_THREAD = -11700

[ ] E_HANDLE = -11800

[ ] E_INCOMPAT_TYPES = -11900

[ ] E_INTERNAL = -12000

[ ] E_LIST_FULL = -12100

[ ] E_NO_LIST_OPEN = -12200

[ ] E_NO_RETVAL = -12300

[ ] E_NULL = -12400

[ ] E_NUM_ARGS = -12500

[ ] E_OUT_OF_MEMORY = -12600

[ ] E_SEMAPHORE = -12700

[ ] E_STR_OVERFLOW = -12800

[ ] E_SYNTAX = -12900

[ ] E_SYSTEM = -13000

[ ] E_TIMER = -13100

[ ] E_TYPE_MISMATCH = -13200

[ ] E_UNDEFINED = -13300

[ ] E_UNSUPPORTED = -13400

[ ] E_VAR_EXPECTED = -13500

[ ] E_VAR_NOT_SET = -13600

[ ] E_VERIFY = -13700

[ ] E_WINDOW_TAG = -13800

[ ] E_ZERO_STEP = -13900

[ ] E_PARENT_HALTED = -14000

[ ] E_SIBLING_HALTED = -14100

Page 19: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

[ ] E_AGENT_GUI_MISMATCH = -14200

[ ]

[ ] // 4TEST AGENT

[ ] E_APP_FAULT = -20000

[ ] E_APP_NOT_RESPONDING = -20100

[ ] E_APPID_INVALID = -20200

[ ] E_BITMAP_NOT_STABLE = -20300

[ ] E_BITMAP_REGION_INVALID = -20400

[ ] E_BITMAPS_ALMOST_MATCH = -20500

[ ] E_BITMAPS_DIFFERENT = -20600

[ ] E_BITMAPS_DIFF_COLORTABLE = -20700

[ ] E_BITMAPS_DIFF_DEPTH = -20800

[ ] E_BITMAPS_DIFF_EMPTY = -20900

[ ] E_BITMAPS_DIFF_HEIGHT = -21000

[ ] E_BITMAPS_DIFF_PLANES = -21100

[ ] E_BITMAPS_DIFF_SIZE = -21200

[ ] E_BITMAPS_DIFF_WIDTH = -21300

[ ] E_CANT_CAPTURE_BITMAP = -21400

[ ] E_CANT_CLEAR_SELECTION = -21500

[ ] E_CANT_CLOSE_WINDOW = -21600

[ ] E_CANT_CONVERT_RESOURCE = -21700

[ ] E_CANT_EXIT_APP = -21800

[ ] E_CANT_EXTEND_SELECTION = -21900

[ ] E_CANT_LOAD_DLL = -22000

[ ] E_CANT_MAXIMIZE_WINDOW = -22100

[ ] E_CANT_MINIMIZE_WINDOW = -22200

[ ] E_CANT_MOVE_WINDOW = -22300

[ ] E_CANT_RESTORE_WINDOW = -22400

[ ] E_CANT_SET_ACTIVE = -22500

[ ] E_CANT_SET_FOCUS = -22600

[ ] E_CANT_SIZE_WINDOW = -22700

[ ] E_CANT_START_APP = -22800

[ ] E_CANT_TRANSLATE_KEYS = -22900

[ ] E_CANT_TRANSLATE_TEXT = -23000

[ ] E_COL_COUNT_INVALID = -23100

[ ] E_COL_NUM_INVALID = -23200

[ ] E_COL_START_EXCEEDS_END = -23300

[ ] E_CONNECTION_REFUSED = -23400

[ ] E_CONTROL_NOT_RESPONDING = -23500

[ ] E_COORD_OFF_SCREEN = -23600

[ ] E_COORD_OUTSIDE_WINDOW = -23700

[ ] E_CURSOR_TIMEOUT = -23800

[ ] E_DELAY_INVALID = -23900

Page 20: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

[ ] E_FUNCTION_NOT_FOUND = -24000

[ ] E_FUNCTION_NOT_REGISTERED = -24100

[ ] E_GUIFUNC_ID_INVALID = -24200

[ ] E_ITEM_NOT_FOUND = -24300

[ ] E_ITEM_NOT_VISIBLE = -24400

[ ] E_ITEM_INDEX_INVALID = -24500

[ ] E_INVALID_REQUEST = -24600

[ ] E_KEY_COUNT_INVALID = -24700

[ ] E_KEY_NAME_INVALID = -24800

[ ] E_KEY_SYNTAX_ERROR = -24900

[ ] E_LINE_COUNT_INVALID = -25000

[ ] E_LINE_NUM_INVALID = -25100

[ ] E_LINE_START_EXCEEDS_END = -25200

[ ] E_MOUSE_BUTTON_INVALID = -25300

[ ] E_NO_ACTIVE_WINDOW = -25400

[ ] E_NO_DEFAULT_PUSHBUTTON = -25500

[ ] E_NO_FOCUS_WINDOW = -25600

[ ] E_OPTION_CLASSMAP_INVALID = -25700

[ ] E_OPTION_EVTSTR_LENGTH = -25800

[ ] E_OPTION_NAME_INVALID = -25900

[ ] E_OPTION_TOO_MANY_TAGS = -26000

[ ] E_OPTION_TYPE_MISMATCH = -26100

[ ] E_OPTION_VALUE_INVALID = -26200

[ ] E_POS_INVALID = -26300

[ ] E_POS_NOT_REACHABLE = -26400

[ ] E_PROPERTY_INDEX_INVALID = -26500

[ ] E_PROPERTY_IS_NULL = -26600

[ ] E_PROPERTY_NOT_FOUND = -26700

[ ] E_PROPERTY_READ_ONLY = -26800

[ ] E_PROPERTY_TYPE_MISMATCH = -26900

[ ] E_RESOURCE_NOT_FOUND = -27000

[ ] E_SBAR_HAS_NO_THUMB = -27100

[ ] E_TAG_SYNTAX_ERROR = -27200

[ ] E_TRAP_NOT_SET = -27300

[ ] E_WINDOW_INDEX_INVALID = -27400

[ ] E_WINDOW_NOT_ACTIVE = -27500

[ ] E_WINDOW_NOT_ENABLED = -27600

[ ] E_WINDOW_NOT_EXPOSED = -27700

[ ] E_WINDOW_NOT_FOUND = -27800

[ ] E_WINDOW_NOT_UNIQUE = -27900

[ ] E_WINDOW_SIZE_INVALID = -28000

[ ] E_WINDOW_TYPE_MISMATCH = -28100

[ ]

Page 21: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

[ ] E_COLUMN_INDEX_INVALID = -28200

[ ] E_COLUMN_NOT_FOUND = -28201

[ ] E_ITEM_CANT_COLLAPSE = -28300

[ ] E_ITEM_CANT_EXPAND = -28400

[ ] E_KEY_STRING_TOO_LONG = -28500

[ ]

[ ] /*** THESE ARE FOR HANDLING OLE2/VB CALLS ***/

[ ]

[ ] E_AXEXT_NOT_RESPONDING = -28600

[ ] E_OBJ_CALL_FAILED = -28700

[ ] E_OBJ_NOT_FOUND = -28800

[ ] E_ARG_TYPE_MISMATCH = -28900

[ ] E_BAD_ARG_COUNT = -29000

[ ] E_ARG_VAL_OUT_OF_RANGE = -29100

[ ] E_APP_NOT_READY = -29200

[ ] E_CANT_SCROLL_INTO_VIEW = -29300

[ ] E_ALREADY_DRAGGING = -29400

[ ] E_NOT_DRAGGING = -29500

[ ]

[ ] E_DLL_EXCEPTION = -29800

[ ]

[ ] E_ROW_INDEX_INVALID = -30000

[ ] E_TBL_HAS_NO_ROW_HDR = -30100

[ ] E_TBL_HAS_NO_COL_HDR = -30200

[ ] E_TBL_SINGLE_CELL_ONLY = -30300

[ ] E_UD_HAS_NO_RANGE = -30400

[ ] E_ROW_NOT_TOP = -30500

[ ] E_COLUMN_NOT_LEFT = -30600

[ ]

[ ] E_VO_COLUMN_INVALID = -50100

[ ] E_VO_COUNT_INVALID = -50200

[ ] E_VO_ITEM_INDEX_INVALID = -50300

[ ] E_VO_ITEM_NOT_FOUND = -50400

[ ] E_VO_LINE_INVALID = -50500

[ ] E_VO_PROPERTY_NOT_FOUND = -50600

[ ] E_VO_REGION_INVALID = -50700

[ ] E_VO_ROW_INVALID = -50800

[ ] E_VO_STATUS_NOT_FOUND = -50900

[ ] E_VO_TYPE_MISMATCH = -51000

FILEINFO data type

Page 22: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

Describes a particular file by providing its attributes. 4Test defines this record data type

as follows:

type FILEINFO is record

string sName

boolean bIsDir

number iSize

integer iAttributes

datetime dtLastModifyTime

datetime dtCreationTime

Where:

· sName is a string specifying the file name

· bIsDir is a boolean indicating whether the file is a true file or a directory

· iSize is an number specifying the file’s size

· iAttributes is an integer specifying the attributes of the file

· dtLastModifyTime is of the datetime data type and specifies the date and time that

the file was last modified

· dtCreationTime is of the datetime data type and specifies the date and time that

the file was created

Attributes

The file attributes that you can determine with FILEINFO are:

FILE_ATTRIBUTE_ARCHIVE FILE_ATTRIBUTE_OFFLINE

FILE_ATTRIBUTE_COMPRESSED FILE_ATTRIBUTE_READONLY

FILE_ATTRIBUTE_DIRECTORY FILE_ATTRIBUTE_REPARSE_POINT

FILE_ATTRIBUTE_HIDDEN FILE_ATTRIBUTE_SPARSE_FILE

FILE_ATTRIBUTE_ENCRYPTED FILE_ATTRIBUTE_SYSTEM

FILE_ATTRIBUTE_NORMAL FILE_ATTRIBUTE_TEMPORARY

FILE_ATTRIBUTE_NOT_CONTENT_INDEXED

Note To determine a file attribute, you must use a binary AND comparison with the file

attribute. If the comparison returns that same file attribute, then the attribute exists.

FILEINFO_LIST data type

A list containing instances of the FILEINFO data type. 4Test defines this alias data type

as follows:

Page 23: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

type FILEINFO_LIST is list of FILEINFO

FILEMODE data type

Describes the file mode for a file. The file mode is a required parameter for the FileOpen

function. 4Test defines this enumerated data type as follows:

type FILEMODE is enum

FM_READ

FM_WRITE

FM_UPDATE

FM_APPEND

Each field is defined as follows:

FM_READ Opens the file for reading. SilkTest raises the exception E_FILE if

the file does not exist.

FM_WRITE Opens the file for writing. If the file does not exist, it is created. If

the file exists, it is truncated to zero (0) bytes.

FM_UPDATE Similar to FM_WRITE, except that it does not truncate the file. By

default, it denies write access to other users. The file pointer is

positioned at the beginning of the file.

FM_APPEND Opens the file for appending. If the file does not exist, it is created.

If the file exists, the file pointer is positioned at the last line of the

file. By default, it does not deny write access to other users.

FILEPOS data type

Describes how the FileSetPointer function should set the read/write position in an open

file. 4Test defines this enumerated data type as follows:

type FILEPOS is enum

FP_START

FP_END

FP_RELATIVE

FILESHARE data type

Describes the file-sharing behavior of a file. The file-sharing behavior is an optional

parameter for the FileOpen function, IniFileOpen function, and ListWrite function. 4Test

defines this enumerated data type as follows:

type FILESHARE is enum

NULL

FS_DENY_NONE

FS_DENY_WRITE

Page 24: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

FS_EXCLUSIVE

Each field is defined as follows:

NULL (default) Previous file-sharing behavior. For example, if the file was last

opened with a fsShare value of FS_DENY_WRITE, then the next file open will have this

value as well.

FS_DENY_NONE Others have read/write access.

FS_DENY_WRITE Others have read access.

FS_EXCLUSIVE Others have no access.

FILETYPE data type

Describes the file type of a file. The file type is an optional parameter for the FileOpen

and IniFileOpen functions. It is available only with SilkTest International. 4Test defines

this enumerated data type as follows:

type FILETYPE is enum

FT_ANSI

FT_UNICODE

FT_UTF8

Each field is defined as follows:

FT_ANSI Creates a new file in ANSI format.

FT_UNICODE Creates a new file in UNICODE format.

FT_UTF8 Creates a new file in UTF-8 format.

FONTSTYLE data type

FONTSTYLE identifies the style of a font. 4Test defines this set data type as follows:

type FONTSTYLE is set

FS_BOLD

FS_ITALIC

FS_STRUCKOUT

FS_UNDERLINE

FUZZYVERIFY data type

FUZZYVERIFY identifies the values that the optional argument to VerifyProperties can

have. It is used in fuzzy verification. 4Test defines this data type as follows:

type FUZZYVERIFY is BOOLEAN, DATACLASS, LIST OF DATACLASS

Page 25: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

GETWINDOWFLAG data type

4Test defines this enumerated data type as follows:

type GETWINDOWFLAG is enum

[ ] GW_HWNDFIRST = 0

[ ] GW_HWNDLAST = 1

[ ] GW_HWNDNEXT = 2

[ ] GW_HWNDPREV = 3

[ ] GW_OWNER = 4

[ ] GW_CHILD = 5

HANDLE data type

Description

Certain functions, such as TimerCreate and FileOpen, create and return values of type

HANDLE. You can only store or reassign these return values; you cannot directly create

values of type HANDLE. A handle is an identification code provided for certain types of

object so that you can pass it to a function that needs to know which object to manipulate.

For example,

hTimer = TimerCreate() // Create a timer

TimerStart (hTimer) // Start the timer just created

HDATABASE data type

The handle that identifies a database. 4Test defines this alias data type as follows:

type HDATABASE is HANDLE

HDRIVER data type

The handle for a driver. A driver handle provides you with a means to identify, and

therefore to access, a specific driver. 4Test defines this alias data type as follows:

type HDRIVER is HANDLE

HEAPSTATS data type

4Test defines this record data type as follows:

type HEAPSTATS is record

[ ] INTEGER iHeapSize

[ ] INTEGER iHeapCommitted

[ ] INTEGER iHeapAllocated

Page 26: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

[ ] INTEGER iHeapFree

[ ] INTEGER iHeapOverhead

HFILE data type

The handle for an open file. A file handle provides you with a means to identify, and

therefore to access, a specific file. The FileOpen function returns an HFILE that you can

then pass to such functions as FileReadLine to identify a particular open file that

FileReadLine is to read. 4Test defines this alias data type as follows:

type HFILE is HANDLE

HINIFILE data type

The handle for an open .ini file. A file handle provides you with a means to identify, and

therefore to access, a specific file. A .ini file is an initialization file. SilkTest stores test

attributes and their values in the initialization file called testplan.ini. The IniFileOpen

function returns an HINIFILE that you can then pass to such functions as IniFileSetValue

to identify the initialization file in which to set a value. 4Test defines this alias data type

as follows:

type HINIFILE is HANDLE

HMACHINE data type

The handle for a machine that is connected to the 4Test Agent. The Connect function

returns an HMACHINE when it completes successfully. 4Test defines this alias data type

as follows:

type HMACHINE is HANDLE

When a function requires a machine handle for an input parameter, you can substitute the

string form of the machine name instead of the handle form. For example:

SetMachineData ("Client3", "StateData", sTestState)

HSQL data type

4Test defines this alias data type as follows:

type HSQL is HANDLE

HTIMER data type

Page 27: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

The handle that identifies a 4Test timer. The TimerCreate function returns an HTIMER.

4Test defines this alias data type as follows:

type HTIMER is HANDLE

INTEGER data type

Description

A variable of type INTEGER stores integral values. On all platforms, an INTEGER is 32-

bits.

LBSTYLE data type

LBSTYLE describes the style of a list box: single, extended, or multiple. 4Test defines

this enumerated data type as follows:

type LBSTYLE is enum

LBS_SINGLE

LBS_EXTEND

LBS_MULTIPLE

LINKTESTERINFO data type

Specifies data passed to the Link Tester tool. 4Test defines this record datatype as

follows:

type LINKTESTERINFO is record

STRING sBaseURL

STRING sIncludeDomains

INTEGER iDepth

LISTCOLUMN data type

LISTCOLUMN identifies a column in a table and is defined as follows:

type LISTCOLUMN is INTEGER, STRING

The interpretation of a value of type LISTCOLUMN depends on whether the type is an

integer or a string.

An integer value specifies the 1-based index of the column.

A string value specifies the name of the column. The string can contain wildcard

characters. (You can also specify the index of the column as a string, in the form "#n"

where n is the numerical index of the column.)

LISTITEM data type

Page 28: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

LISTITEM identifies a particular item in a list that is implemented by a control such as a

ListBox, ComboBox, or ListView. It is defined as follows:

type LISTITEM is INTEGER, STRING

The interpretation of a value of type LISTITEM depends on whether the type is an

integer or a string.

An integer value specifies the 1-based index of the item.

A string value specifies the name of the item. The string can contain wildcard characters.

(You can also specify the index of the item as a string, in the form "#n" where n is the

numerical index of the item.)

LOCALECATEGORY data type

4Test defines this enumerated data type as follows:

type LOCALECATEGORY is enum

[ ] LC_ALL

[ ] LC_COLLATE

[ ] LC_CTYPE

[ ] LC_MONETARY

[ ] LC_NUMERIC

[ ] LC_TIME

LONG data type

Description

Use a variable of type LONG to store integers which require four bytes, for example, a

return value from a Microsoft Windows Dynamic Link Library (DLL).

LVSTYLE data type

LVSTYLE describes the style of a listview: single, extended, or multiple. 4Test defines

this enumerated data type as follows:

type LVSTYLE is enum

LVS_SINGLE

LVS_EXTEND

LVS_MULTIPLE

LVVIEW data type

Page 29: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

This data type stores information about the multiple ways to view a elaborated list box

control: large and small rearrangeable icons, normal text, and a detail, or report, view.

4Test defines this enumerated data type as follows:

type LVVIEW is enum

LVV_ICON

LVV_SMALL_ICON

LVV_LIST

LVV_DETAILS

MEMINFO data type

MEMINFO describes the Windows NT performance counters: a process's working set;

the largest address in a process's virtual address space; the number of bytes of writeable,

committed memory in a process's address space; and the number of bytes of private

(unshared) memory in a process's address space. 4Test defines this enumerated data type

as follows:

type MEMINFO is enum

WORKING_SET

VIRTUAL_SIZE

PRIVATE_READWRITE

PRIVATE_BYTES

MULTITAG_ITEM data type

4Test defines this enumerated data type as follows:

type MULTITAG_ITEM is enum

[ ] TAG_CAPTION

[ ] TAG_PRIOR_LABEL

[ ] TAG_INDEX

[ ] TAG_WINDOW_ID

[ ] TAG_LOCATION

MULTITAG_LIST data type

4Test defines this alias data type as follows:

type MULTITAG_LIST is LIST OF MULTITAG_ITEM

NUMBER data type

Description

Page 30: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

A variable of type NUMBER stores either integers or real numbers. Use a variable of this

type only when its value can be either integer or real.

Variables of type NUMBER can have a value from 2.0 – 32. If the value is outside the

range, the data type returns a value of zero.

PINTERFACE data type

Certain properties and methods have a pointer to an ActiveX interface as their return

type, for example, a pointer to an IDispatch interface. Such a pointer is represented in

4Test as a PINTERFACE type.

4Test defines this alias data type as follows:

type PINTERFACE is LONG

The interface pointed to cannot be called directly from SilkTest; however, the pointer can

be processed further by passing it to a method or property that accepts a pointer.

POINT data type

Position coordinates typically used to specify a screen or window location. 4Test defines

this record data type as follows:

type POINT is record

INTEGER x

INTEGER y

RECT data type

The information necessary to specify a rectangle relative to a window, the entire screen,

or some other coordinate space. 4Test defines this record data type as follows:

type RECT is record

INTEGER xPos

INTEGER yPos

INTEGER xSize

INTEGER ySize

The following table explains the fields.

Field Description

xPos The x-coordinate of the top-left corner. INTEGER.

yPos The y-coordinate of the top-left corner. INTEGER.

xSize The width (in pixels) of the capture region. INTEGER.

ySize The height (in pixels) of the capture region.

SBRANGE data type

Page 31: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

Holds the minimum and maximum values to which a ScrollBar or UpDown object can be

set. 4Test defines this record data type as follows:

type SBRANGE is record

INTEGER iMin

INTEGER iMax

SCLRANGE data type

Holds the minimum and maximum values to which a Scale object can be set. 4Test

defines this record data type as follows:

type SCLRANGE is record

NUMBER nMin

NUMBER nMax

SIZE datatype Description

The dimensions of an object, without regard to position. 4Test defines this record data

type as follows

[+] type SIZE is record

[ ] INTEGER iWidth

[ ] INTEGER iHeight

STRING data type Description

A variable of type STRING stores character strings. You define a string by enclosing it in

either single (') or double quotation marks (").

For the range of valid values, see Data type ranges.

To sort lists of strings and compare strings by ASCII value, add the line AsciiSort=TRUE

in the [Runtime] section of the partner.ini file. This setting also affects the comparison of

strings, not just sorting of lists of strings.

WINATTR data type

4Test defines this record data type as follows:

type WINATTR is record

[ ] STRING sName

[ ] STRING sVerifyMethod

[ ] STRING sGetMethod

Page 32: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

TIME data type

Description

A variable of type TIME holds values for a hours, minutes, seconds, and microseconds.

WINATTR_LIST

4Test defines this record data type as follows:

type WINATTR_LIST is LIST OF WINATTR

WINDOW data type

Description

You can declare a variable of type WINDOW to store a window identifier and then

reference the window using the variable name, instead of using the window identifier as

specified in the window's declaration.

Examples

// The window declaration

window MainWin Notepad

...

// code in the testcase

WINDOW w

w = Notepad

w.File.Open.Pick ()

WINDOWDEFINEDHOW data type

Use WindowDefinedHow as optional parameter for the IsDefined method to see how a

particular string definition has been defined: as a method, not as a method but as some

other definition, or to find out if the string is defined in the DATACLASS at all.

4Test defines this enumerated data type as follows:

type WINDOWDEFINEDHOW is enum

DEFINED_ANY

DEFINED_METHOD

DEFINED_NOT_METHOD

Each field is defined as follows:

· DEFINED_ANY returns true if the string is defined.

· DEFINED_METHOD returns true if the string is defined as a method.

Page 33: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

· DEFINED_NOT_METHOD returns true if the string is defined but not as a

method (for example, it might be defined as a property or member) and false if the string

is defined as a method.

WININFO data type

4Test defines this record data type as follows:

type WININFO is record

[ ] WINDOW w

[ ] BOOLEAN bEnabled

[ ] BOOLEAN bChecked

WINPROP data type

4Test defines this record data type as follows:

type WINPROP is record

WINDOW w

INTEGER iLevel

LIST OF PROPINFO lPropInfo

WINPROPLIST data type

4Test defines this list data type as follows:

type WINPROPLIST is LIST OF WINPROP

WINPROPTREE data type

The data type used to store the names and values of the properties of a window and that

window’s child windows. 4Test defines this data structure as follows:

type WINPROPTREE is record

STRING sWindow

LIST OF PROPINFO lPropInfo

LIST OF WINPROPTREE lChildren

WINSTATE data type

The data type returned by the GetState function to report the current state of a

MoveableWin object. 4Test defines this enumerated data type as follows:

type WINSTATE is enum

WS_NORMAL

Page 34: Core Data Types of SilkTest

(¯`•._.•[Jagan’s]•._.•´¯)

WS_MAXIMIZED

WS_MINIMIZED

WNDTAG data type

The data type of the WndTag property, which is the window tag of a window. 4Test

defines this alias data type as follows:

type WNDTAG is STRING

************************************************************************