Welcome to Silk Test Classic 18.5

Note: This Help covers the functionality of Silk Test Classic when using the Open Agent. If you are using the Classic Agent, refer to the Silk Test Classic Classic Agent Help.

Welcome to Silk Test Classic 18.5

  • Getting Started
  • Product Suite

What's New

  • What's New in Silk Test Classic 18.5
  • Release Notes

Featured Sections

  • Silk Test Agents
  • Designing and Recording Test Cases
  • Testing in Your Environment with the Open Agent
  • Running Tests and Interpreting Results
  • Debugging Test Scripts

Tutorials and Demonstrations

  • Silk Test Documentation on SupportLine

Code Samples

  • 4Test Language Reference

Online Resources

  • Micro Focus Home Page
  • Micro Focus Learning Center
  • Micro Focus Channel on YouTube
  • Silk Test Documentation on SupportLine
  • Online Documentation
  • Micro Focus SupportLine
  • Micro Focus Product Updates
  • Silk Test Knowledge Base
  • Silk Test Forum
  • Web-Based Training

Provide Feedback

  • Contacting Micro Focus
  • Email us feedback regarding this Help
  • Suggest a feature


Licensing Information

Unless you are using a trial version, Silk Test requires a license.

Note: A Silk Test license is bound to a specific version of Silk Test. For example, Silk Test 18.5 requires a Silk Test 18.5 license.
The licensing model is based on the client that you are using and the applications that you want to be able to test. The available licensing modes support the following application types:
Licensing Mode | Application Type
Mobile Native
  • Mobile web applications.
    • Android
    • iOS
  • Native mobile applications.
    • Android
    • iOS
Full
  • Web applications, including the following:
    • Apache Flex
    • Java-Applets
  • Mobile web applications.
    • Android
    • iOS
  • Apache Flex
  • Java AWT/Swing, including Oracle Forms
  • Java SWT and Eclipse RCP
  • .NET, including Windows Forms and Windows Presentation Foundation (WPF)
  • Rumba
  • Windows API-Based
Note: To upgrade your license to a Full license, visit http://www.microfocus.com.
Premium

All application types that are supported with a Full license, plus SAP applications.

Note: To upgrade your license to a Premium license, visit http://www.microfocus.com.
Mobile Native Add-On | In addition to the technologies supported with a Full or Premium license, the mobile native add-on license offers support for testing native mobile applications on Android and iOS.


Getting Started

Silk Test Classic is the traditional Silk Test client. With Silk Test Classic you can develop tests using the 4Test language, an object-oriented fourth-generation language (4GL), which is designed specifically for QA professionals. Silk Test Classic guides you through the entire process of creating test cases, running the tests, and interpreting the results of your test runs.

Silk Test Classic supports the testing of a broad set of application technologies.

Note: This Help covers the functionality of Silk Test Classic when using the Open Agent. If you are using the Classic Agent, refer to the Silk Test Classic Classic Agent Help.

This section provides information to get you up and running with Silk Test Classic.

Note: If you have opted not to display the start screen when you start Silk Test Classic, you can check for available updates by clicking Help > Check for Product Update.
  • Best Practices for Using Silk Test Classic
    Lists the best practices for using Silk Test Classic.
  • Automation Under Special Conditions (Missing Peripherals)
    Describes how you can use Silk Test Classic in a complex testing environment which includes access to remote machines.
  • Silk Test Product Suite
    Describes the components available with Silk Test.
  • Silk Test Classic UI
    Describes the main features and functionality of the Silk Test Classic user interface.
  • Enabling or Disabling Usage Data Collection
    Provide usage data to Micro Focus to help improve the usability of Silk Test.
  • Contacting Micro Focus
    Describes how you can access Micro Focus SupportLine for your support needs.


Best Practices for Using Silk Test Classic

Depending on the application under test and the testing environment, you might face different challenges while trying to perform functional or regression tests against your application. Micro Focus recommends the following best practices:
  • To optimally use the functionality that Silk Test Classic provides, create an individual project for each application that you want to test, except when testing multiple applications in the same test.
  • If you have a large test framework in place, consider using the keyword-driven testing approach.
  • Set the size of text and other items on the screen of the machine on which you are testing to the default value. When using another setting than the default, you might experience coordinate offset issues during record and replay.
    • If you are using Microsoft Windows 7, you can change this setting under Start > Control Panel > Appearance and Personalization > Display.
    • If you are using Microsoft Windows 10, you can change this setting under Settings > System > Display > Change the size of text, apps and other items.
Parent topic: Getting Started


Automation Under Special Conditions (Missing Peripherals)

Basic product orientation

Silk Test Classic is a GUI testing product that tries to act like a human user in order to achieve meaningful test results under automation conditions. A test performed by Silk Test Classic should be as valuable as a test performed by a human user while executing much faster. This means that Silk Test Classic requires a testing environment that is as similar as possible to the testing environment that a human user would require in order to perform the same test.

Physical peripherals

Manually testing the UI of a real application requires physical input and output devices like a keyboard, a mouse, and a display. Silk Test Classic does not necessarily require physical input devices during test replay. What Silk Test Classic requires is the ability of the operating system to perform keystrokes and mouse clicks. The Silk Test Classic replay usually works as expected without any input devices connected. However, some device drivers might block the Silk Test Classic replay mechanisms if the physical input device is not available.

The same applies to physical output devices. A physical display does not necessarily need to be connected, but a working video device driver must be installed and the operating system must be in a condition to render things to the screen. For example, rendering is not possible in screen saver mode or if a session is locked. If rendering is not possible, low-level replay will not work and high-level replay might also not work as expected, depend on the technology that is used in the application under test (AUT).

Virtual machines

Silk Test Classic does not directly support virtualization vendors, but can operate with any type of virtualization solution as long as the virtual guest machine behaves like a physical machine. Standard peripherals are usually provided as virtual devices, regardless of which physical devices are used with the machine that runs the virtual machine.

Cloud instances

From an automation point of view, a cloud instance is not different to a virtual machine. However, a cloud instance might run some special video rendering optimization, which might lead to situations where screen rendering is temporarily turned off to save hardware resources. This might happen when the cloud instance detects that no client is actively viewing the display. In such a case, you could open a VNC window as a workaround.

Special cases

Application launched without any window (headless)
Such an application cannot be tested with Silk Test Classic. Silk Test Classic needs to hook to a target application process in order to interact with it. Hooking is not possible for processes that do not have a visible window. In such a case you can only run system commands.
Remote desktops, terminal services, and remote applications (all vendors)
If Silk Test Classic resides and operates within a remote desktop session, it will fully operate as expected.
Note: You require a full user session and the remote viewing window needs to be maximized. If the remote viewing window is not displayed for some reason, for example network issues, Silk Test Classic will continue to replay but might produce unexpected results, depending on what remote viewing technology is used. For example, a lost remote desktop session will negatively impact video rendering, whereas other remote viewing solutions might show no impact at all once the viewing window was lost.

If Silk Test Classic is used to interact with the remote desktop, remote view, or remote app window, only low-level techniques can be used, because Silk Test Classic sees only a screenshot of the remote machine. For some remote viewing solutions even low-level operations may not be possible because of security restrictions. For example, it might not be possible to send keystrokes to a remote application window.

Known automation obstacles

Silk Test Classic requires an interactively-logged-on full-user session. Disable anything that could lock the session, for example screen savers, hibernation, or sleep mode. If this is not possible because of organizational policies you could workaround such issues by adding keep alive actions, for example moving the mouse, in regular intervals or at the end of each test case.

Note: Depending on the configuration of the actual testing environment and the technologies that are used for the AUT, the virtualization, and the terminal services, you may face additional challenges and limitations during the test automation process.
Parent topic: Getting Started


Silk Test Product Suite

Silk Test is an automated testing tool for fast and reliable functional and regression testing. Silk Test helps development teams, quality teams, and business analysts to deliver software faster, and with high quality. With Silk Test you can record and replay tests across multiple platforms and devices to ensure that your applications work exactly as intended.

The Silk Test product suite includes the following components:
  • Silk Test Workbench – Silk Test Workbench is the quality testing environment that offers .NET scripting for power users and easy to use visual tests to make testing more accessible to a broader audience.
  • Silk4NET – The Silk4NET Visual Studio plug-in enables you to create Visual Basic or C# test scripts directly in Visual Studio.
  • Silk4J – The Silk4J Eclipse plug-in enables you to create Java-based test scripts directly in your Eclipse environment.
  • Silk Test Classic – Silk Test Classic is the Silk Test client that enables you to create scripts based on 4Test.
  • Silk Test Agents – The Silk Test agent is the software process that translates the commands in your tests into GUI-specific commands. In other words, the agent drives and monitors the application you are testing. One agent can run locally on the host machine. In a networked environment, any number of agents can run on remote machines.

The sizes of the individual boxes in the image above differ for visualization purposes and do not reflect the included functionality.

The product suite that you install determines which components are available. To install all components, choose the complete install option. To install all components with the exception of Silk Test Classic, choose the standard install option.

Parent topic: Getting Started


Silk Test Classic UI

The desktop of Silk Test Classic is the starting point for all test activities.

The main parts of the Silk Test Classic UI are the following:
Menu Bar
Contains all menus that are available for Silk Test Classic. For additional information about the available menus and menu commands, see Silk Test Classic Menus.
Toolbar
The toolbars provide one-click access to commonly used actions.
Basic Workflow Bar

The Basic Workflow bar guides you through the process of creating a test case. To create and execute a test case, click each icon in the workflow bar to perform the relevant procedures. The procedures and the appearance of the workflow bar differ depending on whether your test uses the Open Agent or the Classic Agent.

For additional information on the basic workflow for the Open Agent, see Basic Workflow for the Open Agent.

For additional information on the basic workflow for the Classic Agent, see Basic Workflow for the Classic Agent in the Silk Test Classic Classic Agent Help.

Start Page
The Start Page is your launching point into the functionality of Silk Test Classic, enabling you to access commonly used actions and useful resources.
Parent topic: Getting Started
Related concepts
Using the Silk Test Classic Menus


Enabling or Disabling Usage Data Collection

To help Micro Focus improve your overall testing experience, Micro Focus would like to collect some information on how you use Micro Focus software and services. By accepting the terms of the License Agreement while installing Silk Test Classic, you allow Micro Focus to collect information about how you use Silk Test Classic and about the computer system on which Silk Test Classic is installed. Micro Focus does not collect any personally identifiable information, for example your name or address, or any of your data files, for example scripts or passwords. By allowing Micro Focus to collect this information, you assist Micro Focus in identifying trends and usage patters.

To enable or disable the collection of usage data by Micro Focus:

  1. Click Help > About Silk Test Classic in the menu.
  2. In the About dialog box, click Customer Feedback Options.
  3. Select one of the following options:
    • To enable usage data collection, click Yes, I am willing to participate.
    • To disable usage data collection, click No, I would not like to participate.
  4. Click OK.
Parent topic: Getting Started


Contacting Micro Focus

Micro Focus is committed to providing world-class technical support and consulting services. Micro Focus provides worldwide support, delivering timely, reliable service to ensure every customer's business success.

All customers who are under a maintenance and support contract, as well as prospective customers who are evaluating products, are eligible for customer support. Our highly trained staff respond to your requests as quickly and professionally as possible.

Visit http://supportline.microfocus.com/assistedservices.asp to communicate directly with Micro Focus SupportLine to resolve your issues, or email supportline@microfocus.com.

Visit Micro Focus SupportLine at http://supportline.microfocus.com for up-to-date support news and access to other support information. First time users may be required to register to the site.

  • Information Needed by Micro Focus SupportLine
    Lists information needed by Micro Focus SupportLine to help address customer issues.
Parent topic: Getting Started


Information Needed by Micro Focus SupportLine

When contacting Micro Focus SupportLine, please include the following information if possible. The more information you can give, the better Micro Focus SupportLine can help you.

  • The name and version number of all products that you think might be causing an issue.
  • Your computer make and model.
  • System information such as operating system name and version, processors, and memory details.
  • Any detailed description of the issue, including steps to reproduce the issue.
  • Exact wording of any error messages involved.
  • Your serial number.

To find out these numbers, look in the subject line and body of your Electronic Product Delivery Notice email that you received from Micro Focus.

Parent topic: Contacting Micro Focus


What's New in Silk Test Classic

Silk Test Classic supports the following new features for the Open Agent:

  • Support for Virtualized Test Environments
    You can now use cloud-based devices and browsers for automated testing through Silk Central.
  • Enhanced Recording on Microsoft Edge
    Action recording on Microsoft Edge now supports additional functionality.
  • Usability Enhancements
    Lists usability enhancements that have been made in Silk Test 18.5.
  • API Enhancements
    Lists API enhancements that have been made in Silk Test 18.5.
  • Technology Updates
    Lists the significant technology updates for Silk Test 18.5.


Support for Virtualized Test Environments

You can now execute your mobile and web tests on mobile devices and browsers that are managed by Mobile Center or Sauce Labs. Just configure the Mobile Center or Sauce Labs integration through Silk Central and start testing on remote devices and browsers.

Parent topic: What's New in Silk Test Classic
Related tasks
Using Devices from Mobile Center
Using SauceLabs Devices


Enhanced Recording on Microsoft Edge

Recording actions on Microsoft Edge now supports all functionality available when recording actions on Google Chrome and Mozilla Firefox.

Parent topic: What's New in Silk Test Classic


Usability Enhancements

This section lists usability enhancements that have been made in Silk Test 18.5.

Testing complex embedded Chrome applications

You can now test embedded Chrome applications that expose more than a single browser window in the UI, for example applications that contain multiple browser windows in the UI, or applications that include UI controls that are based on Win32. Silk Test Classic now also supports testing WeChat apps.

Parent topic: What's New in Silk Test Classic


API Enhancements

This section lists API enhancements that have been made in Silk Test 18.5.

Retrieving the page source of a web application

You can now use the GetPageSource method to retrieve the page source of a web application.

System functions

Additional new operating system calls now enable you to create, check, and delete registry keys and values.

Double-clicking on a mobile object

You can now use the DoubleClick method to double-click on a mobile object.

Escaping special characters when matching strings

When using the MatchStr function, Silk Test Classic now supports escaping wildcard characters in the pattern to search for with a backslash (\).

Parent topic: What's New in Silk Test Classic


Technology Updates

This section lists the significant technology updates for Silk Test 18.5.

  • New macOS Version
    Silk Test now supports macOS High Sierra (10.13).
  • New iOS Version
    Silk Test now provides support for the latest iOS version.
  • New Android Version
    Silk Test now provides support for the latest Android version.
  • New Mozilla Firefox Versions
    Silk Test has now been tested for recording and replay with new versions of Mozilla Firefox.
  • New Google Chrome Versions
    Silk Test has now been tested with the following versions of Google Chrome.
  • New Apple Safari Version
    Silk Test has now been tested with an additional version of Apple Safari.
  • New Microsoft Edge Version
    Silk Test has now been tested for recording and replay with a new version of Microsoft Edge.
  • New SAPGUI Client Version
    Silk Test now supports SAPGUI client 7.50.
  • New Java SWT Version
    Silk Test now supports Java SWT 4.7.
Parent topic: What's New in Silk Test Classic


New macOS Version

You can now leverage your test set by simply executing all your existing functional, regression, and localization tests for Apple Safari or iOS on macOS High Sierra (10.13).

Parent topic: Technology Updates


New iOS Version

In addition to the iOS versions, which have been tested with the previous version of Silk Test, Silk Test has now been tested with iOS 11.

Parent topic: Technology Updates


New Android Version

In addition to the Android versions, which have been tested with the previous version of Silk Test, Silk Test has now been tested with Android 8.

Parent topic: Technology Updates


New Mozilla Firefox Versions

In addition to the versions of Mozilla Firefox, which have been tested with the previous version of Silk Test, Silk Test has now been tested with the following new versions of Mozilla Firefox:
  • Mozilla Firefox 55
  • Mozilla Firefox 56
Note: This list includes the new versions of Mozilla Firefox that have been tested with Silk Test 18.5 until the release date of Silk Test 18.5. Silk Test 18.5 should be able to support newer versions of Mozilla Firefox, even if these versions have been released after the release date of Silk Test 18.5.
Parent topic: Technology Updates


New Google Chrome Versions

In addition to the versions of Google Chrome, which have been tested with the previous version of Silk Test, Silk Test has now been tested with the following versions of Google Chrome:
  • Google Chrome 60
  • Google Chrome 61
  • Google Chrome 62
Note: This list includes the versions of Google Chrome that have been tested with Silk Test 18.5 until the release date of Silk Test 18.5. Silk Test 18.5 should be able to test with newer versions of Google Chrome, even if these versions have been released after the release date of Silk Test 18.5.
Parent topic: Technology Updates


New Apple Safari Version

In addition to the versions of Apple Safari, which have been tested with the previous version of Silk Test, Silk Test has now been tested with Apple Safari 11.

Parent topic: Technology Updates


New Microsoft Edge Version

In addition to the versions of Microsoft Edge, which have been tested with the previous version of Silk Test, Silk Test has been tested for recording and replay with build 10.0.16299.19, the Microsoft Edge version for the Windows 10 Fall Creators Update.

Parent topic: Technology Updates


New SAPGUI Client Version

Silk Test now supports SAPGUI client 7.50.

Parent topic: Technology Updates


New Java SWT Version

Silk Test now supports Java SWT 4.7 standalone and Rich Client Platform (RCP) applications.

Parent topic: Technology Updates


Open Agent

The Silk Test agent is the software process that translates the commands in your test scripts into GUI-specific commands. In other words, the agent drives and monitors the application you are testing. One agent can run locally on the host machine. In a networked environment, any number of agents can run on remote machines.

Silk Test Classic provides two types of agents, the Open Agent and the Classic Agent. The agent that you assign to your project or script depends on the type of application that you are testing.

Note: This Help covers the functionality of Silk Test Classic when using the Open Agent. If you are using the Classic Agent, refer to the Silk Test Classic Classic Agent Help.

When you create a new project, Silk Test Classic automatically uses the agent that supports the type of application that you are testing. For instance, if you create an Apache Flex or Windows API-based client/server project, Silk Test Classic uses the Open Agent. When you open a project or script that was developed with the Classic Agent, Silk Test Classic automatically uses the Classic Agent. For information about the supported technology domains for each agent, refer to Testing in Your Environment.

The Open Agent supports dynamic object recognition to record and replay test cases that use XPath queries to find and identify objects. With the Open Agent, one Agent can run locally on the host machine. In a networked environment, any number of Agents can replay tests on remote machines. However, you can record only on a local machine.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

  • How Silk Test Classic Assigns an Agent to a Window Declaration
    Describes how Silk Test Classic assigns an agent to a window declaration.
  • Agent Options
    Lists the AgentClass options that can be manipulated with the GetOption method and SetOption method.
  • Setting the Default Agent
    Describes how you can set the default agent.
  • Connecting to the Default Agent
    Describes how you can manually connect to the default Agent.
  • Creating a Script that Uses Both Agents
    Describes how you can create a script that uses both agents.
  • Overview of Record Functionality Available for the Silk Test Agents
    Lists the recording functionality that is available for each agent.
  • Setting the Window Timeout Value to Prevent Window Not Found Exceptions
    Describes how you can set the window timeout value to prevent Window Not Found exceptions.
  • Configuring Open Agent Port Numbers
    Describes how you can configure the port of the Open Agent.
  • Configuring the Port to Connect to the Information Service
    Change the port number that all clients use to connect to the information service.
  • Open Agent Port Numbers
    Describes the port number for the Open Agent.
  • Stopping the Open Agent After Test Execution
    Stop the Open Agent from a script at the end of the test execution to ensure that the agent does not continue running.
Related concepts
Testing in Your Environment with the Open Agent
Overview of the Methods Supported by the Silk Test Agents
Overview of the Locator Keyword
Related reference
Differences in the Classes Supported by the Silk Test Agents


How Silk Test Classic Assigns an Agent to a Window Declaration

When you record a test with the Open Agent set as the default agent, Silk Test Classic includes a locator to identify the top-most window of the test application. For instance, this window declaration for a Notepad application that uses the Open Agent includes the following locator:
window MainWin UntitledNotepad
locator "/MainWin[@caption='Untitled - Notepad']"

Silk Test Classic determines which agent to use by detecting whether a locator or Find or FindAll command is used. When Silk Test Classic detects a locator on the top-most window or detects a Find or FindAll command, the Open Agent is automatically used. If no locator or Find or FindAll command is present, Silk Test Classic uses the Classic Agent.

Note: Any window declaration is only valid for either the Open Agent or the Classic Agent. There is no way to use the same window declaration with both agents. The only exception to this rule are SYS functions and DLL calls, which are implemented for both agents.
Parent topic: Open Agent
Related concepts
Overview of the Methods Supported by the Silk Test Agents
Calling Windows DLLs from 4Test
Operating System Calls
Related reference
Differences in the Classes Supported by the Silk Test Agents


Agent Options

The following table lists the AgentClass options that can be manipulated with the GetOption method and SetOption method. Only options that can be manipulated by the user are listed here; other options are for internal use only.
Agent Option Agent Supported Description
OPT_AGENT_CLICKS_ONLY Classic Agent

BOOLEAN

FALSE to use the API-based clicks; TRUE to use agent-based clicks. The default is FALSE. This option applies to clicks on specific HTML options only. For additional information, see API Click Versus Agent Click.

This option can be set through the Compatibility tab on the Agent Options dialog box, Agent.SetOption, or BindAgentOption(), and may be retrieved through Agent.GetOption().

OPT_ALTERNATE_RECORD_BREAK

Classic Agent

Open Agent

BOOLEAN

TRUE pauses recording when Ctrl+Shift is pressed. Otherwise, Ctrl+Alt is used. By default, this is FALSE.

OPT_APPREADY_RETRY

Classic Agent

Open Agent

NUMBER

The number of seconds that the agent waits between attempts to verify that an application is ready. The agent continues trying to test the application for readiness if it is not ready until the time specified with OPT_APPREADY_TIMEOUT is reached.

OPT_APPREADY_TIMEOUT

Classic Agent

Open Agent

NUMBER

The number of seconds that the agent waits for an application to become ready. If the application is not ready within the specified timeout, Silk Test Classic raises an exception.

To require the agent to check the ready state of an application, set OPT_VERIFY_APPREADY.

This option applies only if the application or extension knows how to communicate to the agent that it is ready. To find out whether the extension has this capability, see the documentation that comes with the extension.

OPT_BITMAP_MATCH_COUNT

Classic Agent

Open Agent

INTEGER

The number of consecutive snapshots that must be the same for the bitmap to be considered stable. Snapshots are taken up to the number of seconds specified by OPT_BITMAP_MATCH_TIMEOUT, with a pause specified by OPT_BITMAP_MATCH_INTERVAL occurring between each snapshot.

Related methods:
  • CaptureBitmap
  • GetBitmapCRC
  • SYS_CompareBitmap
  • VerifyBitmap
  • WaitBitmap
OPT_BITMAP_MATCH_INTERVAL

Classic Agent

Open Agent

INTEGER

The time interval between snapshots to use for ensuring the stability of the bitmap image. The snapshots are taken up to the time specified by OPT_BITMAP_MATCH_TIMEOUT.

Related methods:
  • CaptureBitmap
  • GetBitmapCRC
  • SYS_CompareBitmap
  • VerifyBitmap
  • WaitBitmap
OPT_BITMAP_MATCH_TIMEOUT

Classic Agent

Open Agent

NUMBER

The total time allowed for a bitmap image to become stable.

During the time period, Silk Test Classic takes multiple snapshots of the image, waiting the number of seconds specified with OPT_BITMAP_MATCH_TIMEOUT between snapshots. If the value returned by OPT_BITMAP_MATCH_TIMEOUT is reached before the number of bitmaps specified by OPT_BITMAP_MATCH_COUNT match, Silk Test Classic stops taking snapshots and raises the exception E_BITMAP_NOT_STABLE.

Related methods:
  • CaptureBitmap
  • GetBitmapCRC
  • VerifyBitmap
  • WaitBitmap
OPT_BITMAP_PIXEL_TOLERANCE

Classic Agent

Open Agent

INTEGER

The number of pixels of difference below which two bitmaps are considered to match. If the number of pixels that are different is smaller than the number specified with this option, the bitmaps are considered identical. The maximum tolerance is 32767 pixels.

Related methods:
  • SYS_CompareBitmap
  • VerifyBitmap
  • WaitBitmap
OPT_CLASS_MAP

Classic Agent

Open Agent

LIST OF STRING

The class mapping table for custom objects, with each entry in the list in the form custom_class = standard_class.

OPT_CLOSE_CONFIRM_BUTTONS

Classic Agent

Open Agent

LIST OF STRING

The list of buttons used to close confirmation dialog boxes, which are dialog boxes that display when closing windows with the methods Close, CloseWindows, and Exit.

OPT_CLOSE_DIALOG_KEYS

Classic Agent

Open Agent

LIST OF STRING

The keystroke sequence used to close dialog boxes with the methods Close, CloseWindows, and Exit.

OPT_CLOSE_MENU_NAME

Classic Agent

STRING

A list of strings representing the list of menu items on the system menu used to close windows with the methods Close, CloseWindows, and Exit.

Default is Close.

OPT_CLOSE_WINDOW_BUTTONS

Classic Agent

Open Agent

LIST OF STRING

The list of buttons used to close windows with the methods Close, CloseWindows, and Exit.

OPT_CLOSE_WINDOW_MENUS

Classic Agent

Open Agent

LIST OF STRING

The list of menu items used to close windows with the methods Close, CloseWindows, and Exit.

OPT_CLOSE_WINDOW_TIMEOUT

Classic Agent

Open Agent

NUMBER

The number of seconds that Silk Test Classic waits before it tries a different close strategy for the Close method when the respective window does not close. Close strategies include Alt+F4 or sending the keys specified by OPT_CLOSE_DIALOG_KEYS. By default, this is 2.

OPT_COMPATIBLE_TAGS

Classic Agent

BOOLEAN

TRUE to generate and operate on tags compatible with releases earlier than Release 2; FALSE to use the current algorithm.

The current algorithm affects tags that use index numbers and some tags that use captions. In general, the current tags are more portable, while the earlier algorithm generates more platform-dependent tags.

OPT_COMPATIBILITY

Open Agent

STRING

Enables you to use the behavior of the specified Silk Test Classic version for specific features, when the behavior of these features has changed in a later version.

Example strings:
  • 12
  • 11.1
  • 13.0.1

By default, this option is not set.

OPT_COMPRESS_WHITESPACE

Classic Agent

BOOLEAN

TRUE to replace all multiple consecutive white spaces with a single space for comparison of tags. FALSE (the default) to avoid replacing blank characters in this manner.

This is intended to provide a way to match tags where the only difference is the number of white spaces between words.

If at all possible, use "wildcard " instead of this option.

This option can increase test time because of the increased time it takes for compressing of white spaces in both source and target tags. If Silk Test Classic processes an object that has many children, this option may result in increased testing times.

The tag comparison is performed in two parts. The first part is a simple comparison; if there is a match, no further action is required. The second part is to compress consecutive white spaces and retest for a match.

Due to the possible increase in test time, the most efficient way to use this option is to enable and disable the option as required on sections of the testing that is affected by white space. Do not enable this option to cover your entire test.

Tabs in menu items are processed before the actual tags are compared. Do not modify the window declarations of frame files by adding tabs to any of the tags.

OPT_DROPDOWN_PICK_BEFORE_GET

Classic Agent

BOOLEAN

TRUE to drop down the combo box before trying to access the content of the combo box. This is usually not needed, but some combo boxes only get populated after they are dropped down. If you are having problems getting the contents of a combo box, set this option to TRUE.

Default is FALSE.

OPT_ENABLE_ACCESSIBILITY

Classic Agent

Open Agent

BOOLEAN

TRUE to enable Accessibility when you are testing a Win32 application and Silk Test Classic cannot recognize objects. Accessibility is designed to enhance object recognition at the class level. FALSE to disable Accessibility.

Note: For Mozilla Firefox and Google Chrome, Accessibility is always activated and cannot be deactivated.

Default is FALSE.

OPT_ENSURE_ACTIVE_WINDOW

Open Agent

BOOLEAN

TRUE ensures that the main window of the call is active before a call is executed. By default, this is FALSE.

OPT_EXTENSIONS

Classic Agent

LIST OF STRING

The list of loaded extensions. Each extension is identified by the name of the .dll or .vxx file associated with the extension.

Unlike the other options, OPT_EXTENSIONS is read-only and works only with GetOption().

OPT_GET_MULTITEXT_KEEP_EMPTY_LINES

Classic Agent

BOOLEAN

TRUE returns an empty list if no text is selected. FALSE removes any blank lines within the selected text.

By default, this is TRUE.

OPT_HANG_APP_TIME_OUT

Open Agent

NUMBER

Specifies the Unresponsive application timeout, which is the timeout for pending playback actions.

The default value is 5 seconds.

OPT_ITEM_RECORD

Open Agent

BOOLEAN

For SWT applications, TRUE records methods that invoke tab items directly rather than recording the tab folder hierarchy. For example, you might record SWTControls.SWTTabControl1.TabFolder.Select(). If this option is set to FALSE, SWT tab folder actions are recorded. For example, you might record SWTControls.SWTTabControl1.Select("TabFolder").

By default, this is TRUE.

OPT_KEYBOARD_DELAY

Classic Agent

Open Agent

NUMBER

Default is 0.02 seconds; you can select a number in increments of .001 from .001 to up to 1000 seconds.

Be aware that the optimal number can vary, depending on the application that you are testing. For example, if you are testing a Web application, a setting of .001 radically slows down the browser. However, setting this to 0 (zero) may cause basic application testing to fail.

OPT_KEYBOARD_LAYOUT

Classic Agent

STRING

Provides support for international keyboard layouts in the Windows environment. Specify an operating-system specific name for the keyboard layout. Refer to the Microsoft Windows documentation to determine what string your operating system expects. Alternatively, use the GetOption method to help you determine the current keyboard layout, as in the following example: Print (Agent.GetOption (OPT_KEYBOARD_LAYOUT))

OPT_KILL_HANGING_APPS

Classic Agent

Open Agent

BOOLEAN

Specifies whether to shutdown the application if communication between the Agent and the application fails or times out. Set this option to TRUE when testing applications that cannot run multiple instances. By default, this is FALSE.

OPT_LOCATOR_ATTRIBUTES_CASE_SENSITIVE

Open Agent

BOOLEAN

Set to Yes to add case-sensitivity to locator attribute names, or to No to match the locator names case insensitive.

OPT_MATCH_ITEM_CASE

Classic Agent

Open Agent

BOOLEAN

Set this option to TRUE to have Silk Test Classic consider case when matching items in combo boxes, list boxes, radio lists, and popup lists, or set this option to FALSE to ignore case differences during execution of a Select method. This option has no effect on a Verify function or a VerifyContents method.

OPT_MENU_INVOKE_POPUP

Classic Agent

STRING

The command, keystrokes or mouse buttons, used to display pop-up menus, which are menus that popup over a particular object. To use mouse buttons, specify <button1>, <button2>, or <button3> in the command sequence.

OPT_MENU_PICK_BEFORE_GET

Classic Agent

BOOLEAN

TRUE to pick the menu before checking whether an item on it exists, is enabled, or is checked, or FALSE to not pick the menu before checking. When TRUE, you may see menus pop up on the screen even though your script does not explicitly call the Pick method.

Default is FALSE.

OPT_MOUSE_DELAY

Classic Agent

Open Agent

NUMBER

The delay used before each mouse event in a script. The delay affects moving the mouse, pressing buttons, and releasing buttons. By default, this is 0.02.

OPT_MULTIPLE_TAGS

Classic Agent

Open Agent

BOOLEAN

TRUE to use multiple tags when recording and playing back. FALSE to use one tag only, as done in previous releases.

This option cannot be set through the Agent Options dialog box. Its default is TRUE and is only set by the INI file, option file, and through Agent.SetOption.

This option overrides the Record multiple tags check box that displays in both the Recorder Options dialog box and the Record Window Declaration Options dialog box.

If the Record multiple tags check box is grayed out and you want to change it, check this setting.

OPT_NO_ICONIC_MESSAGE_BOXES

Classic Agent

BOOLEAN

TRUE to not have minimized windows automatically recognized as message boxes.

Default is FALSE.

OPT_PAUSE_TRUELOG

Classic Agent

BOOLEAN

TRUE to disable TrueLog at runtime for a specific portion of a script, or FALSE to enable TrueLog.

This option has no effect if Truelog is not enabled.

Default is FALSE.

OPT_PLAY_MODE

Classic Agent

STRING

Used to specify playback mechanism. For additional information for Windows applications, see Playing Back Mouse Actions.
OPT_POST_REPLAY_DELAY

Classic Agent

Open Agent

NUMBER

The time in seconds to wait after invoking a function or writing properties. Increase this delay if you experience replay problems due to the application taking too long to process mouse and keyboard input. By default, this is 0.00.

OPT_RADIO_LIST

Classic Agent

BOOLEAN

TRUE to view option buttons as a group; FALSE to use the pre-Release 2 method of viewing option buttons as individual objects.

OPT_RECORD_LISTVIEW_SELECT_BY_TYPEKEYS

Open Agent

BOOLEAN

TRUE records methods with typekeys statements rather than with keyboard input for certain selected values. By default, this is FALSE.

OPT_RECORD_MOUSE_CLICK_RADIUS

Open Agent

INTEGER

The number of pixels that defines the radius in which a mouse down and mouse up event must occur in order for the Open Agent to recognize it as a click. If the mouse down and mouse up event radius is greater than the defined value, a PressMouse and ReleaseMouse event are scripted. By default, this is set to 5 pixels.

OPT_RECORD_MOUSEMOVES

Classic Agent

Open Agent

BOOLEAN

TRUE records mouse moves for Web pages, Win32 applications, and Windows Forms applications that use mouse move events. You cannot record mouse moves for child domains of the xBrowser technology domain, for example Apache Flex and Swing. By default, this is FALSE.

OPT_RECORD_SCROLLBAR_ABSOLUT

Open Agent

BOOLEAN

TRUE records scroll events with absolute values instead of relative to the previous scroll position. By default, this is FALSE.

OPT_REL1_CLASS_LIBRARY

Classic Agent

BOOLEAN

TRUE to use pre-Release 2 versions of GetChildren, GetClass, and GetParent, or FALSE to use current versions.

OPT_REMOVE_FOCUS_ON_CAPTURE_TEXT

Open Agent

BOOLEAN

TRUE to remove the focus from a window before text is captured. By default, this is FALSE.

OPT_REPLAY_HIGHLIGHT_TIME

Open Agent

NUMBER

The number of seconds before each invoke command that the object is highlighted.

By default, this is 0, which means that objects are not highlighted by default.

OPT_REPLAY_MODE

Classic Agent

Open Agent

NUMBER

The replay mode defines how replays on a control are executed: They can be executed with mouse and keyboard (low level) or using the API (high level). Each control defines which replay mode is the default mode for the control. When the default replay mode is enabled, most controls use a low level replay. The default mode for each control is the mode that works most reliably. If a replay fails, the user can change the replay mode and try again. Each control that supports that mode will execute the replay in the specified mode. If a control does not support the mode, it executes the default mode. For example, if PushButton supports low level replay but uses high level replay by default, it will use low level replay only if the option specifies it. Otherwise, it will use the high level implementation.

Possible values include 0, 1, and 2. 0 is default, 1 is high level, 2 is low level. By default, this is 0.

OPT_REQUIRE_ACTIVE

Classic Agent

BOOLEAN

Setting this option to FALSE allows 4Test statements to be attempted against inactive windows.

Default is TRUE, except when running script statements that were recorded and are in a recording statement.

OPT_RESIZE_APPLICATION_BEFORE_RECORDING

Open Agent

BOOLEAN

Define whether to resize the application under test (AUT) when a recording session starts, to display the Silk Recorder next to the AUT. If this option is disabled, the AUT and the Silk Recorder might overlap. This option is TRUE by default.

OPT_SCROLL_INTO_VIEW

Classic Agent

BOOLEAN

TRUE to scroll a control into view before recording events against it or capturing its bitmap. This option applies only when OPT_SHOW_OUT_OF_VIEW is set to TRUE. This option is useful for testing Web applications in which dialog boxes contain scroll bars. This option applies only to HTML objects when you are using the DOM extension.

OPT_SET_TARGET_MACHINE

Classic Agent

STRING

The IP address and port number to use for the target machine in distributed testing using the SetOption method. To set the target machine, type: Agent.SetOption(OPT_SET_TARGET_MACHINE, < IPAddress >:< PortNumber >) .

Note: A colon must separate the IP address and the port number.

To return the IP address and port number of the current target machine, type: Agent.GetOption(OPT_SET_TARGET_MACHINE)

OPT_SHOW_OUT_OF_VIEW

Classic Agent

BOOLEAN

TRUE to have the agent see a control not currently scrolled into view; FALSE to have the Agent consider an out-of-view window to be invisible. This option applies only to HTML objects when you are using the DOM extension.

OPT_SYNC_TIMEOUT

Open Agent

NUMBER

Specifies the maximum time in seconds for an object to be ready.

Note: When you upgrade from a Silk Test version prior to Silk Test 13.0, and you had set the OPT_XBROWSER_SYNC_TIMEOUT option, the Options dialog box will display the default value of the OPT_SYNC_TIMEOUT, although your timeout is still set to the value you have defined.
OPT_TEXT_NEW_LINE

Classic Agent

STRING

The keys to type to enter a new line using the SetMultiText method of the TextField class. The default value is "<Enter>".

OPT_TRANSLATE_TABLE

Classic Agent

STRING

Specifies the name of the translation table to use. If a translation DLL is in use, the QAP_SetTranslateTable entry point is called with the string specified in this option.

OPT_TRIM_ITEM_SPACE

Classic Agent

BOOLEAN

TRUE to trim leading and trailing spaces from items on windows, or FALSE to avoid trimming spaces.

OPT_USE_ANSICALL

Classic Agent

BOOLEAN

If set to TRUE, each following DLL function is called as ANSI. If set to FALSE, which is the default value, UTF-8 DLL calls are used. For single ANSI DLL calls you can also use the ansicall keyword.

OPT_USE_SILKBEAN

Classic Agent

BOOLEAN

TRUE to enable the agent to interact with the SilkBean running on a UNIX machine.

Default is FALSE.

OPT_VERIFY_ACTIVE

Classic Agent

Open Agent

BOOLEAN

TRUE to verify that windows are active before interacting with them; FALSE to not check. See Active and Enabled Statuses for information about how this option affects Silk Test Classic methods.

Default is TRUE, except when running script statements that were recorded and are in a recording statement.

OPT_VERIFY_APPREADY

Classic Agent

BOOLEAN

TRUE to synchronize the agent with the application under test. Calls to the agent will not proceed unless the application is ready.

OPT_VERIFY_CLOSED

Classic Agent

BOOLEAN

TRUE to verify that a window has closed. When FALSE, Silk Test Classic closes a window as usual, but does not verify that the window actually closed.

Default is TRUE, except when running script statements that were recorded and are in a recording statement.

OPT_VERIFY_COORD

Classic Agent

BOOLEAN

TRUE to check that coordinates passed to a method are inside the window before the mouse is pressed; FALSE to not check. Typically, you use the checking feature unless you need to be able to pass coordinates outside of the window, such as negative coordinates.

If this option is set to TRUE and coordinates fall outside the window, Silk Test Classic raises the exception E_COORD_OUTSIDE_WINDOW.

OPT_VERIFY_CTRLTYPE

Classic Agent

BOOLEAN

TRUE to check that objects are of the specified type before interacting with them; FALSE to not check.

When TRUE, Silk Test Classic checks, for example, that an object that claims to be a listbox is actually a listbox. For custom objects, you must map them to the standard types to prevent the checking from signaling an exception, using the Silk Test Classic class map facility.

Default is FALSE.

OPT_VERIFY_ENABLED

Classic Agent

BOOLEAN

TRUE to verify that windows are enabled before interacting with them; FALSE to not check. For information about how this option affects various Silk Test Classic methods, see Active and Enabled Statuses.

OPT_VERIFY_EXPOSED

Classic Agent

BOOLEAN

TRUE to verify that windows are exposed (that is, not covered, obscured, or logically hidden by another window) before interacting with them; FALSE to not check.

Default is TRUE, except when running script statements that were recorded and are in a recording statement.

OPT_VERIFY_RESPONDING

Classic Agent

BOOLEAN

Setting this option to FALSE suppresses "control not responding" errors.

OPT_VERIFY_UNIQUE

Classic Agent

Open Agent

BOOLEAN

TRUE to raise the E_WINDOW_NOT_UNIQUE exception upon encountering two or more windows with the same tag; FALSE to not raise the exception. When OPT_VERIFY_UNIQUE is FALSE, Silk Test Classic ignores the duplication and chooses the first window with that tag that it encounters.

You can use a modified tag syntax to refer to a window with a non-unique tag, even when OPT_VERIFY_UNIQUE is TRUE. You can either include an index number after the object, as in myDialog("Cancel[2]"), or you can specify the window by including the text of a child that uniquely identifies the window, such as "myDialog/uniqueText/...", where the unique text is the tag of a child of that window.

OPT_WAIT_ACTIVE_WINDOW

Open Agent

NUMBER

The number of seconds Silk Test Classic waits for a window to become active. If a window does not become active within the specified time, Silk Test Classic raises an exception.

To require the Open Agent to check the active state of a window, set OPT_ENSURE_ACTIVE_WINDOW to TRUE.

By default, OPT_WAIT_ACTIVE_WINDOW is set to 2 seconds.

OPT_WAIT_ACTIVE_WINDOW_RETRY

Open Agent

NUMBER

The number of seconds Silk Test Classic waits for a window to become active before trying to verify again that the window is active.

To require the Open Agent to retry the active state of an object, set OPT_ENSURE_ACTIVE_WINDOW to TRUE.

By default, OPT_WAIT_ACTIVE_WINDOW_RETRY is set to 0.5 seconds.

OPT_WINDOW_MOVE_TOLERANCE

Classic Agent

INTEGER

The number of pixels allowed for a tolerance when a moved window does not end up at the specified position.

For some windows and GUIs, you cannot always move the window to the specified pixel. If the ending position is not exactly what was specified and the difference between the expected and actual positions is greater than the tolerance, Silk Test Classic raises an exception.

On Windows, the tolerance can be set through the Control Panel, by setting the desktop window granularity option. If the granularity is zero, you can place a window at any pixel location. If the granularity is greater than zero, the desktop is split into a grid of the specified pixels in width, determining where a window can be placed. In general, the tolerance should be greater than or equal to the granularity.

OPT_WINDOW_RETRY

Classic Agent

Open Agent

NUMBER

The number of seconds Silk Test Classic waits between attempts to verify a window, if the window does not exist or is in the incorrect state. Silk Test Classic continues trying to find the window until the time specified with OPT_WINDOW_TIMEOUT is reached.

The correct state of the window depends on various options. For example, Silk Test Classic might check whether a window is enabled, active, exposed, or unique, depending on the settings of the following options:

  • OPT_VERIFY_ENABLED
  • OPT_VERIFY_ACTIVE
  • OPT_VERIFY_EXPOSED
  • OPT_VERIFY_UNIQUE
OPT_WINDOW_SIZE_TOLERANCE

Classic Agent

INTEGER

The number of pixels allowed for a tolerance when a resized window does not end at the specified size.

For some windows and GUIs, you cant always resize the window to the particular size specified. If the ending size is not exactly what was specified and the difference between the expected and actual sizes is greater than the tolerance, Silk Test Classic raises an exception.

On Windows, windows cannot be sized smaller than will fit comfortably with the menu bar.

OPT_WINDOW_TIMEOUT

Classic Agent

Open Agent

NUMBER

The number of seconds Silk Test Classic waits for a window to appear and be in the correct state. If a window does not appear within the specified timeout, Silk Test Classic raise an exception.

The correct state of the window depends on various options. For example, Silk Test Classic might check whether a window is enabled, active, exposed, or unique, depending on the settings of the following options:

  • OPT_VERIFY_ENABLED
  • OPT_VERIFY_ACTIVE
  • OPT_VERIFY_EXPOSED
  • OPT_VERIFY_UNIQUE
OPT_WPF_CHECK_DISPATCHER_FOR_IDLE

Open Agent

BOOLEAN

For some WPF applications the Silk Test synchronization might not work due to how certain controls are implemented, resulting in Silk Test Classic not recognising when the WPF application is idle. Setting this option to FALSE disables the WPF synchronization and prevents Silk Test Classic from checking the WPF dispatcher, which is the thread that controls the WPF application. Set this option to FALSE to solve synchronization issues with certain WPF applications. By default, this is TRUE.
OPT_WPF_CUSTOM_CLASSES

Open Agent

LIST OF STRING

Specify the names of any WPF classes that you want to expose during recording and playback. For example, if a custom class called MyGrid derives from the WPF Grid class, the objects of the MyGrid custom class are not available for recording and playback. Grid objects are not available for recording and playback because the Grid class is not relevant for functional testing since it exists only for layout purposes. As a result, Grid objects are not exposed by default. In order to use custom classes that are based on classes that are not relevant to functional testing, add the custom class, in this case MyGrid, to the OPT_WPF_CUSTOM_CLASSES option. Then you can record, playback, find, verify properties, and perform any other supported actions for the specified classes.

OPT_WPF_PREFILL_ITEMS

Open Agent

BOOLEAN

Defines whether items in a WPFItemsControl, like WPFComboBox or WPFListBox, are pre-filled during recording and playback. WPF itself lazily loads items for certain controls, so these items are not available for Silk Test Classic if they are not scrolled into view. Turn pre-filling on, which is the default setting, to additionally access items that are not accessible without scrolling them into view. However, some applications have problems when the items are pre-filled by Silk Test Classic in the background, and these applications can therefore crash. In this case turn pre-filling off.

OPT_XBROWSER_FIND_HIDDEN_INPUT_FIELDS

Open Agent

BOOLEAN

Specifies whether to display hidden input fields, which are HTML fields for which the tag includes type="hidden". The default value is TRUE.

OPT_XBROWSER_SYNC_MODE

Open Agent

STRING

Configures the supported synchronization mode for HTML or AJAX. Using the HTML mode ensures that all HTML documents are in an interactive state. With this mode, you can test simple Web pages. If more complex scenarios with Java script are used, it might be necessary to manually script synchronization functions, such as WaitForObject, WaitForProperty, WaitForDisappearance, or WaitForChildDisappearance. Using the AJAX mode eliminates the need to manually script synchronization functions. By default, this value is set to AJAX.

OPT_XBROWSER_SYNC_TIMEOUT

Open Agent

NUMBER

Specifies the maximum time in seconds for an object to be ready.

Note: Deprecated. Use the option OPT_SYNC_TIMEOUT instead.
OPT_XBROWSER_SYNC_EXCLUDE_URLS

Open Agent

STRING

Specifies the URLs of any services or web pages that you want to exclude during page synchronization. Some AJAX frameworks or browser applications use special HTTP requests, which are permanently open in order to retrieve asynchronous data from the server. These requests may let the synchronization hang until the specified synchronization timeout expires. To prevent this situation, either use the HTML synchronization mode or specify the URL of the problematic request in the Synchronization exclude list setting.

Type the entire URL or a fragment of the URL, such as http://test.com/timeService or timeService. Separate entries by comma. For example:
Agent.SetOption(OPT_XBROWSER_SYNC_EXCLUDE_URLS, { "fpdownload.macromedia.com", "fpdownload.adobe.com", "download.microsoft.com" })
Parent topic: Open Agent
Related concepts
TrueLog Explorer
Specifying Options Sets
Related tasks
Setting Recording Options for the Open Agent
Setting TrueLog Options
Related reference
Agent Options Dialog Box
SetOption Method


Setting the Default Agent

Silk Test Classic automatically assigns a default agent to your project or scripts. When you create a new project, the agent currently selected in the toolbar is the default agent. Silk Test Classic automatically starts the default agent when you open a project or create a new project. You can configure Silk Test Classic to automatically connect to the Open Agent or the Classic Agent by default.

To set the default agent, perform one of the following:
  • Click Options > Runtime and set the default agent in the Runtime Options dialog box.
  • Click the appropriate agent icon in the toolbar.

When you enable extensions, set the recovery system, configure the application, or record a test case, Silk Test Classic uses the default agent. When you run a test, Silk Test Classic automatically connects to the appropriate agent. Silk Test Classic uses the window declaration, locator, or Find or FindAll command to determine which agent to use.

  • Setting the Default Agent Using the Runtime Options Dialog Box
    Use the Runtime Options dialog box to set the default Agent.
  • Setting the Default Agent Using the Toolbar Icons
    Use the toolbar icons to set the default Agent.
Parent topic: Open Agent
Related reference
Differences in the Classes Supported by the Silk Test Agents
Runtime Options Dialog Box


Setting the Default Agent Using the Runtime Options Dialog Box

To set the default agent using the Runtime Options dialog box:
  1. In the main menu, click Options > Runtime. The Runtime Options dialog box opens.
  2. Select the agent that you want to use as the default from the Default Agent list box.
  3. If you use the Classic Agent, select the type of network you want to use in the Network list box. If you select the Open Agent, TCP/IP is automatically selected.
  4. If you use named agents, select the local agent name from the Agent Name list box. For instance, if your environment uses multiple agents or a port that uses a value other than the default, select the local agent.
  5. Click OK. When you record a test case, Silk Test Classic automatically uses the default agent.
Parent topic: Setting the Default Agent
Related reference
Runtime Options Dialog Box


Setting the Default Agent Using the Toolbar Icons

From the main toolbar, click one of the following icons to set the default agent:
  • to use the Classic Agent.
  • to use the Open Agent.
Parent topic: Setting the Default Agent


Connecting to the Default Agent

Typically, the default agent starts automatically when it is needed by Silk Test Classic. However, you can connect to the default agent manually if it does not start or to verify that it has started.

To connect to the default Agent, from the main menu, click Tools > Connect to Default Agent.

The command starts the Classic Agent or the Open Agent on the local machine, depending on which agent is specified as the default in the Runtime Options dialog box. If the Agent does not start within 30 seconds, a message is displayed. If the default Agent is configured to run on a remote machine, you must connect to it manually.

Parent topic: Open Agent
Related reference
Runtime Options Dialog Box


Creating a Script that Uses Both Agents

You can create a script that uses the Classic Agent and the Open Agent. Recording primarily depends on the default agent while replaying the script primarily depends on the window declaration of the underlying control. If you create a script that does not use window declarations, the default agent is used to replay the script.

  1. Set the default agent to the Classic Agent.
  2. In the Basic Workflow bar, enable extensions for the application automatically.
  3. In the Basic Workflow bar, click Record Testcase and record your test case.
  4. When prompted, click Paste to Editor and then click Paste testcase and update window declaration(s).
  5. Click OK. The frame now contains window declarations from the Classic Agent.
  6. Click File > Save to save the test case.
  7. Type a name for the file into the File name field and click Save.
  8. Set the default agent to the Open Agent.
  9. Click Options > Application Configurations. The Edit Application Configurations dialog box opens.
  10. Click Add.

    The Select Application dialog box opens.

  11. Configure a standard or Web site test configuration.
  12. Click OK.
  13. Click Record Testcase in the Basic Workflow bar and record your test case.
  14. When prompted, click Paste to Editor and then click Paste testcase and update window declaration(s). The frame now contains window declarations from both the Classic Agent and the Open Agent. Silk Test Classic automatically detects which agent is required for each test based on the window declaration and changes the agent accordingly.
  15. Click File > Save to save the test case.
  16. Click Run Testcase in the Basic Workflow bar to replay the test case. Silk Test Classic automatically recognizes which agent to use based on the underlying window declarations.

You can also use the function Connect([sMachine, sAgentType]) in a script to connect a machine explicitly with either the Classic Agent or the Open Agent. Using the connect function changes the default agent temporarily for the current test case, but it does not change the default agent of your project. However, this does not override the agent that is used for replay, which is defined by the window declaration.

Parent topic: Open Agent
Related concepts
Overview of the Methods Supported by the Silk Test Agents
Related tasks
Recording Test Cases for Standard and Web Applications
Related reference
Differences in the Classes Supported by the Silk Test Agents


Overview of Record Functionality Available for the Silk Test Agents

The Open Agent provides the majority of the same record capabilities as the Classic Agent and the same replay capabilities.

The following table lists the record functionality available for each Silk Test agent.

Record Command | Classic Agent | Open Agent
Window Declarations | Supported | Supported
Application State | Supported | Supported
Testcase | Supported | Supported
Actions | Supported | Supported
Window Identifiers | Supported | Not Supported
Window Locations | Supported | Not Supported
Window Locators | Not Supported | Supported
Class/Scripted | Supported | Not Supported
Class/Accessibility | Supported | Not Supported
Method | Supported | Not Supported
Defined Window | Supported | Not Supported
Note: Silk Test Classic determines which agent to use by detecting whether a locator or Find or FindAll command is used. If a locator or Find or FindAll command is present, Silk Test Classic uses the Open Agent. As a result, you do not need to record window declarations for the Open Agent. For calls that use window declarations, the agent choice is made based on the presence or absence of the locator keyword and on the presence or absence of TAG_IS_OPEN_AGENT in a tag or multitag. When a window declaration contains both locators and tags and either could be used for resolving the window, check or uncheck the Prefer Locator check box in the General Options dialog box to determine which method is used.
Parent topic: Open Agent
Related concepts
Overview of the Locator Keyword
Overview of the Methods Supported by the Silk Test Agents
Overview of Test Frames
Related tasks
Setting Recording Options for the Open Agent
Related reference
Differences in the Classes Supported by the Silk Test Agents


Setting the Window Timeout Value to Prevent Window Not Found Exceptions

The window timeout value is the number of seconds Silk Test Classic waits for a window to display. If the window does not display within that period, the Window not found exception is raised. For example, loading an Apache Flex application and initializing the Apache Flex automation framework may take some time, depending on the machine on which you are testing and the complexity of your Apache Flex application. In this case, setting the Window timeout value to a higher value enables your application to fully load.

If you suspect that Silk Test Classic is not waiting long enough for a window to display, you can increase the window timeout value in the following ways:
  • Change the window timeout value on the Timing tab of the Agent Options dialog box.
  • Manually add a line to the script.

If the window is on the screen within the amount of time specified in the window timeout, the tag for the object might be the problem.

  • Manually Setting the Window Timeout Value
    Set the window timeout value manually to prevent Window Not Found exceptions for specific tests.
  • Setting the Window Timeout Value in the Agent Options Dialog Box
    Set the window timeout value in the Agent Options dialog box to prevent Window Not Found exceptions for all tests.
Parent topic: Open Agent
Related tasks
Enabling View Trace Listing


Manually Setting the Window Timeout Value

In some cases, you may want to increase the window timeout value for a specific test, rather than for all tests in general. For example, you may want to increase the timeout for Flex application tests, but not for browser tests.
  1. Open the test script.
  2. Add the following to the script: Agent.SetOption (OPT_WINDOW_TIMEOUT, numberOfSeconds).
Parent topic: Setting the Window Timeout Value to Prevent Window Not Found Exceptions


Setting the Window Timeout Value in the Agent Options Dialog Box

To change the window timeout value in the Agent Options dialog box:
  1. Click Options > Agent.
  2. Click the Timing tab.
  3. Type the value into the Window timeout text box. The value should be based on the speed of the machine, on which you are testing, and the complexity of the application that you are testing. By default, this value is set to 5 seconds. For example, loading and initializing complex Flex applications generally requires more than 5 seconds.
  4. Click OK.
Parent topic: Setting the Window Timeout Value to Prevent Window Not Found Exceptions


Configuring Open Agent Port Numbers

Typically, you do not have to configure port numbers manually. The information service handles port configuration automatically. Use the default port of the information service to connect to the agent. Then, the information service forwards communication to the port that the agent uses. However, if you have a port number conflict or an issue with a firewall, you must configure the port number for that machine or for the information service.

The default port of the information service is 22901. When you can use the default port, you can type hostname without the port number for ease of use. If you do specify a port number, ensure that it matches the value for the default port of the information service or one of the additional information service ports. Otherwise, communication will fail.

After changing the port number, restart the Open Agent, Silk Test Classic, Silk Test Recorder, and the application that you want to test.

Parent topic: Open Agent
Parent topic: Remote Testing with the Open Agent
Related concepts
Overview of the Methods Supported by the Silk Test Agents


Configuring the Port to Connect to the Information Service

Before you begin this task, stop the Silk Test Open Agent.

This functionality is supported only if you are using the Open Agent.

Typically, you do not have to configure port numbers manually. The information service handles port configuration automatically. Use the default port of the information service to connect to the Agent. Then, the information service forwards communication to the port that the Agent uses.

The default port of the information service is 22901. When you can use the default port, you can type hostname without the port number for ease of use. If you do specify a port number, ensure that it matches the value for the default port of the information service or one of the additional information service ports. Otherwise, communication will fail.

If necessary, you can change the port number that all clients use to connect to the information service.

  1. Navigate to the infoservice.properties.sample file and open it.
    • In a Microsoft Windows system, this file is located in C:\ProgramData\Silk\Silk Test\conf, where “C:\ProgramData” is equivalent to the content of the ALLUSERSPROFILE environment variable, which is set by default on Windows systems.
    • On macOS, this file is located in /Users/<user>/.silk/silktest/conf.
    This file contains commented text and sample alternate port settings.
  2. Change the value for the appropriate port. Typically, you configure the information service port settings to avoid problems with a firewall by forcing communication on a specific port.

    Port numbers can be any number from 1 to 65535.

    • infoservice.default.port – The default port where the information service runs. By default, this port is set to 22901.

  3. Save the file as infoservice.properties.
  4. Restart the Open Agent, the Silk Test client, and the application that you want to test.
Parent topic: Open Agent


Open Agent Port Numbers

When the Open Agent starts, a random available port is assigned to Silk Test Classic, Silk Test Recorder, and the application that you are testing. The port numbers are registered on the information service. Silk Test Classic and Silk Test Recorder contact the information service to determine the port to use to connect to the Open Agent. The information service communicates the appropriate port, and Silk Test Classic or the Silk Test Recorder connect to that port. Communication runs directly between Silk Test Classic or the Silk Test Recorder and the agent.

By default, the Open Agent communicates with the information service on port 22901. You can configure additional ports for the information service as alternate ports that work when the default port is not available. By default, the information service uses ports 2966, 11998, and 11999 as alternate ports.

Typically, you do not have to configure port numbers manually. However, if you have a port number conflict or an issue with a firewall, you must configure the port number for that machine or for the information service. You can use a different port number for a single machine or you can use the same available port number for all your machines.

Parent topic: Open Agent
Related concepts
Overview of the Methods Supported by the Silk Test Agents


Stopping the Open Agent After Test Execution

You can stop the Open Agent from a script, to ensure that the agent does not continue running after the end of the test execution.
  1. Open or create a script that is executed when the test execution is finished. For example, open an existing script that is used for cleanup after test execution.
  2. Add the ShutDown method to the script.
Note: The Open Agent will restart as soon as the agent is required by another script.
Parent topic: Open Agent


Basic Workflow for the Open Agent

The Basic Workflow bar guides you through the process of creating a test case. To create and execute a test case, click each icon in the workflow bar to perform the relevant procedures. The procedures and the appearance of the workflow bar differ depending on whether your test uses the Open Agent or the Classic Agent.

The Basic Workflow bar is displayed by default. You can display it or hide it by checking and un-checking the Workflows > Basic check box. If your test uses both the Open Agent and the Classic Agent, the Basic Workflow bar changes when you switch between the agents.

When you use the Open Agent, the Basic Workflow uses dynamic object recognition to record and replay test cases that use XPath queries to find and identify objects.

  • Creating a New Project
    Create a new project to test an application.
  • Configuring Applications
    Describes how Silk Test Classic supports configuring applications.
  • Recording Test Cases for Standard and Web Applications
    Record a test case with the Open Agent to create a script for a standard application or a Web application.
  • Recording Test Cases for Mobile Applications
    Record a test case with the Open Agent to create a script for a mobile application on a physical device or an Android emulator.
  • Running a Test Case
    Describes how to run a test case.
  • Viewing Test Results
    View test results to see how many tests passed, how many failed, why tests failed, and summary information.
Related concepts
Open Agent
Dynamic Object Recognition
Setting the Default Agent
Related reference
Data-Driven Workflow


Creating a New Project

You can create a new project and add the appropriate files to the project, or you can have Silk Test Classic automatically create a new project from an existing file.

Since each project is a unique testing environment, by default new projects do not contain any settings, such as extensions, class mappings, or Agent options. If you want to retain the settings from your current test set, save them as an options set by opening Silk Test Classic and clicking Options > Save New Options Set. You can add the options set to your project.

To create a new project:

  1. In Silk Test Classic, click File > New Project, or click Open Project > New Project on the basic workflow bar. the Create Project dialog box appears.
  2. Type a unique name for the project into the Project Name field. If the project name already exists, you are prompted to specify a different project name or overwrite the existing project. Project files with a .vtp (Verify Test Project) extension, projectname.vtp, and a projectname.ini are created in the directory that you specify in the Save in text box.
  3. Optional: Type a description for the project into the Description field. After you create the project, you can view the project description by right-clicking the projectname folder on the Files or Global tabs or clicking Project > Project Description.
  4. Type the location at which you want to save the project into the Save in field. You can also click Browse and specify the folder in which you want to save your project. The default location is C:\Users\<Current user>\Documents\Silk Test Classic Projects.
  5. Click OK. Silk Test Classic creates a <Project name> folder within the specified directory, saves the projectname.vtp and projectname.ini to this location and copies the extension .ini files, which are appexpex.ini, axext.ini, domex.ini, and javaex.ini, to the extend subdirectory. If you do not want to save your project in the default location, click Browse and specify the folder in which you want to save your project. Silk Test Classic then creates your project and displays nodes on the Files and Global tabs for the files and resources associated with this project.
  6. Perform one of the following steps:
    • If your test uses the Open Agent, configure the application to set up the test environment.
    • If your test uses the Classic Agent, enable the appropriate extensions to test your application.
Parent topic: Basic Workflow for the Open Agent
Parent topic: Silk Test Classic Projects
Parent topic: Testing the Component Explorer
Related concepts
Configuring Applications
Constructing a Test Case
Setting the Default Agent
Related tasks
Adding Existing Files to a Project
Related reference
Project Explorer
Basic Workflow for the Open Agent


Configuring Applications

When you configure an application, Silk Test Classic automatically creates a base state for the application. An application’s base state is the known, stable state that you expect the application to be in before each test begins execution, and the state the application can be returned to after each test has ended execution.

Silk Test Classic has slightly different procedures depending on which type of application you are configuring:
  • A standard application, which is an application that does not use a web browser, for example a Windows application or a Java SWT application.
  • A web application, which is an application that uses a web browser, for example a web page, a web-based application on a mobile device, or an Apache Flex application.
  • A mobile native application, which is a non web-based application on a mobile device.
  • Configuring Standard Applications
    Configure the application that you want to test to set up the environment that Silk Test Classic will create each time you record or replay a test case.
  • Configuring Web Applications
    Configure the application that you want to test to set up the environment that Silk Test Classic will create each time you record or replay a test case.
  • Configuring Mobile Applications
    Configure the mobile application that you want to test to set up the environment that Silk Test Classic will create each time you record or replay a test case.
  • Select Application Dialog Box
    Describes the Select Application dialog box.
Parent topic: Basic Workflow for the Open Agent
Parent topic: Application Configuration
Related tasks
Configuring Standard Applications


Recording Test Cases for Standard and Web Applications

Note: Before you can record a test case, you have to configure the application that you want to test.

This functionality is supported only if you are using the Open Agent.

When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations. With this approach, you combine the advantages of INC files with the advantages of dynamic object recognition. For example, scripts can use window names in the same manner as traditional, Silk Test Classic tag-based scripts and leverage the power of XPath queries.

  1. Click Record Testcase on the basic workflow bar. If the workflow bar is not visible, click Workflows > Basic to enable it. The Select Test Type dialog box opens.
  2. Select 4Test Testcase.
  3. Click OK. The Record Testcase dialog box opens.
  4. Type the name of your test case into the Testcase name field. Test case names are not case sensitive; they can have any length and they can consist of any combination of alphabetic characters, numerals, and underscore characters.
  5. From the Application State list box, select DefaultBaseState to have the built-in recovery system restore the default base state before the test case begins executing.
    • If you choose DefaultBaseState as the application state, the test case is recorded in the script file as testcase testcase_name ().
    • If you choose another application state, the test case is recorded as testcase testcase_name () appstate appstate_name.
  6. Click Start Recording. Silk Test Classic performs the following actions:
    • Closes the Record Testcase dialog box.
    • Starts your application, if it was not already running. If you have not configured the application yet, the Select Application dialog box opens and you can select the application that you want to test.
    • Removes the editor window from the display.
    • Displays the Recording window.
    • Waits for you to take further action.
  7. In the application under test, perform the actions that you want to test.
    For information about the actions available during recording, see Actions Available During Recording.
  8. To stop recording, click Stop in the Recorder. Silk Test Classic displays the Record Testcase dialog box, which contains the code that has been recorded for you.
  9. To resume recording your interactions, click Resume Recording.
  10. To add the recorded interactions to a script, click Paste to Editor in the Record Testcase window. If you have interacted with objects in your application that have not been identified in your include files, the Update Files dialog box opens.
  11. Perform one of the following steps:
    • Click Paste testcase and update window declaration(s) and then click OK. In most cases, you want to choose this option.
    • Choose Paste testcase only and then click OK. This option does not update the window declarations in the INC file when it pastes the script to the Editor. If you previously recorded the window declarations related to this test case, choose this option.
  12. Click OK. Silk Test Classic adds the recorded actions to the specified script file, and opens the file in the editor.
Parent topic: Basic Workflow for the Open Agent
Parent topic: Creating Test Cases with the Open Agent
Related concepts
Basic Workflow for the Open Agent
Overview of Application States
Dynamic Object Recognition
Configuring Applications
Understanding the Recovery System for the Open Agent
Cross-Browser Testing with the Open Agent
Related tasks
Configuring Web Applications
Configuring Mobile Applications
Configuring Standard Applications
Running a Test Case
Recording Test Cases for Mobile Applications
Recording a Test on Microsoft Edge
Related reference
Actions Available During Recording
Record Testcase Dialog Box


Recording Test Cases for Mobile Applications

This functionality is supported only if you are using the Open Agent.

When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations. With this approach, you combine the advantages of INC files with the advantages of dynamic object recognition. For example, scripts can use window names in the same manner as traditional, Silk Test Classic tag-based scripts and leverage the power of XPath queries.
  1. Click Record Testcase on the basic workflow bar. If the workflow bar is not visible, click Workflows > Basic to enable it. The Select Test Type dialog box opens.
  2. Select 4Test Testcase.
  3. Click OK. The Record Testcase dialog box opens.
  4. Type the name of your test case into the Testcase name field. Test case names are not case sensitive; they can have any length and they can consist of any combination of alphabetic characters, numerals, and underscore characters.
  5. From the Application State list box, select DefaultBaseState to have the built-in recovery system restore the default base state before the test case begins executing.
    • If you choose DefaultBaseState as the application state, the test case is recorded in the script file as testcase testcase_name ().
    • If you choose another application state, the test case is recorded as testcase testcase_name () appstate appstate_name.
  6. Click Start Recording. Silk Test Classic performs the following actions:
    • Closes the Record Testcase dialog box.
    • Starts your application, if it was not already running. If you have not configured the application yet, the Select Application dialog box opens and you can select the application that you want to test.
    • Removes the editor window from the display.
    • Displays the Recording window.
    • Waits for you to take further action.
  7. On the device or the Emulator, interact with your native mobile application, driving it to the state that you want to test.
  8. In the Recording window, perform the actions that you want to record.
    1. Click on the object with which you want to interact. Silk Test Classic performs the default action for the object. If there is no default action, or if you have to insert text or specify parameters, the Choose Action dialog box opens.
    2. Optional: To chose an action for an object, which might not be the default action, right-click on the object. The Choose Action dialog box opens.
    3. Optional: If the action has parameters, type the parameters into the parameter fields. Silk Test Classic automatically validates the parameters.
    4. Click OK to close the Choose Action dialog box. Silk Test Classic adds the action to the recorded actions and replays it on the mobile device or emulator.
    For information about how to record an interaction with a mobile device, see Interacting with a Mobile Device.
  9. To verify an image or a property of a control during recording, click Ctrl+Alt. For additional information, see Adding a Verification to a Script while Recording.
  10. Optional: To interact with an object that is currently not visible in the Recording window, use the Hierarchy View:
    1. Click Toggle Hierarchy View. The Hierarchy View opens.
    2. In the object tree, right-click on the object on which you want to perform an action.
    3. Click Add New Action. The Choose Action dialog box opens.
    4. Proceed as with any other action.
    For example, to open the main menu of the device or emulator, right-click on the MobileDevice object in the object tree and select the action PressMenu().
  11. To pause the recording of interactions with the application, for example to move the application into a different state, click Pause.
  12. To resume recording interactions, click Start.
  13. To add the recorded interactions to a script, click Stop. If you have interacted with objects in your application that have not been identified in your include files, the Update Files dialog box opens.
  14. Perform one of the following steps:
    • Click Paste testcase and update window declaration(s) and then click OK. In most cases, you want to choose this option.
    • Choose Paste testcase only and then click OK. This option does not update the window declarations in the INC file when it pastes the script to the Editor. If you previously recorded the window declarations related to this test case, choose this option.
Parent topic: Basic Workflow for the Open Agent
Parent topic: Creating Test Cases with the Open Agent
Related concepts
Testing Mobile Applications
Related tasks
Configuring Web Applications
Configuring Mobile Applications
Recording Test Cases for Standard and Web Applications
Running a Test Case
Related reference
Record Testcase Dialog Box


Running a Test Case

When you run a test case, Silk Test Classic interacts with the application by executing all the actions you specified in the test case and testing whether all the features of the application performed as expected.

Silk Test Classic always saves the suite, script, or test plan before running it if you made any changes to it since the last time you saved it. By default, Silk Test Classic also saves all other open modified files whenever you run a script, suite, or test plan. To prevent this automatic saving of other open modified files, uncheck the Save Files Before Running check box in the General Options dialog box.

  1. Make sure that the test case that you want to run is in the active window.
  2. Click Run Testcase on the Basic Workflow bar. If the workflow bar is not visible, choose Workflows > Basic to enable it. Silk Test Classic displays the Run Testcase dialog box, which lists all the test cases contained in the current script.
  3. Select a test case and specify arguments, if necessary, in the Arguments field. Remember to separate multiple arguments with commas.
  4. To wait one second after each interaction with the application under test is executed, check the Animated Run Mode (Slow-Motion) check box. Typically, you will only use this check box if you want to watch the test case run. For instance, if you want to demonstrate a test case to someone else, you might want to check this check box. Executions of the default base state and functions that include one of the following strings are not delayed:
    • BaseStateExecutionFinished
    • Connecting
    • Verify
    • Exists
    • Is
    • Get
    • Set
    • Print
    • ForceActiveXEnum
    • Wait
    • Sleep
  5. To view results using the TrueLog Explorer, check the Enable TrueLog check box. Click TrueLog Options to set the options you want to record.
  6. Click Run. Silk Test Classic runs the test case and generates a results file. For the Classic Agent, multiple tags are supported. If you are running test cases using other agents, you can run scripts that use declarations with multiple tags. To do this, check the Disable Multiple Tag Feature check box in the Agent Options dialog box on the Compatibility tab. When you turn off multiple-tag support, 4Test discards all segments of a multiple tag except the first one.
  7. Optional: If necessary, you can press both Shift keys at the same time to stop the execution of the test.
Parent topic: Basic Workflow for the Open Agent
Parent topic: Testing the Component Explorer
Parent topic: Running Tests
Related tasks
Recording Test Cases for Standard and Web Applications
Recording Test Cases for Mobile Applications
Viewing Test Results


Viewing Test Results

Whenever you run tests, a results file is generated which indicates how many tests passed and how many failed, describes why tests failed, and provides summary information.

  1. Click Explore Results on the Basic Workflow or the Data Driven Workflow bars.
  2. On the Results Files dialog box, navigate to the file name that you want to review and click Open.

By default, the results file has the same name as the executed script, suite, or test plan. To review a file in the TrueLog Explorer, open a .xlg file. To review a results file, open a .res file.

Parent topic: Basic Workflow for the Open Agent
Parent topic: Interpreting Results
Related concepts
Running a Data-Driven Test Case
Related tasks
Running a Test Case
Related reference
Basic Workflow for the Open Agent
Data-Driven Workflow


Migrating from the Classic Agent to the Open Agent

This section includes several useful topics that explain the differences between the Classic Agent and the Open Agent. If you plan to migrate from testing using the Classic Agent to the Open Agent, review this information to learn how to migrate your existing assets including window declarations and scripts.

  • Differences for Agent Options Between the Silk Test Agents
    Lists the Agent options that are supported for the Classic Agent and whether the option is supported on the Open Agent or not.
  • Differences in Object Recognition Between the Silk Test Agents
    Describes the different approaches that are used by the Classic Agent and the Open Agent to recognize objects.
  • Differences in the Classes Supported by the Silk Test Agents
    Lists the classes that are supported for the Open Agent and the Classic Agent.
  • Differences in the Parameters Supported by the Silk Test Agents
    Lists the parameters that are supported by the Open Agent and the Classic Agent.
  • Overview of the Methods Supported by the Silk Test Agents
    Provides an overview of the methods that are supported for the Open Agent and the Classic Agent.
  • SYS Functions Supported by the Open Agent and the Classic Agent
    Describes the SYS functions that are supported by the Open Agent and the Classic Agent.
Related concepts
Overview of the Locator Keyword
XPath Basic Concepts
Related tasks
Recording Locators Using the Locator Spy
Recording Window Declarations that Include Locator Keywords
Related reference
Supported XPath Subset


Differences for Agent Options Between the Silk Test Agents

Before you migrate existing Classic Agent scripts to the Open Agent, review the Agent Options listed below to determine if any additional action is required to facilitate the migration.

Classic Agent Option | Action for Open Agent
OPT_AGENT_CLICKS_ONLY | Option not needed. Note: Use OPT_REPLAY_MODE for switching between high-level (API) clicks and low-level clicks.
OPT_CLOSE_MENU_NAME | Not supported by Open Agent.
OPT_COMPATIBLE_TAGS | Option not needed.
OPT_COMPRESS_WHITESPACE | Not supported by Open Agent.
OPT_DROPDOWN_PICK_BEFORE_GET | Option not needed. The Open Agent performs this action by default during replay.
OPT_EXTENSIONS | Option not needed.
OPT_GET_MULTITEXT_KEEP_EMPTY_LINES | Not supported by Open Agent.
OPT_KEYBOARD_LAYOUT | Not supported by Open Agent.
OPT_MENU_INVOKE_POPUP | No action. Pop-up menu handling using the Open Agent does not need such an option.
OPT_MENU_PICK_BEFORE_GET | Option not needed.
OPT_NO_ICONIC_MESSAGE_BOXES | Option not needed.
OPT_PLAY_MODE | Option not needed.
OPT_RADIO_LIST | Open Agent always sees RadioList items as individual objects.
OPT_REL1_CLASS_LIBRARY | Obsolete option.
OPT_REQUIRE_ACTIVE | Use the option OPT_ENSURE_ACTIVE instead.
OPT_SCROLL_INTO_VIEW | Option not needed. Open Agent only requires scrolling into view for low-level replay. By default, high-level replay is used, so no scrolling needs to be performed. However, CaptureBitmap never scrolls an object into view.
OPT_SET_TARGET_MACHINE | Option not needed.
OPT_SHOW_OUT_OF_VIEW | Option not needed. Out-of-view objects are always recognized.
OPT_TEXT_NEW_LINE | Option not needed. The Open Agent always uses Enter to type a new line.
OPT_TRANSLATE_TABLE | Not supported by Open Agent.
OPT_TRAP_FAULTS | Fault trap is no longer active.
OPT_TRAP_FAULTS_FLAGS | Fault trap is no longer active.
OPT_TRIM_ITEM_SPACE | Option not needed. If required, use a * wildcard instead.
OPT_USE_ANSICALL | Not supported by Open Agent.
OPT_USE_SILKBEAN | SilkBean is not supported on the Open Agent.
OPT_VERIFY_APPREADY | Option not needed. The Open Agent performs this action by default.
OPT_VERIFY_CLOSED | Option not needed. The Open Agent performs this action by default.
OPT_VERIFY_COORD | Option not needed. The Open Agent does not typically check for native input in order to allow clicking outside of an object.
OPT_VERIFY_CTRLTYPE | Option not needed.
OPT_VERIFY_EXPOSED | Option not needed. The Open Agent performs this action when it sets a window to active. OPT_ENSURE_ACTIVE_OBJECT_DEF should yield the same result.
OPT_VERIFY_RESPONDING | Option not needed.
OPT_WINDOW_MOVE_TOLERANCE | Option not needed.
Parent topic: Migrating from the Classic Agent to the Open Agent


Differences in Object Recognition Between the Silk Test Agents

When recording and executing test cases, the Classic Agent uses the keywords tag or multitag in a window declaration to uniquely identify an object in the test application. The tag is the actual name, as opposed to the identifier, which is the logical name.

When using the Open Agent, you typically use dynamic object recognition with a Find or FindAll function and an XPath query to locate objects in your test application. To make calls that use window declarations using the Open Agent, you must use the keyword locator in your window declarations. Similar to the tag or multitag keyword, the locator is the actual name, as opposed to the identifier, which is the logical name. This similarity facilitates a smooth transition of legacy window declarations, which use the Classic Agent, to dynamic object recognition, which leverages the Open Agent.

The following sections explain how to migrate the different tag types to valid locator strings.

Caption

Classic Agent
tag “<caption string>”
Open Agent
locator “//<class name>[@caption=’<caption string>’]”
Note: For convenience, you can use shortened forms for the XPath locator strings. Silk Test Classic automatically expands the syntax to use full XPath strings when you run a script.

You can omit:

  • The hierarchy separator, “.//”. Silk Test Classic defaults to “//”.
  • The class name. Silk Test Classic defaults to the class name of the window that contains the locator.
  • The surrounding square brackets of the attributes, “[ ]”.
  • The “@caption=” if the XPath string refers to the caption.
Note: Classic Agent removes ellipses (…) and ampersands (&) from captions. Open Agent removes ampersands, but not ellipses.

Example

Classic Agent:
CheckBox CaseSensitive
  tag “Case sensitive”
Open Agent:
CheckBox CaseSensitive
  locator “//CheckBox[@caption='Case sensitive']”
Or, if using the shortened form:
CheckBox CaseSensitive
  locator “Case sensitive”

Prior text

Classic Agent
tag “^Find What:”
Open Agent
locator “//<class name>[@priorlabel=’Find What:’]”
Note: Only available for Windows API-based and Java Swing applications. For other technology domains, use the Locator Spy to find an alternative locator.

Index

Classic Agent
tag “#1”
Open Agent
Record window locators for the test application. The Classic Agent creates index values based on the position of controls, while the Open Agent uses the controls in the order provided by the operating system. As a result, you must record window locators to identify the current index value for controls in the test application.

Window ID

Classic Agent
tag “$1041”
Open Agent
locator “//<class name>[@windowid=’1041’]”

Location

Classic Agent
tag “@(57,75)”
Open Agent
not supported
Note: If you have location tags in your window declarations, use the Locator Spy to find an alternative locator.

Multitag

Classic Agent
multitag “Case sensitive” “$1011”
Open Agent
locator “//CheckBox[@caption=’Case sensitive’ or @windowid=’1011’]” ‘parent’ statement

No changes needed. Multitag works the same way for the Open Agent.

Parent topic: Migrating from the Classic Agent to the Open Agent
Related tasks
Recording Locators Using the Locator Spy


Differences in the Classes Supported by the Silk Test Agents

The Classic Agent and the Open Agent differ slightly in the types of classes that they support. These differences are important if you want to manually script your test cases. Or, if you are testing a single test environment with both the Classic Agent and the Open Agent. Otherwise, the Open Agent provides the majority of the same record capabilities as the Classic Agent and the same replay capabilities.

Windows-based applications

Both Agents support testing Windows API-based client/server applications. The Open Agent classes, functions, and properties differ slightly from those supported on the Classic Agent for Windows API-based client/server applications.

Classic Agent | Open Agent
AnyWin | AnyWin
AgentClass (Agent) | AgentClass (Agent)
CheckBox | CheckBox
ChildWin | <no corresponding class>
ClipboardClass (Clipboard) | ClipboardClass (Clipboard)
ComboBox | ComboBox
Control | Control
CursorClass (Cursor) | CursorClass (Cursor)
CustomWin | CustomWin
DefinedWin | <no corresponding class>
DesktopWin (Desktop) | DesktopWin (Desktop)
DialogBox | DialogBox
DynamicText | <no corresponding class>
Header | HeaderEx
ListBox | ListBox
ListView | ListViewEx
MainWin | MainWin
Menu | Menu
MenuItem | MenuItem
MessageBoxClass | <no corresponding class>
MoveableWin | MoveableWin
PageList | PageList
PopupList | ComboBox
PopupMenu | <no corresponding class>
PopupStart | <no corresponding class>
PopupSelect | <no corresponding class>
PushButton | PushButton
RadioButton | Note: Items in Radiolists are recognized as RadioButtons on the CA. OA only identifies all of those buttons as RadioList.
RadioList | RadioList
Scale | Scale
ScrollBar | ScrollBar, VerticalScrollBar, HorizontalScrollBar
StaticText | StaticText
StatusBar | StatusBar
SysMenu | <no corresponding class>
Table | TableEx
TaskbarWin (Taskbar) | <no corresponding class>
TextField | TextField
ToolBar | ToolBar Additionally: PushToolItem, CheckBoxToolItem
TreeView, TreeViewEx | TreeView
UpDown | UpDownEx

The following core classes are supported on the Open Agent only:

  • CheckBoxToolItem
  • DropDownToolItem
  • Group
  • Item
  • Link
  • MonthCalendar
  • Pager
  • PushToolItem
  • RadioListToolItem
  • ToggleButton
  • ToolItem

Web-based Applications

Both Agents support testing Web-based applications. The Open Agent classes, functions, and properties differ slightly from those supported on the Classic Agent for Windows API-based client/server applications.

Classic Agent | Open Agent
Browser | BrowserApplication
BrowserChild | BrowserWindow
HtmlCheckBox | DomCheckBox
HtmlColumn | <no corresponding class>
HtmlComboBox | <no corresponding class>
HtmlForm | DomForm
HtmlHeading | <no corresponding class>
HtmlHidden | <no corresponding class>
HtmlImage | <no corresponding class>
HtmlLink | DomLink
HtmlList | <no corresponding class>
HtmlListBox | DomListBox
HtmlMarquee | <no corresponding class>
HtmlMeta | <no corresponding class>
HtmlPopupList | DomListBox
HtmlPushButton | DomButton
HtmlRadioButton | DomRadioButton
HtmlRadioList | <no corresponding class>
HtmlTable | DomTable
HtmlText | <no corresponding class>
HtmlTextField | DomTextField
XmlNode | <no corresponding class>
Xul* Controls | <no corresponding class>
Note: The DomElement class of the Open Agent enables you to access any element on an HTML page. If the Open Agent has no class associated with a specific class supported on the Classic Agent, you can use the DomElement class to access the controls in the class.

Java AWT/Swing Applications

Both Agents support testing Java AWT/Swing applications. The Open Agent classes, functions, and properties differ slightly from those supported on the Classic Agent for Windows API-based client/server applications.

Classic Agent | Open Agent
JavaApplet | AppletContainer
JavaDialogBox | AWTDialog, JDialog
JavaMainWin | AWTFrame, JFrame
JavaAwtCheckBox | AWTCheckBox
JavaAwtListBox | AWTList
JavaAwtPopupList | AWTChoice
JavaAwtPopupMenu | <no corresponding class>
JavaAwtPushButton | AWTPushButton
JavaAwtRadioButton | AWTRadioButton
JavaAwtRadioList | <no corresponding class>
JavaAwtScrollBar | AWTScrollBar
JavaAwtStaticText | AWTLabel
JavaAwtTextField | AWTTextField, AWTTextArea
JavaJFCCheckBox | JCheckBox
JavaJFCCheckBoxMenuItem | JCheckBoxMenuItem
JavaJFCChildWin | <no corresponding class>
JavaJFCComboBox | JComboBox
JavaJFCImage | <no corresponding class>
JavaJFCListBox | JList
JavaJFCMenu | JMenu
JavaJFCMenuItem | JMenuItem
JavaJFCPageList | JTabbedPane
JavaJFCPopupList | JList
JavaJFCPopupMenu | JPopupMenu
JavaJFCProgressBar | JProgressBar
JavaJFCPushButton | JButton
JavaJFCRadioButton | JRadioButton
JavaJFCRadioButtonMenuItem | JRadioButtonMenuItem
JavaJFCRadioList | <no corresponding class>
JavaJFCScale | JSlider
JavaJFCScrollBar | JScrollBar, JHorizontalScrollBar, JVerticalScrollBar
JavaJFCSeparator | JComponent
JavaJFCStaticText | JLabel
JavaJFCTable | JTable
JavaJFCTextField | JTextField, JTextArea
JavaJFCToggleButton | JToggleButton
JavaJFCToolBar | JToolBar
JavaJFCTreeView | JTree
JavaJFCUpDown | JSpinner

Java SWT/RCP Applications

Only the Open Agent supports testing Java SWT/RCP-based applications. For a list of the classes, see Supported SWT Widgets for the Open Agent.

Parent topic: Migrating from the Classic Agent to the Open Agent
Related concepts
Overview of Record Functionality Available for the Silk Test Agents
Supported Java Classes


Differences in the Parameters Supported by the Silk Test Agents

The Classic Agent and the Open Agent differ slightly in the function parameters that they support. These differences are important if you want to manually script your test cases. Or, if you are testing a single test environment with both the Classic Agent and the Open Agent. Otherwise, the Open Agent provides the majority of the same record capabilities as the Classic Agent and the same replay capabilities.

For some parameters, the Open Agent uses a hard-coded default value internally. If one of these parameters is set in a 4Test script, the Open Agent ignores the value and uses the value listed here.

Function | Parameter | Classic Agent Value | Open Agent Value
AnyWin::PressKeys/ReleaseKeys | nDelay | Any number. | 0
AnyWin::PressKeys/ReleaseKeys | sKeys | More than one key is supported. | Only one key is supported. The first key is used and the remaining keys are ignored. For example MainWin.PressKeys("<Shift><Left>") will only press the Shift key. To press both keys, specify MainWin.PressKeys("<Shift>") MainWin.PressKeys("<Left >").
AnyWin::TypeKeys | sEvents | Keystrokes to type or mouse buttons to press. | The Open Agent supports keystrokes only.
AnyWin::GetChildren | bInvisible | TRUE or FALSE. | FALSE.
AnyWin::GetChildren | bNoTopLevel | TRUE or FALSE. | FALSE.
TextField::GetFontName | iLine | The Classic Agent recognizes this parameter. | The Open Agent ignores this parameter.
AnyWin::GetCaption | bNoStaticText | TRUE or FALSE. | FALSE.
AnyWin::GetCaption, Control::GetPriorStatic | bRawMode | TRUE or FALSE. | FALSE. However, the returned strings include trailing and leading spaces, but ellipses, accelerators, and hot keys are removed.
PageList::GetContents/ GetPageName | bRawMode | TRUE or FALSE. | FALSE. However, the returned strings include trailing and leading spaces, ellipses, and hot keys but accelerators are removed.
AnyWin::Click/ DoubleClick/ MoveMouse/ MultiClick/ PressMouse/ ReleaseMouse, PushButton::Click | bRawEvent | The Classic Agent recognizes this parameter. | The Open Agent ignores this value.
Parent topic: Migrating from the Classic Agent to the Open Agent
Related concepts
Overview of Record Functionality Available for the Silk Test Agents
Related tasks
Creating a Script that Uses Both Agents


Overview of the Methods Supported by the Silk Test Agents

The winclass.inc file includes information about which methods are supported for each Silk Test Classic Agent. The following 4Test keywords indicate Agent support:
supported_ca
Supported on the Classic Agent only.
supported_oa
Supported on the Open Agent only.

Standard 4Test methods, such as AnyWin::GetCaption(), can be marked with one of the preceding keywords. A method that is marked with the supported_ca or supported_oa keyword can only be executed successfully on the corresponding Agent. Methods that do not have a keyword applied will run on both Agents.

To find out which methods are supported on each Agent, open the .inc file, for instance winclass.inc, and verify whether the supported_ca or supported_oa keyword is applied to it.

Classic Agent

Certain functions and methods run on the Classic Agent only. When these are recorded and replayed, they default to the Classic Agent automatically. You can use these in an environment that uses the Open Agent. Silk Test Classic automatically uses the appropriate Agent. The functions and methods include:
  • C data types for use in calling functions in DLLs.
  • ClipboardClass methods.
  • CursorClass methods.
  • Certain SYS functions.
Parent topic: Migrating from the Classic Agent to the Open Agent
Related concepts
Setting the Default Agent
Overview of Test Frames


SYS Functions Supported by the Open Agent and the Classic Agent

The Classic Agent supports all SYS functions. The Open Agent supports all SYS functions with the exception of SYS_GetMemoryInfo. SYS_GetMemoryInfo defaults to the Classic Agent when a script is executed.

The following SYS functions behave differently depending on the agent that is used:

SYS Function
Description
SYS_GetRegistryValue
With the Classic Agent, SYS_GetRegistryValue returns an incorrect value when a binary value is used. Use the Open Agent with SYS_GetRegistryValue to avoid this issue.
SYS_FileSetPointer
When setting the pointer after the end of the file, the Open Agent does not throw an exception, while the Classic Agent does throw an exception.
SYS_IniFileGetValue
The Open Agent does not allow the ] character to be part of a section name, while the Classic Agent does allow it. Also, with the Open Agent, = must not be part of a key name. The Classic Agent allows = to be part of a key name, but produces incorrect results.
Note: Error messages and exceptions might differ between the Open Agent and the Classic Agent.
Parent topic: Migrating from the Classic Agent to the Open Agent
Related concepts
Operating System Calls


Silk Test Classic Projects

Silk Test Classic projects organize all the resources associated with a test set and present them visually in the Project Explorer, making it easy for you to see your test environment, and to manage it and work within it.

Silk Test Classic projects store relevant information about your project, including the following:
  • References to all the resources associated with a test set, such as the following:
    • Data.
    • Frame files.
    • Include files.
    • .ini files.
    • Keyword-driven tests.
    • Option sets.
    • Results.
    • Script files.
    • Test plan files.
  • Configuration information.
  • Editor settings.
  • Data files for attributes and queries.
All of this information is stored at the project level, meaning that once you add the appropriate files to your project and configure it once, you might never need to do it again. Switching among projects is easy - since you need to configure the project only once, you can simply open the project and run your tests.

When you create a new project, Silk Test Classic automatically uses the agent that is selected in the toolbar.

Each project is a unique testing environment

By default, new projects do not contain any settings, such as enabled extensions, class mappings, or agent options. If you want to retain the settings from your current test set, save them as a options set by opening Silk Test Classic and clicking Options > Save New Options Set. You can include the options set when you create your project. You can create a project manually or you can let Silk Test Classic automatically generate a project for you, based on existing files that you specify.

Note: To optimally use the functionality that Silk Test Classic provides, create an individual project for each application that you want to test, except when testing multiple applications in the same test.
  • Storing Project Information
    Describes how Silk Test Classic stores project-related information.
  • Accessing Files Within Your Project
    Describes how you can access the files in your Silk Test Classic project.
  • Sharing a Project Among a Group
    Describes what you have to do to share a Silk Test Classic project among a group.
  • Project Explorer
    Describes how you can use the Project Explorer to view and work with all the resources within a Silk Test Classic project.
  • Creating a New Project
    Create a new project to test an application.
  • Opening an Existing Project
    Use the Open Project dialog box to open an existing project.
  • Converting Existing Tests to a Project
    Convert existing tests into a project.
  • Using Option Sets in Your Project
    Describes how you can load an options set into memory to use it in your project.
  • Silk Test Classic File Types
    Lists the Silk Test Classic file types.
  • Organizing Projects
    Includes the topics that are available for organizing projects.
  • Packaging a Silk Test Classic Project
    Describes how you can package a Silk Test Classic project into a single compressed file that you can relocate to a different computer.
  • Exporting a Project
    Export a project to copy all associated files to a directory or a compressed file in a directory.
  • Troubleshooting Projects
    Provides solutions to common problems that you might encounter when you are working with projects in Silk Test Classic.
  • Project Description Dialog Box
    Describes the Project Description dialog box.


Storing Project Information

Silk Test Classic stores project-related information in the following project files:
projectname.vtp
The project file has a Verify Test Project (.vtp) extension and is organized as an .ini file. It stores the names and locations of files used by the project.
projectname.ini
The project initialization file, similar to the partner.ini file, stores information about options sets, queries, and other resources included in your project.
SilkTestClassic.ini
A user-specific initialization file that stores user-specific information about the location of the last projects, the size of the project history, and the location of the current project.

These files are created in the projectname folder. When you create your project, Silk Test Classic prompts you to store your project in the default location C:\Users\<Current user>\Documents\Silk Test Classic Projects. Silk Test Classic creates a <Project name> folder within the specified directory, saves the projectname.vtp and projectname.ini to this location and copies the extension .ini files, which are appexpex.ini, axext.ini, domex.ini, and javaex.ini, to the extend subdirectory. If you do not want to save your project in the default location, click Browse and specify the folder in which you want to save your project.

When you export a project, the default location is the project directory.

Note: The extension .ini files, which are appexpex.ini, axext.ini, domex.ini, and javaex.ini, located in your <Silk Test Classic installation directory>\extend folder are copied to the extend directory of your project, regardless of what extension you have enabled. Do not rename the extend directory; this directory must exist in order for Silk Test Classic to open your project.

You can have Silk Test Classic automatically enable the appropriate extension using the basic workflow bar, or you can manually enable extensions. The current project uses the extension options in the extension .ini file copied to the extend directory of your project. Any modifications you make to the options for this enabled extension will be saved to the copy stored within the current project in the extend directory.

The extend directory is used only for local testing on the host machine. If you want to test on remote agent machines, you must copy the .ini files from the extend directory of your project to the extend directory on the target machines.

File references

Whether you are emailing, packaging, or adding files to a project, it is important to understand how Silk Test Classic stores the path of the file. The .vtp files of Silk Test Classic use relative paths for files on the same root drive and absolute paths for files with different root drives. The use of relative and absolute file paths is not configurable and cannot be overridden. If you modify the .vtp file to change file references from relative paths to absolute paths, the next time you open and close the project it will have relative paths and your changes will be lost.

Parent topic: Silk Test Classic Projects


Accessing Files Within Your Project

Working with Silk Test Classic projects makes it easy to access your files - once you have added a file to your project, you can open it by double-clicking it in the Project Explorer. The Project Explorer contains the following two tabs:
Tab
Description
Files
Lists all of the files included in the project. From the Files tab, you can view, edit, add, and remove files from the project, as well as right-click to access menu options for each of the file types. From the Files tab, you can also add, rename, remove and work with folders within each category.
Global
Displays all the resources that are defined at a global level within the project's files. For example test cases, functions, classes, window declarations, and others. When you double-click an object on the Global tab, the file in which the object is defined opens and your cursor displays at the beginning of the line in which the object is defined. You can run and debug test cases and application states from the Global tab. You can also sort the elements that display within the folders on the Global tab.

Existing test sets do not display in the Project Explorer by default; you must convert them into projects.

Parent topic: Silk Test Classic Projects


Sharing a Project Among a Group

Apply the following guidelines to share a Silk Test Classic project among a group:
  • Create the project in the location from which it will be shared. For example, you can create the project on a network drive.
  • Ensure that testers create the same directory structure on their machines.
Parent topic: Silk Test Classic Projects


Project Explorer

Use the Project Explorer to view and work with all the resources within a Silk Test Classic project. You can access the Project Explorer by clicking:
  • File > Open Project and specifying the project you want to open.
  • File > New Project and creating a new project.
  • Project > View Explorer, if you currently have a project open and do not have the Project Explorer view on.
  • Project > New Project or Open Project on the Basic Workflow bar.

The resources associated with the project are grouped into categories. You can easily navigate among and access all of these resources using the Files and Global tabs. When you double-click a file on the Files tab, or an object on the Global tab, the file opens in the right pane. You can drag the divider to adjust the size of the Project Explorer windows and click Project > Align to change the orientation of the tabs from left to right.

Files tab

The Files tab lists all of the files that have been added to the project. The file name displays first, followed by the path. If files exist on a network drive, they are referenced using Universal Naming Conventions (UNC). Files are grouped into the following categories:
Category
Description
Profile
Contains project-specific initialization files, such as the projectname.ini and option sets files, which means .opt files, that are associated with the project.
Script
Contains test scripts, which means .t and .g.t files, that are associated with the project.
Include/Frame
Contains include files, which means .inc files, and frame/object files that are associated with the project.
Plan
Contains test plans and suite files, which means .pln and .s files, that are associated with the project.
Results
Contains results, which means .res and .rex files, that are associated with the project.
Data
Contains data associated with the project, such as Microsoft Word documents, text files, bitmaps, and others. Double-click the file to open it in the appropriate application. You must open files that are not associated with application types in the Windows Registry using the File/Open dialog box.

From the Files tab, you can view, edit, add, remove and work with files within the project. For example, to add a file to the project, right-click the category name, for example Script, and then click Add File. After you have added the file, you can right-click the file name to view options for working with the file, such as record test case and run test case. Silk Test Classic functionality has not changed - it is now accessible through a project.

You can work with the folders within the categories on the Files tab, by adding, renaming, moving, and deleting folders within each category.

Global tab

The Global tab lists resources that are defined at a global level within the entire project. The resource name displays first, followed by the file in which it is defined. Resources contained within the project's files are grouped into the following categories:
  • Records
  • Classes
  • Enums
  • Window Declarations
  • Testcases
  • Appstates
  • Functions
  • Constants

From the Global tab, you can go directly to the location in which a global object or resource is defined. Double-click any object within the folders to go to the location in which the object is defined. Silk Test Classic opens the file and positions your cursor at the beginning of the line in which the object is defined.

You can also run and debug test cases and application states by right-clicking a test case or application state, and then selecting the appropriate option. For example, right-click a test case within the Testcase folder and then click Run. Silk Test Classic opens the file containing the test case you selected, and displays the Run Testcase dialog box with the selected test case highlighted. You can input argument values and run or debug the test case.

On the Global tab, you can sort the resources within each node by resource name, file name, or file date.

Note: Methods and properties are not listed on the Global tab since they are specific to classes or window declarations. You can access methods and properties by double-clicking the class or window declaration in which they are defined.

You cannot move files within the Project Explorer. For example, you cannot drag a script file under the Frame file node. However, you can drag the file to another folder within the same category node.

Note: If you change the location or name of a file included in your project, outside of Silk Test Classic, you must make sure the projectname.vtp contains the correct reference.
Parent topic: Silk Test Classic Projects
Related concepts
Working with Folders in a Project
Silk Test Classic Projects
Related tasks
Opening an Existing Project
Creating a New Project
Moving Files and Folders
Adding Existing Files to a Project
Removing Files from a Project
Converting Existing Tests to a Project
Recording an Application State
Creating a New Project
Related reference
Basic Workflow for the Open Agent
project


Opening an Existing Project

You can open a Silk Test Classic project as well as open an archived Silk Test Classic project. You can also open a Silk Test Classic project or archived project through the command line.

To open an existing project:

  1. Click File > Open Project or click Open Project > Open Project on the basic workflow bar. If you already have a project open, a dialog box opens informing you that the open project will be closed. If you associated Silk Test Classic file types with Silk Test Classic during installation, then you can open a Silk Test Classic project or package by double-clicking the .vtp or .stp file.
  2. If you are opening a packaged Silk Test Classic project, which means an .stp file, you must perform the following steps:
    1. Indicate into what directory you want to unpack the project in the Base path text box. The files are unpacked to the directory you indicate in the Base path text box.
    2. Enter a password into the Password text box if the archived Silk Test Classic project was saved with a password.

      If you open a package by double-clicking the .stp file, the base path is the directory that contains the .stp file.

      When you select a location for unpacking the archive on the Open Project dialog box, Silk Test Classic uses that directory path, the base path, to substitute for the drive and root directory in the Use Path and Use Files paths.

      The Base path and Password text boxes are enabled only if you are opening an .stp file.

  3. On the Open Project dialog box, specify the project that you want to open, and then click Open. If you open a project file (.vtp) by clicking File > Open command, the projectname.vtp file will open in the 4Test Editor, but the project and its associated settings will not be loaded. Projects do not display in the recently opened files list. To close all open files within a project, click Window > Close All.
Parent topic: Silk Test Classic Projects
Related concepts
Starting Silk Test Classic from the Command Line
Files Not Found When Opening Project
Related tasks
Adding Existing Files to a Project
Related reference
Basic Workflow for the Open Agent


Converting Existing Tests to a Project

Since each project is a unique testing environment, by default new projects do not contain any settings, such as extensions, class mappings, or Agent options. If you want to retain the settings from your current test set, save them as an options set by clicking Options > Save New Options Set. You can include the options set when you create your project.

To convert existing test sets to a project:

  1. Create a new project.
  2. Manually add the files to the project.
Parent topic: Silk Test Classic Projects
Related tasks
Adding Existing Files to a Project
Related reference
Basic Workflow for the Open Agent
Project Explorer


Using Option Sets in Your Project

To use an options set within your project, you must make sure that the options set is loaded into memory. You can tell if an options set is loaded by looking at the Silk Test Classic title bar. If filename.opt displays in the title bar, then the options set filename.opt is loaded. If an options set is loaded, it overrides the settings contained in the projectname.ini file.

Note: When an options set is loaded, the context menu options are available only for the loaded options set; these menu options are grayed out for .ini and .opt files that are not loaded.

You can load an options set into your project using any of the following methods:

  • If the options set is included in your project, within the Profile node on the Files tab, right-click the options set that you want to load and then click Open Options Set.
  • Right-click Save New Options Set to load the options set and add it under the Profile node on the Files tab.
  • Use the Options menu; click Options > Open Options Set, browse to the options set (.opt) that you want to load, and then click Open.
  • Load the options set at runtime using the optionset keyword. This loads the options set at the point in the plan file in which the options set is called. All test cases that follow use this options set.

If an options set was loaded when you closed Silk Test Classic, Silk Test Classic automatically re-loads this options set when you re-start Silk Test Classic.

To include an options set in your project, you can add the options set by right-clicking Profile on the Files tab, clicking Add File, selecting the options set you want to add to the project, and then clicking OK. You can also click Save New Options Set; this loads the options set and adds it under the Profile node on the Files tab.

  • Editing an Options Set
    Expand the Profiles node on the Files tab to edit an options set.
Parent topic: Silk Test Classic Projects
Related concepts
Specifying Options Sets
Options Sets and Porting
Packaging a Silk Test Classic Project
Troubleshooting Projects
Related reference
Project Explorer


Editing an Options Set

To edit an options set in your project:

  1. On the Files tab, expand the Profile node.
  2. Right-click the options set that you want to edit and click Open Options Set. The options set is loaded into memory.
  3. Right-click the options set that you want to edit again and select the type of option you want to edit. For example Runtime, Agent, Extensions, and others.
  4. Modify your options and then click OK. Your current settings are changed and saved to the .opt file.

If you want to change settings for future use, double-click the options set that you want to edit on the Files tab. This opens the options file in the Editor without loading the options file into memory. Changes you make to the options set in the Editor will be saved, but will not take effect until you load the options set by selecting Open Options Set from the Options menu or the right-click shortcut.

Parent topic: Using Option Sets in Your Project


Silk Test Classic File Types

Silk Test Classic uses the following types of files in the automated testing process, each with a specific function. The files marked with an * are required by Silk Test Classic to create and run test cases.

File Type | Extension | Description
Project .vtp

Silk Test Classic projects organize all the resources associated with a test set and present them visually in the Project Explorer, making it easy to see, manage, and work within your test environment.

The project file has a Verify Test Project (.vtp) extension and is organized as an .ini file; it stores the names and locations of files used by the project. Each project file also has an associated project initialization file: projectname.ini.

Exported Project | .stp | A Silk Test Project (.stp) file is a compressed file that includes all the data that Silk Test Classic exports for a project. A file of this type is created when you click File > Export Project. The .stp file includes the configuration files that are necessary for Silk Test Classic to set up the proper testing environment.
Testplan | .pln | An automated test plan is an outline that organizes and enhances the testing process, references test cases, and allows execution of test cases according to the test plan detail. It can be of type masterplan or of subplan that is referenced by a masterplan.
Test Frame* | .inc | A specific kind of include file that upon creation automatically captures a declaration of the AUT’s main window including the URL of the Web application or path and executable name for client/server applications; acts as a central repository of information about the AUT; can also include declarations for other windows, as well as application states, variables, and constants.
4Test Script* | .t | Contains recorded and hand-written automated test cases, written in the 4Test language, that verify the behavior of the AUT.
Data-Driven Script | .g.t | Contains data-driven test cases that pull their data from databases.
4Test Include File | .inc | A file that contains window declarations, constants, variables, classes, and user defined functions.
Suite | .s | Allows sequential execution of several test scripts.
Text File .txt An ASCII file that can be used for the following:
  • Store data that will be used to drive a data driven test case.
  • Print a file in another document (Word) or presentation (PowerPoint).
  • Accompany your automation as a readme file.
  • Transform a tab-delimited plan into a Silk Test Classic plan.
Results File | .res | Is automatically created to store a history of results for a test plan or script execution.
Results Export File | .rex | A single compressed results file that you can relocate to a different machine. Click Results > Export to create a .rex file out of the existing results files of a project.
TrueLog File | .xlg | A file that contains the captured bitmaps and the logging information that is captured when TrueLog is enabled during a test case run.
Keyword-Driven Test File | .kdt | An executable file which contains keywords. Keyword-driven test files are used when testing with the keyword-driven testing methodology.
Keyword Sequence | .kseq | A keyword-sequence file contains a combination of keywords, which are always executed in the same order. A keyword-sequence file cannot be executed on its own, only when included in a keyword-driven test. In context of a keyword-driven test, a keyword-sequence can be used as any other keyword. Keyword sequence files are used when testing with the keyword-driven testing methodology.
Parent topic: Silk Test Classic Projects
Related reference
Project Explorer


Organizing Projects

This section includes the topics that are available for organizing projects.

  • Adding Existing Files to a Project
    Use the Files tab of the Project Explorer to add an existing file to a project.
  • Renaming Your Project
    Change the projectname.vtp and projectname.ini files to rename your project.
  • Working with Folders in a Project
    Describes how you can work with folders in a project.
  • Moving Files Between Projects
    Describes how you can move a file from one project to another.
  • Removing Files from a Project
    Use the Files tab of the Project Explorer to remove a file from a project.
  • Turning the Project Explorer View On and Off
    Describes how you can turn the Project Explorer view on and off.
  • Viewing Resources Within a Project
    Use the Open Project dialog box to view the resources that are included in a project.
Parent topic: Silk Test Classic Projects


Adding Existing Files to a Project

You can add existing files to a project or create new files to add to the project. We recommend adding all referenced files to your project so that you can easily see and access the files, and the objects contained within them. Referenced files do not have to be included in the project. Plans and scripts will continue to run, provided the paths that are referenced are accurate.

When you add a file to a project, project files (.vtp files) use relative paths for files on the same root drive and absolute paths for files with different root drives. The use of relative and absolute files is not configurable and cannot be overridden.

To add an existing file to a project:

  1. If your project is not already open, click File > Open Project or click Open Project > Open Project on the basic workflow bar, select the project to which you want to add a file, and then click Open.
  2. On the Project Explorer, select the Files tab, right-click the node associated with the type of file you want to add, and then click Add File. For example, to add a script file to the project, right-click Script, and then click Add File.
  3. On the Add File to Project dialog box, specify the file you want to add to the open project, and then click Open. The file name, followed by the path, displays under the appropriate category on the Files tab sorted alphabetically by name and is associated with the project through the projectname.vtp file. If files exist on a network drive, they are referenced using Universal Naming Conventions (UNC).

You can also add existing files to the project by clicking Project > Add File. Silk Test Classic automatically places the file in the appropriate node, based on the file type; for example if you add a file with a .pln extension, it will display under the Plan node on the Files tab. We do not recommend adding application .ini files or Silk Test Classic .ini files, which are qaplans.ini, propset.ini, and the extension.ini files, to your project. If you add object files, which are .to and .ino files, to your project, the files will display under the Data node on the Files tab. Objects defined in object files will not display in the Global tab. You cannot modify object files within the Silk Test Classic editor because object files are binary. To modify an object file, open the source file, which is a .t or .inc file, edit it, and then recompile.

Parent topic: Organizing Projects
Related concepts
Files Not Found When Opening Project
Related tasks
Creating a New Project
Opening an Existing Project
Related reference
Basic Workflow for the Open Agent
Project Explorer


Renaming Your Project

The projectname.ini and the projectname.vtp refer to each other; make sure the references are correct in both files when you rename your project.

To rename your project:

  1. Make sure the project you want to rename is closed.
  2. In Windows Explorer, locate the projectname.vtp and projectname.ini associated with the project name you want to change.
  3. Change the names of projectname.vtp and projectname.ini. Make sure that you use the same projectname for both files.
  4. In a text editor outside of Silk Test Classic, open projectname.vtp, change the reference to the projectname.ini file to the new name, and then save and close the file. Do not open the project in Silk Test Classic yet.
  5. In a text editor outside of Silk Test Classic, open projectname.ini, change the reference to the projectname.vtp file to the new name, and then save and close the file.
  6. In Silk Test Classic, open the project by clicking File > Open Project or Open ProjectOpen Project on the basic workflow bar. The new project name displays.
Parent topic: Organizing Projects
Related concepts
Troubleshooting Projects
Using Option Sets in Your Project
Related tasks
Opening an Existing Project
Related reference
Basic Workflow for the Open Agent
Project Explorer


Working with Folders in a Project

In addition to working with files, you can also add your own folders to all nodes listed on the File tab of the Project Explorer. For example, the Files tab of the Project Explorer can include notes.

You can also right-click a folder and click the following:

  • Expand All to display all contents of a folder.
  • Collapse All to collapse the contents of the folder.
  • Display Full Path to show the full path for the contents.
  • Display Date/Time to show creation information for the content file.
  • Adding a Folder to the Files Tab of the Project Explorer
    Use the Files tab of the Project Explorer to add a folder to a project.
  • Moving Files and Folders
    Use the Files tab of the Project Explorer to move files and folders within the same category.
  • Removing a Folder from the Files tab of the Project Explorer
    Use the Files tab of the Projects Explorer to remove a folder from a project.
  • Renaming a Folder on the Files Tab of the Project Explorer
    Use the Files tab of the Projects Explorer to rename a folder in a project.
  • Sorting Resources within the Global Tab of the Project Explorer
    Use the Global tab of the Project Explorer to sort resources in a project.
Parent topic: Organizing Projects
Related concepts
Packaging a Silk Test Classic Project
Related reference
Silk Test Classic File Types


Adding a Folder to the Files Tab of the Project Explorer

You may add a folder to any of the categories (nodes) on the Files tab of the Project Explorer. You may not add a folder to the root project folder, nor change the titles of the root nodes.

To add a folder to a project:

  1. If your project is not already open, click File > Open Project or click Open Project > Open Project on the basic workflow bar. Select a project, then click Open.
  2. In the Project Explorer, click the Files tab, right-click a folder and select Add Folder.
  3. On the Add Folder dialog box, enter the name of the new folder, then click OK. When you are naming a folder, you may use alphanumeric characters, underscore character, character space, or hyphens. Folder names may be a maximum of 256 characters long. Creating folders with more than 256 characters is possible, but Silk Test Classic will truncate the name when you save the project. The concatenated length of the names of all folders within a project may not exceed 256 characters. You may not use periods or parentheses in folder names. Within a node, folder names must be unique.
Parent topic: Working with Folders in a Project
Related concepts
Silk Test Classic Cannot Save Files to My Project


Moving Files and Folders

You may move an individual file or files between folders within the same category on the Files tab of the Project Explorer. You cannot move the predefined Silk Test Classic folders (nodes) such as Profile Script, Plan, Frame, and Data.

You may also move sub-folders within the same category on the Files tab. You cannot move sub-folders across categories.

To move a folder or file:

  1. If your project is not already open, click File > Open Project or click Open Project > Open Project on the basic workflow bar. Select a project, then click Open.
  2. In the Project Explorer, click the Files tab. Click a file, a folder, or shift-click to select several files or folders, then drag the items to the new location.
  3. Release the mouse to move the items. There is no undo.
Parent topic: Working with Folders in a Project
Related concepts
Packaging a Silk Test Classic Project
Related tasks
Exporting a Project


Removing a Folder from the Files tab of the Project Explorer

You may delete folders on the Files tab of the Project Explorer, however, you may not delete any of the predefined Silk Test Classic categories (nodes) such as Profile Script, Plan, Frame, and Data.
Note: There is no undo.

To remove a folder:

  1. If your project is not already open, click File > Open Project or click Open Project > Open Project on the basic workflow bar. Select a project, then click Open.
  2. In the Project Explorer, click the Files tab, right-click a folder and select Remove Folder to delete it from the Project Explorer. If you select a folder with child folders or a folder that contains items, Silk Test Classic displays a warning before deleting the folder.
Parent topic: Working with Folders in a Project
Related concepts
Moving Files Between Projects
Packaging a Silk Test Classic Project
Related tasks
Exporting a Project


Renaming a Folder on the Files Tab of the Project Explorer

You may rename any folder that you have added to a project. You may not rename any of the predefined Silk Test Classic folders (nodes) such as Profile, Script, Include/Frame, Plan, Results, or Data.

To rename a folder:

  1. If your project is not already open, click File > Open Project or click Open Project > Open Project on the basic workflow bar. Select a project, then click Open.
  2. In the Project Explorer, click the Files tab, then navigate to the folder you want to rename.
  3. Right-click the folder and select Rename Folder.
  4. On the Rename Folder dialog box, enter the new name of the folder then click OK. When naming a folder, you may use alphanumeric characters, underscore character, character space, or hyphens. Folder names may be a maximum of 64 characters long. You may not use periods or parentheses in folder names. Within a node, folder names must be unique.
Parent topic: Working with Folders in a Project
Related concepts
Packaging a Silk Test Classic Project
Troubleshooting Projects


Sorting Resources within the Global Tab of the Project Explorer

On the Global tab of the Project Explorer, you can sort the resources within each category (node) by resource name, file name, or file date.

To sort resources:

  1. If your project is not already open, click File > Open Project or click Open Project > Open Project on the basic workflow bar, select the project whose elements you want to sort, and then click Open.
  2. On the Project Explorer, click the Global tab, right-click the node associated with the type of element you want to sort, and then click Sort by FileName or Sort by FileDate. The default is sort by element name.
  3. Click Ascending or Descending to indicate how you want to organize the sort. For example, to sort the elements of a script file by file date in reverse chronological order, right-click the Script node and select Sort by FileDate, then click Descending. When you release the mouse, the elements are sorted by the parameters you selected.
Parent topic: Working with Folders in a Project
Related concepts
Moving Files Between Projects
Packaging a Silk Test Classic Project
Related tasks
Exporting a Project
Related reference
Project Explorer


Moving Files Between Projects

We recommend that you use Export Project to move projects, but if you want to move only a few files rather than an entire project, you can open the project in Silk Test Classic and remove the files that you want to move from the project. Move the files to their new location in Windows Explorer, and then add the files back to the currently open project.

You can also move your project by opening the projectname.vtp and projectname.ini files in a text editor outside of Silk Test Classic and updating references to the location of source files. However, we recommend that you have strong knowledge of your files and how the partner and projectname .ini files work before attempting this. We advise you to use great caution if you decide to edit the projectname .vtp and projectname .ini files.

Parent topic: Organizing Projects
Related concepts
Troubleshooting Projects
Packaging a Silk Test Classic Project
Related tasks
Opening an Existing Project
Exporting a Project


Removing Files from a Project

You cannot remove the projectname.ini file.

To remove a file from a project:

  1. Click File > Open Project or click Open Project > Open Project on the basic workflow bar.
  2. Click the plus sign [+] to expand the node associated with the type of file you want to remove, and then choose one of the following:
    • Right-click the file you want to remove, and then click Remove File.
    • Select the file in the Project Explorer and press the Delete key.
    • Select the file you want to remove on the Files tab, and then click Project > Remove File.
The file is removed from the project and references to the file are deleted from the projectname.vtp. The file itself is not deleted; it is just removed from the project.
Parent topic: Organizing Projects
Related concepts
Troubleshooting Projects
Related tasks
Converting Existing Tests to a Project
Creating a New Project
Opening an Existing Project
Related reference
Basic Workflow for the Open Agent
Project Explorer


Turning the Project Explorer View On and Off

The Project Explorer view is the default. If you do not want to view the Project Explorer, uncheck Project > View Explorer. You can continue to work with your files within the project, you just will not see the Project Explorer.

To turn Project Explorer view on, check Project > View Explorer.

If you do not want to use projects in Silk Test Classic, close the open project, if any, by clicking File > Close Project, and then use Silk Test Classic as you would have in the past.

Parent topic: Organizing Projects
Related tasks
Converting Existing Tests to a Project
Creating a New Project
Opening an Existing Project


Viewing Resources Within a Project

  1. Click File > Open Project or click Open Project > Open Project on the basic workflow bar and select the project that you want to open.
  2. Click one of the following:
    • The Files tab to view all the files associated with the open project.
    • The Global tab to view global objects defined in the files associated with the project.
  3. To close all open files within a project, click Window > Close All.
Parent topic: Organizing Projects
Related concepts
Files Not Found When Opening Project
Related tasks
Converting Existing Tests to a Project
Creating a New Project
Opening an Existing Project
Related reference
Basic Workflow for the Open Agent
Project Explorer


Packaging a Silk Test Classic Project

You can package your Silk Test Classic project into a single compressed file that you can relocate to a different computer. When you unpack your project you will have a fully functional set of test files. This is useful if you need to relocate a project, email a project to a co-worker, or send a project to technical support.

Source files included in the packaged project

When you package a project, Silk Test Classic includes all of the source files, meaning the related files used by a project, such as:
Description | Extension
plan files | .pln
script files | .t
include files | .inc
suite files | .s
results files (optional) | .res and .rex
data files | -

Silk Test Classic takes these files and bundles them up into a new file with an .stp extension. The .stp file includes the configuration files necessary for Silk Test Classic to set up the proper testing environment such as project.ini, testplan.ini, optionset .opt files, and any .ini files found in the …\Silk Test Classic projects\<Project name>\extend directory.

You have the option of including .res and .rex files when you package a Silk Test Classic project because these files are sometimes quite large and not necessary to run the project.

Relative paths in comparison to absolute paths

When you work with Silk Test Classic projects, the files that make up the project are identified by pathnames that are either absolute or relative. A relative pathname begins at a current folder or some number of folders up the hierarchy and specifies the file’s location from there. An absolute pathname begins at the root of the file system (the topmost folder) and fully specifies the file’s location from there. For example:
Absolute path
C:\Users\<Current user>\Documents\Silk Test Classic Projects\<Project name>\options.ini
Relative path
..\tesla\Silk Test\options\options.ini or SUSDir\options.inc

When you package a project, Silk Test Classic checks to make sure that the paths used within the project are properly maintained. If you try to compress a project containing ambiguous paths, Silk Test Classic displays a warning message. Silk Test Classic tracks the paths in a project in a log file.

Including all files needed to run tests

Files associated with a project, but not necessary to run tests, for example bitmap or document files, which you have manually added to the project are included when Silk Test Classic packages a project.

If Silk Test Classic finds any include:, script:, or use: statements in the project files that refer to files with absolute paths, c:\program files\Silk\Silk Test\, Silk Test Classic verifies if you have checked the Use links for absolute files? check box on the Export Project or on the Email Project dialog boxes.

  • If you check the Use links for absolute files? check box, Silk Test Classic treats any file referenced by an absolute path in an include, script, or use statement as a placeholder and does not include those files in the package. For example, if there are use files within the Runtime Options dialog box referred to as "q:\qaplans\SilkTest\frame.inc" or "c", these files are not included in the package. The assumption is that these files will also be available from wherever you unpack the project.

  • If you uncheck the Use links for absolute files? check box, Silk Test Classic includes the files referenced by absolute paths in the packaged project. For example, if the original file is stored on c:\temp\myfile.t, when unpacked at the new location, the file is placed on c:\temp\myfile.t.

The following table compares the results of packaging projects based on whether there are any absolute file references in your source files, and how you respond to the Use links for absolute files? check box on the Export Project or on the Email Project dialog boxes.

Any absolute references in source files? | Use links for absolute files? | Results
No | Checked or unchecked | Package unpacks to any location.
Yes | Checked | Files referenced by absolute paths are not included in the packaged project.
Yes | Unchecked | Files referenced by absolute paths are put into a ZIP file within the packaged project.
Note:
  • If there are any source files located on a different drive than the .vtp project file, and if there are files referenced by absolute paths in the source files, Silk Test Classic treats the source files as referenced by absolute paths. The assumption is that the absolute paths will be available from the new location. Silk Test Classic therefore puts the files into a zip file within the packaged project for you to unpack after you unpack the project.
  • Files not included in the package - The assumption is that since these files are referenced by absolute paths, these same files and paths will be available when the files are unpacked. On unpacking, Silk Test Classic warns you about these files and lists them in a log file (manifest.XXX).
  • ip files – Because you elected not to use links for files referenced by absolute paths, these files are put into a zip file within the packaged project. The zip file is named with the root of the absolute path. For example, if the files are located on c:/, the zip file is named c.zip.

Tips for successful packaging and unpacking

For best results when packaging and unpacking Silk Test Classic projects:

  • Put your .vtp project file and source files on the same drive.
  • Use relative paths to reference the following:
    • include statements
    • options sets
    • use paths set within the Runtime Options dialog box
    • use statements in 4Test scripts
    • script statements
  • Uncheck the default Use links for absolute files? check box if your source files are on a different drive as the .vtp project file and if there are files referenced by absolute paths in your source files.

Packaging with Silk Test Classic Runtime and the Agent

If you are running Silk Test Classic Runtime, you may not package or email a project.

If you are running the Agent, you may package or email a project.

  • Emailing a Project
    Automatically package a project and email it to an email address.
Parent topic: Silk Test Classic Projects
Related concepts
Contacting Micro Focus
Starting Silk Test Classic from the Command Line
Working with Folders in a Project
Related tasks
Exporting a Project
Emailing a Project
Related reference
Project Explorer


Emailing a Project

Emailing a project automatically packages a Silk Test Classic project and then emails it to an email address. In order for this to work, you must have an email client installed on the computer that is running Silk Test Classic.

You cannot email a project if you are running Silk Test Classic Runtime.

One of the options you can select before emailing is to compile your project. If a compile error occurs, Silk Test Classic displays a warning message, and you can opt to continue or to cancel the email.

Silk Test Classic supports any MAPI-compliant email clients such as Outlook Express.

The maximum size for the emailed project is determined by your email client. Silk Test Classic does not place any limits on the size of the project.

To email your project:

  1. If your project is not already open, click File > Open Project or click Open Project > Open Project on the basic workflow bar. Select a project, then click Open.
  2. Click File > Email Project. You can only email a project if you have that project open.
  3. On the Email Project dialog box, type the email address where you want to send the Silk Test Classic project. For example, enter support@acme.com to send a package to Acme Technical Support.
    Tip: If you are not sure about the email address, you can just enter some text here. Once you click OK, this information is passed to your default mail system where you can correct the address.
  4. Optional: Check the Create file references for files with absolute paths check box to use links for any absolute file reference. By default, this check box is checked.
    Note: Using references for absolute paths produces a smaller package that can be opened more quickly.
  5. Optional: Check the Compile before exporting check box to compile the project before emailing it. By default, this check box is checked.
  6. Optional: Check the Include results files of all tests (.res, .rex, and .xlg) check box to include .res, .rex, and .xlg results files in the emailed project. Only results files that were added to the Results folder of the project are emailed. By default, this check box is unchecked.
  7. Optional: Check the Include extend.ini file check box to include extensions that you have configured for target machines in the project that you export. Typically, when working with a project, extension configurations are stored in the project specific project.ini file. However, you can also configure extensions for target machines in the extend.ini file, by using the Extension Enabler, a tool which is available from the Start menu. By default, this check box is unchecked.
  8. Optional: Check the Protect Silk Test Classic package files with password check box to secure the compressed file with a password. If you have secured the compressed file with a password, you cannot extract any files from the compressed package without specifying this password. This option is available only when you have checked the Export to single Silk Test Classic package check box.
    1. Type the password into the Enter password field. A password may include up to 79 alphanumeric characters.
    2. Re-enter the password into the Confirm password field to confirm it.
  9. Click OK. If you opted to compile the project before packaging it, Silk Test Classic displays a warning message if any file failed to compile. Silk Test Classic opens a new email message and attaches the packaged project to a message. You can edit the recipient, add a subject line, and text, just as you can for any outgoing message.
  10. Click Send to add the project to your outgoing queue. If your email client is already open, your message is sent automatically. If your email client was not open, the message is placed in your outgoing queue.
Note: If the email process does not finish successfully, Micro Focus recommends deleting any partially packaged project or draft email message and restarting the email process.
Parent topic: Packaging a Silk Test Classic Project
Related concepts
Packaging a Silk Test Classic Project
Starting Silk Test Classic from the Command Line
Related tasks
Exporting a Project
Opening an Existing Project


Exporting a Project

Exporting a Silk Test Classic project lets you copy all the files associated with a project to a directory or a single compressed file in a directory.

You cannot export a project if you are running Silk Test Classic Runtime.

Silk Test Classic will not change the file creation dates when copying the project’s files.

One of the options you can select before exporting is to compile your project. If a compile error occurs, Silk Test Classic displays a warning message, and you can opt to continue or to cancel the compile.

To export your project:

  1. If your project is not already open, click File > Open Project or click Open Project > Open Project on the basic workflow bar. Select a project, then click Open.
  2. Click File > Export Project. You can only export a project if you have the project open.
  3. On the Export Project dialog box, enter the directory to which you want to export the project or click Browse button to locate the export folder. The default location is the parent directory of the project folder, which means the folder containing the project file, not the project's current location.
  4. Check the Export to single Silk Test Classic package check box if you want to package the Silk Test Classic project into a single compressed file.
  5. Optional: Check the Create file references for files with absolute paths check box to use links for any absolute file reference. By default, this check box is checked.
    Note: Using references for absolute paths produces a smaller package that can be opened more quickly.
  6. Optional: Check the Compile before exporting check box to compile the project before exporting it. By default, this check box is checked.
  7. Optional: Check the Include results files of all tests check box to include .res and .rex results files in the exported project or package. Only results files that were added to the Results folder of the project are exported. By default, this check box is unchecked.
  8. Optional: Check the Include extend.ini file check box to include extensions that you have configured for target machines in the project that you export. Typically, when working with a project, extension configurations are stored in the project specific project.ini file. However, you can also configure extensions for target machines in the extend.ini file, by using the Extension Enabler, a tool which is available from the Start menu. By default, this check box is unchecked.
  9. Optional: Check the Protect Silk Test Classic package files with password check box to secure the compressed file with a password. If you have secured the compressed file with a password, you cannot extract any files from the compressed package without specifying this password. This option is available only when you have checked the Export to single Silk Test Classic package check box.
    1. Type the password into the Enter password field. A password may include up to 79 alphanumeric characters.
    2. Re-enter the password into the Confirm password field to confirm it.
  10. Click OK. Silk Test Classic determines all the files necessary for the project and copies them to the selected directory or compresses them into a package. Silk Test Classic displays a warning message if any of the files could not be successfully packaged and gives you the option of continuing.
Tip: If the export process does not finish successfully, Micro Focus recommends deleting any partially packaged project and restarting the export process.
Parent topic: Silk Test Classic Projects
Related concepts
Moving Files Between Projects
Working with Folders in a Project
Related tasks
Emailing a Project
Opening an Existing Project


Troubleshooting Projects

This section provides solutions to common problems that you might encounter when you are working with projects in Silk Test Classic.

  • Files Not Found When Opening Project
    Describes what you can do if Silk Test Classic cannot find a referenced file when opening your project.
  • Silk Test Classic Cannot Load My Project File
    Describes what you can do if Silk Test Classic cannot load your project file.
  • Silk Test Classic Cannot Save Files to My Project
    Describes what you can do if Silk Test Classic cannot save files to your project.
  • Silk Test Classic Does Not Run
    Describes what you can do if Silk Test Classic does not start.
  • My Files No Longer Display In the Recent Files List
    Describes why files may no longer display in the Recent Files list.
  • Cannot Find Items In Classic 4Test
    Describes what you can do if you cannot find items in Classic 4Test.
  • Editing the Project Files
    To edit the <projectname>.vtp and <projectname>.ini files, open the files in a text editor outside of Silk Test Classic.
Parent topic: Silk Test Classic Projects
Parent topic: Troubleshooting the Open Agent
Related concepts
Moving Files Between Projects
Packaging a Silk Test Classic Project
Working with Folders in a Project


Files Not Found When Opening Project

If, when opening your project, Silk Test Classic cannot find a file in the location referenced in the project file, which is a .vtp file, an error message displays noting the file that cannot be found.

Silk Test Classic may not be able to find files that have been moved or renamed outside of Silk Test Classic, for example in Windows Explorer, or files that are located on a shared network folder that is no longer accessible.
  • If Silk Test Classic cannot find a file in your project, we suggest that you note the name of missing file, and click OK. Silk Test Classic will open the project and remove the file that it cannot find from the project list. You can then add the missing file to your project.
  • If Silk Test Classic cannot open multiple files in your project, we suggest you click Cancel and determine why the files cannot be found. For example a directory might have been moved. Depending upon the problem, you can determine how to make the files accessible to the project. You may need to add the files from their new location.
Parent topic: Troubleshooting Projects
Related tasks
Adding Existing Files to a Project


Silk Test Classic Cannot Load My Project File

If Silk Test Classic cannot load your project file, the contents of your .vtp file might have changed or your .ini file might have been moved.

If you remove or incorrectly edit the ProjectIni= line in the ProjectProfile section of your <projectname>.vtp file, or if you have moved your <projectname>.ini file and the ProjectIni= line no longer points to the correct location of the .ini file, Silk Test Classic is not able to load your project.

To avoid this, make sure that the ProjectProfile section exists in your .vtp file and that the section refers to the correct name and location of your .ini file. Additionally, the <projectname>.ini file and the <projectname>.vtp file refer to each other, so ensure that these references are correct in both files. Perform these changes in a text editor outside of Silk Test Classic.

Example

The following code sample shows a sample ProjectProfile section in a <projectname>.vtp file:
[ProjectProfile]
ProjectIni=C:\Program Files\<Silk Test install directory>\SilkTest\Projects\<projectname>.ini
Parent topic: Troubleshooting Projects
Related concepts
Silk Test Classic Does Not Run
Related reference
Silk Test Classic File Types


Silk Test Classic Cannot Save Files to My Project

You cannot add or remove files from a read-only project. If you attempt to make any changes to a read-only project, a message box displays indicating that your changes will not be saved to the project.

For example, Unable to save changes to the current project. The project file has read-only attributes.

When you click OK on the error message box, Silk Test Classic adds or removes the file from the project temporarily for that session, but when you close the project, the message box displays again. When you re-open the project, you will see your files have not been added or removed.

Additionally, if you are using Microsoft Windows 7 or later, you might need to run Silk Test Classic as an administrator. To run Silk Test Classic as an administrator, right-click the Silk Test Classic icon in the Start Menu and click Run as administrator.

Parent topic: Troubleshooting Projects


Silk Test Classic Does Not Run

The following table describes what you can do if Silk Test Classic does not start.

If Silk Test Classic does not run because it is looking for the following: You can do the following:
Project files that are moved or corrupted.

Open the SilkTestClassic.ini file in a text editor and remove the CurrentProject= line from the ProjectState section. Silk Test Classic should then start, however your project will not open. You can examine your <projectname>.ini and <projectname>.vtp files to determine and correct the problem.

The following code example shows the ProjectState section in a sample partner.ini file:
[ProjectState]
CurrentProject=C:\Program Files\<SilkTest install directory>
  \SilkTest\Examples\ProjectName.vtp
A testplan.ini file that is corrupted. Delete or rename the corrupted testplan.ini file, and then restart Silk Test Classic.
Parent topic: Troubleshooting Projects
Related concepts
Silk Test Classic Cannot Load My Project File


My Files No Longer Display In the Recent Files List

After you open or create a project, files that you had recently opened outside of the project do no longer display in the Recent Files list.

Parent topic: Troubleshooting Projects


Cannot Find Items In Classic 4Test

If you are working with Classic 4Test, objects display in the correct nodes on the Global tab, however when you double-click an object, the file opens and the cursor displays at the top of the file, instead of in the line in which the object is defined.

Parent topic: Troubleshooting Projects


Editing the Project Files

You require good knowledge of your files and how the partner and <projectname>.ini files work before attempting to edit these files. Be cautious when editing the <projectname>.vtp and <projectname>.ini files.

To edit the <projectname>.vtp and <projectname>.ini files:

  1. Update the references to the source location of your files. If the location of your projectname.vtp and projectname.ini files has changed, make sure you update that as well. Each file refers to the other.

The ProjectProfile section in the projectname.vtp file is required. Silk Test Classic will not be able to load your project if this section does not exist.

  1. Ensure that your project is closed and that all the files referenced by the project exist.
  2. Open the <projectname>.vtp and <projectname>.ini files in a text editor outside of Silk Test Classic.
    Note: Do not edit the projectname.vtp and projectname.ini files in the 4Test Editor.
  3. Update the references to the source location of your files.
  4. The <projectname>.vtp and <projectname>.ini files refer to each other. If the relative location of these files has changed, update the location in the files.
The ProjectProfile section in the <projectname>.vtp file is required. Silk Test Classic is not able to load your project if this section does not exist.
Parent topic: Troubleshooting Projects


Project Description Dialog Box

Use the Project Description dialog box to view or edit the description of the current project.

Open a project and click Project > Project Description.

Description
Displays the description of this project. The original description is the text that you typed in the Description field on the Create Project dialog box or the AutoGenerate Project dialog box when you created the project. You can modify the project description as necessary, typing up to 1024 characters. The project description is stored in the System Settings section of the projectname.vtp file.
Parent topic: Silk Test Classic Projects


Application Configuration

This functionality is supported only if you are using the Open Agent.

An application configuration defines how Silk Test Classic connects to the application that you want to test. Silk Test Classic automatically creates an application configuration when you create the base state. However, at times, you might need to modify, remove, or add an additional application configuration. For example, if you are testing an application that modifies a database and you use a database viewer tool to verify the database contents, you must add an additional application configuration for the database viewer tool.

  • For a Windows application, an application configuration includes the following:
    • Executable pattern

      All processes that match this pattern are enabled for testing. For example, the executable pattern for Internet Explorer is *\IEXPLORE.EXE. All processes whose executable is named IEXPLORE.EXE and that are located in any arbitrary directory are enabled.

    • Command line pattern

      The command line pattern is an additional pattern that is used to constrain the process that is enabled for testing by matching parts of the command line arguments (the part after the executable name). An application configuration that contains a command line pattern enables only processes for testing that match both the executable pattern and the command line pattern. If no command-line pattern is defined, all processes with the specified executable pattern are enabled. Using the command line is especially useful for Java applications because most Java programs run by using javaw.exe. This means that when you create an application configuration for a typical Java application, the executable pattern, *\javaw.exe is used, which matches any Java process. Use the command line pattern in such cases to ensure that only the application that you want is enabled for testing. For example, if the command line of the application ends with com.example.MyMainClass you might want to use *com.example.MyMainClass as the command line pattern.

  • For a web application in a desktop browser on the local machine, an application configuration includes only the browser type.
  • For a web application in Apple Safari or in Microsoft Edge on a remote machine, an application configuration includes the following:
    • Browser type.
    • Connection string.
  • For a web application in a mobile browser, an application configuration includes the following:
    • Browser type.
    • Connection string.
  • For a native mobile application, an application configuration includes the following:
    • Connection string.
    • Simple application name. If multiple applications on the mobile device have the same name, the fully qualified name of the application is used.
Note: Do not add more than one browser application configuration when testing a web application with a defined base state.

  • Configuring Applications
    Describes how Silk Test Classic supports configuring applications.
  • Modifying an Application Configuration
    Define how Silk Test Classic connects to the application that you want to test.
  • Application Configuration Errors
    Lists the possible issues that may lead to the failure of attaching to an application as well as the suggested solutions for these issues.
  • Troubleshooting Application Configurations
    Provides useful information on handling potential difficulties while configuring the applications that you want to test.
  • Application Configuration Dialog Box
    Describes the Application Configuration dialog box.
Related concepts
Application Configuration Errors
Connection String for a Remote Desktop Browser
Connection String for a Mobile Device
Related tasks
Modifying an Application Configuration
Related reference
Prerequisites for Replaying Tests with Google Chrome


Configuring Standard Applications

A standard application is an application that does not use a Web browser, such as a Windows application or Java SWT application.

Configure the application that you want to test to set up the environment that Silk Test Classic will create each time you record or replay a test case.

  1. Start the application that you want to test.
  2. Click Configure Applications on the basic workflow bar. If you do not see Configure Applications on the workflow bar, ensure that the default agent is set to the Open Agent. The Select Application dialog box opens.
  3. Select the Windows tab.
  4. Select the application that you want to test from the list.
    Note: If the application that you want to test does not appear in the list, uncheck the Hide processes without caption check box. This option, checked by default, is used to filter only those applications that have captions.
  5. Optional: Check the Create Base State check box to create a base state for the application under test. By default, the Create Base State check box is checked for projects where a base state for the application under test is not defined, and unchecked for projects where a base state is defined. An application’s base state is the known, stable state that you expect the application to be in before each test begins execution, and the state the application can be returned to after each test has ended execution. When you configure an application and create a base state, Silk Test Classic adds an include file based on the technology or browser type that you enable to the Use files location in the Runtime Options dialog box.
  6. Click OK.
    • If you have checked the Create Base State check box, the Choose name and folder of the new frame file page opens. Silk Test Classic configures the recovery system and names the corresponding file frame.inc by default.
    • If you have not checked the Create Base State check box, the dialog box closes and you can skip the remaining steps.
  7. Navigate to the location in which you want to save the frame file.
  8. In the File name text box, type the name for the frame file that contains the default base state and recovery system. Then, click Save. Silk Test Classic creates a base state for the application and opens the include file.
  9. Record the test case whenever you are ready.
Note: For SAP applications, you must set Ctrl+Alt as the shortcut key combination to use. To change the default setting, click Options > Recorder and then check the OPT_ALTERNATE_RECORD_BREAK check box.
Parent topic: Configuring Applications
Parent topic: Testing Windows API-Based Applications
Related concepts
Base State
Understanding the Recovery System for the Classic Agent
Dynamic Object Recognition
Related tasks
Configuring Web Applications
Configuring Mobile Applications
Recording Test Cases for Standard and Web Applications


Configuring Web Applications

This functionality is supported only if you are using the Open Agent.

Configure the web application that you want to test to set up the environment that Silk Test Classic will create each time you record or replay a test case. If you are testing a web application or an application that uses a child technology domain of the xBrowser technology domain, for example an Apache Flex application, use this configuration.
  1. Click Configure Applications on the basic workflow bar. If you do not see Configure Applications on the workflow bar, ensure that the default agent is set to the Open Agent. The Select Application dialog box opens.
  2. Select the Web tab.
  3. Select the browser that you want to use from the list of available browsers. If you want to record a test against a web application, select a browser that is supported for recording. To see which browsers are supported for recording, refer to the Release Notes.
  4. Specify the web page to open in the Enter URL to navigate text box or click Use URL from running browser.
  5. Optional: If you want to test a web application on a desktop browser with a predefined browser size, select the browser size from the Browser size list.
    For example, to test a web application on Apple Safari and in a browser window which is as big as the screen of the Apple iPhone 7, select Apple iPhone 7 from the list.
  6. Optional: Select an Orientation for the browser window.
  7. Optional: Check the Create Base State check box to create a base state for the application under test. By default, the Create Base State check box is checked for projects where a base state for the application under test is not defined, and unchecked for projects where a base state is defined. An application’s base state is the known, stable state that you expect the application to be in before each test begins execution, and the state the application can be returned to after each test has ended execution. When you configure an application and create a base state, Silk Test Classic adds an include file based on the technology or browser type that you enable to the Use files location in the Runtime Options dialog box.
  8. Click OK.
    • If you have checked the Create Base State check box, the Choose name and folder of the new frame file page opens. Silk Test Classic configures the recovery system and names the corresponding file frame.inc by default.
    • If you have not checked the Create Base State check box, the dialog box closes and you can skip the remaining steps.
  9. Navigate to the location in which you want to save the frame file.
  10. In the File name text box, type the name for the frame file that contains the default base state and recovery system. Then, click Save. Silk Test Classic creates a base state for the application. By default, Silk Test Classic lists the caption of the main window of the application as the locator for the base state. Then Silk Test Classic opens the Web page.
  11. Record the test case whenever you are ready.
Parent topic: Configuring Applications
Parent topic: Testing the Component Explorer
Related concepts
Dynamic Object Recognition
Related tasks
Configuring Standard Applications
Configuring Mobile Applications
Recording Test Cases for Standard and Web Applications
Recording Test Cases for Mobile Applications


Configuring Mobile Applications

This functionality is supported only if you are using the Open Agent.

This topic describes how you can configure a native mobile application that runs on a mobile device or an emulator. To configure a mobile web application, see Configuring Web Applications.

Configure the native mobile application that you want to test to set up the environment that Silk Test Classic creates each time that you record or replay a test case.

  1. Start the device or emulator on which you want to test the native mobile application.
  2. Click Configure Applications on the basic workflow bar. If you do not see Configure Applications on the workflow bar, ensure that the default agent is set to the Open Agent. The Select Application dialog box opens.
  3. Select the Mobile tab.
  4. To test a native mobile application (app):
    1. Select the mobile device, on which you want to test the app, from the list.
    2. Click Browse to select the app file or enter the full path to the app file into the Mobile app file text field. Silk Test Classic supports HTTP and UNC formats for the path. Silk Test Classic installs the app on the mobile device or emulator.
  5. Optional: Check the Create Base State check box to create a base state for the application under test. By default, the Create Base State check box is checked for projects where a base state for the application under test is not defined, and unchecked for projects where a base state is defined. An application’s base state is the known, stable state that you expect the application to be in before each test begins execution, and the state the application can be returned to after each test has ended execution. When you configure an application and create a base state, Silk Test Classic adds an include file based on the technology or browser type that you enable to the Use files location in the Runtime Options dialog box.
  6. Click OK.
    • If you have checked the Create Base State check box, the Choose name and folder of the new frame file page opens. Silk Test Classic configures the recovery system and names the corresponding file frame.inc by default.
    • If you have not checked the Create Base State check box, the dialog box closes and you can skip the remaining steps.
  7. Navigate to the location in which you want to save the frame file.
  8. In the File name text box, type the name for the frame file that contains the default base state and recovery system. Then, click Save. Silk Test Classic creates a base state for the application and opens the include file.
  9. Record the test case whenever you are ready.
Parent topic: Configuring Applications
Related concepts
Base State
Related tasks
Configuring Web Applications
Configuring Standard Applications
Recording Test Cases for Standard and Web Applications
Recording Test Cases for Mobile Applications


Select Application Dialog Box

This functionality is supported only if you are using the Open Agent.

Use the Select Application dialog box to select the application that you want to test, to associate an application with an object map, or to add an application configuration to a test. Application types are listed in tabs on the dialog box. Select the tab for the application type you want to use.

Windows
Lists all Microsoft Windows applications that are running on the system. Select an item from the list and click OK.

Use the Hide processes without caption check box to filter out applications that have no caption.

Web

Lists all available browsers, including mobile browsers on any connected mobile devices and Apple Safari on a Mac. Specify the web page to open in the Enter URL to navigate text box. If an instance of the selected browser is already running, you can click Use URL from running browser to record against the URL currently displayed in the running browser instance. When selecting a browser size, you can also select an Orientation for the selected browser.

Note: Do not add more than one browser application configuration when testing a web application with a defined base state.
Mobile
Lists all available mobile devices and all running Android emulators, including devices connected to a remote location. Select this tab to test mobile native applications. You can select to test the mobile application (app) that is currently running on the selected mobile device, or you can browse for or manually specify the name or file of the app that you want to test.
Parent topic: Configuring Applications
Related concepts
Connection String for a Mobile Device
Connection String for a Remote Desktop Browser
Related tasks
Creating a New File
Modifying an Application Configuration
Editing Remote Locations


Modifying an Application Configuration

An application configuration defines how Silk Test Classic connects to the application that you want to test. Silk Test Classic automatically creates an application configuration when you create the base state. However, at times, you might need to modify, remove, or add an additional application configuration. For example, if you are testing an application that modifies a database and you use a database viewer tool to verify the database contents, you must add an additional application configuration for the database viewer tool.
  1. Click Options > Application Configurations. The Edit Application Configurations dialog box opens and lists the existing application configurations.
  2. To add an additional application configuration, click Add application configuration.
    Note: Do not add more than one browser application configuration when testing a web application with a defined base state.
    The Select Application dialog box opens. Select the tab and then the application that you want to test and click OK.
  3. To remove an application configuration, click Remove next to the appropriate application configuration.
  4. To edit an application configuration, click Edit.
  5. If you are testing a desktop application, type the executable name and file path of the desktop application that you want to test into the Executable Pattern text box. For example, you might type *\calc.exe to specify the Calculator.
  6. If you are testing a desktop application and you want to use a command line pattern in combination with the executable file, type the command line pattern into the Command Line Pattern text box.
  7. To test a web application or a mobile web application, select one of the installed browsers or mobile browsers from the list. You can also click Change to open the Select Application dialog box and then select the browser that you want to use.
  8. If you are testing a web application, type the web address for the web page to launch when a test begins into the URL to navigate text box.
  9. To detect any visual breakpoints for a web application, click Analyze. For additional information, see Detecting Visual Breakpoints.
  10. Optional: If you want to test a web application on a desktop browser with a predefined browser size, select the browser size from the Browser size list.
    For example, to test a web application on Apple Safari and in a browser window which is as big as the screen of the Apple iPhone 7, select Apple iPhone 7 from the list.
  11. Optional: Select an Orientation for the browser window.
  12. If you are testing a mobile application or a web application on Apple Safari, type the connection string into the Connection String text box. For additional information, see Connection String.
  13. Click OK.
Parent topic: Application Configuration
Related concepts
Select Application Dialog Box
Related tasks
Editing Remote Locations
Related reference
Application Configuration Errors


Application Configuration Errors

When the program cannot attach to an application, the following error message opens:
Failed to attach to application <Application Name>. For additional information, refer to the Help.

In this case, one or more of the issues listed in the following table may have caused the failure:

Issue | Reason | Solution
Time out
  • The system is too slow.
  • The size of the memory of the system is too small.
Use a faster system or try to reduce the memory usage on your current system.
User Account Control (UAC) fails | You have no administrator rights on the system. | Log in with a user account that has administrator rights.
Command-line pattern | The command-line pattern is too specific. This issue occurs especially for Java. The replay may not work as intended. | Remove ambiguous commands from the pattern.
  • The Select Browser dialog box does not display when running a test against a Web application.
  • Multiple browser instances are started when running a test against a Web application.
  • When running a test against a Web application with a browser instance open, Silk Test Classic might stop working.
A base state and multiple browser application configurations are defined for the test case. Remove all browser application configurations except one from the test case.
Playback error when running a test

No application configuration is defined for the test.

The following exception might be displayed:

No application configuration present.
  • When running a keyword-driven test, ensure that a keyword which executes the base state is included in the test.
  • Ensure that an application configuration is configured for the current project.
Parent topic: Application Configuration
Related concepts
Application Configuration
Related tasks
Modifying an Application Configuration
Related reference
Troubleshooting Application Configurations


Troubleshooting Application Configurations

Why is my application not displayed in the Select Application dialog box

  • Uncheck the Hide processes without caption check box. This check box is checked by default and prevents applications without a caption from being displayed in the dialog box.
  • Run Silk Test Classic with elevated privileges.
    1. Close Silk Test Classic.
    2. Stop the Open Agent.
    3. Run Silk Test Classic as an administrator.
  • Use the Task Manager to check if the application is running under a different user account.
  • Ensure that the application is not started with the runas command or a similar command.
Parent topic: Application Configuration
Related reference
Application Configuration Errors


Application Configuration Dialog Box

This functionality is supported only if you are using the Open Agent.

Use the Application Configuration dialog box to add or edit tech domains for applications.

Click Options > Application Configurations.

You can position the mouse over each field to display a tool tip that provides information about that field.

Executable Pattern type
The application executable file name that you want to add or edit. The pattern is case insensitive and allows an asterisk (*) as a wild card, which matches any text of any length, and a question mark (?), which matches one character.
Command Line Pattern
If a pattern is specified in the Command Line Pattern column, Silk Test Classic enables tech domains only for the processes that match the module pattern and the command line pattern. If no command line pattern is defined, all processes with the specified module pattern are enabled. The command line pattern is case insensitive and allows an asterisk (*) as a wild card, which matches any text of any length, and a question mark (?), which matches one character.
Tech Domains
Type the tech domains that your application requires.
Remove
Click to remove the existing application configuration.
Add
Click to add an application configuration.
Parent topic: Application Configuration


Understanding the Recovery System for the Open Agent

The built-in recovery system is one of the most powerful features of Silk Test Classic because it allows you to run tests unattended. When your application fails, the recovery system restores the application to a stable state, known as the BaseState, so that the rest of your tests can continue to run unattended.

The recovery system can restore your application to its BaseState at any point during test case execution:

  • Before the first line of your test case begins running, the recovery system restores the application to the BaseState even if an unexpected event corrupted the application between test cases.
  • During a test case, if an application error occurs, the recovery system terminates the execution of the test case, writes a message in the error log, and restores the application to the BaseState before running the next test case.
  • After the test case completes, if the test case was not able to clean up after itself, for example it could not close a dialog box it opened, the recovery system restores the application to the BaseState.
  • The recovery system cannot recover from an application crash that produces a modal dialog box, such as a General Protection Fault (GPF).

Silk Test Classic uses the recovery system for all test cases that are based on DefaultBaseState or based on a chain of application states that ultimately are based on DefaultBaseState.

  • If your test case is based on an application state of none or a chain of application states ultimately based on none, all functions within the recovery system are not called. For example, SetAppState and SetBaseState are not called, while DefaultTestCaseEnter, DefaultTestCaseExit, and error handling are called.

Such a test case will be defined in the script file as:

testcase Name () appstate none

Silk Test Classic records test cases based on DefaultBaseState as:

testcase Name ()

How the default recovery system is implemented

The default recovery system is implemented through several functions.

Function | Purpose
DefaultBaseState | Restores the default BaseState, then call the application’s BaseState function, if defined.
DefaultScriptEnter | Executed when a script file is first accessed. Default action: none.
DefaultScriptExit | Executed when a script file is exited. Default action: Call the ExceptLog function if the script had errors.
DefaultTestCaseEnter | Executed when a test case is about to start. Default action: Set the application state.
DefaultTestCaseExit | Executed when a test case has ended. Default action: Call the ExceptLog function if the script had errors, then set the BaseState.
DefaultTestPlanEnter | Executed when a test plan is entered. Default action: none.
DefaultTestPlanExit | Executed when a test plan is exited. Default action: none.

You can write functions that override some of the default behavior of the recovery system.

  • Setting the Recovery System for the Open Agent
    Describes how to set the recovery system for the Open Agent.
  • Base State
    Describes the base state.
  • Modifying the Base State (Open Agent)
    Change the executable location, working directory, locator, or URL of the base state to define the state in which your application under test should be before the execution of a test starts.
  • DefaultBaseState Function
    Describes the DefaultBaseState function
  • Adding Tests that Use the Open Agent to the DefaultBaseState
    Describes how to add tests that use the Open Agent to the DefaultBaseState.
  • DefaultBaseState and the wDynamicMainWindow Object
    Describes how you can use the wDynamicMainWindow to execute the DefaultBaseState for hierarchical object recognition with the Open Agent.
  • Flow of Control
    Describes the flow of control during the execution of each of your test cases.
  • Modifying the Default Recovery System
    Describes how to modify the default recovery system.
  • Set Recovery System Dialog Box
    Describes the Set Recovery System dialog box.
Related concepts
Overview of Application States
Overriding the Default Recovery System


Setting the Recovery System for the Open Agent

The recovery system ensures that each test case begins and ends with the application in its intended state. Silk Test Classic refers to this intended application state as the BaseState. The recovery system allows you to run tests unattended. When your application fails, the recovery system restores the application to the BaseState, so that the rest of your tests can continue to run unattended.

For applications that use the Open Agent and dynamic object recognition, the recovery system is configured automatically whenever the New frame file dialog box opens and you save a file. This dialog box opens when:

  • You click Configure Applications on the Basic Workflow bar and follow the steps in the wizard.
  • You click File > New and click Test frame.
  • You click the Create a new file icon in the toolbar and then click Test frame.
  • You click Record > Testcase, Record > Application State, or Record > Window Locators before you configure an application, the New Test Frame dialog box opens before recording starts.

If you are testing an application that uses both the Classic Agent and the Open Agent, set the Agent that will start the application as the default Agent and then set the recovery system. If you use the Classic Agent to start the application, set the recovery system for the Classic Agent.

Parent topic: Understanding the Recovery System for the Open Agent
Related concepts
Open Agent
Dynamic Object Recognition
Configuring Applications
Setting the Default Agent


Base State

An application’s base state is the known, stable state that you expect the application to be in before each test case begins execution, and the state the application can be returned to after each test case has ended execution. This state may be the state of an application when it is first started.

Base states are important because they ensure the integrity of your tests. By guaranteeing that each test case can start from a stable base state, you can be assured that an error in one test case does not cause subsequent test cases to fail.

Silk Test Classic automatically ensures that your application is at its base state during the following stages:

  • Before a test case runs.
  • During the execution of a test case.
  • After a test case completes successfully.

When an error occurs, Silk Test Classic does the following:

  • Stops execution of the test case.
  • Transfers control to the recovery system, which restores the application to its base state and logs the error in a results file.
  • Resumes script execution by running the next test case after the failed test case.

The recovery system makes sure that the test case was able to "clean up" after itself, so that the next test case runs under valid conditions.

Parent topic: Understanding the Recovery System for the Open Agent
Related concepts
DefaultBaseState Function
Related tasks
Modifying the Base State (Open Agent)


Modifying the Base State (Open Agent)

This functionality is supported only if you are using the Open Agent.

To define the state in which your application under test (AUT) should be before the execution of a test, you can change the executable location, working directory, locator, or URL of the base state. For example, if you want to launch tests from a production web site that were previously tested on a testing web site, change the base state URL and the tests are executed in the new environment.

  1. Open the project for which you want to change the base state.
  2. If you are testing a web application, change the browser in which the tests will be executed in the Edit Application Configurations dialog box.
    1. Click Options > Application Configurations. The Edit Application Configurations dialog box appears.
    2. Click Edit to the right of the application configuration that you want to change. The Edit Browser Application Configuration dialog box appears.
    3. Select the browser that you want to use and click OK.
    4. If you are testing a web application or a mobile native application on a remote location, for example on a mobile device that is connected to a Mac, and you want to edit the remote location, click Change to open the Select Application dialog box and then click Edit Remote Locations.
    5. In the Edit Application Configuration dialog box, click OK.
  3. If you are testing a web application, change the URL of the web application in the .inc file.
    1. In the File tree, expand the Include/Frame node.
    2. Double click on the .inc file to open the file.
    3. Locate the URL in the file. The URL section looks similar to the following:
      // The start URL
const sUrl = "http://demo.borland.com/gmopost/";
    4. Change the URL.
    5. Save the .inc file.
  4. Optional: If you want to test a web application on a desktop browser with a predefined browser size, select the browser size from the Browser size list.
    For example, to test a web application on Apple Safari and in a browser window which is as big as the screen of the Apple iPhone 7, select Apple iPhone 7 from the list.
  5. Optional: Select an Orientation for the browser window.
  6. If you are testing a desktop application, change the application configuration in the Edit Application Configurations dialog box.
    1. Click Options > Application Configurations. The Edit Application Configurations dialog box appears.
    2. Click Edit to the right of the application configuration that you want to change. The Edit Windows Application Configuration dialog box appears.
    3. Type the executable name and file path of the desktop application that you want to test into the Executable Pattern text box. For example, you might type *\calc.exe to specify the Calculator.
    4. If you want to use a command line pattern in combination with the executable file, type the command line pattern into the Command Line Pattern text box.
  7. If you are testing a mobile native application:
    1. Click Options > Application Configurations. The Edit Application Configurations dialog box appears.
    2. Click Edit to the right of the application configuration that you want to change. The Edit Mobile Application Configuration dialog box appears.
    3. In the Connection String text box, specify the platform the location, the name of the mobile device, and the name of the mobile application that you want to test. For example, if the device ID is 11111111, the operating system of the device is Android 5.1.1, the device is connected to the remote machine with the IP address 10.0.0.1, and you want to test the application abc.apk, type:
      platformName=Android;platformVersion=5.1.1;deviceName=MotoG3;udid=11111111;host=http://10.0.0.1;app=C:\Temp\abc.apk;
Tip: If the application under test usually takes a long time to start, increase the application ready timeout in the replay options.
Parent topic: Understanding the Recovery System for the Open Agent
Related concepts
Connection String for a Mobile Device
Base State


DefaultBaseState Function

Silk Test Classic provides a DefaultBaseState for applications, which ensures the following conditions are met before recording and executing a test case:

  • The application is running.
  • The application is not minimized.
  • The application is the active application.
  • No windows other than the application’s main window are open. If the UI of the application is localized, you need to replace the strings, which are used to close a window, with the localized strings. The preferred way to replace these buttons is with the lsCloseWindowButtons variable in the object’s declaration. You can also replace the strings in the Close tab of the Agent Options dialog box.

For Web applications that use the Open Agent, the DefaultBaseState also ensures the following for browsers, in addition to the general conditions listed above:

  • The browser is running.
  • Only one browser tab is open, if the browser supports tabs and the frame file does not specify otherwise.
  • The active tab is navigated to the URL that is specified in the frame file.

For web applications that use the Classic Agent, the DefaultBaseState also ensures the following for browsers, in addition to the general conditions listed above:

  • The browser is ready.
  • Constants are set.
  • The browser has toolbars, location and status bar are displayed.
  • Only one tab is opened, if the browser supports tabs.

DefaultBaseState Types

Silk Test Classic includes two slightly different base state types depending on whether you use the Open Agent and dynamic object recognition or traditional hierarchical object recognition. When you use dynamic object recognition, Silk Test Classic creates a window object named wDynamicMainWindow in the base state. When you set the recovery system for a test that uses hierarchical object recognition, Silk Test Classic creates a window object called wMainWindow in the base state. Silk Test Classic uses the window object to determine which type of DefaultBaseState to execute.

Parent topic: Understanding the Recovery System for the Open Agent
Related concepts
Base State
Dynamic Object Recognition
Cross-Browser Testing with the Open Agent


Adding Tests that Use the Open Agent to the DefaultBaseState

If you want the recovery system to perform additional steps after it restores the default base state, record a new test case based on no application state and paste it into the declaration of the main window of your application.

  1. Open your test application and the frame file of the test application.
  2. Click Record > Testcase. Silk Test Classic displays the Record Testcase dialog box.
  3. From the Application state list box, select (None).
  4. Click Start Recording. Silk Test Classic opens the Recording window, which indicates that you can begin recording.
  5. When you have finished recording the actions that you want to perform whenever the base state is restored, click Stop on the Recording window. Silk Test Classic displays the Record Testcase dialog box.
  6. Click Paste to Editor.
  7. In the Update Files dialog box, select Paste testcase and update window declarations(s).
  8. Click OK. Silk Test Classic creates a new script file with the new test case.
  9. Add a new method named BaseState to the declaration of the main window in the test frame file.
  10. Paste the recorded actions from the script file into the new BaseState method.
  11. Choose File > Save to save the test frame file.

Examples

For example, if you want the Insurance Company web application to preselect Auto Quote each time the base state is restored, the new declaration for the main window in the frame file should look similar to the following:
window BrowserApplication WebBrowser
  locator "//BrowserApplication"

  // Go to Options -> Application Configurations... to switch the browser
  // Alternatively set sDir and sCmdLine if you want to start a custom browser

  // The working directory of the application when it is invoked
  // const sDir = "."

  // The command line used to invoke the application
  // const sCmdLine = ""

  // The start URL
  const sUrl = "http://demo.borland.com/InsuranceWebExtJS/index.jsf"

  const bCloseOtherTabs = TRUE

  // The list of windows the recovery system is to leave open
  // const lwLeaveOpenWindows = {?}
  // const lsLeaveOpenLocators = {?}
  BrowserWindow BrowserWindow
    locator "//BrowserWindow"
    DomListBox QuickLinkJumpMenu
      locator "SELECT[@id='quick-link:jump-menu']"
  // ...

  // Recorded actions, which should be performed whenever the base state of the application is restored
  Basestate()
    WebBrowser.BrowserWindow.QuickLinkJumpMenu.Select("Auto Quote")
To execute the same web application on Apple Safari on an iOS device each time the base state is restored, the new declaration for the main window in the frame file should look similar to the following:
window BrowserApplication WebBrowser
  locator "//BrowserApplication"

  // Go to Options -> Application Configurations... to switch the browser
  // Alternatively set sDir and sCmdLine if you want to start a custom browser

  // The working directory of the application when it is invoked
  // const sDir = "."

  // The command line used to invoke the application
  // const sCmdLine = ""

  // The start URL
  const sUrl = "http://demo.borland.com/InsuranceWebExtJS/index.jsf"

  const bCloseOtherTabs = TRUE

  // Overrides the browser type of the application configuration
  STRING sBrowserType = BROWSER_TYPE_SAFARI

  // Overrides the connection string of the application configuration
  STRING sConnectionString = "host=macmini1702.microfocus.com"

  // The list of windows the recovery system is to leave open
  // const lwLeaveOpenWindows = {?}
  // const lsLeaveOpenLocators = {?}
  BrowserWindow BrowserWindow
    locator "//BrowserWindow"
    DomListBox QuickLinkJumpMenu
      locator "SELECT[@id='quick-link:jump-menu']"
  // ...

  // Recorded actions, which should be performed whenever the base state of the application is restored
  Basestate()
    WebBrowser.BrowserWindow.QuickLinkJumpMenu.Select("Auto Quote")
To execute the native mobile application InsuranceMobile.apk on an Android device each time the base state is restored, the new declaration for the main window in the frame file should look similar to the following:
[-] window MobileDevice Device
    [ ] locator "/MobileDevice"
    [ ]
    [ ] // Go to Options -> Application Configurations... to switch the mobile device
    [ ] // Alternatively set sConnectionString
    [ ]
    [ ] // Overrides the connection string of the application configuration
    [ ] STRING sConnectionString = "deviceName=MotoG3;platformName=Android;app=C:\\Temp\InsuranceMobile.apk"
    [ ]
    [ ] // The list of windows the recovery system is to leave open
    [-] MobileTextField Email
        [ ] locator "@resource-id='silktest.insurancemobile:id/email'"
Parent topic: Understanding the Recovery System for the Open Agent


DefaultBaseState and the wDynamicMainWindow Object

Silk Test Classic executes the DefaultBaseState for dynamic object recognition when the default agent is the Open Agent and the global constant wDynamicMainWindow is defined. DefaultBaseState works with the wDynamicMainWindow object in the following ways:

  1. If the wDynamicMainWindow object does not exist, invoke it, either using the Invoke method defined for the MainWin class or a user-defined Invoke method built into the object.
  2. If the wDynamicMainWindow object is minimized, restore it.
  3. If there are child objects of the wDynamicMainWindow open, close them.
  4. If the wDynamicMainWindow object is not active, make it active.
  5. If there is a BaseState method defined for the wDynamicMainWindow object, execute it.
Parent topic: Understanding the Recovery System for the Open Agent
Related concepts
Dynamic Object Recognition


Flow of Control

This section describes the flow of control during the execution of each of your test cases.

  • The Non-Web Recovery Systems Flow of Control
    Describes the flow of control in the non-Web recovery system during the execution of each of your test cases.
  • How the Non-Web Recovery System Closes Windows
    Describes how the non-Web recovery system closes all windows except for the main window.
  • How the Non-Web Recovery System Starts the Application
    Describes how the non-Web recovery system starts the application.
Parent topic: Understanding the Recovery System for the Open Agent


The Non-Web Recovery Systems Flow of Control

Before you modify the recovery system, you need to understand the flow of control during the execution of each of your test cases. The recovery system executes the DefaultTestcaseEnter function. This function, in turn, calls the SetAppState function, which does the following:

  1. Executes the test case.
  2. Executes the DefaultTestcaseExit function, which calls the SetBaseState function, which calls the lowest level application state, which is either the DefaultBaseState or any user defined application state.
    Note: If the test case uses AppState none, the SetBaseState function is not called.

DefaultTestCaseEnter() is considered part of the test case, but DefaultTestCaseExit() is not. Instead, DefaultTestCaseExit() is considered part of the function that runs the test case, which implicitly is main() if the test case is run standalone. Therefore an unhandled exception that occurs during DefaultTestCaseEnter() will abort the current test case, but the next test case will run. However, if the exception occurs during DefaultTestCaseExit(), then it is occurring in the function that is calling the test case, and the function itself will abort. Since an application state may be called from both TestCaseEnter() and TestCaseExit(), an unhandled exception within the application state may cause different behavior depending on whether the exception occurs upon entering or exiting the test case.

Parent topic: Flow of Control
Related concepts
Base State
DefaultBaseState Function


How the Non-Web Recovery System Closes Windows

The built-in recovery system restores the base state by making sure that the non-Web application is running, is not minimized, is active, and has no open windows except for the main window. To ensure that only the main window is open, the recovery system attempts to close all other open windows, using an internal procedure that you can customize as you see fit.

To make sure that there are no application windows open except the main window, the recovery system calls the built-in CloseWindows method. This method starts with the currently active window and attempts to close it using the sequence of steps below, stopping when the window closes.

  1. If a Close method is defined for the window, call it.
  2. Click the Close menu item on the system menu, on platforms and windows that have system menus.
  3. Click the window’s close box, if one exists.
  4. If the window is a dialog box, type each of the keys specified by the OPT_ CLOSE_DIALOG_KEYS option and wait one second for the dialog box to close. By default, this option specifies the Esc key.
  5. If there is a single button in the window, click that button.
  6. Click each of the buttons specified by the OPT_CLOSE_WINDOW_ BUTTONS option. By default, this option specifies the Cancel, Close, Exit, and Done keys.
  7. Select each of the menu items specified by the OPT_CLOSE_WINDOW_ MENUS option. By default, this option specifies the File > Exit and the File > Quit menu items.
  8. If the closing of a window causes a confirmation dialog box to open, CloseWindows attempts to close the dialog box by clicking each of the buttons specified with the OPT_CLOSE_CONFIRM_BUTTONS option. By default, this option specifies the No button.

When the window, and any resulting confirmation dialog box, closes, CloseWindows repeats the preceding sequence of steps with the next window, until all windows are closed.

If any of the steps fails, none of the following steps is executed and the recovery system raises an exception. You may specify new window closing procedures.

In a Web application, you are usually loading new pages into the same browser, not closing a page before opening a new one.

Parent topic: Flow of Control
Related concepts
Base State
DefaultBaseState Function
Specifying New Window Closing Procedures


How the Non-Web Recovery System Starts the Application

To start a non-Web application, the recovery system executes the Invoke method for the main window of the application. The Invoke method relies on the sCmdLine constant as recorded for the main window when you create a test frame.

For example, here is how a declaration for the sCmdLine constant might look for a sample Text Editor application running under Windows:

const sCmdLine = "c:\ProgramFiles\<SilkTest install directory>\SilkTest\TextEdit.exe"

After it starts the application, the recovery system checks whether the main window is minimized, and, if it is, uses the Restore method to open the icon and restore the application to its proper size.

The limit on the sCmdLine constant is 8191 characters.

Parent topic: Flow of Control
Related concepts
Base State
DefaultBaseState Function


Modifying the Default Recovery System

The default recovery system is implemented in defaults.inc, which is located in the directory in which you installed Silk Test Classic. If you want to modify the default recovery system, instead of overriding some of its features, as described in Overriding the default recovery system, you can modify defaults.inc.

We cannot provide support for modifying defaults.inc or the results. We recommend that you do not modify defaults.inc. This file might change from version to version. As a result, if you manually modify defaults.inc, you will encounter issues when upgrading to a new version of Silk Test Classic.

If you decide to modify defaults.inc, be sure that you:

  • Make a backup copy of the shipped defaults.inc file.
  • Tell Technical Support when reporting problems that you have modified the default recovery system.
  • Overriding the Default Recovery System
    Describes how to over-ride the default recovery system.
  • Handling Login Windows
    Describes how to handle login windows.
  • Specifying Windows to be Left Open for Tests that Use the Open Agent
    Describes how to specify windows to be left open for tests that use the open agent.
  • Specifying New Window Closing Procedures
    Describes how to specify new window closing procedures for non-web recovery systems.
  • Specifying Buttons, Keys, and Menus that Close Windows
    Describes how to specify buttons, keys, and menus that close windows.
  • Recording a Close Method for Tests that Use the Open Agent
    Describes how to record a close method for tests that use the Open Agent.
Parent topic: Understanding the Recovery System for the Open Agent
Related concepts
Contacting Micro Focus
defaults.inc


Overriding the Default Recovery System

The default recovery system specifies what Silk Test Classic does to restore the base state of your application. It also specifies what Silk Test Classic does whenever:

  • A script file is first accessed.
  • A script file is exited.
  • A test case is about to begin.
  • A test case is about to exit.

You can write functions that override some of the default behavior of the recovery system.

To override | Define the following
DefaultScriptEnter | ScriptEnter
DefaultScriptExit | ScriptExit
DefaultTestCaseEnter | TestCaseEnter
DefaultTestCaseExit | TestCaseExit
DefaultTestPlanEnter | TestPlanEnter
DefaultTestPlanExit | TestPlanExit

If ScriptEnter, ScriptExit, TestcaseEnter, TestcaseExit, TestPlanEnter, or TestPlanExit are defined, Silk Test Classic uses them instead of the corresponding default function. For example, you might want to specify that certain test files are copied from a server in preparation for running a script. You might specify such processing in a function called ScriptEnter in your test frame.

If you want to modify the default recovery system, instead of overriding some of its features, you can modify defaults.inc. We do not recommend modifying defaults.inc and cannot provide support for modifying defaults.inc or the results.

Example

If you are planning on overriding the recovery system, you need to write your own TestCaseExit(Boolean bException). In the following example, DefaultTestcaseExit() is called inside TestCaseExit() to perform standard recovery systems steps and the bException argument is passed into DefaultTestCaseExit().

if (bException)
  DefaultTestcaseExit(bException)

If you are not planning to call DefaultTestcaseExit() and plan to handle the error logging in your own way, then you can use the TestcaseExit() signature without any arguments.

Use the following function signature if you plan on calling DefaultTestCaseExit(Boolean bException) or if your logic depends on whether an exception occurred. Otherwise, you can simply use the function signature of TestcaseExit() without any arguments. For example, the following is from the description of the ExceptLog() function.

TestCaseExit (BOOLEAN bException)
if (bException)
  ExceptLog()

Here, DefaultTestcaseExit() is not called, but the value of bException is used to determine if an error occurred during the test case execution.

Parent topic: Modifying the Default Recovery System
Related concepts
defaults.inc


Handling Login Windows

Silk Test Classic handles login windows differently, depending on whether you are testing Web or client/server applications. These topics provide information on how to handle login windows in your application under test.

  • Handling Login Windows in Non-Web Applications that Use the Open Agent
    Describes how to handle login windows in non-Web applications that use the Open Agent.
Parent topic: Modifying the Default Recovery System


Handling Login Windows in Non-Web Applications that Use the Open Agent

Although a non-Web application’s main window is usually displayed first, it is also common for a login or security window to be displayed before the main window.

Use the wStartup constant and the Invoke method

To handle login windows, record a declaration for the login window, set the value of the wStartup constant, and write a new Invoke method for the main window that enters the appropriate information into the login window and dismisses it. This enables the DefaultBaseState routine to perform the actions necessary to get past the login window.

You do not need to use this procedure for splash screens, which disappear on their own.

  1. Open the login window that precedes the application’s main window.
  2. Open the test frame.
  3. Click Record > Window Locators to record a locator for the window.
  4. Point to the title bar of the window and then press Ctrl+Alt. The locator is captured in the Record Window Locators dialog box.
  5. Click Paste to Editor to paste the locator into the test frame.
  6. In the Record Window Locators dialog box, click Close.
  7. Close your application.
  8. In your test frame file, find the stub of the declaration for the wStartup constant, located at the top of the declaration for the main window:
    // First window to appear when application is invoked
// const wStartup = ?
  9. Complete the declaration for the wStartup constant by:
    • Removing the comment characters, the two forward slash characters, at the beginning of the declaration.
    • Replacing the question mark with the identifier of the login window, as recorded in the window declaration for the login window.
  10. Define an Invoke method in the main window declaration that calls the built-in Invoke method and additionally performs any actions required by the login window, such as entering a name and password.

    After following this procedure, your test frame might look like this:

    window MainWin MyApp
   locator "/MainWin[@caption='MyApp']"
   const wStartup = Login

   // the declarations for the MainWin should go here
   Invoke ()
      derived::Invoke ()
      Login.Name.SetText ("Your name")
      Login.Password.SetText ("password")
      Login.OK.Click ()

window DialogBox Login
   locator "/DialogBox[@caption='Login']"

   // the declarations for the Login window go here
   PushButton OK
      locator "OK"
    Note: Regarding the derived keyword and scope resolution operator. The statement derived::Invoke ( ) uses the derived keyword followed by the scope resolution operator ( :: ) to call the built-in Invoke method, before performing the operations needed to fill in and dismiss the login window.
Parent topic: Handling Login Windows


Specifying Windows to be Left Open for Tests that Use the Open Agent

By default, the non-Web recovery system closes all windows in your test application except the main window. To specify which windows, if any, need to be left open — such as a child window that is always open — use the lwLeaveOpenWindows or lsLeaveOpenLocators constant.

lwLeaveOpenWindows and lsLeaveOpenLocators constants

When you record and paste the declarations for your application’s main window, the stub of a declaration for the lwLeaveOpenWindows constant is automatically included. Additionally, it is possible to specify windows to leave open by using XPath locator strings. These can be specified with the variable lsLeaveOpenLocators, which must be a list of strings. The following example shows the lwLeaveOpenWindows and lsLeaveOpenLocators constants before they have been edited:

// The list of windows the recovery system is to leave open
// const lwLeaveOpenWindows = {?}
// const lsLeaveOpenLocators = {?}

To complete the declaration for these constants:

  1. For lwLeaveOpenWindows, replace the question mark in the comment with the 4Test identifiers of the windows you want to be left open. Separate each identifier with a comma.
  2. For lsLeaveOpenLocators, click Record > Window Locators and record the locators that you want to include.
  3. Replace the question mark in the comment with the locator strings for the windows that you want to be left open. Separate each identifier with a comma.

  4. Remove the comment characters (the two forward slash characters) at the beginning of the lwLeaveOpenWindows declaration.

    For example, the following code shows how to set the lwLeaveOpenWindows constant so that the recovery system leaves open the window with the identifier DocumentWindow when it restores the BaseState.

    const lwLeaveOpenWindows = {DocumentWindow}

  5. Remove the comment characters (the two forward slash characters) at the beginning of the lsLeaveOpenLocators declaration.

    For example, the following code shows how to set the lsLeaveOpenLocators constant so that the recovery system leaves open the About dialog box when it restores the BaseState.

    lsLeaveOpenLocators = {“/MainWin[@caption=’*Information*’]”, “//Dialog[@caption=’About’]”}
Parent topic: Modifying the Default Recovery System
Related tasks
Recording Locators Using the Locator Spy


Specifying New Window Closing Procedures

When the recovery system cannot close a window using its normal procedure, you can reconfigure it in one of two ways:

  • If the window can be closed by a button press, key press, or menu selection, specify the appropriate option either statically in the Close tab of the Agent Options dialog box or dynamically at runtime.
  • Otherwise, record a Close method for the window.

This is only for classes derived from the MoveableWin class: DialogBox, ChildWin, and MessageBox. Specifying window closing procedures is not necessary for web pages, so this does not apply to BrowserChild objects/classes.

Parent topic: Modifying the Default Recovery System
Related concepts
Specifying Buttons, Keys, and Menus that Close Windows
Related tasks
How the Non-Web Recovery System Closes Windows
Recording a Close Method for Tests that Use the Open Agent


Specifying Buttons, Keys, and Menus that Close Windows

Specify statically

To specify statically the keys, menu items, and buttons that the non-Web recovery system should use to close all windows, choose Options > Agent and then click the Close tab.

The Close tab of the Agent Options dialog box contains a number of options, each of which takes a comma-delimited list of character string values.

Specify dynamically

As you set close options in the Agent Options dialog box, the informational text at the bottom of the dialog box shows the 4Test command you can use to specify the same option from within a script; add this 4Test command to a script if you need to change the option dynamically as a script is running.

Specify for individual objects

If you want to specify the keys, menu items, and buttons that the non-web recovery system should use to close an individual dialog box, define the appropriate variable in the window declaration for the dialog box:

  • lsCloseWindowButtons
  • lsCloseConfirmButtons
  • lsCloseDialogKeys
  • lsCloseWindowMenus

This is only for classes derived from the MoveableWin class: DialogBox, ChildWin, and MessageBox. Specifying window closing procedures is not necessary for web pages, so this does not apply to BrowserChild objects/classes.

Parent topic: Modifying the Default Recovery System
Related concepts
Specifying New Window Closing Procedures
Related tasks
Recording a Close Method for Tests that Use the Open Agent
Related reference
Agent Options Dialog Box


Recording a Close Method for Tests that Use the Open Agent

To specify the keys, menu items, and buttons that the non-web recovery system uses to close an individual dialog box, record a Close method to define the appropriate variable in the window declaration for the dialog box.

  1. Open your application.
  2. Open the application’s test frame file.
  3. Choose Record > Testcase. Silk Test Classic displays the Record Testcase dialog box.
  4. From the Application state list box, click (None).
  5. Click Start Recording. Silk Test Classic opens the Recording window, which indicates that you can begin recording the Close method.
  6. When you have finished recording the Close method, click Stop on the Recording window. Silk Test Classic redisplays the Record Testcase dialog box.
  7. Click Paste to Editor and then copy and paste the script in the declaration for the dialog box in the test frame file.
  8. Choose File > Save to save the test frame file.

You can also specify buttons, keys, and menus that close windows. This is only for classes derived from the MoveableWin class: DialogBox, ChildWin, and MessageBox. Specifying window closing procedures is not necessary for Web pages, so this does not apply to BrowserChild objects/classes.

Parent topic: Modifying the Default Recovery System
Related concepts
Specifying New Window Closing Procedures
Specifying Buttons, Keys, and Menus that Close Windows


Set Recovery System Dialog Box

Use the Set Recovery System dialog box to identify the starting point of the application you are testing, the BaseState. The recovery system will return your application to this BaseState:

  • Before running a test case.
  • During a test case.
  • If an error occurs.
  • After a test case completes.

If you are using the Basic workflow bar, click Set Recovery System .

If you are recording a test case, click Set Recovery System on the Record Application State dialog box or the Record Testcase dialog box.

Frame filename

Displays the default name and path of the frame file you are creating. This field appears only if you access this dialog box from the Basic workflow bar. The default is frame.inc. If frame.inc already exists, Silk Test appends the next logical number to the new frame file name. For example, frame1.inc.

Modify the frame file name and click Browse to specify the location in which you want to save this file. Frame files must have a .inc extension.

Application

Lists all open applications that are not minimized, including any Web applications, which are identified by the title of the currently loaded page. Click to select an application. This list is dynamic and will update if you open a new application.

If you are connected to the Open Agent, only those applications that have extensions enabled display in the list.

Command line
Displays the path to the executable (.exe) for the application that you selected. This field does not display if you have selected a Web application.
Start testing on this page
Displays the URL for the application you selected. This field displays only if you have selected a Web application. If an application displays in the list, but the URL does not display in this field, your extensions may not be enabled correctly. Click the Enable Extensions button in the Basic workflow bar to automatically enable and test extension settings.
Working directory
Displays the path of the application you selected. This field does not display if you have selected a Web application.
Window name
Displays the window name, a suggested identifier that you can use in your test cases to identify your application. You can change the window name. We recommend using a short name to identify your application.
Parent topic: Understanding the Recovery System for the Open Agent


Test Plans

A test plan usually is a hierarchically-structured document that describes the test requirements and contains the statements, 4Test scripts, and test cases that implement the test requirements. A test plan is displayed in an easy-to-read outline format, which lists the test requirements in high-level prose descriptions. The structure can be flat or many levels deep.

Indentation and color indicate the level of detail and various test plan elements. Large test plans can be divided into a master plan and one or more sub-plans. A test plan file has a .pln extension, such as find.pln.

Structuring your test plan as an hierarchical outline provides the following advantages:
  • Assists the test plan author in developing thoughts about the test problem by promoting and supporting a top-down approach to test planning.
  • Yields a comprehensive inventory of test requirements, from the most general, through finer and finer levels of detail, to the most specific.
  • Allows the statements that actually implement the tests to be shared by group descriptions or used by just a single test description.
  • Provides reviewers with a framework for evaluating the thoroughness of the plan and for following the logic of the test plan author.
  • If you are using the test plan editor, the first step in creating automated tests is to create a test plan. If you are not using the test plan editor, the first step is creating a test frame.
  • Structure of a Test Plan
    Describes the structure of a test plan.
  • Overview of Test Plan Templates
    Provides an overview of the test plan template.
  • Example Outline for Word Search Feature
    Provides sample outlines for organizing and developing the details of a test plan.
  • Converting a Results File to a Test Plan
    Use the Convert Results to Plan dialog box to convert a results file to a test plan.
  • Working with Test Plans
    Describes how you can work with test plans.
  • Working with Large Test Plans
    Describes how you can divide large test plans into a set of master plans and sub-plans to allow several staff members to work on the test plan at the same time.
  • Adding Data to a Test Plan
    Describes how you can add data to a test plan.
  • Linking Test Plans
    Describes how Silk Test Classic handles linking from a test plan to a script or test case.
  • Categorizing and Marking Test Plans
    Describes how you can work with selected tests in a test plan.
  • Using Symbols
    Describes symbols, which represent pieces of data in a data driven test case.
  • Attributes and Values
    Describes site-specific characteristics that you can define for your test plan and assign to test descriptions and group descriptions.
  • Queries
    You can use a test plan query to mark all tests that match a user-selected set of criteria, or test characteristics.
  • Testplan Detail Dialog Box
    Describes the Testplan Detail dialog box.
  • Testplan Detail - Testcase Dialog Box
    Describes the Testplan Detail - Testcase dialog box.
  • Define Attributes Dialog Box
    Describes the Define Attributes dialog box.
  • New Attribute Dialog Box
    Describes the New Attribute dialog box.
  • Update Manual Tests Dialog Box
    Describes the Update Manual Tests dialog box.
  • Duplicate Test Descriptions dialog box
    Describes the Duplicate Test Descriptions dialog box.
Related concepts
Linking the Test Plan to Scripts and Test Cases
Related tasks
Creating a New Test Plan


Structure of a Test Plan

A test plan is made up of the following elements, each of which is identified by color and indentation on the test plan.

Element | Description | Color
Comment | Provide documentation throughout the test plan; preceded by //. | Green
Group Description | High level line in the test requirements outline that describes a group of tests. | Black
Test Description | Lowest level line describing a single test case; is a statement of the functionality to be tested by the associated test case. | Blue
Test Plan Statement | Used to provide script name, test case name, test data, or include statement. | Red when a sub plan is not expanded. Magenta statement when sub-plan is expanded

A statement placed at the group description level applies to all the test descriptions contained by the group. Conversely, a statement placed at the test description level applies only to that test description. Levels in the test plan are represented by indentation.

Because there are many ways to organize information, you can structure a test plan using as few or as many levels of detail as you feel are necessary. For example, you can use a list structure, which is a list of test descriptions with no group description, or a hierarchical structure, which is a group description and test description. The goal when writing test plans is to create a top-down outline that describes all of the test requirements, from the most general to the most specific.

Parent topic: Test Plans
Related concepts
Indent and Change Levels in an Outline
Example Outline for Word Search Feature
Related tasks
Changing Colors in a Test Plan


Overview of Test Plan Templates

Because a test plan is initially empty, you may want to insert a template, which is a hierarchical outline you can use as a guide when you create a new test plan.

The template contains placeholders for each GUI object in your application. Although you may not want to structure the test plan in a way which mirrors the hierarchy of your application’s GUI, this can be a good starting point if you are new to creating test plans.

In order to be able to insert a template, you must first record a test frame, which contains declarations for each of the GUI objects in your application.

Parent topic: Test Plans
Related concepts
Overview of Test Frames
Related reference
Insert Testplan Template Dialog Box


Example Outline for Word Search Feature

Because a test plan is made up of a large amount of information, a structured, hierarchical outline provides an ideal model for organizing and developing the details of the plan. You can structure an outline using as few or as many levels of detail as you feel necessary.

The following is a series of sample outlines, ranging from a simple list structure to a more specific hierarchical structure. For completeness, each of the plans also shows the script and test case statements that link the descriptions to the 4Test scripts and test cases that implement the test requirements.

For example, consider the Find dialog box from the Text Editor application, which allows a user to search in a document. A user enters the characters to search for in the Find What text box, checks the Case sensitive check box to consider case, and clicks either the Up or Down radio button to indicate the direction of the search.

List Structure

At its simplest, an outline is a hierarchy with just a single level of detail. In other words, it is a list of test descriptions, with no group descriptions.

Using the list structure, each test is fully described by a single line, which is followed by the script and test case that implement the test. You may find this style of plan useful in the beginning stages of test plan design, when you are brainstorming the list of test requirements, without regard for the way in which the test requirements are related. It is also useful if you are creating an ad hoc test plan that runs a set of unrelated 4Test scripts and test cases.

Example for List Structure

For example:

Hierarchical Structure

The following test plan has a single level of group description, preceding the level that contains each of the test descriptions. The group description indicates that all the tests are for the Find dialog box.

As the figure shows, the test plan editor indicates levels in the outline with indentation. Each successive level is indented one level to the right. The minus icons indicate that each of the levels is fully expanded. By clicking on the minus icon at any level, you collapse the branch below that level. When working with large test plans, collapsing and expanding test plan detail makes it easy to see as much or as little of the test plan as you need. You could continue this test plan by adding a second level of group description, indicating whether or not the tests in the group are case sensitive, and even more detail by adding a third level of group descriptions which indicate whether the tests in the group search in the forward or backward direction.

Parent topic: Test Plans
Related concepts
Structure of a Test Plan
Related tasks
Linking a Description to a Script or Test Case using the Testplan Detail Dialog Box
Changing Colors in a Test Plan


Converting a Results File to a Test Plan

You can use the Convert Results to Plan dialog box to transform a results file to a test plan.

  1. Open a results file that was generated by running a script file.
  2. Click Results > Convert to Plan. The Convert Results to Plan dialog box appears.
  3. Select the results file that you want to convert.
  4. Click OK.
When creating a test plan from a results file generated for a script, the test plan editor uses the # symbol so that when this test plan is run, the testdata statement doubles as description. Since the results file was for a script, not a test plan, it does not contain any group or test case descriptions. The # symbol can be used with any test plan editor statement so that the statement will double as description.
Parent topic: Test Plans


Working with Test Plans

This section describes how you can work with test plans.

  • Creating a New Test Plan
    Create a test plan to map your test requirements to their implementation.
  • Indent and Change Levels in an Outline
    Describes the indent and change levels in an outline.
  • Adding Comments to Test Plan Results
    Describes how to add comments, which will display in the results of your tests, to a test plan.
  • Documenting Manual Tests in the Test Plan
    Describes how to document manual tests in the test plan.
  • Describing the State of a Manual Test
    Describe the state of a manual test to specify the outcome, the status, and other useful information about the test.
  • Inserting a Template
    Describes how to insert a template.
  • Changing Colors in a Test Plan
    Describes how to change colors in a test plan.
  • Linking the Test Plan to Scripts and Test Cases
    Describes how to link the test plan to scripts and test cases.
  • Insert Testplan Template Dialog Box
    Describes the Insert Testplan Template dialog box.
Parent topic: Test Plans


Creating a New Test Plan

  1. Click File > New.
  2. Click Test plan and click OK. An empty test plan window opens.
  3. Create your test plan and then click File > Save.
  4. Specify the name and location in which to save the file, and then click OK.
  5. If you are working within a project, Silk Test Classic prompts you to add the file to the project. Click Yes if you want to add the file to the open project, or No if you do not want to add this file to the project.

Before you can begin testing, you must enable extensions for applications you plan to test on both the target machine and the host machine.

Parent topic: Working with Test Plans
Related concepts
Silk Test Classic Projects


Indent and Change Levels in an Outline

You can use menu, keyboard, or toolbar commands to enter or change group and test descriptions as you are typing them. The following table summarizes the commands:

Action | Menu Item | Key
Indent one level | Outline/Move Right | ALT + forward arrow
Outdent one level | Outline/Move Left | ALT + back arrow
Swap with line above | Outline/Transpose Up | ALT + up arrow
Swap with line below | Outline/Transpose Down | ALT + down arrow

Each command acts on the current line or currently selected lines.

Silk Test Classic ignores comments when compiling, with the exception of functions and test cases. Comments within functions and test cases must be within the scope of the function/test case. If a comment is outdented beyond the scope of the function/test case, the compiler assumes that the function/test case has ended. As long as comments do not violate the function/test case scope, they can be placed anywhere on a line.

Note: Comments beyond the scope can also impact expand/collapse functionality and may prevent a function/test case from being fully expanded/collapsed. We recommend that you keep comments within scope.
Parent topic: Working with Test Plans
Related concepts
Structure of a Test Plan


Adding Comments to Test Plan Results

You can add comments to your test plans which will display in the results when you run your tests. You can annotate your tests with such comments to ease the interpretation of the test results.

To add a comment to a test plan, include the following statement in the test plan:

comment: Your comment text

For example, running the following piece of a test plan:

Find dialog
  Get the default button
    comment: This test should return Find.FindNext
    script: find.t
    testcase: GetButton

produces the following in the results file:

Find dialog
  Get the default button
    Find.FindNext
    comment: This test should return Find.FindNext
Note: You can also preface lines in all 4Test files with // to indicate a single-line comment. Such comments do not display in test plan results.
Parent topic: Working with Test Plans
Related concepts
Overview of the Results File


Documenting Manual Tests in the Test Plan

Your QA department might do some of its testing manually. You can document the manual testing in the test plan. In this way, the planning, organization, and reporting of all your testing can be centralized in one place. You can describe the state of each of your manual tests. This information is used in reports.

To indicate that a test description in the test plan is implemented with a manual test, use the value manual in the testcase statement, as in:

testcase: manual

By default, whenever you generate a report, it includes information on the tests run for that results file, plus the current results of any manual tests specified in the test plan. If the manual test results are subsequently updated, the next time you generate the report, it incorporates the latest manual results. However, this might not be what you want. If you want the report to use a snapshot of manual results, not the most recent manual results, merge the results of manual tests into the results file.

Parent topic: Working with Test Plans


Describing the State of a Manual Test

  1. Open a test plan containing manual tests.
  2. Click Testplan > Run Manual Tests.
  3. Select a manual test from the Update Manual Tests dialog box and document it. The Update Manual Tests dialog box lists all manual tests in the current test plan.
    Mark the test complete

    Click the Complete option button.

    Complete means that a test has been defined. A manual test marked here as Complete will be tabulated as complete in Completion reports.

    Indicate whether the test passed or failed
    1. Click the Has been run option button.
    2. Select Passed or Failed.
    3. Specify when the test was run and optionally, specify the machine.

    To specify when the test was run, use the following syntax:

    YYYY-MM-DD HH:MM:SS

    Hours, minutes, and seconds are optional. For example, enter 2006-01-10 to indicate that the test was run Jan 10, 2006.

    A test marked Has been run is also considered complete in Completion reports.

    Add any comments you want about the test
    Fill in the Comments text box.
Parent topic: Working with Test Plans
Related reference
Update Manual Tests Dialog Box


Inserting a Template

  1. Click Testplan > Insert Template. The Insert Testplan Template dialog box, which lists all the GUI objects declared in your test frame, opens.
  2. Select each of the GUI objects that are related to the application features you want to test. Because this is a multi-select list box, the objects do not have to be contiguous. For each selected object, Silk Test Classic inserts two lines of descriptive text into the test plan.

For example, the test plan editor would create the following template for the Find dialog box of the Text Editor application:

Tests for DialogBox Find
Tests for StaticText FindWhatText
(Insert tests here)
Tests for TextField FindWhat
(Insert tests here)
Tests for CheckBox CaseSensitive
(Insert tests here)
Tests for StaticText DirectionText
(Insert tests here)
Tests for PushButton FindNext
(Insert tests here)
Tests for PushButton Cancel
(Insert tests here)
Tests for RadioList Direction
(Insert tests here)
Parent topic: Working with Test Plans
Related concepts
Overview of Test Plan Templates
Related reference
Insert Testplan Template Dialog Box


Changing Colors in a Test Plan

You can customize your test plan so that different test plan components display in unique colors.

To change the default colors:

  1. Click Options > Editor Colors.
  2. On the Editor Colors dialog box, select the outline editor item you want to change in the Editor Item list box at the left of the dialog box.
  3. Apply a color to the item by selecting a pushbutton from the list of predefined colors or create a new color to apply by selecting the red, green, and blue values that compose the color.
    Default color | Component | Description
    Blue | Test description | Lowest level of the hierarchical test plan outline that describes a single test case.
    Red | Test plan statement | Link scripts, test cases, test data, closed sub-plans, or an include file, such as a test frame, to the test plan.
    Magenta | Include statement when sub-plan is open | Sub-plans to be included in a master plan.
    Green | Comment | Additional user information that is incidental to the outline; preceded by double slashes (//); provides documentation throughout the test plan.
    Black | Other line (group description) | Higher level lines of the hierarchical test plan outline that describe a group of tests; may be several levels in depth.
Parent topic: Working with Test Plans
Related tasks
Setting the Editor Colors


Linking the Test Plan to Scripts and Test Cases

After you create your test plan, you can associate the appropriate 4Test scripts and test cases that implement your test plan. You create this association by inserting script and testcase statements in the appropriate locations in the test plan.

There are three ways to link a script or test case to a test plan:
  • Linking a description to a script or test case using the Testplan Detail dialog box if you want to automate the process of linking scripts and test cases to the test plan.
  • Linking to a test plan manually.
  • Linking scripts and test cases to a test plan: the test plan editor automatically inserts the script and testcase statements into the plan once the recording is finished, linking the plan to the 4Test code.

You can insert a script and testcase statement for each test description, although placing a statement at the group level when possible eliminates redundancy in the test plan. For example, since it is usually good practice to place all the test cases for a given application feature into a single script file, you can reduce the redundancy in the test plan by specifying the script statement at the group level that describes that feature.

You can also insert a testcase statement at the group level, although doing so is only appropriate when the test case is data driven, meaning that it receives test data from the plan. Otherwise the same test case would be called several times with no difference in outcome.

Parent topic: Working with Test Plans
Parent topic: Linking Test Plans
Related concepts
Data-Driven Test Cases
Linking a Description to a Script or Test Case using the Testplan Detail Dialog Box
Related tasks
Linking to a Test Plan Manually
Related reference
Testplan Detail Dialog Box


Insert Testplan Template Dialog Box

Use the Insert Testplan Template dialog box to insert a hierarchical outline (template) of objects into your testplan. This dialog is only available when a testplan is open and the Testplan dialog is active. In order to be able to insert a template, you must first record a test frame, which contains declarations for each of the objects in your application.

Click Testplan > Insert Template.

Windows to create a template for

Displays a list of all the objects declared in your test frame. Select objects related to the application features you want to test in your testplan. (Press Ctrl-Click to select multiple objects.) For each selected object, two lines of descriptive text are inserted into the testplan.

Parent topic: Working with Test Plans
Related concepts
Overview of Test Plan Templates
Related tasks
Inserting a Template


Working with Large Test Plans

For large or complicated applications, the test plan can become quite large. This raises the following issues:
Issue | Solution
How to keep track of where you are in the test plan and what is in scope at that level. | Use the Testplan Detail dialog box.
How to determine which portions of the test plan have been implemented. | Produce a Completion report.
How to allow several staff members to work on the test plan at the same time. | Structure your test plan as a master plan with one or more sub-plans.

This section describes how you can divide your test plan into a master plan with one or more sub-plans to allow several staff members to work on the test plan at the same time.

  • Determining Where Values are Defined in a Large Test Plan
    Describes how to determine where values are defined in a large test plan.
  • Dividing a Test Plan into a Master Plan and Sub-Plans
    Describes how to divide a test plan into a master plan and sub-plans.
  • Creating a Sub-Plan
    Describes how to create a sub-plan.
  • Copying a Sub-Plan
    Describes how to copy a sub-plan.
  • Opening a Sub-Plan
    Describes how to open a sub-plan.
  • Connecting a Sub-Plan with a Master Plan
    Describes how to use the include statement to connect the sub-plan with the master plan.
  • Refreshing a Local Copy of a Sub-Plan
    Describes how to refresh the local copy of a sub-plan.
  • Sharing a Test Plan Initialization File
    Describes how to share a test plan initialization file.
  • Saving Changes
    Describes how to save changes to a sub-plan.
  • Overview of Locks
    Provides an overview of locks.
  • Acquiring and Releasing a Lock
    Describes how to acquire and release a lock.
  • Generating a Test Plan Completion Report
    Describes how to generate a test plan completion report.
  • Testplan Completion Report Dialog Box
    Describes the Testplan Completion Report dialog box.
Parent topic: Test Plans
Related reference
Testplan Detail Dialog Box


Determining Where Values are Defined in a Large Test Plan

  1. Place the insertion point at the relevant point in the test plan and click Testplan > Detail. The Testplan Detail dialog box opens.
  2. Click the level in the list box at the top of the Testplan Detail dialog box, to see just the set of symbols, attributes, and statements that are defined on a particular level.
  3. Once you find the level at which a symbol, attribute, or statement was defined, you can change the value at that level, causing the inherited value at the lower levels to change also.
Parent topic: Working with Large Test Plans
Related reference
Testplan Detail Dialog Box


Dividing a Test Plan into a Master Plan and Sub-Plans

If several engineers in your QA department will be working on a test plan, it makes sense to break up the plan into a master plan and sub-plans. This approach allows multi-user access, while at the same time maintaining a single point of control for the entire project.

The master plan contains only the top few levels of group descriptions, and the sub-plans contain the remaining levels of group descriptions and test descriptions. Statements, attributes, symbols, and test data defined in the master plan are accessible within each of the sub-plans.

Sub-plans are specified with an include statement. To expand the sub-plan files so that they are visible within the master plan, double-click in the left margin next to the include statement. Once a sub-plan is expanded inline, the sub-plan statement changes from red (the default color for statements) to magenta, indicating that the line is now read-only and that the sub-plan is expanded inline. At the end of the expanded sub-plan is the <eof> marker, which indicates the end of the sub-plan file.

Parent topic: Working with Large Test Plans


Creating a Sub-Plan

You create a sub-plan in the same way you create any test plan: by opening a new test plan file and entering the group descriptions, test descriptions, and the test plan editor statements that comprise the sub-plan, either manually or using the Testplan Detail dialog.

Parent topic: Working with Large Test Plans
Related reference
Testplan Detail Dialog Box


Copying a Sub-Plan

When you copy and paste the include statement and the contents of an open include file, note that only the include statement will be pasted.

To view the contents of the sub-plan, open the pasted include file by clicking Include > Open or double-click the margin to the left of the include statement.

Parent topic: Working with Large Test Plans


Opening a Sub-Plan

Open the sub-plan from within the master plan. To do this, you can either:

  • double-click the margin to the left of the include statement or
  • highlight the include statement and choose Include > Open. (Compiling a script also automatically opens all sub-plans.)

If a sub-plan does not inherit anything (that is, statements, attributes, symbols, or data) from the master plan, you can open the sub-plan directly from the File > Open dialog box.

Parent topic: Working with Large Test Plans


Connecting a Sub-Plan with a Master Plan

To connect the master plan to a sub-plan file, you enter an include statement in the master plan at the point where the sub-plan logically fits. The include statement cannot be entered through the Testplan Detail dialog box; you must enter it manually.

The include statement uses this syntax:

include:  myinclude.pln

where myinclude is the name of the test plan file that contains the sub-plan.

If you enter the include statement correctly, it displays in red, the default color used for the test plan editor statements. Otherwise, the statement displays in blue or black, indicating a syntax error (the compiler is interpreting the line as a description, not a statement).

Parent topic: Working with Large Test Plans


Refreshing a Local Copy of a Sub-Plan

When another user modifies a sub-plan, those changes are not automatically reflected in your read-only copy of the sub-plan. Once the other user has released the lock on the sub-plan, there are two ways to refresh your copy:

  1. Close and then reopen the sub-plan.
  2. Acquire a lock for the sub-plan.
Parent topic: Working with Large Test Plans
Related concepts
Acquiring and Releasing a Lock


Sharing a Test Plan Initialization File

All QA engineers working on a test plan that is broken up into a master plan and sub-plans must use the same test plan initialization file.

To share a test plan initialization file:

  1. Click Options > General.
  2. On the General Options dialog box, specify the same file name in the Data File for Attributes and Queries text box.
Parent topic: Working with Large Test Plans
Related tasks
Setting General Options


Saving Changes

When you finish editing, choose Include > Save to save the changes to the sub-plan.

Include > Save saves changes to the current sub-plan while File > Save saves all open master plans and sub-plans.

Parent topic: Working with Large Test Plans


Overview of Locks

When first opened, a master plan and its related sub-plans are read-only. This allows many users to open, read, run, and generate reports on the plan. When you need to edit the master plan or a sub-plan, you must first acquire a lock, which prevents others from making changes that conflict with your changes.

Parent topic: Working with Large Test Plans


Acquiring and Releasing a Lock

Acquire a lock

Place the cursor in or highlight one or more sub-plans and then choose Include > Acquire Lock.

The bar in the left margin of the test plan changes from gray to yellow.

Release a lock

Select Include > Release Lock.

The margin bar changes from yellow to gray.

Parent topic: Working with Large Test Plans


Generating a Test Plan Completion Report

To measure your QA department’s progress in implementing a large test plan, you can generate a completion report. The completion report considers a test complete if the test description is linked to a test case with two exceptions:
  • If the test case statement invokes a data-driven test case and a symbol being passed to the data-driven test case is assigned the value ? (undefined), the test is considered incomplete.
  • If the test case is manual and marked as Incomplete in the Update Manual Tests dialog box, the test is considered incomplete. A manual test case is indicated with the testcase:manual syntax.

To generate a test plan completion report:

  1. Open the test plan on which you want to report.
  2. Click Testplan > Completion Report to display the Testplan Completion Report dialog box.
  3. In the Report Scope group box, indicate whether the report is for the entire plan or only for those tests that are marked.
  4. To subtotal the report by a given attribute, select an attribute from the Subtotal by Attribute text box.
  5. Click Generate.

    The test plan editor generates the report and displays it in the lower half of the dialog box. If the test plan is structured as a master plan with associated sub-plans, the test plan editor opens any closed sub-plans before generating the report.

    You can:

    • Print the report.
    • Export the report to a comma-delimited ASCII file. You can then bring the report into a spreadsheet application that accepts comma-delimited data.
Parent topic: Working with Large Test Plans
Related concepts
Documenting Manual Tests in the Test Plan
Related reference
Update Manual Tests Dialog Box
Testplan Completion Report Dialog Box


Testplan Completion Report Dialog Box

Use the Testplan Completion Report dialog box to generate a report on the number of completed tests. This dialog is only available when a test plan is open and the Testplan dialog box is active.

To open the Testplan Completion Report dialog box, click Testplan > Completion Report.

The Testplan Completion Report considers a test complete if the test description is linked to a test case, with two exceptions:

  • If the testcase statement invokes a data-driven test case and a symbol being passed to the data-driven test case has the value ? (undefined) assigned, the test is considered incomplete.

  • If the test case is manual and has not been marked as complete with the Finish Test Run button on the Execute Manual Test dialog box, the test is considered incomplete.

Test plan items that are marked with attributes of type set are not categorized in a Testplan Completion Report.

Marked tests

Select to generate a report only for those tests that are marked within the test plan.

All tests

Select to generate a report for all tests within the test plan.

Subtotal by attribute

If you want to subtotal the report by a specific attribute, select an attribute from the list. Default attributes are Category, Component, and Developer.

Report tab

Displays the completion report for the selected test plan.

Print

Click to print the selected test plan completion report.

Export

Click to export the report as an ANSI, Unicode, or UTF-8 file.

Generate

Click to generate a Testplan Completion Report, based on the options you specified, for the selected test plan.

Parent topic: Working with Large Test Plans
Related tasks
Generating a Test Plan Completion Report


Adding Data to a Test Plan

This section describes how you can add data to a test plan.

  • Specifying Unique and Shared Data
    Describes how to specify unique and shared data.
  • Adding Comments in the Test Plan Editor
    Describes how to add comments in the test plan editor.
  • Testplan Editor Statements
    Describes test plan editor statements.
  • The # Operator in the Testplan Editor
    Describes the # operator in the test plan editor.
  • Using the Testplan Detail Dialog Box to Enter the testdata Statement
    Describes how to use the Testplan Detail dialog box to enter the testdata statement.
  • Entering the testdata Statement Manually
    Describes how to manually enter the testdata statement.
Parent topic: Test Plans


Specifying Unique and Shared Data

If a data value is unique to a single test description
You should place it in the plan at the same level as the test description, using the testdata statement. You can add the testdata statement using the Testplan Detail dialog box or type the testdata statement directly into the test plan.
If data is common to several tests
You can factor out the data that is common to a group of tests and define it at a level in the test plan where it can be shared by the group. To do this, you define symbols and assign them values. Using symbols results in less redundant data, and therefore, less maintenance.
Parent topic: Adding Data to a Test Plan


Adding Comments in the Test Plan Editor

Use two forward slash characters to indicate that a line in a test plan is a comment. For example:

// This is a comment

Comments preceded by // do not display in the results file. You can also specify comments using the comment statement; these comments will display in the results files.

Parent topic: Adding Data to a Test Plan


Testplan Editor Statements

You use the test plan editor keywords to construct statements, using this syntax:

keyword : value

keyword: One of the test plan editor keywords.

value: A comment, script, test case, include file, attribute name, or data value.

For example, this statement associates the script myscript.t with the plan:

script : myscript.t

Spaces before and after the colon are optional.

Parent topic: Adding Data to a Test Plan


The # Operator in the Testplan Editor

When a # character precedes a statement, the statement will double as a test description in the test plan. This helps eliminate possible redundancies in the test plan. For example, the following test description and script statement:

Script is test.t
        script:test.t

can be reduced to one line in the test plan:

#script: test.t

The test plan editor considers this line an executable statement as well as a description. Any statements that follow this "description" in the test plan and that trigger test execution must be indented.

Parent topic: Adding Data to a Test Plan


Using the Testplan Detail Dialog Box to Enter the testdata Statement

  1. Place the insertion point at the end of the test description. If a testdata statement is not associated with a test description, the compiler generates an error.
  2. Click Testplan > Detail. To provide context, the multi-line list box at the top of the Testplan Detail dialog box displays the line in the test plan that the cursor was on when the dialog box was invoked, indicated by the black arrow icon. If the test case and script associated with the current test description are inherited from a higher level in the test plan, they are shown in blue; otherwise, they are shown in black.
  3. Enter the data in the Test Data text box, separating each data element with a comma. Remember, if the test case expects a record, you need to enclose the list of data with the list constructor operator (the curly braces); otherwise, Silk Test Classic interprets the data as individual variables, not a record, and will generate a data type mismatch compiler error.
  4. Click OK. Silk Test Classic closes the Testplan Detail dialog box and enters the testdata statement and data values in the plan.
Parent topic: Adding Data to a Test Plan
Related reference
Testplan Detail Dialog Box


Entering the testdata Statement Manually

  1. Open up a new line after the test description and indent the line one level.
  2. Enter the testdata statement as follows.
    • If the test case expects one or more variables, use this syntax: testdata: data [,data], where data is any valid 4Test expression.
    • A record, use the same syntax as above, but open and close the list of record fields with curly braces: testdata: {data [,data]}, where data is any valid 4Test expression.

    Be sure to follow the testdata keyword with a colon. If you enter the keyword correctly, the statement displays in dark red, the default color. Otherwise, the statement displays in either blue or black, indicating the compiler is interpreting the line as a description.

Parent topic: Adding Data to a Test Plan


Linking Test Plans

This section describes how Silk Test Classic handles linking from a test plan to a script or test case.

  • Linking a Description to a Script or Test Case using the Testplan Detail Dialog Box
    Describes how to link a description to a script or test case using the Testplan Detail dialog box.
  • Linking a Test Plan to a Data-Driven Test Case
    Describes how to link a test plan to a data-driven test case.
  • Linking to a Test Plan Manually
    Describes how to link a test plan manually.
  • Linking a Test Case or Script to a Test Plan using the Testplan Detail Dialog Box
    Describes how the Testplan Detail dialog box automates the process of linking scrips and test cases.
  • Linking the Test Plan to Scripts and Test Cases
    Describes how to link the test plan to scripts and test cases.
  • Example of Linking a Test Plan to a Test Case
    Provides an example of linking a test plan to a test case.
Parent topic: Test Plans


Linking a Description to a Script or Test Case using the Testplan Detail Dialog Box

  1. Place the insertion cursor on either a test description or a group description.
  2. Click Testplan > Detail. The test plan editor invokes the Testplan Detail dialog box, with the Test Execution tab showing. The multi-line list box at the top of the dialog box displays the line in the test plan that the cursor was on when the dialog box was invoked, as well as its ancestor lines. The black arrow icon indicates the current line. The current line appears in black and white, and the preceding lines display in blue.
  3. If you:
    • know the names of the script and test case, enter them in the Script and Testcase fields, respectively.
    • are unsure of the script name, click the Scripts button to the right of the Script field to browse for the script file.
  4. On the Testplan Detail - Script dialog box, navigate to the appropriate directory and select a script name by double-clicking or by selecting and then clicking OK. Silk Test Classic closes the Testplan Detail - Script dialog box and enters the script name in the Script field.
  5. Click the Testcases button to the right of the Testcase field, to browse for the test case name. The Testplan Detail – Testcase dialog box shows the names of the test cases that are contained in the selected script. Test cases are listed alphabetically, not in the order in which they occur in the script.
  6. Select a test case from the list and click OK.
  7. Click OK. The script and test case statements are entered in the plan.

If you feel comfortable with the syntax of the test plan editor statements and know the locations of the appropriate script and test case, you can enter the script and test case statements manually.

Parent topic: Linking Test Plans
Related concepts
Linking the Test Plan to Scripts and Test Cases
Related reference
Testplan Detail Dialog Box


Linking a Test Plan to a Data-Driven Test Case

To link a group of test descriptions in the plan with a data-driven test case, add the test case declaration to the group description level. There are three ways to do this:

  • Linking a test case or script to a test plan using the Testplan Detail dialog box to automate the process.
  • Link to a test plan manually.
  • Record the test case from within the test plan.
Parent topic: Linking Test Plans


Linking to a Test Plan Manually

If you feel comfortable with the syntax of the test plan editor statements and know the locations of the appropriate script and test case, you can enter the script and testcase statements manually.

  1. Place the insertion cursor at the end of a test or group description and press Enter to create a new line.
  2. Indent the new line one level.
  3. Enter the script and/or test case statements using the following syntax:
    script:
scriptfilename.t testcase:
testcasename

    Where script and testcase are keywords followed by a colon, scriptfilename.t is the name of the script file, and testcasename is the name of the test case.

    If you enter a statement correctly, it displays in dark red, the default color used for statements. If not, it will either display in blue, indicating the line is being interpreted as a test description, or black, indicating it is being interpreted as a group description.

Parent topic: Linking Test Plans


Linking a Test Case or Script to a Test Plan using the Testplan Detail Dialog Box

The Testplan Detail dialog box automates the process of linking to scripts and test cases. It lets you browse directories and select script and test case names, and it enters the correct the test plan editor syntax into the plan for you.

Parent topic: Linking Test Plans


Example of Linking a Test Plan to a Test Case

For example, consider the data-driven test case FindTest, which takes a record of type SEARCHINFO as a parameter:

type SEARCHINFO is record
   STRING  sText      // Text to type in document window
   STRING  sPos       // Starting position of search
   STRING  sPattern   // String to look for
   BOOLEAN bCase      // Case-sensitive or not
   STRING  sDirection // Direction of search
   STRING  sExpected  // The expected match

testcase FindTest (SEARCHINFO Data)
   TextEditor.File.New.Pick ()
   DocumentWindow.Document.TypeKeys (Data.sText + Data.sPos)
   TextEditor.Search.Find.Pick ()
   Find.FindWhat.SetText (Data.sPattern)
   Find.CaseSensitive.SetState (Data.bCase)
   Find.Direction.Select (Data.sDirection)
   Find.FindNext.Click ()
   Find.Cancel.Click ()
   DocumentWindow.Document.VerifySelText ({Data.sExpected})
   TextEditor.File.Close.Pick ()
   MessageBox.No.Click ()

The following test plan is associated with the FindTest test case. The testcase statement occurs at the Find dialog group description level, so that each of the test descriptions in the group can call the test case and pass a unique set of data to the test case:

Testplan FindTest.pln

Find dialog
script: findtest.t
testcase: FindTest
. . . .
Parent topic: Linking Test Plans


Categorizing and Marking Test Plans

This section describes how you can work with selected tests in a test plan.

  • Marking a Test Plan
    Describes how to mark a test plan.
  • How the Marking Commands Interact
    Provides an overview for how the marking commands interact.
  • Marking One or More Tests
    Describes how to mark tests.
  • Printing Marked Tests
    Use the Print dialog box to print marked tests.
  • Mark By Query Dialog Box
    Describes the controls on the Mark By Query dialog box.
  • Mark By Named Query Dialog Box
    Describes the Mark By Named Query dialog box.
Parent topic: Test Plans


Marking a Test Plan

Marks are temporary denotations that allow you to work with selected tests in a test plan. For example, you might want to run only those tests that exercise a particular area of the application or to report on only the tests that were assigned to a particular QA engineer. To work with selected tests rather than the entire test plan, you denote or mark those tests in the test plan.

Marks can be removed at any time, and last only as long as the current work session. You can recognize a marked test case by the black stripe in the margin.

You can mark test cases by:

Choice
Select the individual test description, group description, or entire plan that you want to mark, and then choosing the appropriate marking command on the Testplan menu.
Query
You can also mark a test plan according to a certain set of characteristics it possesses. This is called marking by query. You build a query based on one or more specific test characteristics; its script file, data, symbols, or attributes, and then mark those tests that match the criteria set up in the query. For example, you might want to mark all tests that live in the find.t script and that were created by the developer named Peter. If you name and save the query, you can reapply it in subsequent work sessions without having to rebuild the query or manually remark the tests that you’re interested in working with.
Test failure
After running a test plan, the generated results file might indicate test failures. You can mark these failures in the plan by selecting Results > Mark Failures in Plan. You then might fix the errors and re-run the failed tests.
Parent topic: Categorizing and Marking Test Plans


How the Marking Commands Interact

When you apply a mark using the Mark command, the new mark is added to existing marks.

When you mark tests through the query marking commands, the test plan editor by default clears all existing marks before running the query. Mark by Named Query supports sophisticated query combinations, and it would not make sense to retain previous marks. However, Mark by Query, which allows one-time-only queries, lets you override the default behavior and retain existing marks.

To retain existing marks, uncheck the Unmark All Before Query check box in the Mark by Query dialog box.

Parent topic: Categorizing and Marking Test Plans
Related reference
Mark By Query Dialog Box


Marking One or More Tests

To mark:

A single test
Place the cursor on the test description and click Testplan > Mark.
A group of related tests
Place the cursor on the group description and click Testplan > Mark. The test plan editor marks the group description, its associated statements, and all test descriptions and statements subordinate to the group description.
Two or more adjacent tests and their subordinate tests
Select the test description of the adjacent tests and click Testplan > Mark. The test plan editor marks the test descriptions and statements of each selected test and any subordinate tests.
Parent topic: Categorizing and Marking Test Plans


Printing Marked Tests

  1. Click File > Print.
  2. In the Print dialog box, make sure the Print Marked Only check box is checked, as well as any other options you want.
  3. Click OK.
Parent topic: Categorizing and Marking Test Plans


Mark By Query Dialog Box

You can use the Mark By Query dialog box to mark a set of tests in a test plan based on a query which is constructed out of a combination of attributes, symbols, the script, the test case, and the test data. This dialog box is only available when a test plan window is active.

To open the Mark By Query dialog box click Testplan > Mark by Query.

The dialog box includes the following controls:

Control
Description
Query name
Optional: The name of the query. Named queries are stored by default in the testplan.ini file. The .ini file is specified in the Data File for Attributes and Queries field in the General Options dialog box.
Unmark all before query
Check to clear all marks before running the query. Uncheck to retain existing marks. By default this check box is checked and all marks are cleared.
Mark
Click to close the dialog, run the query against the test plan, and mark all tests in the test plan that are returned by the query.

Test Execution tab

Use the Test Execution tab to select the script, test case, and test data in the test plan for which the query should search.

Control
Description
Script
Specify the full path of the script for which the query should search. To browse for the correct script, click Scripts.
Testcase
Specify the name of the test case for which the query should search. To browse for the correct test case, click Testcases. To query for test cases in a specific script you must specify the script before you can specify the test case. To build a query that marks only manual tests, type the keyword manual into the Testcase field.
Test data
Specifies the data values for which the query should search. Separate each value with a comma.

Test Attributes tab

Use the Test Attributes tab to add attribute values in the test plan to the query.

Control
Description
Category
Select a Category value to add the tests which belong to this category to the query.
Component
Select a Component value to add the tests which have this component to the query.
Developer
Select a Developer value to add the tests which are developed by this developer to the query.

Symbols tab

Use the Symbols tab to add symbols in the test plan to the query.

Note: Do not type the dollar sign ($) prefix before the symbol name. The wildcard characters * (asterisk) and ? (question mark) are supported for partial matches: * is a placeholder for 0 or more characters, and ? is a placeholder for 1 character.
Control
Description
Edit
Select a symbol from the list and then click Edit to modify the symbol in the text box below the list. Click Replace after you have made your modifications.
Remove
Select a symbol from the list and then click Remove to remove the symbol from the query.
Add
Type the symbol definition in the box below the list of symbols, and then click Add. The newly-defined symbol appears in the list and is added to the query.
Parent topic: Categorizing and Marking Test Plans
Related concepts
How the Marking Commands Interact
Overview of Combining Queries to Create a New Query
The Differences between Query and Named Query Commands
Related tasks
Creating a New Query


Mark By Named Query Dialog Box

Use the Mark By Named Query dialog box to create, combine, edit, or delete named queries. To use named queries, you must have defined attributes.

Click Testplan > Mark by Named Query.

Named queries are stored by default in testplan.ini. The testplan.ini file is specified in the Data File for Attributes and Queries field in the General Options dialog box.

The Mark By Named Query dialog is only available when a test plan is open and the test plan window is active.

Testplan Queries
Displays a list of existing test plan queries.
Mark
Click to mark the selected query within the test plan.
New
Click to access the New/Edit Testplan Query dialog box where you can create a new test plan query.
Combine
Click to access the Combine Testplan Queries dialog where you can select a query to combine with the currently selected test plan query.
Edit
Click to access the New/Edit Testplan Query dialog box where you can modify the currently selected test plan. The Edit button is not available until you select an existing query.
Remove
Click to delete the selected test plan query. The Remove button is not available until you select an existing query.
Parent topic: Categorizing and Marking Test Plans
Related concepts
The Differences between Query and Named Query Commands
Related tasks
Creating a New Query
Delete a Query
Combining Queries


Using Symbols

This section describes symbols, which represent pieces of data in a data driven test case.

  • Overview of Symbols
    Provides an overview of symbols.
  • Symbol Definition Statements in the Test Plan Editor
    Describes the symbol definition in the test plan editor.
  • Defining Symbols in the Testplan Detail Dialog box
    Describes how to define symbols in the Testplan Detail dialog box.
  • Assigning a Value to a Symbol
    Describes how you can use symbolname and symbolvalue to assign a value to a symbol.
  • Specifying Symbols as Arguments when Entering a testcase Statement
    Describes how to specify symbols as arguments.
Parent topic: Test Plans


Overview of Symbols

A symbol represents a piece of data in a data driven test case. It is like a 4Test identifier, except that its name begins with the $ character. The value of a symbol can be assigned locally or inherited. Locally assigned symbols display in black and symbols that inherit their value display in blue in the Testplan Detail dialog box.

For example, consider the following test plan:

The test plan in the figure uses six symbols:

  • $Text is the text to enter in the document window.
  • $Position is the position of the insertion point in the document window.
  • $Pattern is the pattern to search for in the document window.
  • $Case is the state of the Case Sensitive check box.
  • $Direction is the direction of the search.
  • $Expected is the expected match.

The symbols are named in the parameter list to the FindTest testcase, within the parentheses after the test case name.

testcase: FindTest ({ $Text, $Position, $Pattern, $Case, $Direction, $Expected })

  • The symbols are only named in the parameter list; they are not assigned values. The values are assigned at either the group or test description level, depending on whether the values are shared by several tests or are unique to a single test. If a symbol is defined at a level in the plan where it can be shared by a group of tests, each test can assign its own local value to the symbol, overriding whatever value it had at the higher level. You can tell whether a symbol is locally assigned by using the Testplan Detail dialog box: Locally assigned symbols display in black. Symbols that inherit their values display in blue.

For example, in the preceding figure, each test description assigns its own unique values to the $Pattern and the $Expected symbols. The remaining four symbols are assigned values at a group description level:

  • The $Text symbol is assigned its value at the Find dialog group description level, because all eight tests of the Find dialog enter the text Silk Test Classic into the document window of the Text Editor application.
  • The $Case symbol is assigned the value TRUE at the Case sensitive group description level and the value FALSE at the Case insensitive group description level.
  • The $Direction symbol is assigned the value Down at the Forward group description level, and the value Up at the Backward group description level.
  • The $Position symbol is assigned the value <HOME> at the Forward group description level, and the value <END> at the Backward group description level.

Because the data that is common is factored out and defined at a higher level, it is easy to see exactly what is unique to each test.

Parent topic: Using Symbols
Related reference
Testplan Detail Dialog Box


Symbol Definition Statements in the Test Plan Editor

Use symbols to define data that is shared by a group of tests in the plan. Symbol definitions follow these syntax conventions:

  • The symbol name can be any valid 4Test identifier name, but must begin with the $ character.
  • The symbol value can be any text. When the test plan editor encounters the symbol, it expands it (in the same sense that another language expands macros). For example, the following test plan editor statement defines a symbol named Color and assigns it the STRING value "Red":
    $Color = "Red"
  • To use a $ in a symbol value, precede it with another $. Otherwise, the compiler will interpret everything after the $ as another symbol. For example, this statement defines a symbol with the value Some$String: $MySymbol = "Some$$String "
  • To assign a null value to a symbol, do not specify a value after the equals sign. For example: $MyNullSymbol =
  • To indicate that a test is incomplete when generating a test plan completion report, assign the symbol the ? character. For example: $MySymbol = ?

If a symbol is listed in the argument list of a test case, but is not assigned a value before the test case is actually called, the test plan editor generates a runtime error that indicates that the symbol is undefined. To avoid this error, assign the symbol a value or a ? if the data is not yet finalized.

Parent topic: Using Symbols


Defining Symbols in the Testplan Detail Dialog box

Place the insertion cursor in the plan where you need to assign a value to a symbol.

  1. Click Testplan > Detail.
  2. Select the Symbols tab on the Testplan Detail dialog box, and enter the symbol definition in the text box to the left of the Add button. You do not need to enter the $ character; the test plan editor takes care of this for you when it inserts the definitions into the test plan.
  3. Click Add. Silk Test Classic adds the symbol to the list box above the Add text text box.
  4. Define additional symbols in the same manner, and then click OK when finished.

    Silk Test Classic closes the Testplan Detail dialog box and enters the symbol definitions, including the $ character, into the plan. If a symbol is defined at a level in the plan where it can be shared by a group of tests, each test can assign its own local value to the symbol, overriding whatever value it had at the higher level. You can tell whether a symbol is locally assigned by using the Testplan Detail dialog box: Locally assigned symbols display in black. Symbols that inherit their values display in blue.

Parent topic: Using Symbols
Related reference
Testplan Detail Dialog Box


Assigning a Value to a Symbol

You can define symbols and assign values to them by typing them into the test plan, using this syntax:

$symbolname = symbolvalue

where symbolname is any valid 4Test identifier name, prefixed with the $ character and symbolvalue is any string, list, array, or the ? character (which indicates an undefined value).

For example, the following statement defines a symbol named Color and assigns it the STRING value "Red":

$Color = "Red"

If a symbol is defined at a level in the plan where it can be shared by a group of tests, each test can assign its own local value to the symbol, overriding whatever value it had at the higher level.

Parent topic: Using Symbols


Specifying Symbols as Arguments when Entering a testcase Statement

  1. Place the insertion cursor in the test plan at the location where the testcase statement is to be inserted. Placing a symbol name in the argument list of a testcase statement only specifies the name of the symbol; you also need to define the symbol and assign it a value at either the group or test case description level, as appropriate. If you do not know the value when you are initially writing the test plan, assign a question mark (?) to avoid getting a compiler error when you compile the test plan; doing so will also cause the tests to be counted as incomplete when a Completion report is generated.
  2. Click Testplan > Detail.
  3. Enter the name of a data driven test case on the Testplan Detail dialog box, followed by the argument list enclosed in parenthesis. If the test case expects a record, and not individual values, you must use the list constructor operator (curly braces).
  4. Click OK. Silk Test Classic dismisses the Testplan Detail dialog box and inserts the testcase statement into the test plan.
Parent topic: Using Symbols
Related reference
Testplan Detail Dialog Box


Attributes and Values

Attributes are site-specific characteristics that you can define for your test plan and assign to test descriptions and group descriptions. Attributes are used to categorize tests, so that you can reference them as a group. Attributes can also be incorporated into queries, which allow you to mark tests that match the query’s criteria. Marked tests can be run as a group.

By assigning attributes to parts of the test plan, you can:

  • Group tests in the plan to distinguish them from the whole test plan.
  • Report on the test plan based on a given attribute value.
  • Run parts of the test plan that have a given attribute value.

For example, you might define an attribute called Engineer that represents the set of QA engineers that are testing an application through a given test plan. You might then define values for Engineer like David, Jesse, Craig, and Zoe, the individual engineers who are testing this plan. You can then assign the values of Engineer to the tests in the test plan. Certain tests are assigned the value of David, others the value of Craig, and so on. You can then run a query to mark the tests that have a given value for the Engineer attribute. Finally, you can run just these marked tests.

Attributes are also used to generate reports. You do not need to mark the tests or build a query in this case.

Attributes and values, as well as queries, are stored by default in testplan.ini which is located in the Silk Test Classic installation directory. The initialization file is specified in the Data File for Attributes and Queries field in the General Options dialog box.

Silk Test Classic ships with predefined attributes. You can also create up to 254 user-defined attributes.

Make sure that all the QA engineers in your group use the same initialization body file. You can modify the definition of an attribute.

Modifying attributes and values through the Define Attributes dialog box has no effect on existing attributes and values already assigned to the test plan. You must make the changes in the test plan yourself.

  • Predefined Attributes
    Describes predefined attributes in the test plan editor.
  • User Defined Attributes
    Describes user defined attributes.
  • Adding or Removing Members of a Set Attribute
    Describes how to add or remove members of a Set attribute.
  • Rules for Using + and -
    Describes rules for using the + and - operators.
  • Defining an Attribute and the Values of the Attribute
    Describes how to define an attribute and values.
  • Assigning Attributes and Values to a Test Plan
    Describes how to assign attributes and values to a test plan.
  • Assigning an Attribute from the Testplan Detail Dialog Box
    Describes how to assign an attribute from the Testplan Detail dialog box.
  • Modifying the Definition of an Attribute
    Describes how to modify the definition of an attribute.
Parent topic: Test Plans
Related tasks
Setting General Options
Related reference
Define Attributes Dialog Box


Predefined Attributes

The test plan editor has three predefined attributes:

Developer
Specifies the group of QA engineers who developed the test cases called by the test plan.
Component
Specifies the application modules to be tested in this test plan.
Category
Specifies the kinds of tests used in your QA Department, for example, Smoke Test.
Parent topic: Attributes and Values
Related concepts
User Defined Attributes


User Defined Attributes

You can define up to 254 attributes. You can also rename the predefined attributes.

The rules for naming attributes include:

  • Attribute names can be up to 11 characters long.
  • Attribute and value names are not case sensitive.
Parent topic: Attributes and Values
Related concepts
Predefined Attributes


Adding or Removing Members of a Set Attribute

You can assign multiple values to test attributes of the type Set.

For example, you might have a Set attribute called RunWhen with the following three values:
  • UI
  • regression
  • smoke
You can assign any combination of these three values to a test or a group of tests. Separate each value with a semicolon.

You can use the + operator to add members to a Set attribute and the – operator to remove members from a Set attribute.

Example 1: Using + to add values

RunWhen: UI; regression Test 1 testcase: t1 RunWhen: + smoke Test 2 testcase: t2

In this example, Test 1 has the values UI and regression.

The statement RunWhen: + smoke adds the value smoke to the previously assigned values, so Test 2 has the values UI, regression, and smoke.

Example 2: Using - to remove values

RunWhen: UI; regression Test 1 testcase: t1 RunWhen: - regression Test 2 testcase: t2

In this example, Test 1 has the values UI and regression.

The statement RunWhen: - regression removes the value regression from the previously assigned values, so Test 2 has the value UI.

Parent topic: Attributes and Values
Related concepts
Rules for Using + and -


Rules for Using + and -

  • You must follow the + or – with a space.
  • You can add or remove any number of elements with one statement. Separate each element with a semicolon.
  • You can specify + elements even if no assignments had previously been made. The result is that the elements are now assigned.
  • You can specify – elements even if no assignments had previously been made. The result is that the set’s complement is assigned. Using the previous example, specifying:
    RunWhen: - regression
    when no RunWhen assignment had previously been made results in the values UI and smoke being assigned.
Parent topic: Attributes and Values
Related concepts
Adding or Removing Members of a Set Attribute


Defining an Attribute and the Values of the Attribute

  1. Click Testplan > Define Attributes, and then click New.
  2. Type a name for the new attribute into the Name field.
  3. Select one of the following types, and then click OK.
    Normal
    You specify values when you define the attribute. Users of the attribute in a test plan pick one value from the list.
    Edit
    You don't specify values when you define the attribute. Users type their own values when they use the attribute in a test plan.
    Set
    Like normal, except that users can pick more than one value.
  4. On the Define Attributes dialog box, if you:
    • have defined an Edit type attribute, you are done. Click OK to close the dialog box.
    • are defining a Normal or Set type attribute, type a value into the Values field and click Add.

Once attributes have been defined, you can modify them.

Parent topic: Attributes and Values
Related tasks
Modifying the Definition of an Attribute
Related reference
Define Attributes Dialog Box
New/Edit Testplan Query Dialog Box


Assigning Attributes and Values to a Test Plan

Attributes and values have no connection to a test plan until you assign them to one or more tests using an assignment statement. To add an assignment statement, you can do one of the following:

  • Type the assignment statement yourself directly in the test plan.
  • Use the Testplan Detail dialog box.

Format

An assignment statement consists of the attribute name, a colon, and a valid attribute value, in this format:

attribute-name: attribute value

For example, the assignment statement that associates the Searching value of the Module attribute to a given test would look like:

Module: Searching

Attributes of type Set are represented in this format:

attribute-name: attribute value; attribute
value; attribute value; ...

Placement

Whether you type an assignment statement yourself or have the Testplan Detail dialog box enter it for you, the position of the statement in the plan is important.

To have an assignment statement apply to | Place it directly after the
An individual test | test description
A group of tests | group description
Parent topic: Attributes and Values
Related tasks
Assigning an Attribute from the Testplan Detail Dialog Box


Assigning an Attribute from the Testplan Detail Dialog Box

  1. Place the cursor in the test plan where you would like the assignment statement to display, either after the test description or the group description.
  2. Click Testplan > Detail, and then click the Test Attributes tab on the Testplan Detail dialog box. The arrow in the list box at the top of the dialog box identifies the test description at the cursor position in the test plan. The attribute will be added to this test description. The Test Attributes tab lists all your current attributes at this level of the test plan.
  3. Do one of the following:
    • If the attribute is of type Normal, select a value from the list.
    • If the attribute is of type Set, select on or more values from the list.
    • If the attribute is of type Edit, type a value.
  4. Click OK. Silk Test Classic closes the dialog box and places the assignment statements in the test plan.
Parent topic: Attributes and Values
Related reference
Testplan Detail Dialog Box


Modifying the Definition of an Attribute

Be aware that modifying attributes and values through the Define Attributes dialog box has no effect on existing attributes and values already assigned to the test plan. You must make the changes in the test plan yourself.

  1. Click Testplan > Define Attributes.
  2. On the Define Attributes dialog box, select the attribute you want to modify, then:
    Rename an attribute
    Edit the name in the Name text box.
    Assign a new value to the attribute
    Type the value in the text box at the bottom right of the dialog box, and click Add. The value is added to the list of values.
    Modify a value
    Select the value from the Values list box, and click Edit. The value displays in the text box at the bottom right of the dialog box and the Add button is renamed to Replace. Modify the value and click Replace.
    Delete a value
    Select the value from the Values list box and click Remove. The text box is cleared and the value is removed from the Values list box.
    Delete an attribute
    Click Delete.
  3. Click OK. The attributes and values are saved in the initialization file specified in the General Options dialog box.
Parent topic: Attributes and Values
Related tasks
Setting General Options
Related reference
Define Attributes Dialog Box


Queries

This section describes how you can use a test plan query to mark all tests that match a user-selected set of criteria, or test characteristics.

  • Overview of Test Plan Queries
    Provides an overview of test plan queries.
  • Overview of Combining Queries to Create a New Query
    Provides an overview of combining queries into a single new query.
  • Guidelines for Including Symbols in a Query
    Provides guidelines for including symbols in a query.
  • The Differences between Query and Named Query Commands
    Describes the differences between Query and Named Query.
  • Creating a New Query
    Describes how to create a new query for a test plan.
  • Edit a Query
    Describes how to edit a query.
  • Delete a Query
    Describes how to delete a query.
  • Combining Queries
    Describes how to combine queries.
  • Combine Testplan Queries Dialog Box
    Describes the Combine Testplan Queries dialog box.
  • New/Edit Testplan Query Dialog Box
    Describes the New/Edit Testplan Query dialog box.
  • Create Session Dialog Box
    Describes the Create Session dialog box.
Parent topic: Test Plans


Overview of Test Plan Queries

You can use a test plan query to mark all tests that match a user-selected set of criteria, or test characteristics. A query comprises one or more of the following criteria:

  • Test plan execution: script file, test case name, or test data
  • Test attributes and values
  • Symbols and values

Test attributes and symbols must have been previously defined to be used in a query.

Named queries are stored by default in testplan.ini. The initialization file is specified in the Data File for Attributes and Queries text box in the General Options dialog box. The testplan.ini file is in the Silk Test Classic installation directory. Make sure that all the QA engineers in your group use the same initialization file.

Parent topic: Queries
Related concepts
Attributes and Values
Related tasks
Setting General Options


Overview of Combining Queries to Create a New Query

You can combine two or more existing queries into a new query using the Mark by Named Query dialog box. The new query can represent the union of the constituent queries (logical OR) or the intersection of the constituent queries (logical AND).

Combining by union

Combining two or more queries by union creates a new named query that marks all tests that would have been marked by running each query one after the other while retaining existing marks. Since Mark by Named Query clears existing marks before running a query, the only way to achieve this result is to create a new query that combines the constituent queries by union.

Example

Suppose you have two queries, Query1 and Query2, that you want to combine by union.

Query1 | Query2
Developer: David | Developer: Jesse
Component: Searching | TestLevel: 2

The new query created from the union of Query1 and Query2 will first mark those tests that match all the criteria in Query1 (Developer is David and Component is Searching) and then mark those tests that match all the criteria in Query2 (Developer is Jesse and TestLevel is 2).

Combining by intersection

Combining two or more queries by intersection creates a new named query that marks every test that has the criteria specified in all constituent queries.

Example

For example, combining Query1 and Query2 by intersection would create a new query that comprised these criteria: Developer is David and Jesse, Component is Searching, and TestLevel is 2. In this case, the new query would not mark any tests, since it is impossible for a test to have two different values for the attribute Developer (unless Developer were defined as type Set under Windows). Use care when combining queries by intersection.

Parent topic: Queries
Related tasks
Combining Queries
Related reference
Mark By Query Dialog Box


Guidelines for Including Symbols in a Query

  • Use ? (question mark) to indicate an unset value. For example, Mysymbol = ? in a query would mark those tests where Mysymbol is unset. Space around the equals sign (=) is insignificant.
  • If you need to modify the symbol in the query, select it from the list box and click Edit. The test plan editor places it in the text box and changes the Add button to Replace. Edit the symbol or value and click Replace.
  • To exclude the symbol from the query, select it from the list box and click Remove. The test plan editor deletes it from the list box.
Parent topic: Queries


The Differences between Query and Named Query Commands

Testplan > Mark by Query or Testplan > Mark by Named Query both create queries, however, Mark by Named Query provides extra features, like the ability to combine queries or to create a query without running it immediately. If the query-creation function and the query-running function are distinct in your company, then use Mark by Named Query. If you intend to run a query only once, or run a query while keeping existing marks, then use Mark by Query.

The following table highlights the differences between the two commands.

Mary by Query | Mark by Named Query
Builds a query based on criteria you select and runs query immediately. | Builds a new query based on criteria you select. Can run query at any time.
Name is optional, but note that only named queries are saved and can be rerun at any time in the Mark by Named Query dialog box. | Name is required. Query is saved.
Cannot edit or delete a query. | Can edit or delete a query.
Cannot combine queries. | Can combine queries into a new query.
Lets you decide whether or not to clear existing marks before running new query. Unmarks by default. | Clears existing marks before running new query.

Unnamed queries can be run only once. If you name the query, you can have the test plan editor run it in the same or subsequent work sessions without having to rebuild the query or manually remark the tests that you’re interested in rerunning or reporting on.

Parent topic: Queries
Related reference
Mark By Query Dialog Box
Mark By Named Query Dialog Box


Creating a New Query

You can create a new query for a test plan through either Testplan > Mark by Query or Testplan > Mark by Named Query. You can also create a new query by combining existing queries.

  1. Open the test plan and any associated sub-plans.
  2. Click Testplan > Mark by Query or Testplan > Mark by Named Query.
  3. Identify the criteria you want to include in the query.
    • To include a script, a test case, or test data, use the Test Execution tab. Click Script to select a script and click Testcase to select a test case, or type the full specification yourself. To build a query that marks only manual tests, type the keyword into the Testccase field.
    • To include existing attributes and values in the query, use the Test Attributes tab.
    • To include one or more existing symbols and values, use the Symbols tab. Type the information into the Add field and click Add. The symbol and value are added to the list box.

    Do not type the dollar sign ($) prefix before the symbol name. The wildcard characters * (asterisk) and ? (question mark) are supported for partial matches: * is a placeholder for 0 or more characters, and ? is a placeholder for 1 character.

    Example 1

    If you type find_5 (* in the Testcase field, the query searches all the testcase statements in the plan and marks those test descriptions that match, as well as all subordinate descriptions to which the matching testcase statement applies, which are the test cases where the find_5 test case passed in data.

    Example 2

    If you type find.t in the Script field, the query searches all script statements in the plan and marks those test descriptions that match exactly, as well as all subordinate descriptions to which the matching script statement applies, which are the test cases in which you had specified find.t exactly. It would not match any script statements in which you had specified a full path.

  4. Take one of the following actions, depending on the command you chose to create the query:
    Mark by Query
    Click Mark to run the query against the test plan. The test plan editor closes the dialog box and marks the test plan, retaining the existing marks if requested.
    Mark by Named Query

    Click OK to create the query. The New Testplan Query dialog box closes, and the Mark by Named Query dialog box is once again visible. The new query displays in the Testplan Queries list box.

    If you want to:

    • Run the query, select it from the list box and click Mark.
    • Close the dialog box without running the query, click Close.
Parent topic: Queries
Related tasks
Combining Queries
Related reference
Mark By Query Dialog Box
Mark By Named Query Dialog Box
New/Edit Testplan Query Dialog Box


Edit a Query

  1. Click Testplan > Mark by Named Query to display the Mark by Named Query dialog box.
  2. Select a query from the Testplan Queries list box and click Edit.
  3. On the Edit Testplan Query dialog box, edit the information as appropriate, and then click OK .
  4. To run the query you just edited, select the query and click Mark . To close the dialog box without running the edited query, click Close .
Parent topic: Queries


Delete a Query

  1. Click Testplan > Mark by Named Query to open the Mark by Named Query dialog box.
  2. Select a query from the Testplan Queries box and click Remove.
  3. Click Yes to delete the query, and then click Close to close the dialog box.
Parent topic: Queries
Related reference
Mark By Named Query Dialog Box


Combining Queries

  1. Click Testplan > Mark by Named Query to display the Mark by Named Query dialog box.
  2. Click Combine. The Combine Testplan Queries dialog box lists all existing named queries in the Queries to Combine list box.
  3. Specify a name for the new query in the Query Name text box.
  4. Select two or more queries to combine from the Queries to Combine list box.
  5. Click the option button that represents the combination method to use: either Union of Queries or Intersection of Queries.
  6. Click OK to save the new query. The Mark by Named Query dialog box displays with the new query in the Testplan Queries list box.
  7. To run the query, select the query and click Mark or click Close to close the dialog box without running the query.
Parent topic: Queries
Related concepts
Overview of Combining Queries to Create a New Query
Related reference
Mark By Named Query Dialog Box
Combine Testplan Queries Dialog Box


Combine Testplan Queries Dialog Box

Use to create a new query by combining existing queries.

Click Testplan > Mark by Named Query and then click Combine.

Query name

Type the name of the new query that you want to create by combining existing queries.

Queries to combine

Displays a list of named queries. Select two or more queries from the list to combine.

Union of queries

Click to combine two or more queries by union. This option creates a new named query that marks all tests that would have been marked by running each query, one after the other, while retaining existing marks. Since Mark by Named Query clears existing marks before running a query, the only way to achieve this result is to create a new query that combines the queries by union.

Intersection of queries

Click to combine two or more queries by intersection. This option creates a new named query that marks every test that has the criteria specified in all constituent queries. Use care when combining queries by intersection.

Parent topic: Queries
Related tasks
Combining Queries


New/Edit Testplan Query Dialog Box

Use to construct a query from attributes, symbols, the script, the test case, and test data. This dialog is only available when a test plan is open and the test plan window is active.

Click Testplan > Mark by Named Query and then click New or Edit. To access the Edit Testplan Query dialog box, you must select an existing test plan query.

Query name

Type the name of the query. This is optional. Named queries are stored by default in testplan.ini. The initialization file is specified in the Data File for Attributes and Queries field in the General Options dialog box.

Test Execution tab

Script

Specifies the full path of the script that you want to display on the current line of the test plan. To browse for the correct script, click Scripts to display the Testplan Detail Scripts dialog box. Once you select a script, the Testplan Editor writes the selected script into the test plan, beginning the line with the reserved word script, followed by a colon.

Test case

Specifies the name of the test case that you want to display on the current line of the test plan. To browse for the correct test case, click Test Cases to view the test cases contained in the script that you have specified in the Script field. Once you select a test plan from the Testplan Detail Testcase dialog box, the Testplan Editor writes the selected test case into the test plan, beginning the line with the reserved word testcase, ddatestcase for a data-driven test case, followed by a colon. To build a query that marks only manual tests, type the keyword manual into the Test case field.

Test data

Specifies the data values that you want to pass to the test case. Separate each value with a comma. The Testplan Editor writes the data you specify here to the current line of the test plan, beginning the line with the reserved word testdata, ddatestdata for a data-driven test case, followed by a colon.

Scripts

Click to select a script to include in the query or type the script name into the Script field.

Test Cases

Click to select a test case to include in the query or type the test case name into the Test case field.

Test Attributes tab

Use the Test Attributes tab to assign existing attribute values to your test plan. For information about adding new attributes and values, see Defining an Attribute and the Values of the Attribute.

Category

Lists the available categories. Click the arrow to select a category from the list.

Component

Lists the available components. Click the arrow to select a component from the list.

Developer

Displays the available developers. Click the arrow to select a developer from the list.

Symbols tab

Note: Do not type the dollar sign ($) prefix before the symbol name. The wildcard characters * (asterisk) and ? (question mark) are supported for partial matches: * is a placeholder for 0 or more characters, and ? is a placeholder for 1 character.

Symbols will be ignored for a data-driven test case.

Edit

Select a symbol from the list and then click Edit to modify the symbol in the field below the symbols list. Click Replace after you have made your modifications.

Remove

Select a symbol from the list and then click Remove to remove the symbol from the test plan.

Add

Type the symbol definition in the field below the symbols list, and then click Add. The newly-defined symbol displays in the list. You do not need to enter the $ character because the Testplan Editor takes care of this when it inserts the definitions into the test plan.

Parent topic: Queries
Related tasks
Defining an Attribute and the Values of the Attribute
Creating a New Query


Create Session Dialog Box

You can use the Create Session dialog box to create a new manual test session. Select a product, then use the list boxes to enter test data such as component, platform, version, and build. You can use the Named Query box to select tests that have been marked by a Named Query.

When you are using the Create Session dialog box for a new manual session, inactive and active products are displayed.

In order for reports to properly reflect your manual session, it is important to completely assign test data. For example, if you do not assign a build to this session, this session is not reflected on any reports that are based on builds.

Parent topic: Queries


Testplan Detail Dialog Box

Use the Testplan Detail dialog box to:

  • Specify valid script, test case, and test data statements.
  • Assign attribute values to your test plan.
  • Add, edit, or delete a symbol associated with the test plan.

This dialog box is only available when a test plan is open and the Testplan dialog box is active.

Click Testplan > Testplan Detail. You can also place your cursor in a test case, click the right mouse button, and then select Test Details.

The box at the top of the dialog displays your cursor position in the test plan when you opened the dialog box. The black arrow in the left margin identifies the test at which your cursor is positioned in the test plan. This is the test description to which you are adding details. Any details will apply to this test and any tests that inherit details from this test. If the test case and script associated with the current test description are inherited from a higher level in the test plan, they are shown in blue; otherwise, they are shown in black.

Test Execution tab

Script

Specifies the full path of the script that you want to appear on the current line of the test plan. To browse for the correct script, click Scripts to display the Testplan Detail - Script dialog. Once you select a script, the Testplan Editor writes the selected script into the test plan, beginning the line with the reserved word script, followed by a colon.

Test case

Specifies the name of the test case that you want to display on the current line of the test plan. To browse for the correct test case, click Test Cases to view the test cases contained in the script you have specified in the Script field. Once you select a test plan from the Testplan Detail - Testcase dialog box, the Testplan Editor writes the selected test case into the test plan, beginning the line with the reserved word testcase, or ddatestcase for a data-driven test case, followed by a colon. Selecting the test case ensures that the proper keywords are inserted into the test plan.

Test data

Specifies the data values that you want to pass to the test case. Separate each value with a comma. The Testplan Editor writes the data you specify here to the current line of the test plan, beginning the line with the reserved word testdata , or ddatestcase for a data-driven test case, followed by a colon. To select certain rows to use to run the data-driven test case, click Specify Rows to view the Specify Rows dialog box.

Test Attributes tab

Use the Test Attributes tab to assign existing attribute values to your test plan.

Category

Displays the categories available. Click the arrow to select from the list of available categories.

Component

Displays the components available. Click the arrow to select from the list of available components.

Developer

Displays the available developers. Click the arrow to select from the list of available developers.

Symbols tab

Use the Symbols tab to add, edit, or delete a symbol associated with the test. If a symbol is defined at a level in the test plan where it can be shared by a group of tests, each test can assign its own local value to the symbol, overriding whatever value the symbol had at the higher level. Locally assigned symbols display in black. Symbols that inherit their values display in blue.

Note: Do not type the dollar sign ($) prefix before the symbol name. The wildcard characters * (asterisk) and ? (question mark) are supported for partial matches: * is a placeholder for 0 or more characters, and ? is a placeholder for 1 character. Symbols are ignored for a data-driven test case.
Edit

Select a symbol from the list and then click Edit to modify the symbol in the text box below the list. Click Replace after you have made your modifications.

Remove

Select a symbol from the list and then click Remove to remove the symbol from the test plan.

Add

Type the symbol definition in the box below the list of symbols and then click Add. The newly-defined symbol displays in the list. You do not need to enter the $ character because the Testplan Editor takes care of this for you when it inserts the definitions into the test plan.

Parent topic: Test Plans
Related concepts
Adding a Data-Driven Test Case to a Test Plan
Linking a Description to a Script or Test Case using the Testplan Detail Dialog Box
Linking the Test Plan to Scripts and Test Cases
Working with Large Test Plans
Creating a Sub-Plan
Overview of Symbols
Specifying Unique and Shared Data
Related tasks
Determining Where Values are Defined in a Large Test Plan
Using the Testplan Detail Dialog Box to Enter the testdata Statement
Defining Symbols in the Testplan Detail Dialog box
Specifying Symbols as Arguments when Entering a testcase Statement
Assigning an Attribute from the Testplan Detail Dialog Box
Defining an Attribute and the Values of the Attribute
Related reference
Specify Rows Dialog Box


Testplan Detail - Testcase Dialog Box

Use the Testplan Detail - Testcase dialog box to select a test case to add to the currently selected test plan.

Click Testplan > Detail, click the Test Execution tab, specify a script in the Script field, and then click Testcases.

Testcase

Lists the test cases available in the currently selected script. Select the test case that you want to enter into the test plan from the list. Silk Test Classic enters the correct Testplan Editor syntax into the test plan.

Parent topic: Test Plans


Define Attributes Dialog Box

Use to define or rename the Testplan Editor attributes, as well as add, rename, or remove attribute values. This dialog box is only available when a test plan is open and the test plan window is active. Attribute values are stored in the testplan.ini file.

To open the Define Attributes dialog box, click Testplan > Define Attributes in the Silk Test Classic menu.

Attributes
Displays the list of attributes defined in the Testplan Editor. An attribute is a site-specific characteristic that you define for your test plan and associate with tests. Attributes allow you to query or execute sections of the test plan or report on various characteristics. The Testplan Editor has three predefined attributes:
Category

Specifies the type of test case or the type of the group of test cases used in your QA Department, for example Smoke Test.

Component

Specifies the pages or application modules of the application under test which should be tested in this test plan.

Developer

Specifies the group of QA engineers which are assigned to develop the test case or group of test cases in the test plan.

New

Displays the New Attribute dialog box, which you can use to define a new attribute. You can then use the Define Attributes dialog box to assign values to the new attribute.

Delete

Deletes the selected attribute. When you delete an attribute, you also delete the values of the attribute.

Name

Displays the name of the attribute that you have selected in the Attributes list. You can edit the attribute name by modifying the text in the Name field.

Type
Displays the type that is associated with the currently selected attribute in the Attributes list. An attribute may be one of the following types:
  • Normal
  • Edit
  • Set
This field is display-only.
Values

Displays the values that are associated with the selected attribute type.

Edit

Click to modify the selected attribute name and value. You must select an attribute from the Attributes list and a value from the Values list before the Edit button is available. To modify the attribute name, edit the text in the Name field. To modify the value, edit the text in the field next to the Replace button, and then click Replace.

Remove

Removes the selected value from the list. You must select an attribute from the Attributes list and a value from the Values list before the Remove button is available. To remove an attribute, you must select the attribute from the Attributes list, and then click Delete.

Add

Allows you to add a new value that should be associated with the selected attribute type. You must select an attribute from the Attributes list and type a value in the text field before the Add button is available. You cannot assign values for attributes of type Edit. Attribute values are stored in the testplan.ini file.

Parent topic: Test Plans
Related concepts
Attributes and Values
Related tasks
Defining an Attribute and the Values of the Attribute
Modifying the Definition of an Attribute


New Attribute Dialog Box

Use to define new attributes. You can define up to 254 attributes or rename the predefined attributes, Developer, Component, and Category. This dialog is only available from the Define Attributes dialog.

Click Testplan > Define Attributes and then click New.

Name

Name of the attribute you are defining, using up to 11 characters. Attribute names cannot have spaces and are not case sensitive.

Type
Click to specify a Type for the new attribute you are defining. Specifying a Type is optional. You can select from the following types:
Normal

Values are assigned when defining the attribute. You can pick a value from the list when associating attributes with the testplan statement.

Edit

Values are not assigned when defining the attribute. You must type your own values when you use the attribute in a testplan.

Set

Values are assigned when defining the attribute. The Set type is similar to the Normal type, except that you can pick multiple values from the list when associating attributes with the testplan statement.

Parent topic: Test Plans
Related tasks
Defining an Attribute and the Values of the Attribute


Update Manual Tests Dialog Box

Use the Update Manual Tests dialog box to describe the state of manual tests included in the test plan. This dialog is only available when a test plan that contains manual tests is active.

To open the Update Manual Tests dialog box, click Testplan > Run Manual Tests .

Plan file

Displays the path and name of the currently selected test plan.

Manual tests

Lists all manual tests contained within the currently selected test plan. Select the manual test that you want to update from this list.

Incomplete

Click to mark the currently selected manual test case incomplete.

Complete

Click to mark the currently selected manual test case complete. This means that a test has been defined. A manual test marked as Complete is tabulated as complete in the Testplan Completion reports.

Has been run

Click to mark the currently selected test case as having been run. The current date and time display in the Run at box. You can then indicate if the test case passed or failed by clicking the appropriate button. A test marked Has been run is considered complete in Testplan Completion reports.

Failed

Click to indicate that the currently selected manual test failed. This button is available only when you select Has been run in the Completion area.

Passed

Click to indicate that the currently selected manual test passed. This button is available only when you select Has been run in the Completion area.

Comments for <currently selected manual testcase>

Type any comments you want to associate with the currently selected manual test.

Print

Click to print status information for the manual tests included in the currently selected test plan. This includes the test case name, status, and run information, if applicable.

Run at

Specify when the test was run using this syntax: year-month-day hours:minutes:seconds YYYY-MM-DD HH:MM:SS Hours, minutes, and seconds are optional. For example, enter 2011-10-01 to indicate the test was run Oct 1, 2011.

Machine

Optional: Specify the name of the machine on which the test was run.

Parent topic: Test Plans
Related tasks
Describing the State of a Manual Test
Generating a Test Plan Completion Report


Duplicate Test Descriptions dialog box

This dialog box is displayed when a managed test plan is saved and duplicate test descriptions are found. These duplicates are usually a result of the editing process.

You can select a test description that will retain the original test ID, or you can use Reset All IDs to generate new identifiers for all test descriptions. Reset All IDs has database ramifications and affects any existing Silk Central and Issue Manager references to the test description ID. This means that an existing reference will no longer be valid.

Parent topic: Test Plans


Designing and Recording Test Cases with the Open Agent

This section describes how you can design and record test cases with the Open Agent.

  • Creating Test Cases with the Open Agent
    Describes how you can use the Open Agent to create test cases.
  • Dynamic Object Recognition
    Describes how dynamic object recognition enables you to create test cases that use XPath queries to find and identify objects.
  • Highlighting Objects During Recording
    Describes how the active object is highlighted during recording.
  • Overview of the Locator Keyword
    Describes the locator keyword, which is used to identify objects in the application when executing test cases.
  • Test Cases
    Describes how you can use automated tests to address single objectives of a test plan.
  • Verification
    Describes how you can verify one or more characteristics, or properties, of an object.
  • Data-Driven Test Cases
    Describes how to pass data to a test case and how to invoke the test case once for each item in the data source.
  • Characters Excluded from Recording and Replaying
    Lists the characters that are excluded from recording and are not recognized by Silk Test during replay.


Creating Test Cases with the Open Agent

This section describes how you can use the Open Agent to create test cases.

  • Recording Test Cases for Standard and Web Applications
    Record a test case with the Open Agent to create a script for a standard application or a Web application.
  • Recording Test Cases for Mobile Applications
    Record a test case with the Open Agent to create a script for a mobile application on a physical device or an Android emulator.
  • Recording a Test on Microsoft Edge
    Record a test on Microsoft Edge to test a web application.
  • Recording Window Declarations that Include Locator Keywords
    Record window declarations that include locator keywords to create scripts that use dynamic object recognition.
  • Recording Locators Using the Locator Spy
    Use the Locator Spy to record the locator of a specific object in your application under test.
  • Recording an Application State
    Use the Record Application State dialog box to record an application state routine that Silk Test Classic runs before it executes your test case.
  • Recording Additional Actions Into an Existing Test
    Record additional actions to update an existing test.
  • Actions Available During Recording
    Lists actions that you can perform during recording.
  • Setting Recording Options for the Open Agent
    Set the recording options to optimize recording with the Open Agent.
  • Best Practices for Creating Test Scripts
    Describes how you can create stable test scripts with Silk Test Classic.
  • Specifying Whether to Use Locators or Tags to Resolve Window Declarations
    Specify if you want to use locators or tags to resolve window declarations.
  • Saving a Script File
    Describes how to save a script file.
  • Testing an Application State
    Describes how to test an application state.
  • Editing Remote Locations
    Specify remote locations to add any browsers and mobile devices that are available on these locations to the set of applications that you can test.
  • Overview of Recording the Stages of a Test Case
    Provides an overview of recording the stages of a test case.
  • Recording the Cleanup Stage and Pasting the Recording
    Describes how to record the cleanup stage and paste the recording.
  • Testing the Ability of the Recovery System to Close the Dialog Boxes of Your Application
    Test if the recovery system can close representative dialog boxes of your application before you begin to design and record test cases.
  • Linking to a Script and Test Case by Recording a Test Case
    Describes how to link a script and test case by recording a test case.
  • Recording Actions
    Describes recording actions.
  • Locator Spy Dialog Box
    Describes the Locator Spy dialog box.
  • Record Testcase Dialog Box
    Describes the Record Testcase dialog box, which you can use to record an entire test case, specifying the application state of your choice and including verification statements.
  • Update Files Dialog Box
    Describes the Update Files dialog box.
Parent topic: Designing and Recording Test Cases with the Open Agent


Recording a Test on Microsoft Edge

This functionality is supported only if you are using the Open Agent.

Before you can record a Silk Test Classic test, you must have created a Silk Test Classic project.

When starting the interaction with a web application on Microsoft Edge, Silk Test Classic closes any open instance of Microsoft Edge and starts a new browser. This new browser uses a temporary profile without add-ons and with an empty cache. This instance of Microsoft Edge is closed when shutting down the Open Agent or when starting to test another application outside Microsoft Edge.

Note: You can currently not record keyword-driven tests on Microsoft Edge.
To record a new test for a web application on Microsoft Edge:
  1. Select the project to which you want to add the new test.
  2. In the toolbar, click Record Testcase.
  3. Type a name for the new test into the Testcase name field.
  4. Click Start Recording.
  5. Optional: If you want to test a web application on a desktop browser with a predefined browser size, select the browser size from the Browser size list.
  6. Optional: Select an Orientation for the browser window.
  7. The Interactive Recording window opens and displays the web application. Perform the actions that you want to record.
    1. Click on the object with which you want to interact. Silk Test Classic performs the default action for the object. If there is no default action, or if you have to insert text or specify parameters, the Choose Action dialog box opens.
    2. Optional: To chose an action for an object, which might not be the default action, right-click on the object. The Choose Action dialog box opens.
    3. Optional: If the action has parameters, type the parameters into the parameter fields. Silk Test Classic automatically validates the parameters.
    4. Click OK to close the Choose Action dialog box. Silk Test Classic adds the action to the recorded actions and replays it on the mobile device or emulator.
    During recording, Silk Test Classic displays the mouse position next to the recording window. You can toggle the location to switch between displaying the absolute mouse position on the device display and the mouse position in relation to the active object. For additional information about the actions available during recording, see Actions Available During Recording.
  8. Click Stop. The Record Testcase dialog box opens.
  9. Perform one of the following steps:
    • Click Paste testcase and update window declaration(s) and then click OK. In most cases, you want to choose this option.
    • Choose Paste testcase only and then click OK. This option does not update the window declarations in the INC file when it pastes the script to the Editor. If you previously recorded the window declarations related to this test case, choose this option.
  10. Click OK.

Replay the test to ensure that it works as expected. You can modify the test to make changes if necessary.

Parent topic: Creating Test Cases with the Open Agent
Related tasks
Recording Test Cases for Standard and Web Applications
Related reference
Limitations for Testing with Microsoft Edge


Recording Window Declarations that Include Locator Keywords

A window declaration specifies a cross-platform, logical name for a GUI object, called the identifier, and maps the identifier to the object’s actual name, called the tag or locator. You can use locator keywords, rather than tags, to create scripts that use dynamic object recognition and window declarations. Or, you can include locators and tags in the same window declaration.

To record window declarations that include locator keywords, you must use the Open Agent.

To record window declarations using the Locator Spy:
  1. Configure the application to set up the technology domain and base state that your application requires.
  2. Click Record > Window Locators. The Locator Spy opens.
  3. Position the mouse over the object that you want to record and perform one of the following steps:
    • Press Ctrl+Alt to capture the object hierarchy with the default Record Break key sequence.
    • Press Ctrl+Shift to capture the object hierarchy if you specified the alternative Record Break key sequence on the General Recording Options page of the Recording Options dialog box.
      Note: For SAP applications, you must set Ctrl+Shift as the shortcut key combination. To change the default setting, click Options > Recorder and then check the OPT_ALTERNATE_RECORD_BREAK check box.
    • If you use Picking mode, click the object that you want to record and press the Record Break keys.
  4. Click Stop Recording Locator.

    The Locator text box displays the XPath query string for the object on which the mouse rests. The Locator Details section lists the hierarchy of objects for the locator that displays in the text box. The hierarchy listed in the Locator Details section is what will be included in the INC file.

  5. To refine the locator, in the Locator Details table, click Show additional locator attributes, right-click an object and then choose Expand subtree. The objects display and any related attributes display in the Locator Attribute table.
  6. To replace the hierarchy that you recorded, select the locator that you want to use as the parent in the Locator Details table. The new locator displays in the Locator text box.
  7. Perform one of the following steps:
    • To add the window declarations to the INC file for the project, position your cursor where you want to add the window declarations in the INC file, and then click Paste Hierarchy to Editor.
    • To copy the window declarations to the Clipboard, click Copy Hierarchy to Clipboard and then paste the window declarations into a different editing window or into the current window at the location of your choice.
  8. Click Close.
Parent topic: Creating Test Cases with the Open Agent
Related concepts
Overview of the Locator Keyword
Dynamic Object Recognition
Related tasks
Setting Recording Options for the Open Agent


Recording Locators Using the Locator Spy

This functionality is supported only if you are using the Open Agent.

Use the Locator Spy to record the locator of a specific object in your application under test. You can then copy the locator to the test case or to the Clipboard.

  1. Configure the application to set up the technology domain and base state that your application requires.
  2. Click File > New. The New File dialog box opens.
  3. Select 4Test script and then click OK. A new 4Test Script window opens.
  4. Click Record > Window Locators. The Record Locator dialog appears.
  5. From the Application State list box, select DefaultBaseState to have the built-in recovery system restore the default base state before the test case begins executing.
    • If you choose DefaultBaseState as the application state, the test case is recorded in the script file as testcase testcase_name ().
    • If you choose another application state, the test case is recorded as testcase testcase_name () appstate appstate_name.
  6. Click Start Recording. Silk Test Classic performs the following actions:
    • Closes the Record Locator dialog box.
    • Starts your application, if it was not already running. If you have not configured the application yet, the Select Application dialog box opens and you can select the application that you want to test.
    • Removes the editor window from the display.
    • Displays the Recording window.
    • Waits for you to take further action.
  7. Position the mouse over the object that you want to record. The related locator XPath query string shows in the Selected Locator text box. The Locator Details section lists the hierarchy of objects for the locator that displays in the text box.
    Note: If you are testing on a browser, the Selected Locator field displays the locator only when you actually capture it.
  8. Perform one of the following steps:
    • Press Ctrl+Alt to capture the object. The Locator field displays the XPath query string for the object. You can edit the locator.
    • Press Ctrl+Shift to capture the object if you specified the alternative Record Break key sequence on the General Recording Options page of the Recording Options dialog box.
      Note: For SAP applications, you must set Ctrl+Shift as the shortcut key combination to use to pause recording. To change the default setting, click Options > Recorder and then check the OPT_ALTERNATE_RECORD_BREAK check box.
    • Click Stop Recording Locator to capture the locator that is currently displayed in the Locator field.
    • If you use Picking mode, click the object that you want to record and press the Record Break keys.
    Note: Silk Test Classic does not verify whether the locator string is unique. Micro Focus recommends that you ensure that the string is unique, because otherwise additional objects might be found when you run the test. Furthermore, you might want to exclude some of the attributes that Silk Test Classic identifies because the string will work without them.
  9. Click Validate Locator to highlight the object, to which the locator in the Locator field corresponds, in the test application.
  10. To refine the locator, in the Locator Details table, click Show additional locator attributes, right-click an object and then choose Expand subtree. The objects display and any related attributes display in the Locator Attribute table.
  11. Optional: You can replace a recorded locator attribute with another locator attribute from the Locator Details table. For example, your recorded locator might look like the following:
    /Window[@caption='MyApp']//Control[@id='table1']
    If you have a caption Files listed in the Locator Details table, you can manually change the locator to the following:
    /Window[@caption='MyApp']//Control[@caption='Files']
    The new locator displays in the Selected Locator text box.
  12. Copy the locator to the test case or to the Clipboard.
    • Click Paste Hierarchy to Editor to paste the window declarations that are displayed in the Locator Details into the open Silk Test Classic file.
    • Click Copy Hierarchy to Clipboard to copy the window declarations that are displayed in the Locator Details to the Clipboard.
    • Click Paste Locator to Editor to paste the contents of the Locator field into the open Silk Test Classic file.
    • Click Copy Locator to Clipboard to copy the contents of the Locator field to the Clipboard.
    Tip: If you have copied code to the Clipboard, you can click Edit > Paste in the Silk Test Classic menu to insert the code into the current window at the location of your choice, or even into a different editing window.
  13. Click Close.
Parent topic: Creating Test Cases with the Open Agent
Related tasks
Setting Recording Options for the Open Agent
Related reference
Locator Spy Dialog Box


Recording an Application State

You can define an application state routine that Silk Test Classic runs before it executes your test case. You have to create the application state before recording the test cases that are associated with the application state. You can manually write an application state routine or you can use the Record Application State dialog box to record an application state.

To record an application state:

  1. Open the file in which you want to place the application state. This can either be the test frame file for the application or the script file where the associated test cases are defined. If you put the application state in the test frame file, it will be available to all test cases. If you put it in the script file, it will be available only to test cases in that script file.
  2. Open the application that you want to test.
  3. Click Record > Application State. If the current window is not a script or an include file, Silk Test Classic prompts you to create a new include file.
  4. Type the name of your new application state in the Application State Name text box. The application state name must be less than 64 characters.
  5. Select an application state from the Based On list box. This specifies an existing application state on which the new application state is based. By default, the last application state that you have specified in this field is selected.
  6. If you are using the Classic Agent, you can check the Show AppState status window check box to display a status window while Silk Test Classic is driving the application to the specified base state. If the status window obscures critical controls in your application, you can suppress it by un-checking this check box. By default, this check box is not checked.
  7. Click Start Recording. Silk Test Classic closes the Record Application State dialog box and displays one of the following:
    • The Record Status for the Classic Agent window, if you are using the Classic Agent.
    • The Recorder window, if you are using the Open Agent.
    The Status field flashes Recording.
  8. Drive your application to the state you want to record. At any point, you can record a verification by pressing Ctrl+Alt.
  9. When you have finished recording an application state, click Done on the Record Status window. Silk Test Classic redisplays the Record Application State dialog box. The Application State Code field contains the 4Test code that you have recorded. You can take the following actions:
    All the information in the window is complete and what you expect.
    Click Paste to Editor to paste the recorded 4Test code to the editor. Silk Test Classic closes the Record Application State dialog box and places the new application state in your file.
    You want to alter the code.
    Edit the Application State Code field.
    The application state name is not what you want.
    Edit the name in the Application State Name field.
    The application state on which this application state is based is not the one you want.
    Delete the code in the Application State Code field, select a new application state from the list, and click Resume Recording to re-record the application state.
    The application state routine is not finished.
    Click Resume Recording. Silk Test Classic opens the Record Status window.
  10. Click Set Recovery System to specify the base state for the application under test. This button is only available when wMainWindow has not been set, for example if you have referenced an include file that does not contain constwMainWindow = MyWin.
Parent topic: Creating Test Cases with the Open Agent
Related concepts
Overview of Application States
Behavior of an Application State Based on NONE
Related tasks
Testing an Application State
Related reference
Record Testcase Dialog Box


Recording Additional Actions Into an Existing Test

This functionality is supported only if you are using the Open Agent.

Once a test is created, you can open the test and record additional actions to any point in the test. This allows you to update an existing test with additional actions.

  1. Open an existing test script.
  2. Select the location in the test script into which you want to record additional actions.
    Note: Recorded actions are inserted after the selected location. The application under test (AUT) does not return to the base state. Instead, the AUT opens to the scope in which the preceding actions in the test script were recorded.
  3. Click Record > Actions. Silk Test Classic minimizes and the Recording window opens.
  4. Record the additional actions that you want to perform against the AUT. For information about the actions available during recording, see Actions Available During Recording.
  5. To stop recording, click Stop in the Recording window.
  6. In the Record Actions dialog box, click Paste to Editor to insert the recorded actions into your script.
  7. Click Close to close the Record Actions dialog box.
Parent topic: Creating Test Cases with the Open Agent


Actions Available During Recording

This functionality is supported only if you are using the Open Agent.

During recording, you can perform the following actions in the Recording window:

Action | Steps
Pause recording. | Click Pause to bring the AUT into a specific state without recording the actions, and then click Record to resume recording.
Change the sequence of the recorded actions. | To change the sequence of the recorded actions in the Recording window, select the actions that you want to move and drag them to the new location.
Select multiple actions. | To select multiple actions, press Ctrl and click on the actions or press Shift and click on the first and the last action that you want to select.
Replay recorded actions. | To replay recorded actions from the Recording window, select the actions and click Play. To select all recorded actions, click on Recorded Actions and then click Play.
Remove a recorded action. | To remove a falsely recorded action from the Recording window, hover the mouse cursor over the action and click Delete.
Verify an image or a property of a control. | Move the mouse cursor over the object that you want to verify and press Ctrl+Alt. For additional information, see Adding a Verification to a Script while Recording.
Parent topic: Creating Test Cases with the Open Agent
Related tasks
Recording Test Cases for Standard and Web Applications


Setting Recording Options for the Open Agent

This functionality is supported only if you are using the Open Agent.

You can set the recording options to optimize recording with the Open Agent in the following two ways:
  • In the Recording Options dialog box.
  • Within a script, by using the SetOption method.

Using SetOption overrides the value specified for the option in the Recording Options dialog box. If you do not set an option with SetOption, the value specified in the Recording Options dialog box is the default.

To set the recording options in the Recording Options dialog box, perform the following actions:

  1. Click Options > Recorder. The Recording Options dialog box appears.
  2. To set Ctrl+Shift as the shortcut key combination to use to pause recording, check the OPT_ALTERNATE_RECORD_BREAK check box. By default, Ctrl+Alt is the shortcut key combination.
    Note: For SAP applications, you must set Ctrl+Shift as the shortcut key combination.
  3. To record absolute values for scroll events, check the OPT_RECORD_SCROLLBAR_ABSOLUT check box.
  4. To record mouse move actions for web applications, Win32 applications, and Windows Forms applications, check the OPT_RECORD_MOUSEMOVES check box. You cannot record mouse move actions for child technology domains of the xBrowser technology domain, for example Apache Flex and Swing.
  5. If you record mouse move actions, in the OPT_RECORD_MOUSEMOVE_DELAY text box, specify how many milliseconds the mouse has to be motionless before a MouseMove is recorded. By default this value is set to 200.
  6. To record text clicks instead of clicks, check the OPT_RECORD_TEXT_CLICK check box. Recording text clicks is enabled by default, and is the fallback mechanism when testing applications which display texts. Micro Focus recommends to leave this check box checked.
  7. To resize the application under test (AUT) when a recording session starts, check the OPT_RESIZE_APPLICATION_BEFORE_RECORDING check box. This check box is checked by default, enabling the Silk Recorder to display next to the AUT. When this check box is unchecked, the AUT and the Silk Recorder might overlap.
  8. Define custom attributes for recording.
    1. Select the Custom Attributes tab.
    2. Select the technology domain of the application that you are testing. For example, to set custom attributes for a web application, select xBrowser.
    3. Add the attributes that you want to use to the list. Separate attribute names with a comma. Using a custom attribute is more reliable than other attributes like caption or index, since a caption will change when you translate the application into another language, and the index might change when another object is added. If custom attributes are available, the locator generator uses these attributes before any other attribute. The order of the list also represents the priority in which the attributes are used by the locator generator. If the attributes that you specify are not available for the objects that you select, Silk Test Classic uses the default attributes for the application that you are testing.
    Note: You cannot set custom attributes for Apache Flex applications.
  9. Set the classes that you want to ignore during recording and replay.
    1. Select the Transparent Classes tab.
    2. Add the names of any classes that you want to ignore to the list. Separate class names with a comma.
  10. Specify recording options for web applications.
    1. Select the Browser tab.
    2. Add names of attributes that you want to ignore during recording to the Locator attribute name exclude list. For example, if you do not want to record attributes named height, add height to the list. Separate attribute names with a comma.
    3. Add values of attributes that you want to ignore during recording to the Locator attribute value exclude list. For example, if you do not want to record attributes that have the value x-auto, add x-auto to the list.
    4. Check the OPT_XBROWSER_LOWLEVEL check box to record native user input instead of DOM functions.

      For example to record Click instead of DomClick and TypeKeys instead of SetText.

      If your application uses a plug-in or AJAX, use native user input. If your application does not use a plug-in or AJAX, Micro Focus recommends using high-level DOM functions, which do not require the browser to be focused or active during playback. As a result, tests that use DOM functions are faster and more reliable.

    5. Specify the maximum length for locator attribute values in the OPT_XBROWSER_LOCATOR_MAX_ATTRIBUTE_VALUE_LENGTH field.
    6. Check the OPT_XBROWSER_ENABLE_SMART_CLICK_POSITION check box to automatically search for a free click spot on the object. If disabled, the click is always made in the center of the object, and might possibly be performed an object layered over the target.
  11. Specify recording options for WPF applications.
    1. Check the OPT_WPF_PREFILL_ITEMS check box to pre-fill items in a WPFItemsControl, for example a WPFComboBox or WPFListBox, during recording and playback.
    2. Add the names of custom classes that you want to expose during recording and playback to the Custom WPF class names list.
  12. Click OK.
Parent topic: Creating Test Cases with the Open Agent
Parent topic: Setting Silk Test Classic Options
Related concepts
Overview of Record Functionality Available for the Silk Test Agents
Related tasks
Setting xBrowser Synchronization Options
Setting Recording Options for xBrowser
Setting WPF Classes to Expose During Recording and Playback
Setting Pre-Fill During Recording and Replaying
Defining which Custom Locator Attributes to Use for Recognition
Related reference
Agent Options


Best Practices for Creating Test Scripts

This functionality is supported only if you are using the Open Agent.

The way in which you write your test cases might have a great impact on the performance and stability of your test set. During recording, Silk Test Classic creates scripts that are as fast and stable as possible. However, there might be circumstances that require you to manually create or edit test scripts. This topic provides some general guidelines that might help you create test scripts that are maintainable, reusable, and lead to stable tests.

  • Name your tests consistently and ensure that test names are self-explaining. Try to make the names correspond with the application under test and the tested functionality. For example, the test names MyApp_SuccessfulLogin and MyApp_FailingLogin are far easier to understand for other users than Untitled_42 and Untitled_43.
  • Describe your test cases as thoroughly as possible in a comment. Without a good description of the test case in natural language, someone who needs to change the implementing code might not be able to comprehend what exactly the test is doing.
  • Ensure that your application under test is at the proper state when the test case starts. Return the application under test to the correct state before executing the actions in a test case.
  • Ensure that your application under test is at a proper state when the test case finishes. If additional tests depend on the outcome of the test, ensure that they can start. Return the application under test to the correct state when the actions in a test case are executed.
  • Whenever possible, ensure that your test cases are not depending on the results of other test cases. When this is not possible, ensure that the test cases are executed in the right order.
  • Add verifications to your tests, to test the correctness of your application under test as well as the functional flow.
  • Use keyword-driven testing to create highly reusable action sets. Bundle commonly used actions into keywords, combine keywords that are often executed sequentially into keyword sequences, and execute combinations of keywords and keyword sequences as keyword driven-tests.
  • To keep your tests maintainable and reusable, prefer writing multiple simple test cases that are combinable to writing complex test cases.
  • To avoid redundancies in your test set, prefer updating existing test cases to adding new test cases.
Parent topic: Creating Test Cases with the Open Agent


Specifying Whether to Use Locators or Tags to Resolve Window Declarations

This functionality is supported only if you are using the Open Agent.

Note: When using the Open Agent to replay tests, you can include locators and tags in the same window declaration. However, tags are deprecated and can no longer be recorded. Micro Focus recommends to use only locators with the Open Agent.
  1. Click Options > General. The General Options dialog box opens.
  2. Specify if you want to use locators or tags to resolve window declarations.
    • To use locators to resolve window declarations, check the Prefer Locator check box.
    • To use tags to resolve window declarations, uncheck the Prefer Locator check box.
  3. Click OK.
Parent topic: Creating Test Cases with the Open Agent
Related concepts
Overview of the Locator Keyword
Dynamic Object Recognition


Saving a Script File

To save a script file, click File > Save. If it is a new file, Silk Test Classic prompts you for the file name and location.

If you are working within a project, Silk Test Classic prompts you to add the file to the project. Click Yes if you want to add the file to the open project, or No if you do not want to add this file to the project.

To save a new version of a script’s object file when the script file is in view-only mode, choose File > Save Object File.

If you are working within a project, you can add the file to your project. If you add object files (.to, .ino) to your project, the files will display under the Data node on the Files tab. You cannot modify object files within the Silk Test Classic editor because object files are binary. To modify an object file, open the source file (.t or .inc), edit it, and then recompile.

Parent topic: Creating Test Cases with the Open Agent
Related tasks
Adding Existing Files to a Project


Testing an Application State

Before you run a test case that is associated with an application state, make sure the application state compiles and runs without error.

  1. Make the window active that contains the application state and choose Run > Application State.
  2. On the Run Application State dialog box, select the application state you want to run and click Run. If there are compilation errors, Silk Test Classic displays an error window. Fix the errors and rerun the application state.
Parent topic: Creating Test Cases with the Open Agent
Related concepts
Overview of Application States
Behavior of an Application State Based on NONE
Related tasks
Recording an Application State


Editing Remote Locations

This functionality is supported only if you are using the Open Agent.

You can use the Remote Locations dialog box to add any browsers and mobile devices on a remote location to the set of applications that you can test.
  1. Click Options > Edit Remote Locations. The Remote Locations dialog box appears.
  2. To add an additional remote location, perform the following actions:
    1. Click on the arrow to the right of Add Location to specify whether you want to add a remote location which is using the Silk Test Information Service, or Silk Central.
      Note: You can only configure one Silk Central as a remote location. If you have already configured the integration with Silk Central, Silk Central is listed in the remote locations list.
    2. Click Add Location. The Add Location dialog box appears.
    3. Type the URL of the remote location and the port through which Silk Test Classic connects to the information service on the remote machine into the Host field. The default port is 22901.
    4. Optional: Edit the name of the remote location in the Name field.
  3. To edit an existing remote location, click Edit.
  4. To remove a remote location, click Remove.
  5. Optional: To reduce the amount of browsers and devices in the Select Application dialog, click Do not show devices and browsers from this location. The installed browsers and connected devices of the remote location will no longer be displayed in the Select Application dialog. By default, all installed browsers and connected devices of all remote locations are displayed in the Select Application dialog.
  6. By default, remote locations are saved to %APPDATA%\Silk\SilkTest\conf\remoteLocations.xml. To change the file in which the remote locations are saved, for example to share the file with other team members, perform the following actions:
    1. Click Sharing Options. The Sharing Options dialog box appears.
    2. Click Save to shared file.
    3. Click Browse to select the file.
    You could also set the full path to the remote locations in a file named remoteLocationsFileLocation.properties, for example if you want to use a file that is located in a repository. For example, to use the remote locations that are specified in the file remoteLocations.xml, under C:\mySources, create a file with the name remoteLocationsFileLocation.properties in the folder %APPDATA%\Silk\SilkTest\conf\ and type fileLocation=C\:\\mySources\\remoteLocations.xml into the file.
  7. To load a set of already configured remote locations from a shared file, for example to use remote locations that have been specified by another team member, perform the following actions:
    1. Click Sharing Options. The Sharing Options dialog box appears.
    2. Click Load from shared file.
    3. Click Browse to select the file.
  8. Click OK.
When you have added a remote location, the browsers that are installed on the remote location, including Apple Safari on a Mac, are available in the Web tab of the Select Application dialog box, and the mobile devices that are connected to the remote location are available in the Mobile tab of the Select Application dialog box.
Parent topic: Creating Test Cases with the Open Agent
Related concepts
Select Application Dialog Box
Remote Testing with the Open Agent
Related tasks
Modifying an Application Configuration
Installing the Silk Test Information Service on a Mac
Related reference
Prerequisites for Testing with Apple Safari on a Mac


Overview of Recording the Stages of a Test Case

A test case includes several stages. The following table illustrates these stages, describing in high-level terms the steps for each stage of a sample test case that tests whether the Find facility is working.

After learning the basics of recording, you can record from within the test plan file, which makes recording easier by automatically generating the links that connect the test plan to the test case.

Setup and Record

  1. Open a new document.
  2. Type text into the document.
  3. Position the text cursor either before or after the text, depending on the direction of the search.
  4. Click Find in the Search menu.
  5. In the Find dialog box:
    1. Type the text to search for in the Find What text box.
    2. Select a direction for the search.
    3. Make the search case sensitive or not.
    4. Click Find Next to perform the search.
  6. Click Cancel to close the Find dialog box.

Verify

Record a 4Test verification statement that checks that the actual search string found, if any, is the expected search string.

Cleanup

  1. Close the document.
  2. Click No when prompted to save the file.
Parent topic: Creating Test Cases with the Open Agent


Recording the Cleanup Stage and Pasting the Recording

After performing the verification, continue to interact with your application. This is the cleanup stage. For example, in the sample test case, cleanup means closing the document window without saving it.

  1. When you have finished recording your test case or just want to see what you have recorded, click Done on the Record Status on Classic Agent window. Silk Test Classic displays the Record Test Case window again. The Test case code field contains your interactions written as 4Test code.
  2. Review the code and take the following actions:
    • All the information in the window is complete and what you want, then click Paste to Editor. Silk Test Classic closes the Record Test Case dialog box and places the new test case in your script file.
    • If the test case name is not what you want, then edit the name in the Test case name field.
    • If the application state is not the one you want, then delete the code in the Test case code field, select a new application state from the list box and click Resume Recording to re-record the test case.
    • If the test case is not finished, then click Resume Recording. The Record Status on Classic Agent window is reopened. You can continue to record your interactions.
    Note: When you paste a recorded test case, or other recorded actions, such as when you use Record Actions, into a script, Silk Test Classic indents the code under a recording statement to facilitate playback. For more information, see Recording Statement.
  3. Click Paste to Editor. If you have interacted with objects in your application that have not been identified in your include files, the Update Files dialog box opens. Choosing Paste test case only, does not update any .inc files while it pastes to the script with dynamically instantiated new objects. Update window declarations and test case will create window declarations for new objects and use the new identifiers in the resulting test case.
    Note: If you edit the contents of the Recorder window, then you must allow Silk Test Classic to update the window declarations. The Paste test case only option will be disabled.
  4. Click File > Save to save the script file.
Parent topic: Creating Test Cases with the Open Agent
Related tasks
Constructing a Test Case
Related reference
Recording Statement


Testing the Ability of the Recovery System to Close the Dialog Boxes of Your Application

Before you begin to design and record test cases, make sure that the built-in recovery system can close representative dialog boxes of your application. Although the recovery system is robust enough to be able to close almost any application window, some applications may have windows that close in an unconventional fashion.

Here are the three types of dialog boxes you should test:

  • A modal dialog box, which is a dialog box that locks you out of the rest of your application until you dismiss it.
  • A non-modal dialog box.
  • A non-modal dialog box that causes the display of a confirmation dialog box.

To test the ability of the recovery system to close your the dialog boxes of your application:

  1. Start Silk Test Classic.
  2. If you have not already done so, record a test frame for your application.
  3. Choose Options > Runtime to ensure that your application’s test frame file is listed in the Use Files field in the Runtime Options dialog box.
  4. Start your application and invoke a representative dialog box.
  5. In Silk Test Classic, click Run > Application State.
  6. On the Run Application State dialog box, select the DefaultBaseState application state and click Run.
  7. Silk Test Classic executes the DefaultBaseState routine, which should close the dialog box and any open windows, then display a results file. If the built-in recovery system cannot close one of the three representative dialog boxes, you need to modify the recovery system so that it understands how to close the dialog box.
Parent topic: Creating Test Cases with the Open Agent
Related concepts
Specifying New Window Closing Procedures
Related reference
Runtime Options Dialog Box
Run Application State Dialog Box


Linking to a Script and Test Case by Recording a Test Case

  1. Place the cursor at the end of a test description or a group description.
  2. Choose Record > Testcase. Silk Test Classic prompts you to name a script file to contain the test case. Silk Test Classic does not prompt you for a script file if there is a script defined at a higher level and inherited by the test case you are recording. If that script exists, Silk Test Classic puts the test case in that script.
  3. If prompted, select an existing script from the list or enter the name of a new script in the File Name text box, then click OK.
  4. On the Record Testcase dialog box, type the name for the test case and optionally select an application state to be run before the recording starts.
  5. Click Start Recording. Silk Test Classic displays the Recording Status dialog box. The dialog box flashes the word Recording for the duration of the session.
  6. When you are finished recording the actions that comprise the test case, click Done in the Recording Status dialog box.
  7. On the Record Testcase dialog box, click Paste to Editor. Silk Test Classic closes the Record Testcase dialog box and inserts the test case into the script file. It also adds the script and test case statements to the test plan on a new line and indents them appropriately.

If the script file is inherited by the test case you are recording, only the testcase statement is pasted.

Parent topic: Creating Test Cases with the Open Agent
Related concepts
Overview of Test Cases
Example: A Feature of a Word Processor
Test Case Design
Types of Test Cases


Recording Actions

Use the Record Actions dialog box to record the actions you perform to test an application. For example, you can also use the dialog box to write a syntactically correct 4Test statement based on your manual interaction with your application. This eliminates the need to search through the documentation for the correct method and its arguments. Once the statement is recorded, click Paste to Editor to insert the statement to your script.

This functionality is available only for projects or scripts that use the Classic Agent.

  1. Click Record > Actions to open the Record Actions dialog box.
  2. Perform the action that you want to record.

    The dialog box displays the GUI object name when you point to an object. You can click Pause Recording to review the object properties that you have recorded. When you click Resume Recording, the status bar returns.

  3. Press Ctrl+Alt to verify the action.
  4. Click Paste to Editor and then click Close.
Parent topic: Creating Test Cases with the Open Agent


Locator Spy Dialog Box

This functionality is supported only if you are using the Open Agent.

Use the Locator Spy to record a locator keyword or window declarations.

Click Record > Window Locators.

Locator
Displays the XPath query string for the object on which the mouse rests when you press Ctrl+Alt or Ctrl+Shift. After capturing the identifier, you can edit it in this box.

Silk Test Classic does not verify whether the locator string is unique. We recommend that you ensure that the string is unique. Otherwise additional objects might be found when you run the test. Furthermore, you might want to exclude some of the attributes that Silk Test Classic identifies, because the string will work without them.

Stop Recording Locator
Click to capture the locator that is currently displayed in the Locator field.
Validate Locator
Click to highlight the locator in the test application.
Paste Hierarchy to Editor
Click to paste the window declarations into the open Silk Test Classic file. The hierarchy that displays in the Locator Details section is copied.
Copy Hierarchy to Clipboard
Click to copy the window declarations to the clipboard. Use Edit > Paste to insert the code into a different editing window or to insert it into the current window at the location of your choice. The hierarchy that displays in the Locator Details section is copied.
Paste Locator to Editor
Click to paste the locator into the open Silk Test Classic file. The content of the currently active text field is copied.
Copy Locator to Clipboard
Click to copy the locator to the clipboard. Use Edit > Paste to insert the code into a different editing window or to insert it into the current window at the location of your choice. The content of the currently active text field is copied.
Parent topic: Creating Test Cases with the Open Agent
Related concepts
Overview of the Locator Keyword
Related tasks
Recording Locators Using the Locator Spy


Record Testcase Dialog Box

Use the Record Testcase dialog box to record an entire test case, specifying the application state of your choice and including verification statements.

To open the dialog box, click Record > Testcase in the Silk Test Classic menu.

Silk Test Classic will compile the currently active script file or test plan, if not already compiled, before opening the Record Testcase dialog box. If the current window is not a script file or test plan, Silk Test Classic prompts you to open a script file or create a new script file before opening the dialog box.

Testcase name
Specifies the name of the test case you are going to record. Type the name of the test case or accept the default. The test case name must be less than 128 characters.
Application state
Specifies an application state on which this test case is based. Select an application state from the list. The default is the last application state you specified in this field.
Testcase code
Once you have completed recording the test case, this area displays the 4Test code captured during recording.
Start Recording
Click to close the dialog box. Silk Test Classic displays a message box indicating that the base state is being set and displays one of the following:
  • If you are using the Classic Agent, Silk Test Classic displays the Record Status for the Classic Agent window.
  • If you are using the Open Agent, Silk Test Classic displays the Recorder window.
Paste to Editor
Click to close the dialog box and place the 4Test code, if any, in the associated file.
Set Recovery System
Displays the Set Recovery System dialog box. This button is only available when wMainWindow has not been set. For instance, if you have an include file referenced that does not contain constwMainWindow = MyWin, then the button is available. Once Silk Test Classic sees that wMainWin = Something, the button is disabled.
Parent topic: Creating Test Cases with the Open Agent
Related tasks
Recording Test Cases for Mobile Applications
Recording Test Cases for Standard and Web Applications
Recording an Application State


Update Files Dialog Box

Use to indicate whether you want to update window declarations on the fly after you have finished recording.

Click Paste to Editor on the Record dialog boxes if the recorder discovers new windows or child objects. This dialog box gives you the option of using the generated identifiers or the dynamically instantiated variables.

Paste testcase/appstate only
Select this option to paste the dynamically instantiated variables to the test case or appstate. If you select this option, the Update Window Declaration Detail area is unavailable. If you have clicked the Set Recovery System button on the Record Testcase dialog box or the Record Application State dialog box, this button is disabled. If you have configured your basestate, Silk Test Classic creates a main window declaration and saves it to a .inc file. That means that this option is not available to you.
Paste testcase/appstate and update window declaration(s)
Select this option paste the variables to the test case or appstate AND to add the generated identifiers to a new file or an opened file. If you select this option, the Update Window Declaration Detail area is available.
Update Window Declaration Detail area
This area may contain one or both of the following messages.
Input the file name to store new window objects
Indicate the name of the new file or the name of the referenced file (that is, a file loaded into memory) to contain the window declarations. The file you specify here is listed in the Use Files field on the Runtime Options dialog box.
The window declarations in the following files will be updated
If the recorder finds new child objects, Silk Test Classic lists the files that have changed and updates them after you click OK.
Parent topic: Creating Test Cases with the Open Agent


Dynamic Object Recognition

Dynamic object recognition enables you to create test cases that use XPath queries to find and identify objects. Dynamic object recognition uses a Find or FindAll method to identify an object in a test case. For example, the following query finds the first top-level Shell with the caption SWT Test Application:
Desktop.find("/Shell[@caption='SWT Test Application']")

To create tests that use dynamic object recognition, you must use the Open Agent.

Examples of the types of test environments where dynamic object recognition works well include:
  • In any application environment where the graphical user interface is undergoing changes. For example, to test the Check Me check box in a dialog box that belongs to a menu where the menu and the dialog box name are changing, using dynamic object recognition enables you to test the check box without concern for what the menu and dialog box are called. You can then verify the check box name, dialog box name, and menu name to ensure that you have tested the correct component.
  • In a Web application that includes dynamic tables or text. For example, to test a table that displays only when the user points to a certain item on the web page, use dynamic object recognition to have the test case locate the table without regard for which part of the page needs to be clicked in order for the table to display.
  • In an Eclipse environment that uses views. For example, to test an Eclipse environment that includes a view component, use dynamic object recognition to identify the view without regard to the hierarchy of objects that need to open prior to the view.

Using dynamic object recognition compared to using hierarchical object recognition

The benefits of using dynamic object recognition rather than hierarchical object recognition include:
  • Dynamic object recognition uses a subset of the XPath query language, which is a common XML-based language defined by the World Wide Web Consortium, W3C. Hierarchical object recognition is based on the concept of a complete description of the application's object hierarchy and as a result is less flexible than dynamic object recognition.
  • Dynamic object recognition requires a single object rather than an include file that contains window declarations for the objects in the application that you are testing. Using XPath queries, a test case can locate an object using a Find command followed by a supported XPath construct. Hierarchical object recognition uses the include file to identify the objects within the application.

You can create tests for both dynamic and hierarchical object recognition in your test environment. You can use both recognition methods within a single test case if necessary. Use the method best suited to meet your test requirements.

Using dynamic object recognition and window declarations

Silk Test Classic provides an alternative to using Find or FindAll functions in scripts that use dynamic object recognition. By default, when you record a test case with the Open Agent, Silk Test Classic uses locator keywords in an include (.inc) file to create scripts that use dynamic object recognition and window declarations. Using locator keywords with dynamic object recognition enables users to combine the advantages of INC files with the advantages of dynamic object recognition. For example, scripts can use window names in the same manner as traditional, Silk Test Classic tag-based scripts and leverage the power of XPath queries.

Existing test cases that use dynamic object recognition without locator keywords in an INC file will continue to be supported. You can replay these tests, but you cannot record new tests with dynamic object recognition without locator keywords in an INC file. You must manually record test cases that use dynamic object recognition without locator keywords. You can record the XPath query strings to include in test cases by using the Locator Spy dialog box.

  • XPath Basic Concepts
    Describes how Silk Test Classic supports the XPath query language.
  • Supported XPath Subset
    Lists the XPath constructs that Silk Test Classic supports.
  • XPath Samples
    Provides sample XPath queries and explains the semantics for each query.
  • Supported Locator Attributes
    Provides the supported attribute types for dynamic object recognition.
  • Using Locators
    Describes how to use shortened forms for the locators.
  • Using Locators to Check if an Object Exists
    Describes how you can use the Exists method to determine if an object exists in the application under test.
  • Identifying Multiple Objects with One Locator
    Describes how you can identify multiple objects by using a single locator.
  • Locator Customization
    Describes how you can create stable locators that enable Silk Test Classic to reliably recognize the controls in your application under test.
  • Troubleshooting Performance Issues for XPath
    Describes how you can enhance the performance of your scripts by using different locators.
Parent topic: Designing and Recording Test Cases with the Open Agent
Related concepts
Open Agent
Overview of Test Frames
XPath Basic Concepts
Supported Locator Attributes
Custom Attributes
Related tasks
Recording Locators Using the Locator Spy
Recording Test Cases for Standard and Web Applications


XPath Basic Concepts

Silk Test Classic supports a subset of the XPath query language. For additional information about XPath, see http://www.w3.org/TR/xpath20/.

XPath expressions rely on the current context, the position of the object in the hierarchy on which the Find method was invoked. All XPath expressions depend on this position, much like a file system. For example:
  • "//Shell" finds all shells in any hierarchy starting from the current context.
  • "Shell" finds all shells that are direct children of the current context.

Additionally, some XPath expressions are context sensitive. For example, myWindow.find(xPath) makes myWindow the current context.

Silk Test Classic provides an alternative to using Find or FindAll functions in scripts that use XPath queries. You can use locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations.

  • Object Type and Search Scope
    Describes how Silk Test Classic uses the object type and the search scope to identify objects.
  • Using Attributes to Identify an Object
    Describes how you can use attributes to improve the identification of an object.
Parent topic: Dynamic Object Recognition
Related concepts
Overview of the Locator Keyword
Dynamic Object Recognition
Troubleshooting Performance Issues for XPath
Related reference
XPath Samples


Object Type and Search Scope

A locator typically contains the type of object to identify and a search scope. The search scope is one of the following:
  • //
  • /

Locators rely on the current object, which is the object for which the locator is specified. The current object is located in the object hierarchy of the application's UI. All locators depend on the position of the current object in this hierarchy, much like a file system.

XPath expressions rely on the current context, which is the position of the object in the hierarchy on which the Find method was invoked. All XPath expressions depend on this position, much like a file system.

Note:

The object type in a locator for an HTML element is either the HTML tag name or the class name that Silk Test Classic uses for this object. For example, the locators //a and //DomLink, where DomLink is the name for hyperlinks in Silk Test Classic, are equivalent. For all non-HTML based technologies only the Silk Test Classic class name can be used.

Example

  • //a identifies hyperlink objects in any hierarchy relative to the current object.
  • /a identifies hyperlink objects that are direct children of the current object.
Note: <a> is the HTML tag for hyperlinks on a Web page.

Example

The following code sample identifies the first hyperlink in a browser. This example assumes that a variable with the name browserWindow exists in the script that refers to a running browser instance. Here the type is "a" and the current object is browserWindow.

Parent topic: XPath Basic Concepts


Using Attributes to Identify an Object

This functionality is supported only if you are using the Open Agent.

To identify an object based on its properties, you can use locator attributes. The locator attributes are specified in square brackets after the type of the object.

Example

The following sample uses the textContents attribute to identify a hyperlink with the text Home. If there are multiple hyperlinks with the same text, the locator identifies the first one.

WINDOW link = WebBrowser.BrowserWindow.Find("//a[@textContents='Home']")
Parent topic: XPath Basic Concepts


Supported XPath Subset

Silk Test Classic supports a subset of the XPath query language. Use a FindAll or a Find command followed by a supported construct to create a test case.

To create tests that use dynamic object recognition, you must use the Open Agent.

The following table lists the constructs that Silk Test Classic supports.
Supported XPath Construct | Sample | Description
Attribute MenuItem[@caption='abc'] Finds all menu items with the given caption attribute in their object definition that are children of the current context. The following attributes are supported:
  • caption (without caption index)
  • priorlabel (without index)
  • windowid
Index | MenuItem[1] | Finds the first menu item that is a child of the current context. Indices are 1-based in XPath.
Logical Operators: and, or, not, =, != | MenuItem[not(@caption='a' or @windowid!='b') and @priorlabel='p']
. TestApplication.Find(“//Dialog[@caption='Check Box']/././.”) Finds the context on which the Find command was executed. For instance, the sample could have been typed as TestApplication.Find(“//Dialog[@caption='Check Box']”).
.. Desktop.Find(“//PushButton[@caption='Previous']/../PushButton[@caption=’Ok’]”) Finds the parent of an object. For instance, the sample finds a PushButton with the caption “Ok” that has a sibling PushButton with the caption “Previous.”
/ /Shell

Finds all shells that are direct children of the current object.

"./Shell" is equivalent to "/Shell" and "Shell".

/ /Shell/MenuItem Finds all menu items that are a child of the current object.
// //Shell Finds all shells in any hierarchy relative to the current object.
// //Shell//MenuItem Finds all menu items that are direct or indirect children of a Shell that is a direct child of the current object.
// //MenuItem Finds all menu items that are direct or indirect children of the current context.
* *[@caption='c'] Finds all objects with the given caption that are a direct child of the current context.
* .//MenuItem/*/Shell Finds all shells that are a grandchild of a menu item.
The following table lists the XPath constructs that Silk Test Classic does not support.
Unsupported XPath Construct | Example
Comparing two attributes with each other. | PushButton[@caption = @windowid]
An attribute name on the right side is not supported. An attribute name must be on the left side. | PushButton['abc' = @caption]
Combining multiple XPath expressions with 'and' or 'or'. | PushButton [@caption = 'abc'] or .//Checkbox
More than one set of attribute brackets. | PushButton[@caption = 'abc] [@windowid = '123'] Use PushButton [@caption = 'abc and @windowid = '123'] instead.
More than one set of index brackets. | PushButton[1][2]
Any construct that does not explicitly specify a class or the class wildcard, such as including a wildcard as part of a class name. | //[@caption = 'abc'] Use //*[@caption = 'abc'] instead. "//*Button[@caption='abc']"
Parent topic: Dynamic Object Recognition
Related concepts
Dynamic Object Recognition


XPath Samples

The following table lists sample XPath queries and explains the semantics for each query.
XPath String | Description
desktop.Find("/Shell[@caption='SWT Test Application'] ") | Finds the first top-level Shell with the given caption.
desktop.Find("//MenuItem[@caption='Control']") | Finds the MenuItem in any hierarchy with the given caption.
myShell.Find("//MenuItem[@caption!='Control']") | Finds an MenuItem in any child hierarchy of myShell that does not have the given caption.
myShell.Find("Menu[@caption='Control']/MenuItem[@caption!='Control']") | Looks for a specified MenuItem with the specified Menu as parent that has myShell as parent.
myShell.Find("//MenuItem[@caption='Control' and @windowid='20']") | Finds a MenuItem in any child hierarchy of myWindow with the given caption and windowId.
myShell.Find("//MenuItem[@caption='Control' or @windowid='20']") | Finds a MenuItem in any child hierarchy of myWindow with the given caption or windowId.
desktop.FindAll("/Shell[2]/*/PushButton") | Finds all PushButtons that have an arbitrary parent that has the second top-level shell as parent.
desktop.FindAll("/Shell[2]//PushButton") | Finds all PushButtons that use the second shell as direct or indirect parent.
myBrowser.Find("//FlexApplication[1]//FlexButton[@caption='ok']") | Looks up the first FlexButton within the first FlexApplication within the given browser.
myBrowser.FindAll("//td[@class='abc*']//a[@class='xyz']") | Finds all link elements with attribute class xyz that are direct or indirect children of td elements with attribute class abc*.
Parent topic: Dynamic Object Recognition
Related concepts
XPath Basic Concepts
Dynamic Object Recognition
Troubleshooting Performance Issues for XPath


Supported Locator Attributes

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests. If necessary, you can change the attribute type in one of the following ways:

  • Manually typing another attribute type and value.
  • Specifying another preference for the default attribute type by changing the custom attributes list values.

To create tests that use locators, you must use the Open Agent.

Parent topic: Dynamic Object Recognition
Related concepts
Custom Attributes
Locator Attributes for Apache Flex Controls
Locator Attributes for Java AWT/Swing Controls
Locator Attributes for Java SWT Controls
Locator Attributes for Identifying Rumba Controls
Locator Attributes for SAP Controls
Locator Attributes for Silverlight Controls
Locator Attributes for Windows API-Based Applications
Locator Attributes for Windows Forms Applications
Locator Attributes for Windows Presentation Foundation (WPF) Controls
Locator Attributes for xBrowser controls


Using Locators

Within Silk Test Classic, literal references to identified objects are referred to as locators. For convenience, you can use shortened forms for the locator strings in scripts. Silk Test Classic automatically expands the syntax to use full locator strings when you playback a script. When you manually code a script, you can omit the following parts in the following order:

  • The search scope, //.
  • The object type name. Silk Test Classic defaults to the class name.
  • The surrounding square brackets of the attributes, [ ].

When you manually code a script, we recommend that you use the shortest form available.

Note: When you identify an object, the full locator string is captured by default.
The following locators are equivalent:
  • The first example uses the full locator string.

    To confirm the full locator string, use the dialog box.

  • The second example works when the browser window already exists. Alternatively, you can use the shortened form.

To find an object that has no real attributes for identification, use the index. For instance, to select the second hyperlink on a Web page, you can type:

Additionally, to find the first object of its kind, which might be useful if the object has no real attributes, you can type:

Parent topic: Dynamic Object Recognition


Using Locators to Check if an Object Exists

You can use the Exists method to determine if an object exists in the application under test.

The following code checks if a hyperlink with the text Log out exists on a Web page:

if (browserWindow.Exists( "//a[@textContents='Log out']" )) {
  // do something
}

Using the Find method

You can use the Find method and the FindOptions method to check if an object, which you want to use later, exists.

The following code searches for a window and closes the window if the window is found:

Window mainWindow = desktop.Find("//Window[@caption='My Window']", new FindOptions(false))
if (mainWindow != null){
  mainWindow.CloseSynchron()
}
Parent topic: Dynamic Object Recognition


Identifying Multiple Objects with One Locator

You can use the FindAll method to identify all objects that match a locator rather that only identifying the first object that matches the locator.

Example

The following code example uses the FindAll method to retrieve all hyperlinks of a Web page:

LIST OF DOMLINK links = browserWindow.FindAll("//a")
Parent topic: Dynamic Object Recognition


Locator Customization

This section describes how you can create stable locators that enable Silk Test Classic to reliably recognize the controls in your application under test (AUT).

Silk Test Classic relies on the identifiers that the AUT exposes for its UI controls and is very flexible and powerful in regards to identifying UI controls. Silk Test Classic can use any declared properties for any UI control class and can also create locators by using the hierarchy of UI controls. From the hierarchy, Silk Test Classic chooses the most appropriate items and properties to identify each UI control.

Silk Test Classic can exclude dynamic numbers of controls along the UI control hierarchy, which makes the object recognition in Silk Test Classic very robust against changes in the AUT. Intermediate grouping controls that change the hierarchy of the UI control tree, like formatting elements in Web pages, can be excluded from the object recognition.

Some UI controls do not expose meaningful properties, based on which they can be identified uniquely. Applications which include such controls are described as applications with bad testability. Hierarchies, and especially dynamic hierarchies, provide a good means to create unique locators for such applications. Applications with good testability should always provide a simple mechanism to identify UI controls uniquely.

One of the simplest and most effective practices to make your AUT easier to test is to introduce stable identifiers for controls and to expose these stable identifiers through the existing interfaces of the application.

  • Stable Identifiers
    Describes what a stable identifier is and why stable identifiers are important for object recognition.
  • Custom Attributes
    Describes custom attributes that you can add to test applications.
Parent topic: Dynamic Object Recognition


Stable Identifiers

A stable identifier for a UI control is an identifier that does not change between invocations of the control and between different versions of the application, in which the UI control exists. A stable identifier needs to be unique in the context of its usage, meaning that no other control with the same identifier is accessible at the same time. This does not necessarily mean that you need to use GUID-style identifiers that are unique in a global context. Identifiers for controls should be readable and provide meaningful names. Naming conventions for these identifiers will make it much easier to associate the identifier to the actual control.

Example: Is the caption a good identifier for a control?

Very often test tools are using the caption as the default identifier for UI controls. The caption is the text in the UI that is associated with the control. However, using the caption to identify a UI control has the following drawbacks:
  • The caption is not stable. Captions can change frequently during the development process. For example, the UI of the AUT might be reviewed at the end of the development process. This prevents introducing UI testing early in the development process because the UI is not stable.
  • The caption is not unique. For example, an application might include multiple buttons with the caption OK.
  • Many controls are not exposing a caption, so you need to use another property for identification.
  • Using captions for testing localized applications is cumbersome, as you need to maintain a caption for a control in each language and you also have to maintain a complex script logic where you dynamically can assign the appropriate caption for each language.
  • Creating Stable Locators
    Describes how you can create stable locators with Silk Test Classic.
  • Example: Locating Siblings of a Control
    Describes how you can locate a control in an application when you have a stable locator for a sibling of the control.
  • Example: Locating the Expand Icon in a Dynamic GWT Tree
    Describes how you can locate a control in an application for which Silk Test Classic does not generate stable locators by default.
Parent topic: Locator Customization


Creating Stable Locators

One of the main advantages of Silk Test Classic is the flexible and powerful object-recognition mechanism. By using XPath notation to locate UI controls, Silk Test Classic can reliably identify UI controls that do not have any suitable attributes, as long as there are UI elements near the element of interest that have suitable attributes. The XPath locators in Silk Test Classic can use the entire UI control hierarchy or parts of it for identifying UI controls. Especially modern AJAX toolkits, which dynamically generate very complex Document Object Models (DOMs), do not provide suitable control attributes that can be used for locating UI controls.

In such a case, test tools that do not provide intelligent object-recognition mechanisms often need to use index-based recognition techniques to identity UI controls. For example, identify the n-th control with icon Expand. This often results in test scripts that are hard to maintain, as even minor changes in the application can break the test script.

A good strategy to create stable locators for UI controls that do not provide useful attributes is to look for an anchor element with a stable locator somewhere in the hierarchy. From that anchor element you can then work your way to the element for which you want to create the locator.

Silk Test Classic uses this strategy when creating locators, however there might be situations in which you have to manually create a stable locator for a control.

Parent topic: Stable Identifiers


Example: Locating Siblings of a Control

This functionality is supported only if you are using the Open Agent.

This topic describes how you can locate a control, which does not provide any meaningful attributes that can be used in locators, when a stable locator for a sibling of the control is available.

Assume that you have already identified the control Item 0.0, which has the following stable locator:
/BrowserApplication//BrowserWindow//DIV[@textContent='Item 0.0']
If you know that Item 0.0 has a sibling of the type a, you can use the following code to build a stable locator for the sibling:
/BrowserApplication//BrowserWindow//DIV[@textContent='Item 0.0']/../a
You can also use the sibling approach to identify text fields. Text fields often do not provide any meaningful attributes that can be used in locators. By using the label of a text field, you could create a meaningful locator for the text field, because the label is the best identifier for the text field from the perspective of a tester. You can easily use the label as a part of the locator for a test field by using the sibling approach. For example, if the text field is a sibling of a label with the text User Name, you can use the following locator:
/BrowserApplication//BrowserWindow//DIV[@textContent='User Name']/../input[@type='text']
Parent topic: Stable Identifiers


Example: Locating the Expand Icon in a Dynamic GWT Tree

This functionality is supported only if you are using the Open Agent.

The Google Widget Toolkit (GWT) is a very popular and powerful toolkit, which is hard to test. The dynamic tree control is a very commonly used UI control in GWT. To expand the tree, we need to identify the Expand icon element.

You can find a sample dynamic GWT tree at http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwTree.

The default locator generated by Silk Test Classic is the following:
/BrowserApplication//BrowserWindow//DIV[@id='gwt-debug-cwTree-dynamicTree-root-child0']/DIV/DIV[1]//IMG[@border='0']
For the following reasons, this default locator is no reliable locator for identifying the Expand icon for the control Item 0.0:
  • The locator is complex and built on multiple hierarchies. A small change in the DOM structure, which is dynamic with AJAX, can break the locator.
  • The locator contains an index for some of the controls along the hierarchy. Index based locators are generally weak as they find controls by their occurrence, for example finding the sixth expand icon in a tree does not define the control well. An exception to that rule would be if the index is used to express different data sets that you want to identify, for example the sixth data row in a grid.

Often a good strategy for finding better locators is to search for siblings of elements that you need to locate. If you find siblings with better locators, XPath allows you to construct the locator by identifying those siblings. In this case, the tree item Item 0.0 provides a better locator than the Expand icon. The locator of the tree item Item 0.0 is a stable and simple locator as it uses the @textContents property of the control.

By default, Silk Test Classic uses the property @id, but in GWT the @id is often not a stable property, because it contains a value like ='gwt-uid-<nnn>', where <nnn> changes frequently, even for the same element between different calls.

You can manually change the locator to use the @textContents property instead of the @id.

Original Locator:
/BrowserApplication//BrowserWindow//DIV[@id='gwt-uid-109']
Alternate Locator:
/BrowserApplication//BrowserWindow//DIV[@textContents='Item 0.0']

Or you can instruct Silk Test Classic to avoid using @id='gwt-uid-<nnn>'. In this case Silk Test Classic will automatically record the stable locator. You can do this by adding the text pattern that is used in @id properties to the locator attribute value blacklist. In this case, add gwt-uid* to the blacklist.

When inspecting the hierarchy of elements, you can see that the control Item 0.0 and the Expand icon control have a joint root node, which is a DomTableRow control.

To build a stable locator for the Expand icon, you first need to locate Item 0.0 with the following locator:
/BrowserApplication//BrowserWindow//DIV[@textContent='Item 0.0']
Then you need to go up two levels in the element hierarchy to the DomTableRow element. You express this with XPath by adding /../.. to the locator. Finally you need to search from DomTableRow for the Expand icon. This is easy as the Expand icon is the only IMG control in the sub-tree. You express this with XPath by adding //IMG to the locator. The final stable locator for the Expand icon looks like the following:
/BrowserApplication//BrowserWindow//DIV[@textContent='Item 0.0']/../..//IMG
Parent topic: Stable Identifiers


Custom Attributes

This functionality is supported only if you are using the Open Agent.

Add custom attributes to a test application to make a test more stable. You can use custom attributes with the following technologies:
  • Java SWT
  • Swing
  • WPF
  • xBrowser
  • Windows Forms
  • SAP

For example, in Java SWT, the developer implementing the GUI can define an attribute (for example, silkTestAutomationId) for a widget that uniquely identifies the widget in the application. A tester using Silk Test Classic can then add that attribute to the list of custom attributes (in this case, silkTestAutomationId), and can identify controls by that unique ID. Using a custom attribute is more reliable than other attributes like caption or index, since a caption will change when you translate the application into another language, and the index will change whenever another widget is added before the one you have defined already.

If more than one object is assigned the same custom attribute value, all the objects with that value will return when you call the custom attribute. For example, if you assign the unique ID, 'loginName' to two different fields, both fields will return when you call the loginName attribute.

First, enable custom attributes for your application and then create the test.

Recording tests that use dynamic object recognition

Using custom class attributes becomes even more powerful when it is used in combination with dynamic object recognition. For example, If you create a button in the application that you want to test using the following code:

Button myButton = Button(parent, SWT.NONE);
myButton.setData("SilkTestAutomationId", "myButtonId");

To add the attribute to your XPath query string in your test case, you can use the following query:

Window button = Desktop.Find(".//PushButton[@SilkTestAutomationId='myButton']")
  • Custom Attributes for Apache Flex Applications
    Describes which attributes you can use to create stable identifiers for Apache Flex applications.
  • Java SWT Custom Attributes
    Add custom attributes to a test application to make a test more stable.
  • Custom Attributes for Web Applications
    Describes which attributes you can use to create stable identifiers for Web applications.
  • Custom Attributes for Windows Forms Applications
    Describes which attributes you can use to create stable identifiers for Windows Forms applications.
  • Custom Attributes for WPF Applications
    Describes which attributes you can use to create stable identifiers for WPF applications.
Parent topic: Locator Customization
Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Parent topic: Testing Java SWT and Eclipse Applications with the Open Agent
Related concepts
Supported Locator Attributes
Dynamic Object Recognition
Testing Java SWT and Eclipse Applications with the Open Agent
Cross-Browser Testing with the Open Agent
Related tasks
Defining which Custom Locator Attributes to Use for Recognition
Setting Recording Options for xBrowser


Custom Attributes for Apache Flex Applications

Apache Flex applications use the predefined property automationName to specify a stable identifier for the Apache Flex control as follows:
  <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300">
    <fx:Script>
    …
    </fx:Script>
    <s:Button x="247" y="81" label="Button" id="button1" enabled="true" click="button1_clickHandler(event)"
        automationName="AID_buttonRepeat"/>
    <s:Label x="128" y="123" width="315" height="18" id="label1" verticalAlign="middle"
        text="awaiting your click" textAlign="center"/>
  </s:Group>
Apache Flex application locators look like the following:
…//SparkApplication//SparkButton[@caption='AID_buttonRepeat'
Attention: For Apache Flex applications, the automationName is always mapped to the locator attribute caption in Silk Test Classic. If the automationName attribute is not specified, Silk Test Classic maps the property ID to the locator attribute caption.
Parent topic: Custom Attributes


Java SWT Custom Attributes

You can add custom attributes to a test application to make a test more stable. For example, in Java SWT, the developer implementing the GUI can define an attribute (for example, 'silkTestAutomationId') for a widget that uniquely identifies the widget in the application. A tester using Silk Test Classic can then add that attribute to the list of custom attributes (in this case, 'silkTestAutomationId'), and can identify controls by that unique ID. Using a custom attribute is more reliable than other attributes like caption or index, since a caption will change when you translate the application into another language, and the index will change whenever another widget is added before the one you have defined already.

If more than one object is assigned the same custom attribute value, all the objects with that value will return when you call the custom attribute. For example, if you assign the unique ID, 'loginName' to two different text fields, both fields will return when you call the 'loginName' attribute.

Java SWT Example

If you create a button in the application that you want to test using the following code:
Button myButton = Button(parent, SWT.NONE);

myButton.setData("SilkTestAutomationId", "myButtonId");
To add the attribute to your XPath query string in your test, you can use the following query:
Dim button =
desktop.PushButton("@SilkTestAutomationId='myButton'")

To enable a Java SWT application for testing custom attributes, the developers must include custom attributes in the application. Include the attributes using the org.swt.widgets.Widget.setData(String key, Object value) method.

Parent topic: Custom Attributes


Custom Attributes for Web Applications

HTML defines a common attribute ID that can represent a stable identifier. By definition, the ID uniquely identifies an element within a document. Only one element with a specific ID can exist in a document.

However, in many cases, and especially with AJAX applications, the ID is used to dynamically identify the associated server handler for the HTML element, meaning that the ID changes with each creation of the Web document. In such a case the ID is not a stable identifier and is not suitable to identify UI controls in a Web application.

A better alternative for Web applications is to introduce a new custom HTML attribute that is exclusively used to expose UI control information to Silk Test Classic.

Custom HTML attributes are ignored by browsers and by that do not change the behavior of the AUT. They are accessible through the DOM of the browser. Silk Test Classic allows you to configure the attribute that you want to use as the default attribute for identification, even if the attribute is a custom attribute of the control class. To set the custom attribute as the default identification attribute for a specific technology domain, click Options > Recorder > Custom Attributes and select the technology domain.

Example: Changing ID

The application developer just needs to add the additional HTML attribute to the Web element.

Original HTML code:
<A HREF="http://abc.com/control=4543772788784322..." <IMG
src="http://abc.com/xxx.gif" width=16 height=16> </A>
HTML code with the new custom HTML attribute AUTOMATION_ID:
<A HREF="http://abc.com/control=4543772788784322..."
AUTOMATION_ID = "AID_Login" <IMG src="http://abc.com/xxx.gif"
width=16 height=16> </A>
When configuring the custom attributes, Silk Test Classic uses the custom attribute to construct a unique locator whenever possible. Web locators look like the following:
…//DomLink[@AUTOMATION_ID='AID_Login'
One example of a changing ID is the Google Widget Toolkit (GWT), where the ID often holds a dynamic value which changes with every creation of the Web document:
ID = 'gwt-uid-<nnn>'
In this case <nnn> changes frequently.
Parent topic: Custom Attributes


Custom Attributes for Windows Forms Applications

Windows Forms applications use the predefined automation property automationId to specify a stable identifier for the Windows forms control.

Silk Test Classic automatically will use this property for identification in the locator. Windows Forms application locators look like the following:
/FormsWindow//PushButton[@automationId='btnBasicControls']
Parent topic: Custom Attributes


Custom Attributes for WPF Applications

WPF applications use the predefined automation property AutomationProperties.AutomationId to specify a stable identifier for the WPF control as follows:
<Window x:Class="Test.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
  <Grid>
    <Button AutomationProperties.AutomationId="AID_buttonA">The
Button</Button>
  </Grid>
</Window>
Silk Test Classic automatically uses this property for identification in the locator. WPF application locators look like the following:
/WPFWindow[@caption='MainWindow']//WPFButton[@automationId='AID_buttonA']
Parent topic: Custom Attributes


Troubleshooting Performance Issues for XPath

When testing applications with a complex object structure, for example complex web applications, you may encounter performance issues, or issues related to the reliability of your scripts. This topic describes how you can improve the performance of your scripts by using different locators than the ones that Silk Test Classic has automatically generated during recording.

Note: In general, we do not recommend using complex locators. Using complex locators might lead to a loss of reliability for your tests. Small changes in the structure of the tested application can break such a complex locator. Nevertheless, when the performance of your scripts is not satisfying, using more specific locators might result in tests with better performance.
The following is a sample element tree for the application MyApplication:
Root
  Node id=1
    Leaf id=2
    Leaf id=3
    Leaf id=4
    Leaf id=5
  Node id=6
    Node id=7
      Leaf id=8
      Leaf id=9
    Node id=9
      Leaf id=10
You can use one or more of the following optimizations to improve the performance of your scripts:
  • If you want to locate an element in a complex object structure , search for the element in a specific part of the object structure, not in the entire object structure. For example, to find the element with the identifier 4 in the sample tree, if you have a query like Root.Find("//Leaf[@id='4']"), replace it with a query like Root.Find("/Node[@id='1']/Leaf[@id='4']"). The first query searches the entire element tree of the application for leafs with the identifier 4. The first leaf found is then returned. The second query searches only the first level nodes, which are the node with the identifier 1 and the node with the identifier 6, for the node with the identifier 1, and then searches in the subtree of the node with the identifier 1 for all leafs with the identifier 4.
  • When you want to locate multiple items in the same hierarchy, first locate the hierarchy, and then locate the items in a loop. If you have a query like Root.FindAll("/Node[@id='1']/Leaf"), replace it with a loop like the following:
    testcase Test() appstate none
  WINDOW node
  INTEGER i

  node = Root.Find("/Node[@id='1']")
  for i = 1 to 4 step 1
    node.Find("/Leaf[@id='{i}']")
Parent topic: Dynamic Object Recognition
Related reference
XPath Samples


Highlighting Objects During Recording

During recording, the active object in the AUT is highlighted by a green rectangle. As soon as a new object becomes active this new object is highlighted. If the same object remains active for more than 0.5 seconds a tool-tip will be displayed that displays the class name of the active object and also the current position of the mouse relative to the active object. This tool-tip will no longer be displayed when a new object becomes active, the user presses the mouse, or automatically after 2 seconds.

Parent topic: Designing and Recording Test Cases with the Open Agent


Overview of the Locator Keyword

Traditional Silk Test Classic scripts that use the Classic Agent use hierarchical object recognition. When you record a script that uses hierarchical object recognition, Silk Test Classic creates an include (.inc) file that contains window declarations and tags for the GUI objects that you are testing. Essentially, the INC file serves as a central global, repository of information about the application under test. It contains all the data structures that support your test cases and test scripts.

When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations. The locator is the actual name of the object, as opposed to the identifier, which is the logical name. Silk Test Classic uses the locator to identify objects in the application when executing test cases. Test cases never use the locator to refer to an object; they always use the identifier.

You can also manually create test cases that use dynamic object recognition without locator keywords. Dynamic object recognition uses a Find or FindAll function and an XPath query to locate the objects that you want to test. No include file, window declaration, or tags are required.

The advantages of using locators with an INC file include:
  • You combine the advantages of INC files with the advantages of dynamic object recognition. For example, scripts can use window names in the same manner as traditional, Silk Test Classic tag-based scripts and leverage the power of XPath queries.
  • Enhancing legacy INC files with locators facilitates a smooth transition from using hierarchical object recognition to new scripts that use dynamic object recognition. You use dynamic object recognition but your scripts look and feel like traditional, Silk Test Classic tag-based scripts that use hierarchical object recognition.
  • You can use AutoComplete to assist in script creation. AutoComplete requires an INC file.

Syntax

The syntax for the locator keyword is:
[gui-specifier] locator locator-string
where locator-string is an XPath string. The XPath string is the same locator string that is used for the Find or FindAll functions.

Example

The following example shows a window declaration that uses locators:
[-] window MainWin TestApplication
    [ ] locator "//MainWin[@caption='Test Application']"
    [ ]
    [ ] // The working directory of the application when it is invoked
    [ ] const sDir = "{SYS_GetEnv("SEGUE_HOME")}"
    [ ]
    [ ] // The command line used to invoke the application
    [ ] const sCmdLine = """{SYS_GetEnv("SEGUE_HOME")}testapp.exe"""
    [ ]
    [-] Menu Control
        [ ] locator "//Menu[@caption='Control']"
    [-] MenuItem CheckBox
        [ ] locator "//MenuItem[@caption='Check box']"
    [-] MenuItem ComboBox
        [ ] locator "//MenuItem[@caption='Combo box']"
    [-] MenuItem ListBox
        [ ] locator "//MenuItem[@caption='List box']"
    [-] MenuItem PopupList
        [ ] locator "//MenuItem[@caption='Popup list']"
    [-] MenuItem PushButton
        [ ] locator "//MenuItem[@caption='Push button']"
    [-] MenuItem RadioButton
        [ ] locator "//MenuItem[@caption='Radio button']"
    [-] MenuItem ListView
        [ ] locator "//MenuItem[@caption='List view']"
    [-] MenuItem PageList
        [ ] locator "//MenuItem[@caption='Page list']"
    [-] MenuItem UpDown
        [ ] locator "//MenuItem[@caption='Up-Down']"
    [-] MenuItem TreeView
        [ ] locator "//MenuItem[@caption='Tree view']"
    [-] MenuItem Textfield
        [ ] locator "//MenuItem[@caption='Textfield']"
    [-] MenuItem StaticText
        [ ] locator "//MenuItem[@caption='Static text']"
    [-] MenuItem TracKBar
        [ ] locator "//MenuItem[@caption='Track bar']"
    [-] MenuItem ToolBar
        [ ] locator "//MenuItem[@caption='Tool bar']"
    [-] MenuItem Scrollbar
        [ ] locator "//MenuItem[@caption='Scrollbar']"
    [ ]
    [-] DialogBox CheckBox
        [ ] locator "//DialogBox[@caption='Check Box']"
    [-] CheckBox TheCheckBox
        [ ] locator "//CheckBox[@caption='The check box']"
    [-] PushButton Exit
        [ ] locator "//PushButton[@caption='Exit']"
For example, if the script uses a menu item like this:
TestApplication.Control.TreeView.Pick()
Then the menu item is resolved by using dynamic object recognition Find calls using XPath locator strings.
The above statement is equivalent to:
Desktop.Find(“//MainWin[@caption='Test Application']
  //Menu[@caption='Control']//MenuItem[@caption='Tree view']”).Pick()

Locator String Syntax

For convenience, you can use shortened forms for the XPath locator strings. Silk Test Classic automatically expands the syntax to use full XPath strings when you run a script. You can omit:
  • The hierarchy separator, “.//”. Silk Test Classic defaults to using “//”.
  • The class name. Silk Test Classic defaults to the class name of the window that contains the locator.
  • The surrounding square brackets of the attributes,"[ ]".
  • The “@caption=’” if the xPath string refers to the caption.
The following locators are equivalent:
Menu Control
  //locator "//Menu[@caption='Control']"
  //locator "Menu[@caption='Control']"
  //locator "[@caption='Control']"
  //locator "@caption='Control'"
  locator "Control"

You can use shortened forms for the XPath locator strings only when you use an INC file. For scripts that use dynamic object recognition without an INC file, you must use full XPath strings.

Window Hierarchies

You can create window hierarchies without locator strings. In the following example, the “Menu Control” acts only as a logical hierarchy, used to provide the INC file with more structure. “Menu Control” does not contribute to finding the elements further down the hierarchy.

[-] window MainWin TestApplication
    [ ] locator "//MainWin[@caption='Test Application']"
    [-] Menu Control
        [-] MenuItem TreeView
            [ ] locator "//MenuItem[@caption='Tree view']"
In this case, the statement:
TestApplication.Control.TreeView.Pick()
is equivalent to:
Desktop.Find(“.//MainWin[@caption='Test Application']
  //MenuItem[@caption='Tree view']”).Pick()

Window Declarations

A window declaration in Silk Test Classic cannot be executed for both agent types, Classic Agent and Open Agent, during the execution of a test. The window declaration will only be executed for one of the agent types.

Expressions

You can use expressions in locators. For example, you can specify:
[-] STRING getSWTVersion()
    [ ] return SYS_GETENV("SWT_VERSION")
[-] window Shell SwtTestApplication
    [ ] locator "SWT {getSWTVersion()} Test Application"

Comparing the Locator Keyword to the Tag Keyword

The syntax of locators is identical to the syntax of the tag keyword.

The overall rules for locators are the same as for tags. There can be only one locator per window, except for different gui-specifiers, in this case there can be only one locator per gui-specifier.

You can use expressions in locators and tags.

The locator keyword requires a script that uses the Open Agent while the tag keyword requires a script that uses the Classic Agent.

Parent topic: Designing and Recording Test Cases with the Open Agent
Related concepts
Overview of Test Frames
Using Autocomplete
XPath Basic Concepts
Related tasks
Recording Window Declarations that Include Locator Keywords
Specifying Whether to Use Locators or Tags to Resolve Window Declarations
Recording Test Cases for Standard and Web Applications
Recording Locators Using the Locator Spy
Related reference
Locator Spy Dialog Box


Test Cases

This section describes how you can use automated tests to address single objectives of a test plan.

  • Overview of Test Cases
    Describes how you can use test cases to address single objectives of a test plan.
  • Anatomy of a Basic Test Case
    Provides the anatomy of a base test case.
  • Types of Test Cases
    Provides an overview of the test case types.
  • Test Case Design
    Describes how to design test cases.
  • Constructing a Test Case
    Describes how to construct a test case.
  • Data in Test Cases
    Describes data in test cases.
  • Saving Test Cases
    Describes how to save test cases.
  • Recording Without Window Declarations
    Describes how to record without window declarations.
  • Overview of Application States
    Provides an overview of application states.
  • Behavior of an Application State Based on NONE
    Describes the behavior of an application state based on NONE.
  • Example: A Feature of a Word Processor
    Provides a word processor feature as a test case example.
Parent topic: Designing and Recording Test Cases with the Open Agent


Overview of Test Cases

A test case is an automated test that addresses one objective of a test plan. A test case:

  • Drives the application from the initial state to the state you want to test.
  • Verifies that the actual state matches the expected (correct) state. Your QA department might use the term baseline to refer to this expected state. This stage is the heart of the test case.
  • Cleans up the application, in preparation for the next test case, by undoing the steps performed in the first stage.

In order for a test case to function properly, the application must be in a stable state when the test case begins to execute. This stable state is called the base state. The recovery system is responsible for maintaining the base state in the event the application fails or crashes, either during the execution of a test cases or between test cases.

Each test case is independent and should perform its own setup, driving the application to the state that you want to test, executing the test case, and then returning the application to the base state. The test case should not rely on the successful or unsuccessful completion of another test case, and the order in which the test case is executed should have no bearing on its outcome. If a test case relies on a prior test case to perform some setup actions, and an error causes the setup to fail or, worse yet, the application to crash, all subsequent test cases will fail because they cannot achieve the state where the test is designed to begin.

A test case has a single purpose: a single test case should verify a single aspect of the application. When a test case designed in this manner passes or fails, it is easy to determine specifically what aspect of the target application is either working or not working.

If a test case contains more than one objective, many outcomes are possible. Therefore, an exception may not point specifically to a single failure in the software under test but rather to several related function points. This makes debugging more difficult and time-consuming and leads to confusion in interpreting and quantifying results. The result is an overall lack of confidence in any statistics that might be generated. But there are techniques you can use to perform more than one verification in a test case.

Types of test cases

Silk Test Classic supports two types of test cases, depending on the type of application that you are testing. You can create test cases that use:

Hierarchical object recognition
This is a fast, easy method for creating scripts. This type of testing is supported for all application types.
Dynamic object recognition
This is a more robust and easy to maintain method for creating scripts. However, dynamic object recognition is only supported for applications that use the Open Agent.

If you are using the Open Agent, you can create tests for both dynamic and hierarchical object recognition in your test environment. Use the method best suited to meet your test requirements. You can use both recognition methods within a single test case if necessary.

Parent topic: Test Cases
Related concepts
Test Plans
Understanding the Recovery System for the Open Agent
Performing More than One Verification in a Test Case
Dynamic Object Recognition
Open Agent


Anatomy of a Basic Test Case

A test case is comprised of testcase keywords and object-oriented commands. You place a group of test cases for an application into a file called a script.

Each automated test for an application begins with the testcase keyword, followed by the name of the test case. The test case name should indicate the type of testing being performed.

The core of the test case is object-oriented 4Test commands that drive, verify, and clean up your application. For example, consider this command:

TextEditor.File.New.Pick

The first part of the command, TextEditor.File.New, is the name of a GUI object. The last part of the command, Pick, is the operation to perform on the GUI object. The dot operator (.) delimits each piece of the command. When this command is executed at runtime, it picks the New menu item from the File menu of the Text Editor application.

Parent topic: Test Cases
Related tasks
Creating Test Cases with the Open Agent


Types of Test Cases

There are two basic types of test cases:

  • 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 boxes 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.

Parent topic: Test Cases
Related tasks
Creating Test Cases with the Open Agent


Test Case Design

When defining test requirements, the goal is to vigorously test each application feature. To do so, you need to decide which set of inputs to a feature will provide the most meaningful test results.

As you design your test cases, you may want to associate data with individual objects, which can then be referenced inside test cases. You may find this preferable to declaring global variables or passing parameters to your test cases.

The type of data you decide to define within a window declaration will vary, depending on the type of testing you are doing. Some examples include:

  • The default value that you expect the object to have when it displays.
  • The tab sequence for each of a dialog box’s child objects.

The following declaration for the Find dialog contains a list that specifies the tab sequence of the dialog box children.

window DialogBox Find
   tag "Find"
   parent TextEditor
   LIST OF WINDOW lwTabOrder = {...}
      FindWhat
      CaseSensitive
      Direction
      Cancel

For more information about the syntax to use for lists, see LIST data type.

Before you begin to design and record test cases, make sure that the built-in recovery system can close representative dialogs from your application window.

Parent topic: Test Cases
Related tasks
Testing the Ability of the Recovery System to Close the Dialog Boxes of Your Application
Creating Test Cases with the Open Agent


Constructing a Test Case

This section explains the methodology you use when you design and record a test case.

A test case has three stages

Each test case that you record should have the following stages:
Stage 1
The test case drives the application from the initial state to the state you want to test.
Stage 2
The test case verifies that the actual state matches the expected (correct) state. Your QA department might use the term baseline to refer to this expected state. This stage is the heart of the test case.
Stage 3
The test case cleans up the application, in preparation for the next test case, by undoing the steps performed in stage 1.

Each test case is independent

Each test case you record should perform its own setup in stage 1, and should undo this setup in stage 3, so that the test case can be executed independently of every other test case. In other words, the test case should not rely on the successful or unsuccessful completion of another test case, and the order in which it is executed should have no bearing on its outcome.

If a test case relies on a prior test case to perform some setup actions, and an error causes the setup to fail or, worse yet, the application to crash, all subsequent test cases will fail because they cannot achieve the state where the test is designed to begin.

A test case has a single purpose

Each test case you record should verify a single aspect of the application in stage 2. When a test case designed in this manner passes or fails, it’s easy to determine specifically what aspect of the target application is either working or not working.

If a test case contains more than one objective, many outcomes are possible. Therefore, an exception may not point specifically to a single failure in the software under test but rather to several related function points. This makes debugging more difficult and time-consuming and leads to confusion in interpreting and quantifying results. The net result is an overall lack of confidence in any statistics that might be generated.

There are techniques you can use to do more than one verification in a test case.

A test case starts from a base state

In order for a test case to be able to function properly, the application must be in a stable state when the test case begins to execute. This stable state is called the base state. The recovery system is responsible for maintaining the base state in the event the application fails or crashes, either during a test case’s execution or between test cases.

DefaultBaseState

To restore the application to the base state, the recovery system contains a routine called DefaultBaseState that makes sure that:

  • The application is running and is not minimized.
  • All other windows, for example dialog boxes, are closed.
  • The main window of the application is active.

If these conditions are not sufficient for your application, you can customize the recovery system.

Defining test requirements

When defining test requirements, the goal is to rigorously test each application feature. To do so, you need to decide which set of inputs to a feature will provide the most meaningful test results.

Parent topic: Test Cases
Related concepts
Performing More than One Verification in a Test Case
Understanding the Recovery System for the Open Agent
Overview of Recording the Stages of a Test Case
Related tasks
Creating Test Cases with the Open Agent
Recording the Cleanup Stage and Pasting the Recording


Data in Test Cases

What data does the feature expect

A user can enter three pieces of information in the Find dialog box:

  • The search can be case sensitive or insensitive, depending on whether the Case Sensitive check box is checked or unchecked.
  • The search can be forward or backward, depending on whether the Down or Up option button is selected.
  • The search can be for any combination of characters, depending on the value entered in the Find What text box.

Create meaningful data combinations

To organize this information, it is helpful to construct a table that lists the possible combinations of inputs. From this list, you can then decide which combinations are meaningful and should be tested. A partial table for the Find dialog box is shown below:

Case Sensitive | Direction | Search String
Yes | Down | Character
Yes | Down | Partial word (start)
Yes | Down | Partial word (end)
Yes | Down | Word
Yes | Down | Group of words
Yes | Up | Character
Yes | Up | Partial word (start)
Yes | Up | Partial word (end)
Yes | Up | Word
Yes | Up | Group of words
Parent topic: Test Cases
Related concepts
Saving a Script File


Saving Test Cases

When saving a test case, Silk Test Classic does the following:

  • Saves a source file, giving it the .t extension; the source file is an ASCII text file, which you can edit.
  • Saves an object file, giving it the .to extension; the object file is a binary file that is executable, but not readable by you.

For example, if you name a test case (script file) mytests and save it, you will end up with two files: the source file mytests.t, in the location you specify, and the object file mytests.to.

To save a new version of a script’s object file when the script file is in view-only mode, click File > Save Object File.

Parent topic: Test Cases
Related concepts
Saving a Script File


Recording Without Window Declarations

If you record a test case against a GUI object for which there is no declaration or if you want to write a test case from scratch against such an object, Silk Test Classic requires a special syntax to uniquely identify the GUI object because there is no identifier.

This special syntax is called a dynamic instantiation and is composed of the class and tag of the object. The general syntax of this kind of identifier is:
class("tag").class("tag"). ...

Example

If there is not a declaration for the Find dialog box of the Notepad application, the syntax required to identify the object with the Classic Agent looks like the following:
MainWin("Untitled - Notepad|$C:\Windows\SysWOW64\notepad.exe").DialogBox("Find")

To create the dynamic tag, the recorder uses the multiple-tag settings that are stored in the Record Window Declarations dialog box. In the example shown above, the tag for the Notepad contains its caption as well as its window ID.

For the Open Agent, the syntax for the same example looks like the following:
FindMainWin("/MainWin[@caption='Untitled - Notepad']").FindDialogBox("Find")
Parent topic: Test Cases
Related concepts
Open Agent
dynamic instantiation


Overview of Application States

When testing an application, typically, you have a number of test cases that have identical setup steps. Rather than record the same steps over and over again, you can record the steps as an application state and then associate the application state with the relevant test cases.

An application state is the state you want your application to be in after the base state is restored but before you run one or more test cases. By creating an application state, you are creating reusable code that saves space and time. Furthermore, if you need to modify the Setup stage, you can change it once, in the application state routine.

At most, a test case can have one application state associated with it. However, that application state may itself be based on another previously defined application state. For example, assume that:

  • The test case Find is associated with the application state Setup.
  • The application state Setup is based on the application state OpenFile.
  • The application state OpenFile is based on the built-in application state, DefaultBaseState.
  • Silk Test Classic would execute the programs in this order:
    1. DefaultBaseState application state.
    2. OpenFile application state.
    3. Setup application state.
    4. Find test case.

If a test case is based on a single application state, that application state must itself be based on DefaultBaseState in order for the test case to use the recovery system. Similarly, if a test case is based on a chain of application states, the final link in the chain must be DefaultBaseState. In this way, the built-in recovery system of Silk Test Classic is still able to restore the application to its base state when necessary.

Parent topic: Test Cases
Related tasks
Recording an Application State
Testing an Application State


Behavior of an Application State Based on NONE

If an application state is based on the keyword NONE, Silk Test Classic executes the application state twice: when the test case with which it is associated is entered and when the test case is exited.

On the other hand, if an application state is based on DefaultBaseState, Silk Test Classic executes the application state only when the associated test case is entered.

The following example code defines the application state InvokeFind as based on the NONE keyword and associates that application state with the test case TestFind.

Appstate InvokeFind () basedon none
 xFind.Invoke ()
 print ("hello")

testcase TestFind () appstate InvokeFind
 print ("In TestFind")
 xFind.Exit.Click ()

When you run the test case in Silk Test Classic, in addition to opening the Find dialog box, closing it, and reopening it, the test case also prints:

hello
In TestFind
hello

The test case prints hello twice because Silk Test Classic executes the application state both as the test case is entered and as it is exited.

Parent topic: Test Cases
Related tasks
Testing an Application State
Recording an Application State


Example: A Feature of a Word Processor

For purposes of illustration, this topic develops test requirements for the searching feature of the sample Text Editor application using the Find dialog box. This topic contains the following:

  • Determining what data the feature expects.
  • Creating meaningful data combinations.
  • Overview of recording the stages of a test case.

When a user enters the criteria for the search and clicks Find Next, the search feature attempts to locate the string. If the string is found, it is selected (highlighted). Otherwise, an informational message is displayed.

Determining what data the feature expects

A user can enter three pieces of information in the Find dialog box:

  • The search can be case sensitive or insensitive, depending on whether the Case Sensitive check box is checked or unchecked.
  • The search can be forward or backward, depending on whether the Down or Up option button is clicked.
  • The search can be for any combination of characters, depending on the value entered in the Find What text box.

Creating meaningful data combinations

To organize this information, it is helpful to construct a table that lists the possible combinations of inputs. From this list, you can then decide which combinations are meaningful and should be tested. A partial table for the Find dialog box is shown below:

Case Sensitive | Direction | Search String
Yes | Down | Character
Yes | Down | Partial word (start)
Yes | Down | Partial word (end)
Yes | Down | Word
Yes | Down | Group of words
Yes | Up | Character
Yes | Up | Partial word (start)
Yes | Up | Partial word (end)
Yes | Up | Word
Yes | Up | Group of words

Overview of recording the stages of a test case

A test case performs the included actions in three stages. The following table illustrates these stages, describing in high-level terms the steps for each stage of a sample test case that tests whether the Find facility is working.

Setup
  1. Open a new document.
  2. Type text into the document.
  3. Position the text cursor either before or after the text, depending on the direction of the search.
  4. Select Find from the Search menu.
  5. In the Find dialog box:
    • Enter the text to search for in the Find What text box.
    • Select a direction for the search.
    • Make the search case sensitive or not.
    • Click Find Next to do the search.
  6. Click Cancel to close the Find dialog box.
Verify
Record a 4Test verification statement that checks that the actual search string found, if any, is the expected search string.
Cleanup
  1. Close the document.
  2. Click No when prompted to save the file.

After learning the basics of recording, you can record from within a test plan, which makes recording easier by automatically generating the links that connect the test plan to the test case.

Parent topic: Test Cases
Related tasks
Recording the Cleanup Stage and Pasting the Recording


Verification

This section describes how you can verify one or more characteristics, or properties, of an object.

  • Verifying Object Properties
    Describes how to verify object properties.
  • Overview of Verifying Bitmaps
    Provides an overview of verifying bitmaps.
  • Overview of Verifying an Objects State
    Provides an overview of verifying an object's state.
  • Fuzzy Verification
    Describes fuzzy verification.
  • Verifying that a Window or Control is No Longer Displayed
    Describes how to verify that window or control is no longer displayed.
Parent topic: Designing and Recording Test Cases with the Open Agent


Verifying Object Properties

You will perform most of your verifications using properties. When you verify the properties of an object, a VerifyProperties method statement is added to your script. The VerifyProperties method verifies the selected properties of an object and its children.

Each object has many characteristics, or properties. For example, dialog boxes can have the following verification properties:
  • Caption
  • Children
  • DefaultButton
  • Enabled
  • Focus
  • Rect
  • State

Caption is the text that displays in the title bar of the dialog box. Children is a list of all the objects contained in the dialog box, DefaultButton is the button that is invoked when you press Enter, and so on. In your test cases, you can verify the state of any of these properties.

You can also, in the same test case, verify properties of children of the selected object. For example, the child objects in the Find dialog box, such as the text box FindWhat and the check box CaseSensitive,will also be selected for verification.

By recording verification statements for the values of one or more of an object’s properties, you can determine whether the state of the application is correct or in error when you run your test cases.

  • Verifying Object Properties (Open Agent)
    Record verification statements to verify the properties of an object.
  • Adding a Verification to a Script while Recording
    Describes how to add a verification to a script during recording.
Parent topic: Verification
Related reference
VerifyProperties Method


Verifying Object Properties (Open Agent)

This functionality is supported only if you are using the Open Agent.

Record verification statements to verify the properties of an object.

  1. Record a test case. For information on recording a test case, see Recording Test Cases With the Open Agent.
  2. While recording, hover the cursor over the object, for which you want to verify a property, and click Ctrl+Alt. The Verify Properties dialog box opens.
  3. Select the properties that you want to verify, by checking the check boxes next to the property names. To verify all or most properties, click Select All and then uncheck individual check boxes.
  4. Click OK to close the Verify Properties dialog box.
When you finish recording the test case and paste the recorded test to the editor, all verifications are also pasted to the test script.
Parent topic: Verifying Object Properties
Related tasks
Recording the Cleanup Stage and Pasting the Recording


Adding a Verification to a Script while Recording

This functionality is supported only if you are using the Open Agent.

Do the following to add a verification to a script during recording:

  1. Begin recording.
  2. Move the mouse cursor over the object that you want to verify and press Ctrl+Alt.
    When you are recording a mobile Web application, you can also click on the object and click Add Verification.
    Note: For any application that uses Ctrl+Shift as the shortcut key combination, press Ctrl+Shift.
    This option temporarily suspends recording and displays the Verify Properties dialog box.
  3. To select the property that you want to verify, check the corresponding check box.
  4. Click OK. Silk Test Classic adds the verification to the recorded script and you can continue recording.
Parent topic: Verifying Object Properties


Overview of Verifying Bitmaps

A bitmap is a picture of some portion of your application. Verifying a bitmap is usually only useful when the actual appearance of an object needs to be verified to validate application correctness. For example, if you are testing a drawing or CAD/CAM package, a test case might produce an illustration in a drawing region that you want to compare to a baseline. Other possibilities include the verification of fonts, color charts, and certain custom objects.

When comparing bitmaps, keep the following in mind:

  • Bitmaps are not portable between GUIs. The format of a bitmap on a PC platform is .bmp.
  • A bitmap comparison will fail if the image being verified does not have the same screen resolution, color, window frame width, and window position when the test case is run on a different machine than the one on which the baseline image was captured.
  • Make sure that your test case sets the size of the application window to the same size it was when the baseline bitmap was captured.
  • Capture the smallest possible region of the image so that your test is comparing only what is relevant.
  • If practical, do not include the window’s frame (border), since this may have different colors and/or fonts in different environments.
  • Verifying Appearance Using a Bitmap
    Describes how to verify the appearance using a bitmap.
Parent topic: Verification
Related reference
Bitmap Agent Options
Bitmap Tab


Verifying Appearance Using a Bitmap

When you are using the Classic Agent, use this procedure to compare the actual appearance of an image against a baseline image. Or, use it to verify fonts, color charts, or custom objects.

Note: To verify a bitmap when you are using the Open Agent, you can add the VerifyBitmap method to your script. The VerifyBitmap method is supported for both agents.
  1. Complete the steps in Verifying a Test Case.
  2. On the Verify Window dialog box, click the Bitmap tab and then select the region to update: Entire Window, Client Area of Window (that is, without scroll bar or title bar), or Portion of Window.
  3. In the Bitmap File Name text box, type the full path of the bitmap file that will be created. The default path is based on the current directory. The default file name for the first bitmap is bitmap.bmp. Click Browse if you need help choosing a new path or name.
  4. Click OK. If you selected Entire Window or Client Area of Window, Silk Test Classic captures the bitmap and returns you to your test application. If you selected Portion of Window, position the cursor at the desired location to begin capturing a bitmap. While you press and hold the mouse button, drag the mouse to the screen location where you want to end the capture. Release the mouse button.

    A bitmap comparison will fail if the image being verified does not have the same screen resolution, color, window frame width, and window position as the baseline image.

    Capture the smallest possible region of the image so that your test is comparing only what is relevant.

  5. If you are writing a complete test case, record the cleanup stage and paste the test case into the script. If you have added a verification statement to an existing test case, paste it into your script and close the Record Actions dialog box.
Parent topic: Overview of Verifying Bitmaps
Related tasks
Recording the Cleanup Stage and Pasting the Recording
Related reference
VerifyBitmap Method


Overview of Verifying an Objects State

Each class has a set of methods associated with it, including built-in verification methods. You can verify an object’s state using one of these built-in verification methods or by using other methods in combination with the built-in Verify function.

A class’s verification methods always begin with Verify. For example, a TextField has the following verification methods; VerifyPosition, VerifySelRange, VerifySelText, and VerifyValue.

You can use the built-in Verify function to verify that two values are equal and generate an exception if they are not. Typically, you use the Verify function to test something that does not map directly to a built-in property or method. Verify has the following syntax:
Verify (aActual, aExpected [, sDesc])
aActual
The value to verify. ANYTYPE.
aExpected
The expected value. ANYTYPE.
sDesc
Optional: A message describing the comparison. STRING.

Usually, the value to verify is obtained by calling a method for the object being verified; you can use any method that returns a value.

Example: Verify an object

This example describes how you can verify the number of option buttons in the Direction RadioList in the Replace dialog box of the Text Editor. There is no property or method you can directly use to verify this. But there is a method for RadioList, GetItemCount, which returns the number of option buttons. You can use the method to provide the actual value, then specify the expected value in the script.

When doing the verification, position the mouse pointer over the RadioList and press Ctrl+Alt. Click the Method tab in the Verify Window dialog box, and select the GetItemCount method.

Click OK to close the Verify Window dialog box, and complete your test case. Paste it into a script. You now have the following script:

testcase VerifyFuncTest ()
TextEditor.Search.Replace.Pick ()
Replace.Direction.GetItemCount ()
Replace.Cancel.Click ()
Now use the Verify function to complete the verification statement. Change the line:
Replace.Direction.GetItemCount ()
to
Verify (Replace.Direction.GetItemCount (), 2)

That is, the call to GetItemCount (which returns the number of option buttons) becomes the first argument to Verify. The expected value, in this case, 2, becomes the second argument.

Your completed script is:

testcase VerifyFuncTest ()
TextEditor.Search.Replace.Pick ()
Verify (Replace.Direction.GetItemCount (), 2)
Replace.Cancel.Click ()
Parent topic: Verification


Fuzzy Verification

There are situations when Silk Test Classic cannot see the full contents of a control, such as a text box, because of the way that the application paints the control on the screen. For example, consider a text box whose contents are wider than the display area. In some situations the application clips the text to fit the display area before drawing it, meaning that Silk Test Classic only sees the contents that are visible; not the entire contents.

Consequently, when you later do a VerifyProperties against this text box, it may fail inappropriately. For example, the true contents of the text box might be 29 Pagoda Street, but only 29 Pagoda displays. Depending on how exactly the test is created and run, the expected value might be 29 Pagoda whereas the value seen at runtime might be 29 Pagoda Street, or vice versa. So the test would fail, even though it should pass.

To work around this problem, you can use fuzzy verification, where the rules for when two strings match are loosened. Using fuzzy verification, the expected and actual values do not have to exactly match. The two values are considered to match when one of them is the same as the first or last part of the other one. Specifically, VerifyProperties with fuzzy verification will pass whenever any of the following functions would return TRUE, where actual is the actual value and expected is the expected value:

  • MatchStr (actual + "*", expected)
  • MatchStr ("*" + actual, expected)
  • MatchStr (actual, expected + "*")
  • MatchStr (actual, "*" + expected)

In string comparisons, * stands for any zero or more characters.

For example, all the following would pass if fuzzy verification is enabled:

Actual Value | Expected Value
29 Pagoda | 29 Pagoda Street
oda Street | 29 Pagoda Street
29 Pagoda Street | 29 Pagoda
29 Pagoda Street | oda Street

Enabling fuzzy verification

You enable fuzzy verification by using an optional second argument to VerifyProperties, which has this prototype:

VerifyProperties (WINPROPTREE WinPropTree [,FUZZYVERIFY FuzzyVerifyWhich])

where the FUZZYVERIFY data type is defined as:

type FUZZYVERIFY is BOOLEAN, DATACLASS, LIST OF DATACLASS

So, for the optional FuzzyVerifyWhich argument you can either specify TRUE or FALSE, one class name, or a list of class names.

FuzzyVerifyWhich value

FALSE (default)
Fuzzy verification is disabled.
One class

Fuzzy verification is enabled for all objects of that class.

Example window.VerifyProperties ({…},Table) enables fuzzy verification for all tables in window (but no other object).

List of classes

Fuzzy verification is enabled for all objects of each listed class.

Example window.VerifyProperties ({…}, {Table, TextField}) enables fuzzy verification for all tables and text boxes in window (but no other object).

TRUE

Fuzzy verification is enabled only for those objects whose FuzzyVerifyProperties member is TRUE.

To set the FuzzyVerifyProperties member for an object, add the following line within the object's declaration:

FUZZYVERIFY FuzzyVerifyProperties = TRUE

Example: If in the application's include file, the DeptDetails table has its FuzzyVerifyProperties member set to TRUE:

window ChildWin EmpData
. . .
   Table DeptDetails
     FUZZYVERIFY FuzzyVerifyProperties = TRUE

And the test has this line:

EmpData.VerifyProperties ({...}, TRUE)

Then fuzzy verification is enabled for the DeptDetails table (and other objects in EmpData that have FuzzyVerifyProperties set to TRUE), but no other object.

Fuzzy verification takes more time than standard verification, so only use it when necessary.

For more information, see the VerifyProperties method.

Defining your own verification properties

You can also define your own verification properties.

Parent topic: Verification
Related concepts
Defining New Verification Properties


Verifying that a Window or Control is No Longer Displayed

  1. Click Record > Testcase to begin recording a test case and drive your application to the state you want to verify. To record a verification statement in an existing test case, click Record > Actions.
  2. When you are ready to record a verification statement, position the mouse cursor over the object you want to verify, and press Ctrl+Alt. Silk Test Classic displays the Verify Window dialog box over your application window.
  3. Click the Property tab. Silk Test Classic lists the properties for the selected window or control on the right.
  4. Make sure that only the Exists property is selected for the window or control. If additional properties are selected, the verification will fail because the actual list of properties will differ from the expected list.
  5. Change the value in the Property Value field from TRUE to FALSE.
  6. Click OK to accept the Exists property for the selected window or control. Silk Test Classic closes the Verify Window dialog box and displays the Record Status window. The test case will verify that the window or control has the property value of FALSE, verifying that the object is no longer displayed. If not, Silk Test Classic writes an error to the results file.
Parent topic: Verification


Data-Driven Test Cases

Data-driven test cases enable you to invoke the same test case multiple times, once for each data combination stored in a data source. The data is passed to the test case as a parameter. You can think of a data-driven test case as a template for a class of test cases. Data-driven test cases offer the following benefits:

  • They reduce redundancy in a test plan.
  • Writing a single test case for a group of similar test cases makes it easier to maintain scripts.
  • They are reusable; adding new tests only requires adding new data.

Regardless of the technique you use, the basic process for creating a data-driven test case is:

  1. Create a standard test case. It will be very helpful to have a good idea of what you are going to test and how to perform the verification.
  2. Identify the data in the test case and the 4Test data types needed to store this data.
  3. Modify the test case to use variables instead of hard data.
  4. Modify the test case to specify input arguments to be used to pass in the data. Replace the hard coded data in the test case with variables.
  5. Call the test case and pass in the data, using one of four different techniques:
    • Use a database and the Data Driven Workflow to run the test case. Micro Focus recommends using this method for data-driven testing.
    • Click Run > Testcase and type the data into the Run Testcase dialog box.
    • In a QA Organizer test plan, insert the data as an attribute to a test description.
    • If the data exists in an external file, write a function to read the file and use a main() function to run the test case.
  • Data-Driven Workflow
    Describes how to use the Data Driven Workflow to create, execute, and analyze data-driven test cases.
  • Working with Data-Driven Test Cases
    Describes how to work with data-driven test cases.
  • Code Automatically Generated by Silk Test Classic
    Describes how Silk Test Classic automatically generates code for data-driven test cases.
  • Tips And Tricks for Data-Driven Test Cases
    Provides tips and tricks for data-driven test cases.
  • Testing an Application with Invalid Data
    Describes how to test an application with invalid data.
  • Enabling and Disabling Workflow Bars
    Describes how you can enable or disable a workflow bar.
  • Data Source for Data-Driven Test Cases
    Describes how to set up the data source for data-driven test cases.
  • Creating the Data-Driven Test Case
    Describes how you can create a data-driven test case.
  • Select Data Source Dialog Box
    Describes the Select Data Source dialog box.
  • Setup Data Driven Script DSN Dialog Box
    Describes the Setup Data Driven Script DSN dialog box.
  • Specify Data Driven Script Dialog Box
    Describes the Specify Data Driven Script dialog box.
  • Specify Data Driven Testcase Dialog Box
    Describes the Specify Data Driven Testcase dialog box.
  • Specify Rows Dialog Box
    Describes the Specify Rows dialog box.
  • Go to Testcase Dialog Box
    Describes the Go to Testcase dialog box.
  • Select Testcase Dialog Box
    Describes the Select Testcase dialog box.
Parent topic: Designing and Recording Test Cases with the Open Agent
Related concepts
Linking a Test Plan to a Data-Driven Test Case
Using a main Function in the Script
Related tasks
Creating Test Cases with the Open Agent


Data-Driven Workflow

You can use the Data Driven Workflow to create data-driven test cases that use data stored in databases. The Data Driven Workflow generates much of the necessary code and guides you through the process of creating a data-driven test case.

Before you can create and run data-driven test cases, you need to perform the following actions:
  1. Record a standard test case.
  2. Set up or identify the existing data source with the information you want to use to run the test.
  3. Configure your Data Source Name (DSN), if you are not using the default, which is Silk DDA Excel.
Note: When you use the Data Driven Workflow, Silk Test Classic uses a well-defined record format. To run data-driven test cases that were not created through the Data Driven Workflow, you need to convert your recordings to the new record format. To run data-driven test cases that do not follow the record format, run the tests outside of the Data Driven Workflow.

To enable or disable the Data Driven Workflow, click Workflows > Data Driven.

Data Driven Workflow toolbar

To create and execute a data-driven test case, sequentially click each icon in the workflow bar to perform the corresponding procedure.

Action | Description
Data Drive Testcase | Select a test case to data drive. Silk Test Classic copies the selected test case and creates a new data-driven test case by adding a "DD_" prefix to the original name of the test case. Silk Test Classic also writes other data-driven information to the new or existing data driven script file (.g.t file).
Find/Replace Values | Find and replace values in the new test case with links to the data source.
Run Testcase | Run the data-driven test case, optionally selecting the rows and tables in the data source that you want to use.
Explore Results | View test results.
Parent topic: Data-Driven Test Cases
Related concepts
Data Source for Data-Driven Test Cases
Running a Data-Driven Test Case
Selecting a Test Case to Data Drive
Finding and Replacing Values
Creating the Data-Driven Test Case
Linking a Test Plan to a Data-Driven Test Case
Related tasks
Viewing Test Results
Creating Test Cases with the Open Agent
Configuring Your DSN
Related reference
Basic Workflow for the Open Agent


Working with Data-Driven Test Cases

Consider the following when you are working with data-driven test cases:

  • The 4Test Editor contains additional menu selections and toolbars for you to use.
  • Silk Test Classic can data drive only one test case at a time.
  • You cannot duplicate test case names. Data-driven test cases in the same script must have unique names.
  • The Classic 4Test editor is not available with data-driven test cases in .g.t files.
  • You cannot create data-driven test cases from test cases in .inc files; you can only create data-driven test cases from test cases in .t or .g.t files. However, you can open a project, add the *.inc, select the test case from the test case folder of the project, and then select data drive.
  • When you data drive a [use '<script>.t'] is added to the data-driven test case. This is the link to the .t file where the test case originated. If you add a test case from another script file then another use line pointing to that file is added. If the script file is in the same directory as the <script.g.t>, then no path is given, otherwise, the absolute path is added to the use line. If this path changes, it is up to you to correct the path; Silk Test Classic will not automatically update the path.
  • When you open a .g.t file using File > Open, Silk Test Classic automatically loads the data source information for that file. If you are in a .g.t file and that file’s data source is edited, click Edit > Data Driven > Reload Database to refresh the information from the data source.
  • If you add a new data-driven test case to an existing .g.t file that is fully collapsed, Silk Test Classic expands the previous test case, but does not edit it.
Parent topic: Data-Driven Test Cases
Related concepts
Selecting a Test Case to Data Drive
Related reference
4Test Editor


Code Automatically Generated by Silk Test Classic

When you create a data-driven test case, Silk Test Classic verifies that the DSN configuration is correct by connecting to the database, generates the 4Test code describing the DSN, and writes that information into the data-driven script.

Do not delete or change the information created by Silk Test Classic. If you do, you may not be able to run your data-driven test case.

When you click OK on the Specify Data Driven Testcase dialog box, Silk Test Classic automatically writes the following information to the top of your data driven script file.

The information is delivered "rolled up" (collapsed); in order to see the details you need to click on the plus sign to expand the code:

[+] // *** DATA DRIVEN ASSISTANT Section (!! DO NOT REMOVE !!) ***
The .inc files used by the original test cases, and the .t file indicating where the test case just came from, in this case from Usability.t:
[ ] use "datadrivetc.inc"
[ ] use "Usability.t"
A reference to the DSN, specifying the connect string, including username and password, for example:
[ ] // *** DSN ***
[ ] STRING gsDSNConnect = "DSN=SILK DDA Excel;DBQ=C:\ddatesting\TestExcel.xls;UID=;PWD=;"
Each data-driven test case takes as a single argument a record consisting of a record for each table that is used in the test case. The record definition is automatically generated as shown here:
[+] // testcase VerifyProductDetails (REC_DATALIST_VerifyProductDetails rdVpd)
[ ] // Name: REC_<Testcase name>. Fields Types: Table record types. Field Names: Table record
type with 'REC_' replaced by 'rec'
[-] type REC_DATALIST_VerifyProductDetails is record
  [ ] REC_Products recProducts
  [ ] REC_Customers recCustomers
  [ ] REC_CreditCards recCreditCards

Each table record contains the column names in the same order as in the database. Spaces in table and column names are removed. Special characters such as $ are replaced by underscores.

[ ] // *** Global record for each Table ***
[ ]
[-] type REC_Products_ is record
 [ ] STRING Item //Item,
 [ ] REAL Index //Index,
 [ ] STRING Name //Name,
 [ ] REAL ItemNum //ItemNum,
 [ ] STRING Price //Price,
 [ ] STRING Desc //Desc,
 [ ] STRING Blurb //Blurb,
 [ ] REAL NumInStock //NumInStock,
 [ ] INTEGER QtyToOrder //QtyToOrder,
 [ ] INTEGER OnSale //OnSale,

Silk Test Classic writes a sample record for each table. This is the data used if you opt to use sample data on the Run Testcase dialog box. A value from the original test case is inserted into the sample record, even if there are syntax errors when that column is first used to replace a value.

[ ] // *** Global record containing sample data for each table ***
[ ] // *** Used when running a testcase with 'Use Sample Data from Script' checked ***
[ ]
[-] REC_Products_ grTest_Products_ = {...}
 [ ] NULL // Item
 [ ] NULL // Index
 [ ] NULL // Name
 [ ] NULL // ItemNum
 [ ] NULL // Price
 [ ] NULL // Desc
 [ ] NULL // Blurb
 [ ] NULL // NumInStock
 [ ] 2 // QtyToOrder
 [ ] NULL // OnSale
[ ]
[ ] // *** End of DATA DRIVEN ASSISTANT Section ***
Parent topic: Data-Driven Test Cases
Related reference
Specify Data Driven Testcase Dialog Box
Run Testcase Dialog Box


Tips And Tricks for Data-Driven Test Cases

There are several things to know about working with data sources while you are creating data-driven test cases.

  • You must have an existing data source with tables and columns defined before you data drive a test case. However, the data source does not need to contain rows of data. You cannot use the Data Driven Workflow to create data sources or databases.
  • If you have a table in your data source that has a long name (greater than 25 characters), all of the name may not be visible in the Find and Replace menu bar in the 4Test Editor. You may find it helpful to change the size of the menu bar to display more of your table name.
  • You cannot change to a different data source once you have started to find and replace values in a script. If you do, you will have problems with prior replacements. If you want to change your data source, you should create a new data-driven script file.
  • If you are working with a data source that requires a user name and password, you can add the username and password to the connect string in the .g.t file. The first example below shows how SQL Server requires a userid and password. [ ] STRING gsDSNConnect = "DSN=USER.SQL.DSN;UID=SA;PWD=sesame;" where UID=<your user ID> ("SA" in the example above) and where PWD=<your password> ("sesame" in the example above). On the other hand, the example below shows how the Connect string for a MS Excel DSN does not require user IDs or passwords: [ ] STRING gsDSNConnect = "DSN=Silk DDA Excel;DBQ=C:\TestExcel.xls;UID=;PWD="
  • You can choose to run with a sample record if the table is empty; however, this record is not inserted into the database. The sample record is created by Silk Test Classic when it replaces values from the test case by the table and columns in your database.
  • Real numbers should be stored as valid 4Test Real numbers with format: [-]ddd.ddd[e[-]ddd], even though databases such as MS Excel allow a wider range of formats – for example, currencies and fractions.
  • There are no restrictions on how you name your tables and columns within your data source. Silk Test Classic automatically removes spaces, and converts dollar signs and other special characters to underscores when it creates the sample record and writes other code to your data-driven test case. Silk Test Classic handles MS Excel and MS Access table names without putting quotation marks around them. This means that your table and column names will look familiar when you go to find and replace values.
  • If you encounter the error "ODBC Excel Driver numeric field overflow" while running a test case, check the Excel workbook that you are using as your data source. You may have some columns that are defined as STRING columns but contain numeric values in some of the rows. If you have a column that you want to treat as numeric strings rather than as numbers, either format the column as 'Text' or begin the number strings with a single-quote character. For example: '1003 instead of: 1003
  • If modifying data sources in an existing Excel data sheet, use the remove column option to delete any data to be removed, as simply deleting from the cell, using clear contents, or copy/pasting content will not register correctly with the DDS file in Silk Test Classic and may lead to a data source mismatch error: *** Error: Incompatible types -- Number of list elements exceeds number of fields.

Formatting MS Excel worksheets for use as a data source

Use the 'General' format for the columns of your worksheets. Here are specific suggestions for column formats based on the intended data type of the column:

Intended Data Type of Column | Excel Column Format
STRING | If the column contains only text, no numbers, dates or booleans, then apply the 'General' format. If the column contains text and numbers, then you can still apply the 'General' format if you begin the number strings with a single-quote character. For example: '1003 instead of: 1003. Otherwise, apply the 'Text' format.
INTEGER or REAL | ‘General' or 'Number' format.
BOOLEAN | ‘General' format. Use only the values TRUE and FALSE.
DATETIME | ‘Custom' format: yyyy-mm-dd hh:mm:ss. That agrees with the ISO format used by Silk Test Classic DATETIME values.
Parent topic: Data-Driven Test Cases
Related concepts
Finding and Replacing Values
Related reference
4Test Editor
Rules and Tips for Finding and Replacing Values in the Data-Driven Workflow


Testing an Application with Invalid Data

This topic assumes that you are familiar with data driving test cases.

To thoroughly test an application feature, you need to test the feature with invalid as well as valid data.

For example, the sample Text Editor application displays a message box if a user specifies a search string in the Find dialog box that doesn’t exist in the document. To account for this, you can create a data-driven test case, like the following, that verifies that the message box displays and has the correct message:

type SEARCHINFO is record
   STRING  sText      // Text to type in document window
   STRING  sPos       // Starting position of search
   STRING  sPattern   // String to look for
   BOOLEAN bCase      // Case-sensitive or not
   STRING  sDirection // Direction of search
   STRING  sExpected  // The expected match
   STRING  sMessage   // The expected message in message box

testcase FindInvalidData (SEARCHINFO Data)
   TextEditor.File.New.Pick ()
   DocumentWindow.Document.TypeKeys (Data.sText + Data.sPos)
   TextEditor.Search.Find.Pick ()
   Find.FindWhat.SetText (Data.sPattern)
   Find.CaseSensitive.SetState (Data.bCase)
   Find.Direction.Select (Data.sDirection)
   Find.FindNext.Click ()

   MessageBox.Message.VerifyValue (Data.sMessage)
   MessageBox.OK.Click ()

   Find.Cancel.Click ()
   TextEditor.File.Close.Pick ()
   MessageBox.No.Click ()

The VerifyValue method call in this test case verifies that the message box contains the correct string. For example, the message should be Cannot find Ca if the user enters Ca into the Find dialog box and the document editing area does not contain this string.

Parent topic: Data-Driven Test Cases
Related concepts
Using a main Function in the Script
Using do...except to Handle an Exception


Enabling and Disabling Workflow Bars

Only one workflow bar can be enabled at a time.

To enable or disable a workflow bar, click Workflows and then select the workflow bar that you want to turn on or off. For example, click Workflows > Basic.

You can select one of the following workflows:
Workflow
Description
Basic workflow
Guides you through the process of creating a test case.
Data Driven workflow
Guides you through the process of creating a data-driven test case.
Parent topic: Data-Driven Test Cases
Related reference
Basic Workflow for the Open Agent


Data Source for Data-Driven Test Cases

When you install Silk Test Classic, the SILK DDA EXCEL DSN is copied to your installation computer. This is the default DSN that Silk Test Classic uses. This DSN uses a MS Excel 8.0 driver and does not have a particular workbook (.xls file) associated with it.

The Select Data Source dialog box allows you to choose the data source:
  • For new data-driven test cases, choose Silk DDA Excel.
  • For backward compatibility, choose Segue DDA Excel. This allows existing .g.t files that reference Segue DDA Excel to continue to run.

You do not have to use the default DSN. For additional information when using a different DSN, see Configuring Your DSN.

You may use any of the following types of data sources:
  • Text files and comma separated value files (*.txt and *.csv files)
  • Microsoft Excel
  • Microsoft SQL Server
  • Microsoft Access
  • Oracle
  • Sybase SQL Anywhere

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

  • Configuring Your DSN
    Configure a DSN to use it as a data source for data-driven test cases.
  • Setting Up a Data Source
    Set up a data source to use it for a data-driven test case.
  • Using an Oracle DSN to Data Drive a Test Case
    Make manual modifications to an Oracle DSN to use the DSN to data-driven test cases.
Parent topic: Data-Driven Test Cases
Related concepts
Tips And Tricks for Data-Driven Test Cases


Configuring Your DSN

The default DSN for data-driven test cases, Silk DDA Excel, is created during the installation of Silk Test Classic. To use the default DSN you do not need to configure your DSN.

The Select Data Source dialog box allows you to choose the data source:
  • For new data-driven test cases, choose Silk DDA Excel.
  • For backward compatibility, choose Segue DDA Excel. This allows existing .g.t files that reference Segue DDA Excel to continue to run.

The following instructions show how to configure a machine to use a different DSN than the Silk DDA Excel default.

  1. Click Start > Control Panel > System and Security > Administrative Tools > Data Sources (ODBC).
  2. On the ODBC Data Source Administrator, click either the System DSN tab or the User DSN tab, depending on whether you want to configure this DSN for one user or for every user on this machine.
  3. Click Add.
  4. On the Create New Data Source dialog box, select the driver for the data source and click Finish. To restore the default DSN for Silk Test Classic, select the driver for Microsoft Excel Driver (*.xls).
  5. On the setup dialog box of the data source, enter a name for the data source. To restore the default for Silk Test Classic, enter Silk DDA Excel. For additional information about the dialog box, refer to the database documentation or contact your database administrator.
  6. Click OK.
Parent topic: Data Source for Data-Driven Test Cases
Related concepts
Tips And Tricks for Data-Driven Test Cases


Setting Up a Data Source

Before you can run a data-driven test case you must set up a file that contains the tables, which are called worksheets in Microsoft Excel (Excel), and the columns that you want to use. The tables do not have to be populated with data, but it might help to have at least one complete record filled out.

  1. Open one of the data sources for data-driven test cases, for example Excel.
  2. Name at least one table, or worksheet if you are using Excel, and create column names for the table.
  3. Save the data source.

Example

The Excel file TestExcel.xls can be used as a data source for a data-driven test case and includes the three worksheets Products, Customers, and CreditCards. The Customers worksheet includes the columns Customer, Name, Address, and so on.

Parent topic: Data Source for Data-Driven Test Cases
Related concepts
Tips And Tricks for Data-Driven Test Cases
Related reference
Setup Data Driven Script DSN Dialog Box


Using an Oracle DSN to Data Drive a Test Case

To use an Oracle DSN to data drive a test case, select the test case to data drive, let Silk Test Classic generate code into the new test case file, and then make the following manual modifications to the DSN:

  1. Find out which columns are included in the table of your schema. Different schemas may contain tables with the same name. The table lists for the Find/Replace Values dialog box, the re-sizable menu bar, and the Specify Rows dialog box will list the same table name once for each schema without indicating the schema. For each of those list items the column list will contain the names of the columns in all of the tables with that name.
  2. After finding and replacing values, split each table record into separate records according to the schema. Do that for the sample record as well. The record names should have the form: <Record prefix><schema>_<table>. For example, if the schema is STUser and the table is Customers, the name of the table record type will be REC_STUser_Customers and the declaration for the field in the test case record for the table will be REC_STUser_Customers recSTUser_Customers // Customers.
  3. Run the test case from a test plan, unless you are running all rows for all tables. Use the Specify Rows dialog box to build the ddatestdata value, then modify that value to include the schema name in the query.
    Note: Specify a query for every table, even if you want to run all rows for a table. To run all rows, leave the where clause blank.
Parent topic: Data Source for Data-Driven Test Cases
Related concepts
Selecting a Test Case to Data Drive
Code Automatically Generated by Silk Test Classic
Tips And Tricks for Data-Driven Test Cases
Related reference
Specify Rows Dialog Box


Creating the Data-Driven Test Case

This section describes how you can create a data-driven test case.

  • Selecting a Test Case to Data Drive
    Describes how to select a test case to data drive.
  • Finding and Replacing Values
    Use the Find/Replace Values dialog box to find and replace values in a data-driven test case with links to values in tables and columns.
  • Rules and Tips for Finding and Replacing Values in the Data-Driven Workflow
    Lists rules and tips for finding and replacing values in the data-driven workflow.
  • Running a Data-Driven Test Case
    Describes how to run a data-driven test case.
  • Running a Test Case Using a Sample Record for Each Table Used by the Data-Driven Test Case
    Run a test case using a sample record for each table used by the data-driven test case to do a quick test.
  • Passing Data to a Test Case
    Describes how to pass data to a test case.
  • Example Setup for Forward Case-Sensitive Search
    Provides an example setup for a forward case-sensitive search.
  • Building Queries
    Describes the steps you have to perform to create a query for a table.
  • Adding a Data-Driven Test Case to a Test Plan
    Describes how to add a data-driven test case to a test plan.
  • Using a main Function in the Script
    Describes how to use a main function in the script.
  • Using do...except to Handle an Exception
    Describes how to use do...except to handle exceptions.
Parent topic: Data-Driven Test Cases


Selecting a Test Case to Data Drive

For information on the steps that you need to complete before you can select a test case to data drive, see Data-Driven Workflow.

While you are in a script, choose one of the following to select a test case for data driving:

  • Click Tools > Data Drive Testcase.
  • Right-click into the script and select Data Drive Testcase.

When you select a test case, Silk Test Classic copies the selected test case and creates a new data-driven test case by adding a DD_ prefix to the original name of the test case. Silk Test Classic also writes other data-driven information to the new or existing data-driven script file script.g.t.

Parent topic: Creating the Data-Driven Test Case
Related concepts
Data-Driven Workflow
Code Automatically Generated by Silk Test Classic
Working with Data-Driven Test Cases
Tips And Tricks for Data-Driven Test Cases


Finding and Replacing Values

For information on the steps that you need to complete before you can find and replace values in a test case, see Data-Driven Workflow.

You can use the Find/Replace Values dialog box to find and replace values in a data-driven test case with links to values in tables and columns. Values are text strings, numbers, and booleans that exist in your original test cases. One of the steps in creating a data-driven test case is to find these values and replace them with references to columns in your data source.

Silk Test Classic checks to make sure that each value you select is appropriate for replacement by the column in your test case. You can turn off this validation by clicking Edit > Data Driven > Validate Replacements while you are in a .g.t file. This means that the Find aspect of Find and Replace works as usual, but that the values that you replace are not validated. By turning off this checking, you suppress the error messages that Silk Test Classic would have otherwise displayed. Any 4Test identifier or fragment of a string is considered an invalid value for replacement unless Validate Replacements is turned off. If you are new to creating data-driven test cases, we recommend that you keep this validation turned on.

Note: You can also use the Find and Replace menu bar in the 4Test Editor to find and replace values in a data-driven test case.

When you are using Find and Replace, sometimes a method requires a data type that does not match the column that you want to replace. For example, SetText requires a string, but you may want to set a number instead, or perhaps the database does not store data in the 4Test type that you would like to use. Silk Test Classic can handle these kinds of conversions, with a few exceptions.

  1. Open the Find/Replace Values dialog box.
    • Right-click into a test case in a .t file and select Data Driven Testcase. Specify the data source, the data-driven script, and the data-driven test case. When you complete the Specify Data Driven Testcase dialog box and the data-driven script opens in the 4Test Editor, the Find/Replace Values dialog box opens automatically.
    • Highlight a value in a .g.t file and choose Edit > Data Driven > Find/Replace Values.
    • Right-click a value in a .g.t file and select Find > Replace Values.
  2. Check the Text, Number, and True/False check boxes to specify what type of values you want to find or replace. By default all check boxes are checked, indicating that Silk Test Classic will look for text (string), number, and true/false (boolean) values in the test case.
  3. Select Up or Down to define the direction in which Silk Test Classic searches in the file for the value. The default is Down.
  4. Select the name of the table that contains the values that you want to link to from the Table list.
  5. Select the name of the column that contains the values that you want to link to from the Column list.
  6. Click Find Next to start searching for the values within the test case. Silk Test Classic finds and highlights various values.
  7. Click Replace to replace the found value with a link to the values in the data source.
  8. When you have finished replacing values, click Cancel.

Check the Don't show me this again check box if you want to use the re-sizable menu bars instead of the Find/Replace Values dialog box to find and replace values. You can re-display the dialog box by clicking Edit > Data Driven > Find/Replace Values or by right-clicking into a data-driven test case and un-checking Validate Replacements.

Parent topic: Creating the Data-Driven Test Case
Related concepts
Data-Driven Workflow
Rules and Tips for Finding and Replacing Values in the Data-Driven Workflow
Working with Data-Driven Test Cases
Tips And Tricks for Data-Driven Test Cases
Related reference
4Test Editor
Specify Data Driven Testcase Dialog Box


Rules and Tips for Finding and Replacing Values in the Data-Driven Workflow

Rules for finding and replacing

The following table shows how Silk Test Classic works when it finds and replaces values in your scripts.

Value Found in Script | Database Column Type | Replaced by | Tip
STRING | STRING | Column |
 | INTEGER | Str(Column) | 5
 | REAL | Str(Column,NULL,2) | 1, 3, 4, 5
 | BOOLEAN | Str(Column) | 8
 | DATETIME | [STRING]Column | 7
INTEGER | STRING | Val(Column) |
 | INTEGER | Column |
 | REAL | Column | 1, 6
 | BOOLEAN | (not allowed) |
 | DATETIME | (not allowed) |
REAL | STRING | Val(Column) |
 | INTEGER | Column | 6
 | REAL | Column |
 | BOOLEAN | (not allowed) |
 | DATETIME | (not allowed) |
BOOLEAN | STRING | (not allowed) |
 | INTEGER | Column | 2, 6
 | REAL | (not allowed) |
 | BOOLEAN | Column |
 | DATETIME | (not allowed) |
DATETIME |  |  | 7

When you are creating a data-driven test case, there are several points to note about the find and replace process. These notes are referenced by the Rules for finding and replacing table, shown above.

  • MS Excel stores integers as REALs. This means that you may see a 1 in an MS Excel cell, but the number that is stored is actually 1.000. Whenever you replace an integer in a test case with a column designated as REAL, Silk Test Classic displays a question similar to the following: To ensure that Silk Test Classic handles your data properly, additional information is needed: Will column QtyToOrder contain only INTEGER (no decimal point) values? Click Yes to treat that column's values as INTEGER; click No to continue to treat that column's values as REAL.
  • Some databases (such as MS Excel) store booleans as INTEGERs. This means that you may see a TRUE in an Excel cell, but the value that is stored is actually 1. Whenever you replace a boolean in a test case with a column designated as INTEGER , Silk Test Classic displays a question similar to the following: To ensure that Silk Test Classic handles your data properly, additional information is needed: Will column OnSale contain only BOOLEAN (TRUE/FALSE) values? Click Yes to treat that column's values as BOOLEAN; click No to continue to treat that column's values as INTEGER.
  • If you have a currency string, we recommend that you split it into two strings separated by a plus sign. The first string should contain just the financial symbol (for example, the dollar sign or USD acronym) and the second string should contain just the number value. When you do a find and replace, this lets you replace only the number value, not the financial symbol or acronym. For example, do not use $123.45, instead use $ + 123.45
  • When a STRING literal is replaced by a column containing REAL values, the real number is rounded to two decimal places. To change the number of decimal places that are displayed, change the value of iDecimal in Str (table.column, NULL, iDecimal). For example, to display 7.1234 instead of 7.12, change:
    Str (table.column, NULL, 2)
    to:
    Str (table.column, NULL,4)
  • You can replace any STRING value with a REAL or INTEGER column. However, in order to have a working sample record, the value that is first replaced by that column should be a STRING representation of a REAL or INTEGER constant.
  • In certain cases, 4Test implicitly converts one data type to another. In that case, Silk Test Classic does not insert a conversion expression when replacing the value by the DB column reference..
  • To represent a DATETIME value, in other words a 4Test DATETIME constant, you must create a STRING that specifies the date and time in the standard 4Test DATETIME (ISO) format - YYYY-MM-DD HH:MM:SS.MSMSMS. You can truncate the string at any point, as long as the last field is complete. If you use a different format, you will cause a runtime error. Because DATETIME values found in a script are actually STRING values, the replacement rules are the rules for STRING values.
  • The conversion from STRING to BOOLEAN will cause a runtime error. The expression must be changed manually from 'Str(Column)' to: [STRING]Column.
  • A fraction is considered an INTEGER division expression, so the value inserted into the sample record is truncated to the next lowest integer.
  • If Silk Test Classic does not insert any of the expected conversion expressions, then the Validate Replacements setting is probably unchecked. Click Edit > Data Driven > Validate Replacements to see how Validate Replacements is set.
  • When you do a Find/Replace, Silk Test Classic skips values contained in variable definitions. To find those values, click Edit > Data Driven > Validate Replacements to turn off Validate Replacements. We recommend that you initialize variables after you define them; be sure to separate the variable definition and assignment on two different lines.
Parent topic: Creating the Data-Driven Test Case


Running a Data-Driven Test Case

Once you have selected a test case to data drive, and found and replaced values, choose one of the following ways to run the test case:

  • Click Run > Run while in a .g.t file. This command runs main(), or if there is no main(), the command runs all test cases. For each test case, this command runs all rows for all tables used by the test case.
  • Click Run > Testcase and select the data-driven test case from the list of test cases on the Run Testcase dialog box, for all tables used by the test case.
  • Click Run > Testcase > Run to run the test case for all rows for all tables used by the test case.
Parent topic: Creating the Data-Driven Test Case
Related concepts
Data-Driven Workflow
Related tasks
Setting TrueLog Options
Setting a Test Case to Use Animation Mode
Viewing Results Using the TrueLog Explorer
Related reference
Run Testcase Dialog Box


Running a Test Case Using a Sample Record for Each Table Used by the Data-Driven Test Case

This is useful if you want to do a quick test or are not connected to your data source. The sample record is created as you replace values in the test case. When you first use a column to replace a test case value, that value is inserted into the table record in the field for that column.

  1. On the Run Testcase dialog box, click Use Sample Data from Script.
    By default, Silk Test Classic runs every combination of rows in your tables. The number of test cases that runs is:
    # of rows selected for Table 1 X the # of rows selected for
Table 2 X the number of rows for Table 3
... and so on

    For example, if your test case uses 3 tables with 5 rows each, Silk Test Classic will run 125 test cases.

  2. To select the rows you want to run on a table-by-table basis, click Specify Rows on the Run Testcase dialog box to use the Specify Rows dialog box to create a query.
  3. Specify arguments, if necessary, in the Arguments text box. Remember to separate multiple arguments with commas.
  4. To wait one second after each interaction with the application under test is executed, check the Animated Run Mode (Slow-Motion) check box. Typically, you will only use this check box if you want to watch the test case run. For instance, if you want to demonstrate a test case to someone else, you might want to check this check box. Executions of the default base state and functions that include one of the following strings are not delayed:
    • BaseStateExecutionFinished
    • Connecting
    • Verify
    • Exists
    • Is
    • Get
    • Set
    • Print
    • ForceActiveXEnum
    • Wait
    • Sleep
  5. To view results using the Silk TrueLog Explorer, check the Enable TrueLog check box. Click TrueLog Options to set the options you want to record.
  6. Click Run. Silk Test Classic runs the test case and generates a results file.
Parent topic: Creating the Data-Driven Test Case
Related concepts
Stopping a Running Test Case Before it Completes
Related tasks
Setting a Test Case to Use Animation Mode
Viewing Test Results
Viewing Results Using the TrueLog Explorer


Passing Data to a Test Case

Once you have defined your data-driven test case, you pass data to it, as follows:

  • If you are not using the test plan editor, you pass data from a script's main function.
  • If you are using the test plan editor, you embed the data in the test plan and the test plan editor passes the data when you run the test plan.
Parent topic: Creating the Data-Driven Test Case
Related concepts
Linking a Test Plan to a Data-Driven Test Case
Data-Driven Workflow


Example Setup for Forward Case-Sensitive Search

Here is a sample application state that performs the setup for all forward case-sensitive searches in the Find dialog box:
appstate Setup () basedon DefaultBaseState
TextEditor.File.New.Pick ()
DocumentWindow.Document.TypeKeys ("Test Case<Home>")
TextEditor.Search.Find.Pick ()
Find.CaseSensitive.Check ()
Find.Direction.Select ("Down")
Parent topic: Creating the Data-Driven Test Case


Building Queries

Before you define a query to access certain data in a data-driven test case, there are several steps you need to complete. for additional information, see Using the Data Driven Workflow for more information.

Respond to the prompts on the Specify Rows dialog box to create a query for a table. The following are examples of simple queries:

  • To find and run the records of customers whose customer ID number is 1001: (CUSTID = 1001)
  • To find and run the records of customers whose names begin with the letters "F" or "G": (CUST_NAME LIKE ‘F%’) OR (CUSTNAME LIKE ‘G%’).

See the description of the enter values area in the Specify Rows dialog box to see examples of more complex queries.

Parent topic: Creating the Data-Driven Test Case
Related concepts
Data-Driven Workflow
Tips And Tricks for Data-Driven Test Cases
Related reference
Specify Rows Dialog Box


Adding a Data-Driven Test Case to a Test Plan

You can run a data-driven test case from a test plan as either a data-driven test case or as a regular test case. To distinguish between the two cases, there are two keywords for you to use:

  • ddatestcase specifies the name of a test case that runs as a data-driven test case.
  • ddatestdata specifies the list of rows that will be run with the data-driven test case.

If the test case is specified with the keyword ddatestcase, it is run as a data-driven test case. Use this keyword only with data-driven test cases.

To specify a data-driven test case in a test plan

  • Add keyword ddatestcase in front of the test case name.
  • Add the keyword ddatestdata as a list of queries that specify the particular rows you want the test case to run with. The list of queries is represented as a single LIST OF STRING parameter.

Rules for using data-driven keywords

  • The ddatestdata keyword requires simple select queries. To specify the row you want to run a test case with, use the ddatestdata keyword with the format: select * from <table> where ....
  • The keyword ddatestcase cannot be a level above the script file and still work. The script file has to be at the same level or above it.
  • A test plan needs to specify a test case using either the keyword testcase or the keyword ddatestcase. Using both causes a compiler error.
  • If the ddatestdata keyword is present, then the ddatestcase is run using the ddatestdata value as the rows to run.
  • The default is to run all rows for all tables. The value for ddatestdata for this is ALL_ROWS_FOR_ALL_TABLES.
  • Using the keyword testdata in a test item with keyword ddatestcase will cause a compiler error.
  • If the test case is specified with the keyword testcase, then the test case is run as a regular test case and the testdata keyword or symbols must be present to specify the value that will be passed as the regular argument. This value must be a record of the type defined for the ddatestcase, in other words of type REC_DATALIST_<Testcase name>.

You can add a data-driven test case to a test plan by using the Testplan Detail dialog box or by editing the test plan directly. However, if you edit the test plan directly, then the keywords are not automatically validated and it is your responsibility to make sure that the keywords, which are testcase versus ddatestcase and testdata versus ddatestdata, are appropriate for the intended execution of the test case.

Whenever you use the Test Detail dialog box, be sure to click the Testcases button and select the test case from the list. That will ensure that the proper keywords are inserted into the test plan.

Using sample records data within test plans

To run a test case with the sample record within a test plan, you must manually input the test data, in the format ddatestdata: {"USE_SAMPLE_RECORD_<tablename>"}

For example:

script: example.t
ddatestcase: sampletc
ddatestdata: {"USE_SAMPLE_RECORD_SpaceTable$"}

You must put the USE_SAMPLE_RECORD_ prefix in front of each table name that you want to run against. If you are using two tables, you need to input the prefix twice, as shown below with two tables named "Table1" and "Table2":

ddatestdata: {"USE_SAMPLE_RECORD_Table1","USE_SAMPLE_RECORD_Table2"}
Parent topic: Creating the Data-Driven Test Case
Related concepts
Tips And Tricks for Data-Driven Test Cases
Related reference
Testplan Detail Dialog Box


Using a main Function in the Script

Although most of the script files you create contain only test cases, in some instances you need to add a function named main to your script. You can use the main function to pass data to test cases as well as control the order in which the test cases in the script are executed.

When you run a script file by clicking Run > Run:

  • If the script file contains a main function, the main function is executed, then execution stops. Only test cases and functions called by main will be executed, in the order in which they are specified in main.
  • If the script does not contain a main function, the test cases are executed from top to bottom.

Example

The following template shows the structure of a script that contains a main function that passes data to a data-driven test case:

main ()
// 1. Declare a variable to hold current record
// 2. Store all data for test case in a list of records
// 3. Call the test case once for each record in the list

Using this structure, the following example shows how to create a script that defines data records and then calls the sample test case once for each record in the list:

type SEARCHINFO is record
   STRING  sText      // Text to type in document window
   STRING  sPos       // Starting position of search
   STRING  sPattern   // String to look for
   BOOLEAN bCase      // Case-sensitive or not
   STRING  sDirection // Direction of search
   STRING  sExpected  // The expected match

main ()
   SEARCHINFO Data
   list of SEARCHINFO lsData = {...}
      {"Test Case", "<END>", "C", TRUE, "Up", "C"}
      {"Test Case", "<END>", "Ca", TRUE, "Up", "Ca"}
      // additional data records can be added here
   for each Data in lsData
      FindTest (Data)

testcase FindTest (SEARCHINFO Data)
   TextEditor.File.New.Pick ()
   DocumentWindow.Document.TypeKeys (Data.sText + Data.sPos)
   TextEditor.Search.Find.Pick ()
   Find.FindWhat.SetText (Data.sPattern)
   Find.CaseSensitive.SetState (Data.bCase)
   Find.Direction.Select (Data.sDirection)
   Find.FindNext.Click ()
   Find.Cancel.Click ()
   DocumentWindow.Document.VerifySelText ({Data.sExpected})
   TextEditor.File.Close.Pick ()
     MessageBox.No.Click ()

When you click Run > Run, the main function is called and the FindTest test case will be executed once for every instance of Data in lsData (the list of SEARCHINFO records). In the script shown above, the test case will be run twice. Here is the results file that is produced:

Script findtest.t - Passed
Passed:  2 tests (100%)
Failed:  0 tests (0%)
Totals:  2 tests, 0 errors, 0 warnings

Testcase FindTest ({"Test Case", "<END>", "C", TRUE, "Up", "C"}) - Passed
Testcase FindTest ({"Test Case", "<END>", "Ca", TRUE, "Up", "Ca"}) - Passed
Note: With data-driven test cases, Silk Test Classic records the parameters that are passed in, in the results file.

In this sample data-driven test case, the test case data is stored in a list within the script itself. It is also possible to store the data externally and read records into a list using the FileReadValue function.

Parent topic: Creating the Data-Driven Test Case
Related concepts
Data-Driven Workflow


Using do...except to Handle an Exception

The VerifyValue method, like all 4Test verification methods, raises an exception if the actual value does not match the expected (baseline) value. When this happens, Silk Test Classic halts the execution of the test case and transfers control to the recovery system. The recovery system then returns the application to the base state.

However, suppose you don’t want Silk Test Classic to transfer control to the recovery system, but instead want to trap the exception and handle it yourself. For example, you might want to log the error and continue executing the test case. To do this, you can use the 4Test do...except statement and related statements, which allow you to handle the exception yourself.

Parent topic: Creating the Data-Driven Test Case
Related concepts
Understanding the Recovery System for the Classic Agent


Select Data Source Dialog Box

The Select Data Source dialog box displays when you are creating a new data-driven file, which is a .g.t file, or opening an existing data-driven file that does not contain a data source connection string. This dialog box identifies the data source you will use to replace values in the data-driven test case. After you fill out this dialog box, Silk Test Classic loads the table and column information from your data source so it is available for you to use when you find and replace values in a test case. A data-driven script can use only one data source.

Select Data Source

Defaults to the previously specified DSN or to Silk DDA Excel. Select another data source by clicking the down arrow.

The Select Data Source dialog box allows you to choose either the Silk DDA Excel or the Segue DDA Excel data source. For new data-driven test cases, choose the Silk DDA Excel data source. Choose the Segue DDA Excel data source for backward compatibility. This allows existing g.t files that reference Segue DDA Excel to continue to run.

Select Workbook/Connection String area

Select Workbook displays when you have selected the default data source, Segue DDA Excel. Connection String displays when you choose a data source other than the default. If you are working with Silk DDA Excel you must select a workbook. Click Browse to navigate to the workbook you will use.

OK

Saves the connection string so that it can be inserted into the data-driven script. The connection string is also saved to partner.ini so that this data source will be the new default selection for the list. If you are using the Silk DDA Excel data source, this button is only available after you select a workbook.

Customize

Displays when you select a data source other than the default. Click to display the Setup Data Driven Script DSN dialog box.

Parent topic: Data-Driven Test Cases


Setup Data Driven Script DSN Dialog Box

Use to create or modify the connection string for the DSN you select. Once you fill out this dialog, Silk Test Classic verifies that the DSN configuration is correct by connecting to the database, generating the 4Test code describing the DSN, and writing information into the data driven script.

Click Customize on the Select Data Source dialog box.

Source Provider

Select Microsoft OLE DB Provider for ODBC, since Silk Test Classic uses ODBC to connect to data sources.

Microsoft OLE DB Provider for ODBC
Select Connect Using Data Source Name (DSN).
Connection Information
DSN
Select the data source that you selected on the Select Data Source dialog box.

The rest of the connection information displays information that the DSN requires before it can successfully make a connection. This information varies depending on the DSN you select. For more information about how to respond to the fields on this dialog, consult your database documentation or contact your database administrator.

More>

Click to display the connection string.

If you choose an MS Excel DSN and use the Database field to specify a workbook, then the Connection String will incorrectly contain Database=<.xls file>. To correct this problem, cut the .xls file path out of the Database field and paste it into the Additional Connection String Parameters field, preceded by DBQ=. For example, DBQ=C:\TestExcel.xls.

Parent topic: Data-Driven Test Cases
Related tasks
Setting Up a Data Source


Specify Data Driven Script Dialog Box

You can use the Specify Data Driven Script dialog box to perform one ore more of the following actions:
  • To create a new data-driven script.
  • To overwrite an existing data-driven script.
  • To open an existing data-driven script and to append a test case to the script.
To open the Specify Data Driven Script dialog box, click Tools > Data Drive Testcase in the Silk Test Classic menu, and select a test case from the Select Testcase dialog box.
Note: The dialog box is available only when a script is open in the editor.

The dialog box includes the following elements:

Create a new file/Overwrite an existing file
Click to create a new file or to overwrite the existing file that is specified in the Filename field. Silk Test Classic automatically adds the .g.t extension to the file name. You cannot overwrite existing files which are open in the editor.
Open an existing file
Click to open the existing file that is specified in the Filename field.
Filename
Type the name of the new file you want to create or the existing file you want to open or overwrite.
Browse
Click to navigate to the existing file you want to open or overwrite.
Save as format
You can select one of the following file formats:
  • ANSI
  • Unicode
  • UTF-8
Parent topic: Data-Driven Test Cases


Specify Data Driven Testcase Dialog Box

Use this dialog box to add a new data-driven test case or to overwrite existing test case(s).

Specify a data driven script file and, if prompted, a data source.

Add new Data Driven testcase

Click to create a new data driven test case. This new test case is appended to the end of the file and given the "DD_" prefix.

Overwrite existing Data Driven testcase

Click to overwrite an existing data driven test case.

Name

Defaults to DD_<name of original testcase> when you are adding a new data driven test case. If you opt to overwrite an existing data-driven test case, this field turns into a list of data-driven test cases that already exist in the active file.

Test case names can have a maximum of 127 characters. When you create a data-driven test case, Silk Test Classic truncates any test case name that is greater than 124 characters.

Parent topic: Data-Driven Test Cases
Related concepts
Code Automatically Generated by Silk Test Classic
Finding and Replacing Values


Specify Rows Dialog Box

Use to select rows to run the test case against. You use this dialog box to build queries that run against your data-driven test case.

Click Specify Rows on the Run Testcase dialog box or the Testplan Detail dialog box.

You cannot run using the sample record for individual tables. In order to run using the sample records for each table used by the test case, for example to do a quick test or if you are not connected to the database, click Use Sample Data from Script on the Run Testcase dialog box.

Table-by-table basis

When you select rows on a table-by-table basis, you use 'AND' and 'OR' actions. These may be used only to specify multiple conditions for a single table. You cannot include more than one table in a single 'where' clause. Conditions on separate tables must be specified independently, by selecting each table in the 'Table' list separately. The number of test cases that runs is:

# of rows selected for Table 1 X the # of rows selected for Table 2 X the # of rows for Table 3

Table
Lists the tables used by the test case to be run. For tables that are Microsoft Office Excel worksheets, the record names end in a dollar sign. Select a table in order to specify its where clause.
Run
Runs the selected test case using the queries you have specified.
Debug
Opens the file in which the test case resides, enters debugging mode and places a breakpoint at the first line of the test case. Debugging mode makes available all the debugging commands on the Breakpoint, Debug and View menus.
Query for this table area
Guides you to enter the where clause for the selected table. If you leave this area blank and simply click Run, the default query selects all rows for the table.

The where clause of a query has the form:

(<Column> <relational
             operator> <value>) [and|or] (<Column> <relational
             operator> <value>)...

select * from <tablename> where the first list contains a list of columns from the table selected above.

where (the second list) lists the following relational operators that apply to all column types:

To indicate | Select
Equals =
Not equal to <>
Greater than >
Greater than or equal to >=
Less than <
Less than or equal to <=
Like (typically used with STRING columns) | like

There are three additional relational operators that you can type into the Editable query area – but they do not appear in the where dropdown.

To Indicate | Type
Between two values (value1 <= value <= value2) | between <value1> and <value2>
In a set of discrete values | in (<value>, <value>, <value>)
Not in a set of discrete values | not in (<value>, <value>, <value>)
Enter values area

All string values must be enclosed in single quotation marks, for example, 'value'. For string columns, you can match a pattern by using like ‘pattern’. The pattern can contain the single character (_) wildcard or the 0 or more characters (%) wildcard.

If a column allows NULL values, then you can use the following query to return only those rows for which the column contains a value:

select * from table_name where column_name <> NULL

Similarly, the following query would return only those rows for which the column is empty:

select * from table_name where column_name = NULL
Action
Select Done to indicate you have finished entering where clauses or select AND or OR to indicate the relationship to another where clause. After you selected the appropriate action, the where clause that you have created appears in the bottom box on this dialog. You can add additional where clauses or click Done.
Editable query area
The where clauses that you create appear here after you click DONE, AND, or OR. You can add additional where clauses in this area by clicking and typing them in.

Sample queries

The following table shows several sample queries and their corresponding "where" clause.

To find Use this WHERE clause
adults whose first names begin with 'B'
(FirstName like 'B%') and (Age >= 18)
bananas, cherries, apples, or any type of berry
(Fruit in ('banana', 'cherry', 'apple')) or (Fruit like '%berry')
people born in the 1960's with 3-letter last names
(YearOfBirth between 1960 and 1969) and (LastName like '___')
Parent topic: Data-Driven Test Cases
Related tasks
Using an Oracle DSN to Data Drive a Test Case
Building Queries
Related reference
Testplan Detail Dialog Box
Run Testcase Dialog Box


Go to Testcase Dialog Box

When a data-driven test script file, which is a file with the ending .g.t, is open in the editor, the Go to Testcase dialog box lists all the test cases that are available in the active script. Any listed data-driven test cases are prefixed with DD_.

To open the dialog box, click with the right mouse button into a .g.t file and select Go to Testcase.

Select the test case and then click OK to display the 4Test Editor with the cursor at the beginning of the test case that you have selected.

Parent topic: Data-Driven Test Cases


Select Testcase Dialog Box

When creating a data-driven test case out of an existing test case, the Select Testcase dialog box lists the non-data-driven test cases in the active script.

To open the dialog box, click Tools > Data Driven Testcase. You can also right click in a .t file and then click Data Driven Testcase.

Select the test case that you want to data-drive and then click OK to display the Specify Data Driven Script File dialog box.

Parent topic: Data-Driven Test Cases


Characters Excluded from Recording and Replaying

The following characters are ignored by Silk Test during recording and replay:
Characters | Control
... | MenuItem
tab | MenuItem
& | All controls. The ampersand (&) is used as an accelerator and therefore not recorded.
Parent topic: Designing and Recording Test Cases with the Open Agent


Testing in Your Environment with the Open Agent

This section describes how you can test applications in your environment with the Open Agent.

  • Distributed Testing with the Open Agent
    Describes how you can run tests with the Open Agent on multiple machines.
  • Testing Apache Flex Applications
    Lists the steps that must be performed in order to test Apache Flex applications.
  • Client/Server Application Support
    Describes how Silk Test Classic supports testing client/server applications.
  • Testing .NET Applications with the Open Agent
    Describes the built-in support for testing .NET applications with the Open Agent.
  • Testing Java AWT/Swing Applications with the Open Agent
    Describes how you can test applications and applets that use Java AWT/Swing controls with the Open Agent.
  • Testing Java SWT and Eclipse Applications with the Open Agent
    Describes how you can test Java SWT and Eclipse applications with the Open Agent.
  • Testing Mobile Applications
    Describes how you can test mobile applications on a mobile device or an Android emulator.
  • Testing Rumba Applications
    Describes how Silk Test Classic supports testing Rumba applications.
  • Testing SAP Applications
    Describes how Silk Test Classic provides built-in support for testing SAP client/server applications .
  • Cross-Browser Testing with the Open Agent
    Provides an overview of the sample applications and the controls that are available for cross-browser testing.
  • Testing Windows API-Based Applications
    Describes how Silk Test Classic provides built-in support for testing Microsoft Windows API-based applications.
  • Limitations for Testing on Microsoft Windows 10
    Lists the known limitations for testing on Microsoft Windows 10.


Distributed Testing with the Open Agent

This section describes how you can run tests with the Open Agent on multiple machines.

  • Remote Testing with the Open Agent
    Describes how you can use a remote agent to test an application in a remote location.
  • Running Test Cases in Parallel
    Describes how to run test cases in parallel.
  • Testing Multiple Machines
    Describes strategies for testing multiple machines.
  • Testing Multiple Applications
    Describes testing multiple applications.
  • Troubleshooting Distributed Testing
    Provides troubleshooting information for testing on multiple machines.
Parent topic: Testing in Your Environment with the Open Agent


Remote Testing with the Open Agent

You can install Silk Test Classic on a remote machine and test an application on this remote location from the Silk Test Classic that is installed on your local machine.

Note: If you want to test mobile applications on a mobile device that is connected to a remote machine or on an Emulator or Simulator on a remote machine, or web applications on Apple Safari or on a remote Microsoft Edge, you have to use a remote Silk Test information service instead of a remote Open Agent.
  • Testing with a Remote Open Agent
    Install the Open Agent on a remote machine to replay tests against an application on the remote machine.
  • Connecting to a Remote Open Agent
    Describes how to connect Silk Test Classic on the local machine with an Open Agent on a remote machine.
  • Networking Protocols Used by the Open Agent
    Lists the protocols that are available for the Open Agent.
  • Single Remote Applications
    Describes how Silk Test Classic handles remote applications in a single-application test environment.
  • Multiple Remote Applications
    Describes how you can specify multiple agents.
  • Configuring a Network of Computers
    Configure a network of computers to run Silk Test Classic and the Silk Test Classic agents.
  • Enabling Networking on a Remote Host
    Describes how you can enable networking on a remote host.
  • Configuring Open Agent Port Numbers
    Describes how you can configure the port of the Open Agent.
  • Client/Server Testing Configurations
    Describes different hardware/software configurations that can support Silk Test Classic testing.
Parent topic: Distributed Testing with the Open Agent
Related tasks
Editing Remote Locations


Testing with a Remote Open Agent

This functionality is supported only if you are using the Open Agent.

To replay tests against an application on a remote machine with Silk Test Classic, perform the following actions:
  1. Create a test against the application on the local machine.
  2. Install the Open Agent on the remote machine. For additional information, refer to the Silk Test Installation Guide.
  3. Start the Open Agent on the remote machine.
  4. Connect to the Open Agent on the remote machine.
    • Click Options > Runtime and specify the IP address of the remote machine in the Agent name field.
    • Add the Connect function to your test script.
    For example, to connect to the Open Agent on the remote machine with the network name agentmachine, type the following into the test script:
        [ ] HANDLE hOpenAgent
    [ ] hOpenAgent = Connect("agentmachine", OPEN_AGENT)
    To execute a command in the test script on the remote machine, add the handle to the command. For example, if the command in the local test script was SomeAgentFunction, change the command to the following:
    [ ] hOpenAgent->SomeAgentFunction()
    For additional information, see Connect Function.
Parent topic: Remote Testing with the Open Agent
Related reference
Runtime Options Dialog Box
Connect Function


Connecting to a Remote Open Agent

This functionality is supported only if you are using the Open Agent.

You can only use TCP/IP to connect Silk Test Classic on the local machine with an Open Agent on a remote machine. Silk Test Classic on Microsoft Windows can use any TCP/IP software package that supports the Windows Sockets Interface Standard, Version 1.1, (WINSOCK), and supplies WINSOCK.DLL.

Parent topic: Remote Testing with the Open Agent


Networking Protocols Used by the Open Agent

The Open Agent uses exclusively the TCP/IP protocol.

Parent topic: Remote Testing with the Open Agent
Related concepts
Open Agent
Related tasks
Configuring a Network of Computers


Single Remote Applications

In a single-application test environment, if the application is remote, specify the agent name in the Runtime Options dialog box. This causes Silk Test Classic to automatically connect to that machine and to direct all agent commands to that machine. This contrasts with the multi-application case, in which you explicitly connect to the target machines and explicitly specify which machines are to receive which sections of code.

Parent topic: Remote Testing with the Open Agent
Related concepts
Multiple Remote Applications


Multiple Remote Applications

When you enable networking by selecting the networking type in the Runtime Options dialog box on the host, do not set the Agent Name text box to an agent name if you have multiple remote agents. This field only accepts a single agent name and using it prevents you from handling all your client machines the same way.

If you specify one agent name from your set of agents, then you cannot issue a Connect call to that agent and thus do not receive the machine handle that the Connect function returns. Since you have to issue some Connect calls, be consistent and avoid writing exception code to handle a machine that is automatically connected.

For projects or scripts that use the Classic Agent, you can specify multiple agents from within your script file by adding the following command line to the agent:
agent –p portNumber
Parent topic: Remote Testing with the Open Agent
Related concepts
Single Remote Applications


Configuring a Network of Computers

To configure a network of computers so that they can run Silk Test Classic and the Silk Test Classic agents, perform the following steps:

  1. Install, or have already running, networking protocols supported by Silk Test Classic.
  2. Install Silk Test Classic on the host machine and the agent software on all target machines.
  3. Establish connectability between host and agents. This may be automatic or may require some setup, depending on the circumstances.
  4. Enable networking on any target machines. Use the Agent window, as described in Enabling Networking and Assigning the Classic Agent Name and Port.
  5. Enable networking on the host machine. Use the Runtime Options dialog box. Details may vary, depending on your configuration.
  6. Gather the information that your test scripts need when making explicit connections. For example, you can edit the agent names into a list definition and have your test plan pass the list variable name as an argument for test cases controlled by that plan. The test cases then pass each agent name to a Connect or SetUpMachine function and that function makes the explicit host-to-agent connection.

Configuration details are specific to the different protocols and operating systems you are using. In general, set up your Agents and make all adjustments to the partner.ini file or environment variables before enabling networking on the host machine.

Parent topic: Remote Testing with the Open Agent
Related concepts
Networking Protocols Used by the Open Agent


Enabling Networking on a Remote Host

Once the protocol has been picked for any PC agents and the port settings are consistent, you can enable networking on the host.

Do this by choosing Options > Runtime and setting the port number and/or agent name. You can skip this step if you do not have to change the default port number and you are not specifying an agent name for a single-remote-application configuration.

Parent topic: Remote Testing with the Open Agent


Client/Server Testing Configurations

The processes that participate in a client/server testing scenario are logically associated with three different computers:
  1. System A runs Silk Test Classic, which processes test scripts and sends application commands to the agent.
  2. System B runs the client application and the agent, which submits the application commands to the client application.
  3. System C runs the server software, which reacts to requests submitted by the client application.

The following sections describe different hardware/software configurations that can support Silk Test Classic testing.

Configuration 1

Machine 1 shows the software configuration you would have when testing a stand-alone application. Machine 2 shows Silk Test Classic and a client/server application with all of your software running on one machine. This configuration allows you to do all types of functional testing other than testing the behavior of the connection between a client and a remote server.

During your initial test development phase, you can reduce your hardware needs by making two (and possibly all) of these systems the same. If you write tests for an application running on the same system as Silk Test Classic, you can implement the tests without consideration of any of the issues of remote testing. You can then expand your testing program incrementally to take your testing into each new phase.

Configuration 2

A testing configuration in which the client application runs on the same machine as Silk Test Classic and the server application runs on a separate machine.

Note: In this configuration, as with Machine 2 in Configuration 1, there is no communication between Silk Test Classic and the server. This means that you must manage the work of starting and initializing the server database manually. For some kinds of testing this is appropriate.

This configuration lets you test the remote client-to-server connection and is appropriate for many stress tests. It allows you to do volume load testing from the point of view of the client application, but not the server.

Configuration 3

Multiple copies of the client application running on separate machines, with Silk Test Classic driving the client application by means of the agent process on each client machine, and the client application driving the server application. This is just the multi-client version of the previous configuration. You could run a fourth instance of the client application on the Silk Test Classic machine. The actual number of client machines used is your choice.

This configuration is appropriate for load testing and configuration testing if you have no need to automatically manipulate the server. You must have at least two clients to test concurrency and mutual-exclusion functionality.

Configuration 4

Once you are running Silk Test Classic, it makes sense to have your script initialize your server automatically. Configuration 4 uses the same hardware configuration as Configuration 3, but Silk Test Classic is also driving the server directly. This figure shows Silk Test Classic using an agent on the server machine to drive the server’s GUI (the lower connecting arrow); this approach can be used to start the server’s database and sometimes can be used to initialize it to a base state. The upper arrow shows Silk Test Classic using SQL commands to directly manipulate the server database; use this approach when using the agent is not sufficient. After starting the database with the agent, use SQL commands to initialize it to a base state. The SQL commands are submitted by means of Silk Test Classic’s database functions, which do not require the services of the agent.

Configuration 4 is the most complete testing configuration. It requires the database tester. You can use it for all types of Silk Test Classic testing, including volume load testing of the server, peak load testing, and performance testing.

The special features that allow Silk Test Classic to provide rigorous testing for client/ server applications are the following:
  • Automatic control of multiple applications.
  • Multithreading for automatic control of concurrent applications.
  • Reporting results by thread ID.
  • Testing across networks using a variety of protocols.

The added value that the database tester provides for the client/server environment is direct database access from the test script.

Parent topic: Remote Testing with the Open Agent
Related concepts
Open Agent


Running Test Cases in Parallel

A concurrent, or multithreaded, script is one in which multiple statements can execute in parallel. Concurrency allows you to more effectively test distributed systems, by permitting multiple client applications to submit requests to a server simultaneously.

The 4Test language fully supports the development of concurrent scripts which enables a script to:

  • Create and coordinate multiple concurrent threads.
  • Protect access to variables, which are global to all threads.
  • Synchronize threads with semaphores.
  • Protect critical sections of code for atomic operations.
  • Recover from errors in the event of script deadlock.
  • Concurrency
    Describes how agents on a specified set of machines drive the associated applications simultaneously.
  • Global Variables
    Describes how you can use global variables.
  • Recovering Multiple Tests
    Describes how you can establish the appropriate state on target machines, regardless of the current state of the application.
  • Remote Recording
    Describes how you can record tests remotely with the Classic Agent.
  • Threads and Concurrent Programming
    Describes how Silk Test Classic can run test cases in parallel on more than one machine using parallel threads.
  • Driving Multiple Machines
    Describes how you can drive different applications concurrently on multiple machines.
  • Protecting Access to Global Variables
    Describes how 4Test protects the access to global variables.
  • Synchronizing Threads with Semaphores
    Describes how you can use semaphores to mutually exclude competing threads or to control access to a resource.
  • Testing In Parallel but Not Synchronously
    Describes how to run test functions in parallel on multiple clients, but with different tests running on each client.
  • Statement Types
    Describes the statement types that are available for managing distributed tests.
  • Using Templates
    Describes how you can use templates for distributed testing.
Parent topic: Distributed Testing with the Open Agent
Related concepts
How 4Test Handles Script Deadlock


Concurrency

For Silk Test Classic, concurrent processing means that agents on a specified set of machines drive the associated applications simultaneously. To accomplish this, the host machine interleaves execution of the sets of code assigned to each machine. This means that when you are executing identical tests on several machines, each machine can be in the process of executing the same operation. For example, select the Edit.FindChange menu item.

At the end of a set of concurrent operations, you will frequently want to synchronize the machines so that you know that all are ready and waiting before you submit the next operation. You can do this easily with 4Test.

There are several reasons for executing test cases concurrently:
  • You want to save testing time by running your functional tests for all the different platforms at the same time and by logging the results centrally, on the host machine.
  • You are testing cross-network operations.
  • You need to place a multi-user load on the server.
  • You are testing the application’s handling of concurrent access to the same database record on the server.
To accomplish testing concurrent database accesses, you simply set all the machines to be ready to make the access and then you synchronize. When all the machines are ready, you execute the operation that commits the access operation—for example, clicking OK. Consider the following example:
// [A] Execute 6 operations on all machines concurrently
for each sMachine in lsMachine
  spawn
    SixOpsFunction (sMachine)
rendezvous                        // Synchronize

// [B] Do one operation on each machine
for each sMachine in lsMachine
  spawn
    [sMachine]MessageBox.OK.Click () // One operation
rendezvous                             // Synchronize

In code fragment [A], the six operations defined by the function SixOpsFunction are executed simultaneously on all machines in a previously defined list of agent names. After the parallel operation, the script waits for all the machines to complete; on completion, they will present a message box, unless the application fails. In code fragment [B], the message box is dismissed. By putting the message dismissal operation into its own parallel statement block instead of adding it to the SixOpsFunction, you are able to synchronize and all machines click at almost the same instant.

In order to specify that a set of machines should execute concurrently, you use a 4Test command that starts concurrent threads. In the fragments above, the spawn statement starts a thread for each machine.

Parent topic: Running Test Cases in Parallel
Related concepts
Using a Spawn Statement
Threads and Concurrent Programming


Global Variables

Suppose the code for each machine is counting instances of some event. You want a single count for the whole test and so each machine adds its count to a global variable. When you are executing the code for all your machines in parallel, two instances of the statement iGlobal = iGlobal + iCount could be executing in parallel. Since the instructions that implement this statement would then be interleaved, you could get erroneous results. To prevent this problem, you can declare a variable shareable. When you do so, you can use the access statement to gain exclusive access to the shared variable for the duration of the block of code following the access statement. Make variables shareable whenever the potential for conflict exists.

Parent topic: Running Test Cases in Parallel


Recovering Multiple Tests

There are three major categories of operations that an Agent executes on a target machine:
  • Setup operations that bring the application to the state from which the next test will start.
  • Testing operations that exercise a portion of the application and verify that it executed correctly.
  • Cleanup operations that handle the normal completion of a test plus the case where the test failed and the application is left in an indeterminate state. In either case, the cleanup operations return the application to a known base state.

When there are multiple machines being tested and more than one application, the Agent on each machine must execute the correct operations to establish the appropriate state, regardless of the current state of the application.

Parent topic: Running Test Cases in Parallel


Remote Recording

Once you establish a connection to a target machine, any action you initiate on the host machine, which is the machine running Silk Test Classic, is executed on the target machine.

With the Classic Agent, one Agent process can run locally on the host machine, but in a networked environment, the host machine can connect to any number of remote Agents simultaneously or sequentially. You can record and replay tests remotely using the Classic Agent. If you initiate a Record/Testcase command on the host machine, you record the interactions of the user manipulating the application under test on the target machine. In order to use the Record menu’s remote recording operations, you must place the target machine’s name into the Runtime Options dialog box. Choose Options > Runtime.

With the Open Agent, one Agent process can run locally on the host machine. In a networked environment, any number of Agents can replay tests on remote machines. However, you can record only on a local machine.

Parent topic: Running Test Cases in Parallel
Related reference
host machine
Runtime Options Dialog Box


Threads and Concurrent Programming

Silk Test Classic can run test cases in parallel on more than one machine. To run test cases in parallel, you can use parallel threads within main( ) or in a function called by main( ). If you attempt to run test cases in parallel on the same machine, you will generate a runtime error.

A more elegant alternative to parallel threads is to use a multitestcase function, which provides a robust multi-machine recovery system. For additional information on multitestcase code templates, see Using the Client/Server Template and Using the Parallel Template.

In the 4Test environment, a thread is a mechanism for interleaving the execution of blocks of client code assigned to different Agents so that one script can drive multiple client applications simultaneously. A thread is part of the script that starts it, not a separate script. Each thread has its own call stack and data stack. However, all the threads that a script spawns share access to the same global variables, function arguments, and data types. A file that one thread opens is accessible to any thread in that script.

While the creation of a thread carries no requirement that you use it to submit operations to a client application, the typical reason for creating a multithread script is so that each thread can drive test functions for one client, which allows multiple client application operations to execute in parallel.

When a script connects to a machine, any thread in that script is also connected to the machine. Therefore, you must direct the testing operations in a thread to a particular Agent machine. Threads interleave at the machine instruction level; therefore, no single 4Test statement is atomic with respect to a statement in another thread.

Parent topic: Running Test Cases in Parallel
Related concepts
Client/Server Template
Using the Parallel Template
Related Topics
Using the client/server template
Using the parallel template


Driving Multiple Machines

When you want to run tests on multiple machines simultaneously, you connect to all the machines and then you direct specific test operations to particular machines. This enables you to drive different applications concurrently. For example, you can test the intercommunication capabilities of two different applications or you can drive both a client application and its server.

To do this, at the beginning of a test script you issue for each machine an explicit connection command. This can be either Connect(agent_name) or SetMachine(agent_name). This connection lasts for the duration of the script unless you issue a Disconnect(agent_name) command. In the body of the script you can specify that a particular portion of code is to be executed on a particular machine. The SetMachine(agent_name) command specifies that the following statements are directed to that Agent. You can specify that just one statement is directed to a particular Agent by using the bracket form of the machine handle operator. For example ["Client_A"]SYS_SetDir ("c:\mydir").

Since 4Test allows you to pass variables to these functions, you can write a block of code that sends the same operations to a particular set of target machines and you can pass the SetMachine function in that block of code a variable initialized from a list that specifies the machines in that set. Thus, specifying which machines receive which operations is very simple.

Parent topic: Running Test Cases in Parallel


Protecting Access to Global Variables

When a new thread is spawned, 4Test creates a new copy of all local variables and function arguments for it to use. However, all threads have equal access to global variables. To avoid a situation in which multiple threads modify a variable simultaneously, you must declare the variable as shareable. A shareable variable is available to only one thread at a time.

Instances where threads modify variables simultaneously generate unpredictable results. Errors of this kind are difficult to detect. Make variables shareable wherever the potential for conflict exists.

A declaration for a shareable variable has the following form:
[scope] share data-type name [= expr] {, name [= expr]}
  • scope can be either public or private. If omitted, the default is public.
  • data-type is a standard or user-defined data type.
  • name is the identifier that refers to the shareable variable.
  • expr is an expression that evaluates to the initial value you want to give the variable. The value must have the same type you gave the variable. If you try to use a variable before its value is set, 4Test raises an exception.

At any point in the execution of a script, a shared variable can only be accessed from within the block of code that has explicitly been granted access to it. You request access to shareable variables by using the access statement.

An access statement has the following form:
access name1, name2, ...
  statement

where name1, name2, ... is a list of identifiers of optional length, each of which refers to a shareable variable and statement is the statement to be executed when access to the variables can be granted.

If no other thread currently has access to any of the shareable variables listed, 4Test executes the specified statement. Otherwise, 4Test blocks the thread where the access statement occurs until access can be granted to all the shareable variables listed. At that point, 4Test blocks competing threads and executes the blocked thread.

Example

share INTEGER iTestNum = 0
public share STRING asWeekDay [7]
share ANYTYPE aWhoKnows

void IncrementTestNum ()
  access iTestNum
    iTestNum = iTestNum + 1
Parent topic: Running Test Cases in Parallel


Synchronizing Threads with Semaphores

Use semaphores to mutually exclude competing threads or control access to a resource. A semaphore is a built-in 4Test data type that can only be assigned a value once. The value must be an integer greater than zero. Once it is set, your code can get the semaphore's value, but cannot set it.

Example

The following code example shows legal and illegal manipulations of a variable of type SEMAPHORE:
SEMAPHORE semA = 10                        // Legal
semA = 20                                  // Illegal - existing semaphore
                                           // cannot be reinitialized
if (semA == [SEMAPHORE]2)...               // Legal - note the typecast
Print ("SemA has {semA} resources left.")  // Legal
SEMAPHORE semB = 0                         // Illegal - must be greater than 0

To compare an integer to a semaphore variable, you must typecast from integer to semaphore using [SEMAPHORE].

Note: You cannot cast a semaphore to an integer.

To use a semaphore, you first declare and initialize a variable of type SEMAPHORE. Thereafter, 4Test controls the value of the semaphore variable. You can acquire the semaphore if it has a value greater than zero. When you have completed your semaphore-protected work, you release the semaphore. The Acquire function decrements the value of the semaphore by one and the Release function increments it by one. Thus, if you initialize the semaphore to 5, five threads can simultaneously execute semaphore-protected operations while a sixth thread has to wait until one of the five invokes the Release function for that semaphore.

The Acquire function either blocks the calling thread because the specified semaphore is zero, or "acquires" the semaphore by decrementing its value by one. Release checks for any threads blocked by the specified semaphore and unblocks the first blocked thread in the list. If no thread is blocked, Release "releases" the semaphore by incrementing its value by one so that the next invocation of Acquire succeeds, which means it does not block.

A call to Acquire has the following form:
void Acquire(SEMAPHORE semA)
Where semA s the semaphore variable to acquire.
A call to Release has the following form:
void Release(SEMAPHORE semA)
Where semA s the semaphore variable to release.

If more than one thread was suspended by a call to Acquire, the threads are released in the order in which they were suspended.

A semaphore that is assigned an initial value of 1 is called a binary semaphore, because it can only take on the values 0 or 1. A semaphore that is assigned an initial value of greater than one is called a counting semaphore because it is used to count a number of protected resources.

Example: Application only supports three simultaneous users

Suppose you are running a distributed test on eight machines using eight 4Test threads. Assume that the application you are testing accesses a database, but can support only three simultaneous users. The following code uses a semaphore to handle this situation:
SEMAPHORE DBUsers = 3
...
Acquire (DBUsers)
  access database
Release (DBUsers)
The declaration of the semaphore is global; each thread contains the code to acquire and release the semaphore. The initial value of three ensures that no more than three threads will ever be executing the database access code simultaneously.
Parent topic: Running Test Cases in Parallel


Testing In Parallel but Not Synchronously

This topic illustrates a method for running test functions in parallel on multiple clients, but with different tests running on each client. This provides a realistic multi-user load as opposed to a load in which all clients perform the same operations at roughly the same time.

Example

This example suggests a method by which each client, operating in a separate thread, executes a test that is assigned by a random number. The RandSeed function is called first so that the random number sequence is the same for each iteration of this multi-user test scenario. This enables you to subsequently repeat the test with the same conditions.

The example reads a list of client machines from a file, clients.txt, and receives the test count as in input argument. These external variables make the example scalable as to the number of machines being tested and the number of tests to be run on each. The number of different testcases is twelve in this example, but could be changed by modifying the SelectTest function and adding further test functions. For each machine in the client machine list, the example spawns a thread in which the specified client executes a randomly selected test, repeating for the specified number of tests.

Note: You can execute this test as it is written because it sets its own application states. However, when you use multi-application support, this is automatic. And if you want to use this approach to drive different applications or to initialize a server before starting the testing, you must add multi-application support.
testcase ParallelRandomLoadTest (INTEGER iTestCount)
  LIST OF STRING lsClients
  RandSeed (3)

  // list of client names
  ListRead (lsClients, "clients.txt")

  STRING sClientName

  for each sClientName in lsClients
    spawn
      // Connect to client, which becomes current machine
      Connect (sClientName)
      SetAppState ("MyAppState")           // Initialize application
      TestClient (iTestCount)
      Disconnect (sClientName)
    rendezvous

  TestClient (INTEGER iTestCount)
    for i = 1 to iTestCount
      SelectTest ()

  SelectTest ()
    INTEGER i = RandInt (1, 12)

    // This syntax invokes Test1 to Test12, based on i
    @("Test{i}") ()

  // Define the actual test functions
  Test1 ()
    // Do the test . . .

  Test2 ()
    // Do the test . . .
  . . .
  Test12 ()
    // Do the test . . .
Parent topic: Running Test Cases in Parallel


Statement Types

This section describes the statement types that are available for managing distributed tests.

  • Parallel Processing Statements
    Describes how Silk Test manages multiple threads, running in parallel.
  • Using Parallel Statements
    Describes how you can use a parallel statement to make code more readable.
  • Using a Spawn Statement
    Describes how you can use a spawn statement to initiate concurrent test operations on multiple machines.
Parent topic: Running Test Cases in Parallel


Parallel Processing Statements

You create and manage multiple threads using combinations of the 4Test statements parallel, spawn, rendezvous, and critical.

In 4Test, all running threads, which are 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 detects script deadlock and raises an exception.

Note: The 4Test exit statement terminates all threads immediately when it is executed by one thread.
Parent topic: Statement Types


Using Parallel Statements

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 want 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 must 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.

Parent topic: Statement Types


Using a 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. Silk Test Classic scans for all 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, like the following:
for each sMachine in lsMachine
  spawn        // start thread for each sMachine
    SetMachine (sMachine)
    DoSomething ()
  rendezvous
The preceding example achieves the same result when written as follows:
for each sMachine in lsMachine
  spawn
    [sMachine]DoSomething ()
  rendezvous

To use a spawn statement in tests that use TrueLog, use the OPT_PAUSE_TRUELOG option to disable TrueLog. Otherwise, issuing a spawn statement when TrueLog is enabled causes Silk Test Classic to hang or crash.

Parent topic: Statement Types
Related reference
Agent Options


Using Templates

This section describes how you can use templates for distributed testing.

  • Using the Parallel Template
    Describes how you can use the parallel template.
  • Client/Server Template
    Describes the client/server template.
Parent topic: Running Test Cases in Parallel


Using the Parallel Template

This template is stored as parallel.t in the Examples subdirectory of the Silk Test Classic installation directory. The code tests a single application that runs on an externally defined set of machines.

This multi-test-case template accepts a list of machine names. The application whose main window is MyMainWin is invoked on each machine. The same operations are then performed on each machine in parallel. If any test case fails, the multi-test-case will be marked as having failed; however, a failed test case within a thread does not abort the thread.

You can use this template by doing three edits:

  • Include the file that contains your window declarations.
  • Substitute the MainWin name of your application, which is defined in your MainWin window declaration, with the Mainwin name of the template, MyMainWin.
  • Insert the calls to one or more tests, or to the main function, where indicated.
Use myframe.inc.
use "myframe.inc"
multitestcase MyParallelTest (LIST of STRING lsMachines)

  STRING sMachine

  // Connect to all machines in parallel:
  for each sMachine in lsMachines
    spawn
      SetUpMachine (sMachine, MyMainWin)
    rendezvous

  // Set app state of each machine, invoking if necessary:
  SetMultiAppStates()

  // Run testcases in parallel
  for each sMachine in lsMachines
    spawn
      SetMachine (sMachine)
      // Call testcase(s) or call main()
    rendezvous
Parent topic: Using Templates


Client/Server Template

This template is stored as multi_cs.t in the Examples subdirectory of the Silk Test Classic installation directory. This test case invokes the server application and any number of client applications, based on the list of machines passed to it, and runs the same function on all clients concurrently, after which the server will perform end-of-session processing.

You can use this template by doing the following edits:

  • Include the files that contain your window declarations for both the client application and the server application.
  • Substitute the MainWin name of your server application, which is defined in your MainWin window declaration, with the MainWin name of the template, MyServerApp.
  • Substitute the MainWin name of your client application, which is defined in your MainWin window declaration, with the Mainwin name of the template, MyClientApp.
  • Replace the call to PerformClientActivity with a function that you have written to perform client operations and tests.
  • Replace the call to DoServerAdministration with a function that you have written to perform server administrative processing and/or cleanup.
use "myframe.inc"
multitestcase MyClientServerTest (STRING sServer, LIST of STRING lsClients)
  STRING sClient

  // Connect to server machine:
  SetUpMachine (sServer, MyServerApp)

  // Connect to all client machines in parallel:
  for each sClient in lsClients
    spawn
      SetUpMachine (sClient, MyClientApp)
  rendezvous

  // Set app state of each machine, invoking if necessary:
  SetMultiAppStates()

  // Run functions in parallel on each client:
  for each sClient in lsClients
    spawn
      // Make client do some work:
      [sClient] PerformClientActivity()
    rendezvous

  // Perform end-of-session processing on server application:
  [sServer] DoServerAdministration()
Parent topic: Using Templates


Testing Multiple Machines

This section describes strategies for testing multiple machines.

  • Running Tests on One Remote Target
    Describes how you can run tests on one remote target.
  • Running Tests Serially on Multiple Targets
    Describes how you can run tests serially on multiple remote targets.
  • Specifying the Target Machine Driven By a Thread
    Describes how you can specify the target machine that is driven by a thread.
  • Specifying the Target Machine For a Single Command
    Describes how you can specify the target machine for a single command.
  • Reporting Distributed Results
    Describes the different formats in which Silk Test Classic reports test results.
  • Alternative Machine Handle Operator
    Describes an alternative form of the machine handle operator syntax.
  • Testing Clients Concurrently
    Concurrently test clients to execute the same function on two or more clients at the same time.
  • Testing Clients Plus Server Serially
    Build tests to test the server and its clients in a serial fashion.
  • Testing Databases
    Describes how you can manipulate a database directly from Silk Test Classic.
Parent topic: Distributed Testing with the Open Agent


Running Tests on One Remote Target

Use one of the following methods to specify that you want a script, suite, or test plan to run on a remote target instead of the host:
  • Enter the name of the target Agent in the Runtime Options dialog box of the host. You also need to select a network protocol in the dialog box. If you have been testing a script by running Silk Test Classic and the Agent on the same system, you can then test the script on a remote system without editing your script by using this method.
  • Specify the target Agent’s name by enclosing it within brackets before the script or suite name. For example [Ohio]myscript.t.
  • You can select (none) in the Runtime Options dialog box of the host and then specify the name of the target Agent in a call to the Connect function in your script. For example, to connect to a machine named Ontario:
    testcase MyTestcase ()
  Connect ("Ontario")
  // Call first testcase
  DoTest1 ()
  // Call second testcase
  DoTest2 ()
  Disconnect ("Ontario"

When you are driving only one remote target, there is no need to specify the current machine; all test case code is automatically directed to the only connected machine.

When you use the multi-application support functions, you do not have to make explicit calls to Connect; the support functions issue these calls for you.

Parent topic: Testing Multiple Machines
Related concepts
Running Tests Serially on Multiple Targets
Testing Clients Concurrently
Specifying the Target Machine Driven By a Thread
Related reference
Runtime Options Dialog Box


Running Tests Serially on Multiple Targets

To run your scripts or suites serially on multiple target machines, specify the name of the target Agent within the suite file. For example, the following code runs a suite of three scripts serially on two target machines named Ohio and Montana:
[Ohio] script1.t
[Ohio] script2.t
[Ohio] script3.t
[Montana] script1.t
[Montana] script2.t
[Montana] script3.t

Any spaces between the name of the target Agent and the script name are not significant.

Alternatively, to run test cases serially on multiple target machines, switch among the target machines from within the script, by using the Connect and Disconnect functions of 4Test. For example, the following script contains a function named DoSomeTesting that is called once for each machine in a list of target machines, with the name of the target Agent as an argument:
testcase TestSerially ()
  STRING sMachine
  // Define list of agent names
  LIST OF STRING lsMachines = {...}
    "Ohio"
    "Montana"

  // Invoke test function for each name in list
  for each sMachine in lsMachines
    DoSomeTesting (sMachine)

  // Define the test function
  DoSomeTesting (STRING sMachine)
    Connect (sMachine)
    Print ("Target machine: {sMachine}")
    // do some testing...
    Disconnect (sMachine)

You will rarely need to run one test serially on multiple machines. Consider this example a step on the way to understanding parallel testing.

Parent topic: Testing Multiple Machines
Related concepts
Running Tests on One Remote Target
Testing Clients Concurrently
Specifying the Target Machine Driven By a Thread
Related tasks
Testing Clients Plus Server Serially


Specifying the Target Machine Driven By a Thread

While the typical purpose for a thread is to direct test operations to a particular test machine, you have total flexibility as to which machine is being driven by a particular thread at any point in time. For example, in the code below, the spawn statement starts a thread for each machine in a predefined list of test machines. The SetMachine command directs the code in that thread to the Agent on the specified machine. But the ["server"] machine handle operator directs the code in the doThis function to the machine named server. The code following the doThis invocation continues to be sent to the sMachine specified in the SetMachine command.
for each smachine in lsMachine
  spawn // start thread for each sMachine
  SetMachine (sMachine)
  // ... code executed on sMachine
  ["server"]doThis() // code executed on "server"
  // ...continue with code for sMachine
rendezvous

While the machine handle operator takes only a machine handle, 4Test implicitly casts the string form of the Agent machine’s name as a machine handle and so in the preceding example the machine name is effectively the same as a machine handle.

Parent topic: Testing Multiple Machines
Related concepts
Specifying the Target Machine For a Single Command


Specifying the Target Machine For a Single Command

To specify the target machine for a single command, use the machine handle operator on the command. For example, to execute the SYS_SetDir function on the target machine specified by the sMachine1 variable, type sMachine1->SYS_SetDir (sDir).

To allow you to conveniently perform system related functions (SYS_) on the host, you can preface the function call with the machine handle operator, specifying the globally defined constant hHost as the argument to the operator. For example, to set the working directory on the host machine to c:\mydir, type hHost->SYS_SetDir ("c:\mydir").

You can use this syntax with a method call, for example sMachine-> TextEditor.Search.Find.Pick, but when invoking a method, this form of the machine handle must be the first token in the statement.

If you need to use this kind of statement, use the alternative form of the machine handle operator described below.

You can use the SetMachine function to change target machines for an entire block of code.

The hHost constant cannot be used in simple handle compares like hMyMachineHandle== hHost. This will never be TRUE. A better method is to use GetMachineName(hHost) and compare names. If hHost is used as an argument, it will refer to the "(local)" host not the target host.

Example

The following example shows valid and invalid syntax:
// Valid machine handle operator use
for each sMachine in lsMachine
  sMachine-> TextEditor.Search.Find.Pick

// Invalid machine handle operator use with method
if (sMachine->ProjX.DuplicateAlert.Exists())
  Print ("Duplicate warning on {sMachine} recipient.")

If you need to use this kind of statement, use the alternative form of the machine handle operator described below.

You can use the SetMachine function to change target machines for an entire block of code.

The hHost constant cannot be used in simple handle compares, like hMyMachineHandle== hHost. This will never be TRUE. A better method is to use GetMachineName(hHost) and compare names. If hHost is used as an argument, it will refer to the local host, not the target host.

Parent topic: Testing Multiple Machines
Related concepts
Specifying the Target Machine Driven By a Thread


Reporting Distributed Results

You can view test results in each of several formats, depending on the kind of information you need from the report. Each format sorts the results data differently, as follows:
Elapsed time
Sorts results for all threads and all machines in event order. This enables you to see the complete set of results for a time period and may give you a sense of the load on the server during that time period or may indicate a performance problem.
Machine
Sorts results for all threads running on one machine and presents the results in time-sorted order for that machine before reporting on the next machine.
Thread
Sorts results for all tests run under one thread and presents the results in time-sorted order for that thread before reporting on the next thread.
Parent topic: Testing Multiple Machines


Alternative Machine Handle Operator

An alternative syntax for the machine handle operator is the bracket form, like the following example shows.

[hMachine] Any4TestFunctionCall ()

Example

To execute the SYS_SetDir function on the target machine specified by the string sMachineA, you do this:
[sMachineA] SYS_SetDir (sDir)
The correct form of the invalid syntax shown above is:
// Invalid machine handle operator use
if ([sMachine]ProjX.DuplicateAlert.Exists())
  Print ("Duplicate warning on {sMachine} recipient.")
To execute the SYS_SetDir function on the host machine, you can do the following:
[hHost] SYS_SetDir (sDir)

You can also use this form of the machine handle operator with a function that is not being used to return a value or with a method.

Example

for each sMachine in lsMachine
     [sMachine] FormatTest7 ()

Example

for each sMachine in lsMachine
  [sMachine] TextEditor.Search.Find.Pick
Parent topic: Testing Multiple Machines


Testing Clients Concurrently

In concurrent testing, Silk Test Classic executes one function on two or more clients at the same time. This topic demonstrates one way to perform the same tests concurrently on multiple clients.

For example, suppose you want to initiate two concurrent database transactions on the same record, and then test how well the server performs. To accomplish this, you need to change the script presented in Testing Clients Plus Server Serially to look like this:
testcase TestConcurrently ()
  Connect ("server")
  Connect ("client1")
  Connect ("client2")
  DoSomeSetup ("server")    // initialize server first
  Disconnect ("server")     // testcase is thru with server

  spawn                     // start thread for client1
    UpdateDatabase ("client1")
  spawn                     // start thread for client2
    UpdateDatabase ("client2")

  rendezvous                // synchronize
  Disconnect ("client1")
  Disconnect ("client2")

  DoSomeSetup (STRING sMachine)   // define server setup
    HTIMER hTimer
    hTimer = TimerCreate ()
    TimerStart (hTimer)
    SetMachine (sMachine)
    // code to do server setup goes here
    TimerStop (hTimer)
    Print ("Time on {sMachine} is: {TimerStr (hTimer)}")
    TimerDestroy (hTimer)

  UpdateDatabase (STRING sMachine)   // define update test
    HTIMER hTimer
    hTimer = TimerCreate ()
    TimerStart (hTimer)
    SetMachine (sMachine)
    // code to update database goes here
    TimerStop (hTimer)
    Print ("Time on {sMachine} is: {TimerStr (hTimer)}")
    TimerDestroy (hTimer)
An alternative but equivalent approach is to use the parallel statement in place of the spawn and rendezvous:
testcase TestConcurrently2 ()
  Connect ("server")
  Connect ("client1")
  Connect ("client2")

  DoSomeSetup ("server")
  Disconnect ("server")

  parallel                     // automatic synchronization
    UpdateDatabase ("client1") // thread for client1
    UpdateDatabase ("client2") // thread for client2

  Disconnect ("client1")
  Disconnect ("client2")

  DoSomeSetup (STRING sMachine)
    HTIMER hTimer
    hTimer = TimerCreate ()
    TimerStart (hTimer)
    SetMachine (sMachine)
    // code to do server setup goes here
    TimerStop (hTimer)
    Print ("Time on {sMachine} is: {TimerStr (hTimer)}")
    TimerDestroy (hTimer)

  UpdateDatabase (STRING sMachine)
    HTIMER hTimer
    hTimer = TimerCreate ()
    TimerStart (hTimer)
    SetMachine (sMachine)
    // code to update database goes here
    TimerStop (hTimer)
    Print ("Time on {sMachine} is: {TimerStr (hTimer)}")
    TimerDestroy (hTimer)

If you use variables to specify different database records for each client’s database transactions, you can use the above techniques to guarantee parallel execution without concurrent database accesses.

Parent topic: Testing Multiple Machines
Related concepts
Running Tests on One Remote Target
Running Tests Serially on Multiple Targets
Reporting Distributed Results
Testing Databases
Related tasks
Testing Clients Plus Server Serially


Testing Clients Plus Server Serially

In a client/server application, the server and its clients typically run on different target machines. This topic explains how to build tests that test the server and its clients in a serial fashion. In this scenario, the SetMachine function switches among the target machines on which the server and its clients are running. The following script fragment tests a client/server database application in the following steps:
  1. Connect to three target machines, which are server, client1, and client2.
  2. Call the DoSomeSetup function, which calls SetMachine to make "server" the current target machine, and then perform some setup.
  3. Call the UpdateDatabase function once for each client machine. The function sets the target machine to the specified client, then does a database update. It creates a timer to time the operation on this client.
  4. Disconnect from all target machines.

Example

This example shows how you direct sets of test case statements to particular machines. If you were doing functional testing of one application, you might want to drive the server first and then the application. However, this example is not realistic because it does not show the support necessary to bring the different machines to their different application states and to recover from a failure on any machine.

testcase TestClient_Server ()
  Connect ("server")
  Connect ("client1")
  Connect ("client2")
  DoSomeSetup ("server")
  UpdateDatabase ("client1")
  UpdateDatabase ("client2")
  DisconnectAll ()

DoSomeSetup (STRING sMachine)
  HTIMER hTimer
  hTimer = TimerCreate ()
  TimerStart (hTimer)
  SetMachine (sMachine)
  // code to do server setup goes here
  TimerStop (hTimer)
  Print ("Time on {sMachine} is: {TimerStr (hTimer)}")
  TimerDestroy (hTimer)

UpdateDatabase (STRING sMachine)
  HTIMER hTimer
  hTimer = TimerCreate ()
  TimerStart (hTimer)
  SetMachine (sMachine)
  // code to update database goes here
  TimerStop (hTimer)
  Print ("Time on {sMachine} is: {TimerStr (hTimer)}")
  TimerDestroy (hTimer)
Parent topic: Testing Multiple Machines
Related concepts
Testing Clients Concurrently
Reporting Distributed Results
Running Tests Serially on Multiple Targets


Testing Databases

You may be testing a distributed application that accesses a database or you may be directly testing database software. In either of these cases, you might want to manipulate the database directly from Silk Test Classic for several purposes:
  • To exercise certain database functions that are present in a GUI that runs directly on the server machine and is not a client application. For example, administrative functions used for setting up the database.
  • To set the server database to a known state.
  • To verify an application’s database results without using the application.
  • To read information from the database to use as input to a test case.

Silk Test Classic can drive a server application’s GUI by means of the Silk Test Classic Agent exactly as it drives a client application. In addition, the database tester provides direct access, using SQL, from a test script to any database supported by ODBC drivers. These database functions enable you to read and write database records without using the client application. Thus, you can verify client test results without assuming the ability of the client to do that verification.

In addition to using the SQL functions in your tests, you can also use these functions to help manage your testing process as follows:
  • Maintain a bug database, updating it with the results of your testing.
  • Manage your test data in a database instead of in a text file.

The database functions, among other things, allow you to connect to a database, submit an SQL statement, read data from the selected record(s) if the SQL statement was SELECT, and subsequently disconnect from the database. About a dozen of these functions allow you to access your database’s catalog tables.

The functions that support these operations begin with the letters "DB_".

Parent topic: Testing Multiple Machines


Testing Multiple Applications

This section describes testing multiple applications.

  • Overview of Multi-Application Testing
    Describes how you can test multiple different applications simultaneously.
  • Test Case Structure in a Multi-Application Environment
    Describes the components that enable testing of more than one application.
  • Invoking a Test Case in a Multi-Application Environment
    Describes how you can invoke test cases in multi-application environments.
  • Test Case Structure in a Single-Application Environment
    Describes the Silk Test Classic components that enable testing of a single application.
  • Window Declarations for Multi-Application Testing
    Describes the types of window declarations that are required for testing multiple applications.
  • Concurrency Test Example Code
    Provides an example that tests for problems with concurrency, such as deadlock or out-of-sequence writes.
  • Concurrency Test Explained
    Explains the concurrency test example.
  • Code for template.t
    Describes a code fragment with which you can start a multi-application test case.
  • template.t Explained
    Explains the code fragment with which you can start a multi-application test case.
  • defaults.inc
    Describes the defaults.inc file that implements the recovery system for a single-application test.
  • cs.inc
    Describes the automatically included cs.inc file that contains functions used only in the multi-application environment.
  • Include File Size
    Describes how to handle very large include files.
Parent topic: Distributed Testing with the Open Agent


Overview of Multi-Application Testing

Silk Test Classic can easily drive multiple different applications simultaneously. Thus you can bring a server’s database to a known state at the same time you are bringing multiple instances of the client application to their base state window. Likewise, you can drive a server database with several different client applications at the same time.

The essential difference between single-application and multi-application testing is clearly the difference between "one" and "many." When the following entities in a test case are greater than one, they need special consideration and support functions found in Silk Test Classic:
  • Agent names.
  • Application main window names.
  • Sets of application states associated with each main window name.

Multi-machine testing requires that you map both the name of an application and all application states for that application to the machine on which it will be tested. This makes it possible for you to direct test operations to the right machines, and it enables Silk Test Classic to automatically set the machines to the proper application state before a test is run, and to clean up after a test has failed.

Parent topic: Testing Multiple Applications


Test Case Structure in a Multi-Application Environment

This topic describes Silk Test Classic components that enable concurrent testing of more than one application. For example, there are functions that make it possible to drive both the client application and the client’s server from Silk Test Classic, to set each to its base state, and to recover each if it fails. Compare with the test case structure of a single-application environment.

The multi-application environment uses the same defaults.inc file as does the single-application environment. However, when you define a function as a multitestcase, 4Test uses functions defined in the cs.inc file to invoke functions in defaults.inc. Thus, it can pass the appropriate application states or base states to these functions, depending on the requirements of a particular test machine.

Instead of preceding the test case function declaration with the keyword testcase, you must use the keyword multitestcase to give your test case the multi-application recovery system.

cs.inc is an automatically included file that contains functions used only in the multi-application environment. For additional information about this file and the functions that it contains, see cs.inc. You may need to include other files also.

Parent topic: Testing Multiple Applications
Related concepts
Test Case Structure in a Single-Application Environment
cs.inc
Invoking a Test Case in a Multi-Application Environment


Invoking a Test Case in a Multi-Application Environment

The keyword for a test case declaration is different when you are performing distributed testing. In the single-application environment, you invoke a test case with no arguments or you may specify an application state function. However, in a multi-application environment, instead of preceding the test case function declaration with the keyword testcase, you must use the keyword multitestcase to give your test case the multi-application recovery system.

Declaring a function as a multitestcase gives that function the ability to invoke functions declared with the keyword testcase. A multitestcase thus can be viewed as a wrapper for stand-alone test cases; it provides a means of assigning tests to particular machines and lets you invoke previously written test cases from the multi-test case file by simply adding a use statement to the file to include the test case definitions.

When you are using multi-application environment support, you can pass the test case the names of the machines to be tested during that execution of the test case, but not the application state function. In a multi-application environment, one test case can use multiple application states; you specify these in the required code at the beginning of the test case.

Parent topic: Testing Multiple Applications
Related concepts
Test Case Structure in a Multi-Application Environment


Test Case Structure in a Single-Application Environment

The code that implements a test case for a single application is similar to that of a test case for applications on multiple separate machines in a client/server environment.

This topic summarizes the structure of the single-application version and some Silk Test Classic components used to implement it. You can compare the structure with the support code needed for running multiple applications.

The include file defaults.inc implements the recovery system for a single application test. For information about the DefaulBaseState function and the functions that are contained within defaults.inc, see defaults.inc.

Your test case needs certain definitions that other test cases in your testing program will also need. These include:
  • Window declarations
  • Application states
  • Utility functions

Placing these general purpose definitions in an include file, or several smaller files, saves repetitive coding. When you use Silk Test Classic to record window declarations and application states, Silk Test Classic names the generated file frame.inc.

Parent topic: Testing Multiple Applications
Related concepts
Test Case Structure in a Multi-Application Environment
defaults.inc


Window Declarations for Multi-Application Testing

In the client/server environment, unlike the stand-alone environment, you can test two or more different applications at the same time. For example, you could run the functional tests for application "A" on multiple machines at the same time that you are running the functional tests for application "B" on the same machines. The include files that you must generate may therefore have to take into consideration different platforms and/or different applications.

When you are driving two or more applications from Silk Test Classic, you need separate window declarations for each different application. You must be certain that your main window declaration for each separate application is unique. If the same application is running on different platforms concurrently, you may need to use GUI specifiers to specialize the window declarations. 4Test will identify a window declaration statement, that is preceded by a GUI specifier, as being true only on the specified GUI.

In addition, you may find that the operations needed to establish a particular application state are slightly different between platforms. In this case, you just record application states for each platform and give them names that identify the state and the GUI for your convenience.

Recording window declarations on a client machine that is not the host machine, requires that you operate both Silk Test Classic on the host machine and the application on its machine at the same time. You record window declarations and application states in much the same way for a remote machine as for an application running in the Silk Test Classic host machine. The primary difference is that you start the recording operation by selecting Test Frame in Silk Test Classic on the host system and you do the actual recording of application operations on the remote system.

If you have two or more applications being tested in parallel, you need to have two or more sets of window declarations. You must have window declarations, and application states, if needed, for each different application. When recording window declarations and application states on a remote machine, you will find it convenient to have the machine physically near to your host system.

Remote Recording

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Parent topic: Testing Multiple Applications


Concurrency Test Example Code

The concurrency test example is designed to allow any number of test machines to attempt to access a server database at the same time. This tests for problems with concurrency, such as deadlock or out-of-sequence writes.

This example uses only one application. However, it is coded in the style required by the multi-application environment because you will probably want to use an Agent to start and initialize the server during this type of test. There is no requirement in the client/server environment that you use the single-application style of test case just because you are driving only one application. For consistency of coding style, you will probably find it convenient to always use the multi-application files and functions.

For detailed information on the code example, see Concurrency Test Explained.

const ACCEPT_TIMEOUT = 15
multitestcase MyTest (LIST OF STRING lsMachine)
  STRING sMachine
  INTEGER iSucceed
  STRING sError

  for each sMachine in lsMachine
    SetUpMachine (sMachine, Personnel)
    SetMultiAppStates ()

  /*** HAVE EACH MACHINE EDIT THE SAME EMPLOYEE ***/
  for each sMachine in lsMachine
    spawn

      /*** SET THE CURRENT MACHINE FOR THIS THREAD ***/
      SetMachine (sMachine)

      /*** EDIT THE EMPLOYEE RECORD "John Doe" ***/
      Personnel.EmployeeList.Select ("John Doe")
      Personnel.Employee.Edit.Pick ()

      /*** CHANGE THE SALARY TO A RANDOM NUMBER BETWEEN
      50000 AND 70000 ***/
      Employee.Salary.SetText ([STRING] RandInt (50000, 70000))
  rendezvous

  /*** ATTEMPT TO HAVE EACH MACHINE SAVE THE EMPLOYEE RECORD ***/
  for each sMachine in lsMachine
    spawn

      /*** SET THE CURRENT MACHINE FOR THIS THREAD ***/
      SetMachine (sMachine)

      /*** SELECT THE OK BUTTON ***/
      Employee.OK.Click ()

      /*** CHECK IF THERE IS A MESSAGE BOX ***/
      if (MessageBox.Exists (ACCEPT_TIMEOUT))
        SetMachineData (NULL, "sMessage",
          MessageBox.Message.GetText ())
        MessageBox.OK.Click ()
        Employee.Cancel.Click ()
      else if (Employee.Exists ())
        AppError ("Employee dialog not
          dismissed after {ACCEPT_TIMEOUT} seconds")
  rendezvous

  /*** VERIFY THE OF NUMBER OF MACHINES WHICH SUCCEEDED ***/
  iSucceed = 0
  for each sMachine in lsMachine
    sError = GetMachineData (sMachine, "sMessage")
    if (sMessage == NULL)
      iSucceed += 1
    else
      Print ("Machine {sMachine} got message '{sMessage}'")

  Verify (iSucceed, 1, "number of machines that succeeded")
Parent topic: Testing Multiple Applications
Related concepts
Concurrency Test Explained


Concurrency Test Explained

Before you record and/or code your concurrency test, you record window declarations that describe the elements of the application’s GUI. These are placed in a file named frame.inc, which is automatically included with your test case when you compile. Use Silk Test Classic to generate this file because Silk Test Classic does most of the work.

The following code sample gives just those window declarations that are used in the Concurrency Test Example:
window MainWin Personnel
  tag "Personnel"
  PopupList EmployeeList
  Menu Employee
    tag "Employee"
  MenuItem Edit
    tag "Edit"
  // ...

window DialogBox Employee
  tag "Employee"
  parent Personnel
  TextField Salary
    tag "Salary"
  PushButton OK
    tag "OK"
  // ...

The following explanation of the Concurrency Test Example gives the testing paradigm for a simple concurrency test and provides explanations of many of the code constructs. This should enable you to read the example without referring to the Help. There you will find more detailed explanations of these language constructs, plus explanations of the constructs not explained here. The explanation of each piece of code follows that code.

const ACCEPT_TIMEOUT = 15

The first line of the testcase file defines the timeout value (in seconds) to be used while waiting for a window to display.

multitestcase MyTest (LIST OF STRING lsMachine)

The test case function declaration starts with the multitestcase keyword. It specifies a LIST OF STRING argument that contains the machine names for the set of client machines to be tested. You can implement and maintain this list in your test plan, by using the test plan editor. The machine names you use in this list are the names of the Agents of your target machines.

for each sMachine in lsMachine
  SetUpMachine (sMachine, Personnel)

To prepare your client machines for testing, you must connect Silk Test Classic to each Agent and, by means of the Agent, bring up the application on each machine. In this example, all Agents are running the same software and so all have the same MainWin declaration and therefore just one test frame file. This means you can initialize all your machines the same way; for each machine being tested, you pass to SetUpMachine the main window name you specified in your test frame file. The SetUpMachine function issues a Connect call for each machine. It associates the main window name you specified (Personnel) with each machine so that the DefaultBaseState function can subsequently retrieve it.

SetMultiAppStates ()

The SetMultiAppStates function reads the information associated with each machine to determine whether the machine needs to be set to an application state. In this case no application state was specified (it would have been a third argument for SetUpMachine). Therefore, SetMultiAppStates calls the DefaultBaseState function for each machine. In this example, DefaultBaseState drives the Agent for each machine to open the main window of the Personnel application. This application is then active on the client machine and 4Test can send test case statements to the Agent to drive application operations.

 for each sMachine in lsMachine
  spawn
    // The code to be executed in parallel by
    // all machines... (described below)
rendezvous

Because this is a concurrency test, you want all client applications to execute the test at exactly the same time. The spawn statement starts an execution thread in which each statement in the indented code block runs in parallel with all currently running threads. In this example, a thread is started for each machine in the list of machines being tested. 4Test sends the statements in the indented code block to the Agents on each machine and then waits at the rendezvous statement until all Agents report that all the code statements have been executed.

The following is the code defined for the spawn statement:
// The code to be executed in parallel by
// all machines:
SetMachine (sMachine)
Personnel.EmployeeList.Select ("John Doe")
Personnel.Employee.Edit.Pick ()
Employee.Salary.SetText
[STRING] RandInt (50000, 70000))

Each thread executes operations that prepare for an attempt to perform concurrent writes to the same database record. The SetMachine function establishes the Agent that is to execute the code in this thread. The next two statements drive the application’s user interface to select John Doe’s record from the employee list box and then to pick the Edit option from the Employee menu. This opens the Employee dialog box and displays John Doe’s employee record. The last thread operation sets the salary field in this dialog box to a random number. At this point the client is prepared to attempt a write to John Doe’s employee record. When this point has been reached by all clients, the rendezvous statement is satisfied, and 4Test can continue with the next script statement.

for each sMachine in lsMachine
  spawn
    SetMachine (sMachine)
    Employee.OK.Click ()
    if (MessageBox.Exists (ACCEPT_TIMEOUT))
      SetMachineData (NULL, "sMessage",
      MessageBox.Message.GetText ())
      MessageBox.OK.Click ()
      Employee.Cancel.Click ()
    else if (Employee.Exists ())
      AppError ("Employee dialog not dismissed
        after {ACCEPT_TIMEOUT} seconds")
rendezvous

Now that all the clients are ready to write to the database, the script creates a thread for each client, in which each attempts to save the same employee record at the same time. There is only one operation for each Agent to execute: Employee.OK.Click, which clicks the OK button to commit the edit performed in the previous thread.

The test expects the application to report the concurrency conflict with message boxes for all but one client and for that client to close its dialog box within 15 seconds. The if-else construct saves the text of the message in the error message box by means of the SetMachineData function. It then closes the message box and the Employee window so that the recovery system will not report that it had to close windows. This is good practice because it means fewer messages to interpret in the results file.

The "else if" section of the if-else checks to see whether the Employee window remains open, presumably because it is held by a deadlock condition; this is a test case failure. In this case, the AppError function places the string "***ERROR:" in front of the descriptive error message and raises an exception; all Agents terminate their threads and the test case exits.

iSucceed = 0
for each sMachine in lsMachine
  sMessage = GetMachineData (sMachine, "sMessage")
  if (sMessage == NULL)
    iSucceed += 1
  else
    Print ("Machine {sMachine} got message '{sMessage}'")
Verify (iSucceed, 1, "number of machines that succeeded")

The last section of code evaluates the results of the concurrency test in the event that all threads completed. If more than one client successfully wrote to the database, the test actually failed.

GetMachineData retrieves the message box message (if any) associated with each machine. If there was no message, iSucceed is incremented; it holds the count of "successes." The Print function writes the text of the message box to the results file for each machine that had a message box. You can read the results file to verify that the correct message was reported. Alternatively, you could modify the test to automatically verify the message text.

The Verify function verifies that one and only one machine succeeded. If the comparison in the Verify function fails, Verify raises an exception. All exceptions are listed in the results file.

Parent topic: Testing Multiple Applications
Related concepts
Concurrency Test Example Code
Using a Spawn Statement


Code for template.t

This fragment of an example test case shows the required code with which you start a multi-application test case. It connects Silk Test Classic to all the machines being tested and brings each to its first screen. This is just a template; you must tailor your code to fit your actual needs. For information on the significance of each line of code, see Template.t Explained.

multitestcase MyTest (STRING sMach1, STRING sMach2)
  SetUpMachine (sMach1, MyFirstApp, "MyFirstAppState")
  SetUpMachine (sMach2, MySecondApp, "MySecondAppState")
  SetMultiAppStates ()
    spawn
      SetMachine (sMach1)
      // Here is placed code that drives test operations

    spawn
      SetMachine (sMach2)
      // Here is placed code that drives test operations

  rendezvous
  // "..."
Parent topic: Testing Multiple Applications
Related concepts
template.t Explained


template.t Explained

The following line of code in Code for template.t is the first required line in a multi-application test case file. It is the test case declaration.

Note: The code does not pass an application state as in the stand-alone environment.
multitestcase MyTest (STRING sMach1, STRING sMach2)
In the multi-application environment the arguments to your test case are names of the machines to be tested; you specify application states inside the test case. You can code the machine names arguments as you like. For example, you can pass a file name as the only argument, and then, in the test case, read the names of the machines from that file. Or you can define a LIST OF HMACHINE data structure in your test plan, if you are using the test plan editor, to specify the required machines and pass the name of the list, when you invoke the test case from the test plan. This template assumes that you are using a test plan and that it passes the Agent names when it invokes the test case. For this example, the test plan might specify the following:
Mytest ("Client1", "Client2")
The next two code lines are the first required lines in the test case:
SetUpMachine (sMach1, MyFirstApp, "MyFirstAppState")
SetUpMachine (sMach2, My2ndApp, "My2ndAppState")

You must execute the SetUpMachine function for every client machine that will be tested. For each SetUpMachine call, you specify the application to be tested, by passing the name of the main window, and the state to which you want the application to be set, by passing the name of the application state if you have defined one.

The SetUpMachine function issues a Connect call for a machine you want to test and then configures either the base state or a specified application state.

It does this as follows:
  • It associates the client application’s main window name with the specified machine so that the DefaultBaseState function can subsequently retrieve it to set the base state.
  • It associates the name of the application’s base state, if one is specified, with the specified machine so that the SetMultiAppStates function can subsequently retrieve it and set the application to that state at the start of the test case.
The first argument for SetUpMachine is the machine name of one of your client machines. The second argument is the name you supply in your main window declaration in your test frame file, frame.inc. For this example, the frame.inc file specifies the following:
window MainWin MyFirstApp
Because this template specifies two different applications, it requires two different test frame files.
The third argument is the name you provide for your application state function in your appstate declaration for this test. For this example, the appstate declaration is the following:
appstate MyFirstAppState () based on MyFirstBaseState
The appstate declaration could also be of the form:
appstate MyFirstBaseState ()

Although the DefaultBaseState function is designed to handle most types of GUI-based applications, you may find that you need to define your own base state. It would be the application state that all your tests for this application use. In this case, you would still pass this application state to SetUpMachine so that your application would always be brought to this state at the start of each test case.

This template specifies two application states for generality. You would not use an application state if you wanted to start from the main window each time. If you have a number of tests that require you to bring the application to the same state, it saves test-case code to record the application state once, and pass its name to SetUpMachine. You will probably place your application state declarations in your test frame file.
SetMultiAppStates ()
The SetMultiAppStates function must always be called, even if the test case specifies no application state, because SetMultiAppStates calls the DefaultBaseState function in the absence of an appstate declaration. SetMultiAppStates uses the information that SetUpMachine associated with each connected machine to set potentially different application states or base states for each machine.
 spawn
  SetMachine (sMach1)
  // Here is placed code that drives test operations

The spawn statement starts an execution thread, in which each statement in the indented code block below it runs in parallel with all currently running threads. There is no requirement that your test case should drive all your test machines at the same time, however, this is usually the case. The SetMachine function directs 4Test to execute this thread’s code by means of the Agent on the specified machine. This thread can then go on to drive a portion, or all, of the test operations for this machine.

 spawn
  SetMachine (sMach2)
  // Here is placed code that drives test operations
rendezvous
// "..."
The second spawn statement starts the thread for the second machine in this template. The rendezvous statement blocks the execution of the calling thread until all threads spawned have completed. You can use the rendezvous statement to synchronize machines as necessary before continuing with the test case.
Parent topic: Testing Multiple Applications
Related concepts
Code for template.t
Using a Spawn Statement


defaults.inc

The defaults.inc file is provided by Silk Test Classic and implements the recovery system for a single application test. That is, it contains the DefaultBaseState function that performs any cleanup needed after an operation under test fails and returns the application to its base state.

You can define a base state function to replace the DefaultBaseState function by defining an application state without using the basedon keyword. This creates an application state that 4Test executes instead of the DefaultBaseState function.

The defaults.inc file contains six other functions that 4Test automatically executes unless you define functions that replace them:
DefaultScriptEnter
A null function, allows you to define a ScriptEnter function, as discussed below.
DefaultScriptExit (BOOLEAN bException)
Logs an exception to the results file when a script exits because of an exception.
DefaultTestcaseEnter
Executes the SetAppState function. If you have specified an application state for this test case, the SetAppState function brings your test application to that state. If you have no application state defined, SetAppState brings the application to the base state (if necessary).
DefaultTestcaseExit (BOOLEAN bException)
Logs an exception to the results file when a test case exits because of an exception. The function then executes the SetBaseState function, which calls a base state function that you have defined or the DefaultBaseState function.
DefaultTestPlanEnter
A null function, allows you to define TestPlanEnter, as discussed below, to allow logging of results.
DefaultTestPlanExit (BOOLEAN bException)
A null function, allows you to define TestPlanExit, as discussed below, to allow logging of results.

The word "Default" in each of the above function names signifies that you can define alternative functions to replace these. If, for example, you define a function called TestcaseEnter, 4Test will invoke your function before executing any of the code in your test case and will not invoke DefaultTestcaseEnter.

TestPlanEnter() is not called until the first test case in the plan is run. Or the first marked test case, if you are only running marked test cases. Similarly, TestPlanExit() is called at the completion of the last marked test case. TestPlanExit() is only called if the last marked test description contains an executable test case, which means not a manual test case or a commented out test case specifier.

Parent topic: Testing Multiple Applications


cs.inc

cs.inc is an automatically included file that contains functions used only in the multi-application environment. The following functions provide a recovery system for managing automated testing of client/server applications:
SetMultiAppStates
Sets an application state for each connected machine, if the "AppState" machine data lists one; if not, it calls the DefaultBaseState function, which sets the application to its main window.
SetMultiBaseStates
Sets the application to the lowest state in the application state hierarchy for each connected machine, if the "AppState" machine data lists an application state. The lowest application state is one in which the appstate declaration did not use the basedon keyword. If there is no "AppState" information associated with this machine, SetMultiBaseStates calls the DefaultBaseState function, which sets the application to its main window, invoking it beforehand if necessary.
SetUpMachine
Connects Silk Test Classic to an agent on the specified machine. It provides a way to associate a main window declaration and an application state function with a machine name. These parameters are stored as data accessible by means of the GetMachineData function. Both of these names (the second and third arguments to the function) are optional; however, if you omit both arguments, you will have no recovery system.
DefaultMultiTestCaseEnter
Executes at the beginning of a multi-test case. It invokes a DisconnectAll function. The invocation of the SetAppState function is performed by the SetMultiAppStates function because the DefaultTestCaseEnter function is not executed for a multi-test case.
DefaultMultiTestCaseExit
Executes just before a multi-test case terminates. It logs any pending exception, then invokes SetMultiBaseStates and DisconnectAll.
Parent topic: Testing Multiple Applications


Include File Size

The maximum size of an include file is approximately 65536 lines. If your include file is very large, split it into two files and continue with your testing.

Parent topic: Testing Multiple Applications


Troubleshooting Distributed Testing

This section provides troubleshooting information for testing on multiple machines.

  • Handling Limited Licenses
    Describes how to free up a license for a remote Agent.
Parent topic: Distributed Testing with the Open Agent


Handling Limited Licenses

By default, Silk Test Classic starts up an unplanned Agent on the local workstation. If you do not want to use the local workstation as a test machine, set the Agent Name field in the Runtime Options dialog box to (none) instead of (local). This will free up one license for a remote Agent.

Parent topic: Troubleshooting Distributed Testing
Related reference
Runtime Options Dialog Box


Testing Apache Flex Applications

Silk Test provides built-in support for testing Apache Flex applications. Silk Test also provides several sample Apache Flex applications. You can access the sample applications at http://demo.borland.com/flex/SilkTest18.5/index.html.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Before you can test your own Apache Flex application, your Apache Flex developers must perform the following steps:

  • Enabling your Apache Flex application for testing
  • Creating testable Apache Flex applications
  • Coding Apache Flex containers
  • Implementing automation support for custom controls

To test your own Apache Flex application, follow these steps:

  • Configuring security settings for your local Flash Player
  • Recording a test
  • Playing back a test
  • Customizing Apache Flex scripts
  • Testing a custom Apache Flex control
Note: Loading an Apache Flex application and initializing the Flex automation framework may take some time depending on the machine on which you are testing and the complexity of your Apache Flex application. Set the Window timeout value to a higher value to enable your application to fully load.
  • Overview of Apache Flex Support
    Provides an overview of Apache Flex support.
  • Configuring Security Settings for Your Local Flash Player
    Configure the security settings for your local Flash Player to run an Apache Flex application as a local application.
  • Configuring Flex Applications to Run in Adobe Flash Player
    Open a Flex application in Flash Player rather than in a browser window.
  • Configuring Flex Applications for Adobe Flash Player Security Restrictions
    When you play back tests that use Adobe Flash Player, unexpected results occur when high-level clicks are used in certain situations.
  • Customizing Apache Flex Scripts
    Describes how to manually customize your Flex scrips.
  • Styles in Apache Flex Applications
    Describes how styles in Flex applications are handled.
  • Locator Attributes for Apache Flex Controls
    Describes attributes for Apache Flex controls.
  • Dynamically Invoking Apache Flex Methods
    Describes how to dynamically invoke Apache Flex methods.
  • Testing Multiple Flex Applications on the Same Web Page
    Perform the described steps to test multiple Flex applications on the same web page.
  • Adobe AIR Support
    Provides an overview of Adobe Air support within Silk Test Classic.
  • Apache Flex Exception Values
    Describes Apache Flex exception values.
  • Overview of the Flex Select Method Using Name or Index
    Provides an overview of the Flex Select method.
  • Selecting an Item in the FlexDataGrid Control
    Describes how to select an item in the FlexDataGrid control.
  • Enabling Your Flex Application for Testing
    Describes the components that Apache Flex developers must include in the Flex application to enable testing.
  • Testing the Component Explorer
    Describes how to test the Component Explorer, which is a Flex sample application that is provided by Silk Test.
  • Testing Flex Custom Controls
    Describes how Silk Test Classic supports testing Flex custom controls.
Parent topic: Testing in Your Environment with the Open Agent
Related concepts
Troubleshooting Apache Flex Applications


Overview of Apache Flex Support

Silk Test Classic provides built-in support for testing Apache Flex (Flex) applications using Internet Explorer or the Standalone Flash Player, and Adobe AIR applications built with Flex 4 or later.

Silk Test Classic also supports multiple application domains in Flex 3.x and 4.x applications, which enables you to test sub-applications. Silk Test Classic recognizes each sub-application in the locator hierarchy tree as an application tree with the relevant application domain context. At the root level in the locator attribute table, Flex 4.x sub-applications use the SparkApplication class. Flex 3.x sub-applications use the FlexApplication class.

For information on the supported versions and potential known issues, refer to the Release Notes.

Sample Applications

To access the Silk Test Classic sample Flex applications, go to http://demo.borland.com/flex/SilkTest18.5/index.html.

Object Recognition

Flex applications support hierarchical object recognition and dynamic object recognition. You can create tests for both dynamic and hierarchical object recognition in your test environment. You can use both recognition methods within a single test case if necessary. Use the method best suited to meet your test requirements.

When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations.

Existing Flex test cases that use hierarchical object recognition or dynamic object recognition without locator keywords in an INC file are supported. You can replay these tests, but you cannot record new tests with hierarchical object recognition or dynamic object recognition without locator keywords in an INC file. However, you can manually create tests as needed. Then, replay the tests at your convenience. For instance, any test cases that you recorded with Silk Test 2008 use hierarchical object recognition. You can replay these tests in Silk Test Classic.

Supported Controls

For a complete list of the record and replay controls available for Flex testing, refer to the Flex Class Reference in the 4Test Language section of the Help.

The Silk Test Classic Flex Automation SDK is based on the Automation API for Flex. The Silk Test Classic Automation SDK supports the same components in the same manner that the Automation API for Flex supports them. For instance, the typekey statement in the Flex Automation API does not support all keys. You can use the input text statement to resolve this issue. For more information about using the Flex Automation API, refer to the Apache Flex Release Notes.

Agent Support

When you create a Silk Test Classic Flex project, the Open Agent is assigned as the default Agent.

Parent topic: Testing Apache Flex Applications
Related concepts
Dynamic Object Recognition
Open Agent
Related reference
Flex Class Reference


Configuring Security Settings for Your Local Flash Player

Before you launch an Apache Flex application, that runs as a local application, for the first time, you must configure security settings for your local Flash Player. You must modify the Adobe specific security settings to enable the local application access to the file system.

To configure the security settings for your local Flash player:

  1. Open the Flex Security Settings Page by clicking Flash Player Security Manager on http://demo.borland.com/flex/SilkTest18.5/index.html.
  2. Click Always allow.
  3. In the Edit Locations menu, click Add Location.
  4. Click Browse for folder and navigate to the folder where your local application is installed.
  5. Click Confirm and then close the browser.
Parent topic: Testing Apache Flex Applications
Parent topic: Testing the Component Explorer


Configuring Flex Applications to Run in Adobe Flash Player

To run an Apache Flex application in Flash Player, one or both of the following must be true:
  • The developer who creates the Flex application must compile the application as an EXE file. When a user launches the application, it will open in Flash Player. Install Windows Flash Player from http://www.adobe.com/support/flashplayer/downloads.html.
  • The user must have Windows Flash Player Projector installed. When a user opens a Flex .SWF file, he can configure it to open in Flash Player. Windows Flash Projector is not installed when Flash Player is installed unless you install the Apache Flex developer suite. Install Windows Flash Projector from http://www.adobe.com/support/flashplayer/downloads.html.
  1. For Microsoft Windows 7 and Microsoft Windows Server 2008 R2, configure Flash Player to run as administrator. Perform the following steps:
    1. Right-click the Adobe Flash Player program shortcut or the FlashPlayer.exe file, then click Properties.
    2. In the Properties dialog box, click the Compatibility tab.
    3. Check the Run this program as an administrator check box and then click OK.
  2. Start the .SWF file in Flash Player from the command prompt (cmd.exe) by typing: "<Application_Install_Directory>\ApplicationName.swf" By default, the <SilkTest_Install_Directory> is located at Program Files\Silk\Silk Test.
Parent topic: Testing Apache Flex Applications
Related concepts
Launching the Component Explorer
Related tasks
Configuring Flex Applications for Adobe Flash Player Security Restrictions


Configuring Flex Applications for Adobe Flash Player Security Restrictions

The security model in Adobe Flash Player 10 has changed from earlier versions. When you record tests that use Flash Player, recording works as expected. However, when you play back tests, unexpected results occur when high-level clicks are used in certain situations. For instance, a File Reference dialog box cannot be opened programmatically and when you attempt to play back this scenario, the test fails because of security restrictions.

To work around the security restrictions, you can perform a low-level click on the button that opens the dialog box. To create a low-level click, add a parameter to the Click method.

For example, instead of using SparkButton::Click(), use SparkButton::Click(MouseButton.Left). A Click() without parameters is a high-level click and a click with parameters (such as the button) is replayed as a low-level click.

  1. Record the steps that use Flash Player.
  2. Navigate to the Click method and add a parameter. For example, to open the Open File dialog box, specify:
    SparkButton("@caption='Open File Dialog…'").Click(MouseButton.Left)
    When you play back the test, it works as expected.
Parent topic: Testing Apache Flex Applications
Related tasks
Configuring Flex Applications to Run in Adobe Flash Player


Customizing Apache Flex Scripts

You can manually customize your Flex scripts. You can insert verifications using the Verification wizard. Or, you can insert verifications manually using the Verify function on Flex object properties.

To customize Adobe Flex scripts:

  1. Record a testcase for your Flex application.
  2. Open the script file that you want to customize.
  3. Manually type the code that you want to add. For example, the following code adds a verification call to your script:
    Desktop.Find("//BrowserApplication").Find("//BrowserWindow")
.Find("//FlexApplication[@caption='explorer']").Find("//FlexButton[@caption='OK']")
.VerifyProperties({...})

Each Flex object has a list of properties that you can verify. For a list of the properties available for verification, review the Flex.inc file. To access the file, navigate to the <SilkTest directory>\extend\Flex directory. By default, this file is located in C:\Program Files\Silk\SilkTest\extend\Flex\Flex.inc.

Parent topic: Testing Apache Flex Applications
Parent topic: Testing the Component Explorer
Related tasks
Recording Test Cases for Standard and Web Applications
Recording Test Cases for Mobile Applications


Styles in Apache Flex Applications

For applications developed in Apache Flex 3.x, Silk Test Classic does not distinguish between styles and properties. As a result, styles are exposed as properties. However, with Apache Flex 4.x, all new Flex controls, which are prefixed with Spark, such as SparkButton, do not expose styles as properties. As a result, the GetProperty() and GetPropertyList() methods for Flex 4.x controls do not return styles, such as color or fontSize, but only properties, such as text and name.

The GetStyle(string styleName) method returns values of styles as a string. To find out which styles exist, refer to the Adobe Help located at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/package-detail.html.

If the style is not set, a StyleNotSetException occurs during playback.

For the Flex 3.x controls, such as FlexTree, you can use GetProperty() to retrieve styles. Or, you can use GetStyle(). Both the GetProperty() and GetStyle() methods work with Flex 3.x controls.

Calculating the Color Style

In Flex, the color is represented as a number. It can be calculated using the following formula:

red*65536 + green*256 + blue

Example

In this example, the GetProperty() and GetStyle() methods are used to retrieve styles:
Window myTree = Application.Find("//FlexTree[@caption='myTree']")
COLOR  c = {170, 179, 179}
Verify(myTree.DisabledColor, c)
Verify(myTree.GetProperty("disabledColor"), {170, 179, 179})
Verify(myTree.GetStyle("disabledColor"), "11187123")

The number 11187123 for the color calculates as 170*65536 + 179*256 + 179.

Parent topic: Testing Apache Flex Applications


Locator Attributes for Apache Flex Controls

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.

Silk Test Classic supports the following locator attributes for Apache Flex (Flex) controls:

automationName
The name of the application.
caption
Similar to automationName.
automationClassName
For example FlexButton.
className
The fully qualified name of the implementation class, for example mx.controls.Button.
automationIndex
The index of the control in the view of the FlexAutomation, for example index:1.
index
Similar to automationIndex but without the prefix, for example 1.
id
The identifier of the control.
windowId
Similar to id.
label
The label of the control.
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.
Parent topic: Testing Apache Flex Applications
Related concepts
Dynamic Object Recognition


Dynamically Invoking Apache Flex Methods

You can call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose by using the dynamic invoke feature. This feature is useful for working with custom controls and for working with controls that Silk Test Classic supports without customization.

Call dynamic methods on objects with the DynamicInvoke method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList() method.

Retrieve dynamic properties with the GetProperty method and set dynamic properties with the SetProperty() method. To retrieve a list of supported dynamic properties for a control, use the GetPropertyList() method.

Note: Most properties are read-only and cannot be set.

Supported Methods and Properties

The following methods and properties can be called:

  • Methods and properties that Silk Test Classic supports for the control.
  • All public methods that the Flex API defines.
  • If the control is a custom control that is derived from a standard control, all methods and properties from the standard control can be called.

Supported Parameter Types

The following parameter types are supported:

All built-in Silk Test Classic types
Silk Test Classic types includes primitive types, such as boolean, int, and string, lists, and other types, such as Point.

Returned Values

The following values are returned for properties and methods that have a return value:

  • The correct value for all built-in Silk Test Classic types. These types are listed in the Supported Parameter Types section.
  • All methods that have no return value return NULL.

Example

A custom calculator control has a Reset method and an Add method, which performs an addition of two numbers. You can use the following code to call the methods directly from your tests:
customControl.Invoke("Reset")
REAL sum = customControl.DynamicInvoke("Add",{1,2})
Parent topic: Testing Apache Flex Applications
Related concepts
Dynamic Invoke


Testing Multiple Flex Applications on the Same Web Page

When multiple Flex applications exist on the same web page, Silk Test Classic uses the Flex application ID or the application size property to determine which application to test. If multiple applications exist on the same page, but they are different sizes, Silk Test Classic uses the size property to determine on which application to perform any actions. Silk Test Classic uses JavaScript to find the Flex application ID to determine on which application to perform any actions if:
  • multiple Flex applications exist on a single web page.
  • those applications are the same size.

In this situation, if JavaScript is not enabled on the browser machine, an error occurs when a script runs.

To test multiple Flex applications that are different sizes on a single web page , follow the steps in Testing Apache Flex Applications.

To test multiple Flex applications that are the same size on a single web page, perform the following steps:
  1. Enable JavaScript.
    • In Internet Explorer:
      1. Click Tools > Internet Options.
      2. Click the Security tab.
      3. Click Custom level.
      4. In the Scripting section, under Active Scripting, click Enable and click OK.
    • In Mozilla Firefox:
      1. Choose Tools > Options.
      2. Click Content and then check the Enable JavaScript check box.
      3. Click OK.
  2. Follow the steps in Testing Apache Flex Applications.
Note: If a frame exists on the web page and the applications are the same size, this method will not work.

Silk Test Classic provides sample applications that demonstrate multiple applications on a single web page. You can access the sample applications at http://demo.borland.com/flex/SilkTest18.5/index.html.

Parent topic: Testing Apache Flex Applications


Adobe AIR Support

Silk Test Classic supports testing with Adobe AIR for applications that are compiled with the Flex 4 compiler. For details about supported versions, check the Release Notes for the latest information.

Silk Test provides a sample Adobe AIR application. You can access the sample application at http://demo.borland.com/flex/SilkTest18.5/index.html and then click the Adobe AIR application that you want to use. You can select the application with or without automation. In order to execute the AIR application, you must install the Adobe AIR Runtime.

Parent topic: Testing Apache Flex Applications


Apache Flex Exception Values

Exception values are generated under given error conditions. Flex support defines the following set of exception values:

E_FLEX_REPLAY
A generic exception, which is thrown when no other known exception occurs in Flex.
E_FLEX_REPLAY_EVENT
An error occurred when replaying the Flex event.
E_FLEX_REPLAY_METHOD
An error occurred when replaying the Flex method.
E_FLEX_REPLAY_READ_PROPERTY
An error occurred when reading a property.
E_FLEX_REPLAY_WRITE_PROPERTY
An error occurred when writing a property.
E_FLEX_REPLAY_STYLE_NOT_SET
The style is not set to a Flex object.
E_FLEX_REPLAY_SUPPORTS_TABLUAR
The property used is meant for use with tabular data. However, the specified class does not support tabular data.
E_FLEX_REPLAY_INVALID_FLEX_SDK_VERSION
If you replay a Flex 3.x event, method, or property in a Flex 2.0 environment, this error occurs.
E_VO_PROPERTY_NOT_FOUND
When reading or writing a property, if the property is not defined for the object, this exception occurs.

The E_VO_PROPERTY_NOT_FOUND exception can also be thrown when you test Flex, but it is not limited to the Flex environment.

Parent topic: Testing Apache Flex Applications


Overview of the Flex Select Method Using Name or Index

You can record Flex Select methods using the Name or Index of the control that you select. By default, Silk Test Classic records Select methods using the name of the control. However, you can change your environment to record Select events using the index for the control, or you can switch between the name and index for recording.

You can record Select events using the index for the following controls:

  • FlexList
  • FlexTree
  • FlexDataGrid
  • FlexAdvancedDataGrid
  • FlexOLAPDataGrid
  • FlexComboBox

The default setting is ItemBasedSelection (Select event), which uses the name control. To use the index, you must adapt the AutomationEnvironment to use the IndexBasedSelection (SelectIndex event). To change the behavior for one of these classes, you must modify the FlexCommonControls.xml, AdvancedDataGrid.xml, or OLAPDataGrid.xml file using the following code. Those XML files are located in the <Silk Test_install_directory>\ng\agent\plugins\com.borland.fastxd.techdomain.flex.agent_< version>\config\automationEnvironment folder. Make the following adaptations in the corresponding xml file.

<ClassInfo Extends="FlexList" Name="FlexControlName"  EnableIndexBasedSelection=”true” >

…

</ClassInfo>
With this adaption the IndexBasedSelection is used for recording FlexList::SelectIndex events. Setting the EnableIndexBasedSelection= to false in the code or removing the Boolean returns recording to using the name (FlexList::Select events).
Note: You must re-start your application, which automatically re-starts the Silk Test Agent, in order for these changes to become active.
Parent topic: Testing Apache Flex Applications
Related tasks
Setting the Flex Select Method to Use Name or Index


Selecting an Item in the FlexDataGrid Control

You can select an item in the FlexDataGrid control using the following procedures.

If you know the index value of the FlexDataGrid item, use the SelectIndex method.

For example, type FlexDataGrid.SelectIndex(1)

  1. If you know the content value of the FlexDataGrid item, use the Select method.
  2. Identify the row that you want to select with the required formatted string. Items must be separated by a pipe (“ | ”). At least one Item must be enclosed by two stars (“*”). This identifies the item where the click will be performed.

    The syntax is: FlexDataGrid.Select(“*Item1* | Item2 | Item3”)

The following example selects an item using the Select method (randomly).

[ ] LIST OF LIST OF STRING  allVisibleItems
[ ] window dataGrid = AdobeFlashPlayer9.FlexApplication0.Index0.Index1.SwfLoader.ControlsSimpleDataGridSwf.DataGridControlExample.Dg
[ ]
[ ] // lets get all currently visible items
[ ] allVisibleItems = dataGrid.GetValues(dataGrid.firstVisibleRow, dataGrid.lastVisibleRow)
[ ]
[ ] // pick a random element that we want to select
[ ] integer randomRow = RandInt(dataGrid.firstVisibleRow, dataGrid.lastVisibleRow)
[ ] LIST OF STRING randomRowItems = allVisibleItems[randomRow]
[ ] print("This is the row we want to select: {randomRow}")
[ ]
[ ] // now lets construct the string we need for the select method
[ ] STRING selectString
[ ] STRING itemText
[ ] INTEGER col = 0
[-] for each itemText in randomRowItems
[-] if col == 0
[ ] selectString = "*{itemText}*"
[-] else
[ ] selectString = selectString + " | {itemText}"
[ ] col++
[ ]
[ ] // now lets select the item
[ ] print("We will select {selectString}")
[ ] dataGrid.Select(selectString)
Parent topic: Testing Apache Flex Applications


Enabling Your Flex Application for Testing

To enable your Flex application for testing, your Apache Flex developers must include the following components in the Flex application:

  • Apache Flex Automation Package
  • Silk Test Automation Package

Apache Flex Automation Package

The Flex automation package provides developers with the ability to create Flex applications that use the Automation API. You can download the Flex automation package from Adobe's website, http://www.adobe.com. The package includes:

  • Automation libraries – the automation.swc and automation_agent.swc libraries are the implementations of the delegates for the Flex framework components. The automation_agent.swc file and its associated resource bundle are the generic agent mechanism. An agent, such as the Silk Test Agent, builds on top of these libraries.
  • Samples
Note: The Silk Test Flex Automation SDK is based on the Automation API for Flex. The Silk Test Automation SDK supports the same components in the same manner that the Automation API for Flex supports them. For instance, the typekey statement in the Flex Automation API does not support all keys. You can use the input text statement to resolve this issue. For more information about using the Flex Automation API, see the Apache Flex Release Notes.

Silk Test Automation Package

Silk Test's Open Agent uses the Apache Flex automation agent libraries. The FlexTechDomain.swc file contains the Silk Test specific implementation.

You can enable your application for testing using either of the following methods:

  • Linking automation packages to your Flex application
  • Run-time loading
  • Linking Automation Packages to Your Flex Application
    Describes how to precompile Flex applications that you plan to test.
  • Precompiling the Flex Application for Testing
    Enable your application for testing by precompiling your application for testing.
  • Loading at Run-Time
    Use the Silk Test Flex Automation Launcher to load Flex automation support at run time.
  • Using the Command Line to Add Configuration Information
    Specify the location of the automation.swc, automation_agent.swc, and FlexTechDomain.swc libraries using the command-line compiler.
  • Passing Parameters into a Flex Application
    Lists the ways that you can pass parameters into a Flex application.
  • Creating Testable Flex Applications
    Describes how to provide meaningful identification of objects and how to avoid duplicating objects.
  • Coding Flex Containers
    Containers differ from other kinds of controls because they are used both to record user interactions (such as when a user moves to the next pane in an Accordion container) and to provide unique locations for controls in the testing scripts.
  • Flex Automation Testing Workflow
    Lists the Silk Test Classic workflow for testing Flex applications.
Parent topic: Testing Apache Flex Applications


Linking Automation Packages to Your Flex Application

You must precompile Flex applications that you plan to test. The functional testing classes are embedded in the application at compile time, and the application has no external dependencies for automated testing at run time.

When you embed functional testing classes in your application SWF file at compile time, the size of the SWF file increases. If the size of the SWF file is not important, use the same SWF file for functional testing and deployment. If the size of the SWF file is important, generate two SWF files, one with functional testing classes embedded and one without. Use the SWF file that does not include the embedded testing classes for deployment.

When you precompile the Flex application for testing, in the include-libraries compiler option, reference the following files:

  • automation.swc
  • automation_agent.swc
  • FlexTechDomain.swc
  • automation_charts.swc (include only if your application uses charts and Flex 2.0)
  • automation_dmv.swc (include if your application uses charts and Flex > 3.x)
  • automation_flasflexkit.swc (include if your application uses embedded flash content)
  • automation_spark.swc (include if your application uses the new Flex 4.x controls)
  • automation_air.swc (include if your application is an AIR application)
  • automation_airspark.swc (include if your application is an AIR application and uses new Flex 4.x controls)

When you create the final release version of your Flex application, you recompile the application without the references to these SWC files. For more information about using the automation SWC files, see the Apache Flex Release Notes.

If you do not deploy your application to a server, but instead request it by using the file protocol or run it from within Apache Flex Builder, you must include each SWF file in the local-trusted sandbox. This requires additional configuration information. Add the additional configuration information by modifying the compiler's configuration file or using a command-line option.

Note: The Silk Test Flex Automation SDK is based on the Automation API for Flex. The Silk Test Automation SDK supports the same components in the same manner that the Automation API for Flex supports them. For instance, when an application is compiled with automation code and successive SWF files are loaded, a memory leak occurs and the application runs out of memory eventually. The Flex Control Explorer sample application is affected by this issue. The workaround is to not compile the application SWF files that Explorer loads with automation libraries. For example, compile only the Explorer main application with automation libraries. Another alternative is to use the module loader instead of swfloader. For more information about using the Flex Automation API, see the Apache FlexRelease Notes.
Parent topic: Enabling Your Flex Application for Testing
Related tasks
Loading at Run-Time
Precompiling the Flex Application for Testing
Using the Command Line to Add Configuration Information


Precompiling the Flex Application for Testing

You can enable your application for testing by precompiling your application for testing or by using run-time loading.

  1. Include the automation.swc, automation_agent.swc, and FlexTechDomain.swc libraries in the compiler’s configuration file by adding the following code to the configuration file:
    <include-libraries>

...

<library>/libs/automation.swc</library>

<library>/libs/automation_agent.swc</library>

<library>pathinfo/FlexTechDomain.swc</library>

</include-libraries>
    Note: If your application uses charts, you must also add the automation_charts.swc file.
  2. Specify the location of the automation.swc, automation_agent.swc, and FlexTechDomain.swc libraries using the include-libraries compiler option with the command-line compiler. The configuration files are located at:

    Apache Flex 2 SDK – <flex_installation_directory>/frameworks/flex-config.xml

    Apache Flex Data Services – <flex_installation_directory>/flex/WEB-INF/flex/flex-config.xml

    The following example adds the automation.swc and automation_agent.swc files to the application:
    mxmlc -include-libraries+=../frameworks/libs/automation.swc;../frameworks/libs/
automation_agent.swc;pathinfo/FlexTechDomain.swc MyApp.mxml
    Note: Explicitly setting the include-libraries option on the command line overwrites, rather than appends, the existing libraries. If you add the automation.swc and automation_agent.swc files using the include-libraries option on the command line, ensure that you use the += operator. This appends rather than overwrites the existing libraries that are included.
    Note: The Silk Test Flex Automation SDK is based on the Automation API for Flex. The Silk Test Automation SDK supports the same components in the same manner that the Automation API for Flex supports them. For instance, when an application is compiled with automation code and successive SWF files are loaded, a memory leak occurs and the application runs out of memory eventually. The Flex Control Explorer sample application is affected by this issue. The workaround is to not compile the application SWF files that Explorer loads with automation libraries. For example, compile only the Explorer main application with automation libraries. Another alternative is to use the module loader instead of swfloader. For more information about using the Flex Automation API, see the Apache FlexRelease Notes.
Parent topic: Enabling Your Flex Application for Testing
Related concepts
Linking Automation Packages to Your Flex Application
Related tasks
Loading at Run-Time
Using the Command Line to Add Configuration Information


Loading at Run-Time

  1. Copy the content of the Silk\Silk Test\ng\AutomationSDK\Flex\<version>\FlexAutomationLauncher directory into the directory of the Flex application that you are testing.
  2. Open FlexAutomationLauncher.html in Windows Explorer and add the following parameter as a suffix to the file path:
    ?automationurl=YourApplication.swf

    where YourApplication.swf is the name of the SWF file for your Flex application.

  3. Add file:/// as a prefix to the file path. For example, if your file URL includes a parameter, such as: ?automationurl=explorer.swf, type: .
    file:///C:/Program%20Files/Silk/Silk Test/ng/sampleapplications/Flex/3.2/FlexControlExplorer32/FlexAutomationLauncher.html?automationurl=explorer.swf
  • Run-Time Loading
    Provides an overview of loading Flex automation support at run time using the Silk Test Flex Automation Launcher.
Parent topic: Enabling Your Flex Application for Testing
Related concepts
Linking Automation Packages to Your Flex Application
Related tasks
Precompiling the Flex Application for Testing
Using the Command Line to Add Configuration Information


Run-Time Loading

You can load Flex automation support at run time using the Silk Test Flex Automation Launcher. This application is compiled with the automation libraries and loads your application with the SWFLoader class. This automatically enables your application for testing without compiling automation libraries into your SWF file. The Silk Test Flex Automation Launcher is available in HTML and SWF file formats.

Limitations

  • The Flex Automation Launcher Application automatically becomes the root application. If your application must be the root application, you cannot load automation support with the Silk Test Flex Automation Launcher.
  • Testing applications that load external libraries – Applications that load other SWF file libraries require a special setting for automated testing. A library that is loaded at run time (including run-time shared libraries (RSLs) must be loaded into the ApplicationDomain of the loading application. If the SWF file used in the application is loaded in a different application domain, automated testing record and playback will not function properly. The following example shows a library that is loaded into the same ApplicationDomain:
    import flash.display.*;

import flash.net.URLRequest;

import flash.system.ApplicationDomain;

import flash.system.LoaderContext;

var ldr:Loader = new Loader();

var urlReq:URLRequest = new URLRequest("RuntimeClasses.swf");

var context:LoaderContext = new LoaderContext();

context.applicationDomain = ApplicationDomain.currentDomain;

loader.load(request, context);
Parent topic: Loading at Run-Time


Using the Command Line to Add Configuration Information

To specify the location of the automation.swc, automation_agent.swc, and FlexTechDomain.swc libraries using the command-line compiler, use the include-libraries compiler option.

The following example adds the automation.swc and automation_agent.swc files to the application:

mxmlc -include-libraries+=../frameworks/libs/automation.swc;../frameworks/libs/
automation_agent.swc;pathinfo/FlexTechDomain.swc MyApp.mxml
Note: If your application uses charts, you must also add the automation_charts.swc file to the include-libraries compiler option.

Explicitly setting the include-libraries option on the command line overwrites, rather than appends, the existing libraries. If you add the automation.swc and automation_agent.swc files using the include-libraries option on the command line, ensure that you use the += operator. This appends rather than overwrites the existing libraries that are included.

To add automated testing support to a Flex Builder project, you must also add the automation.swc and automation_agent.swc files to the include-libraries compiler option.

Parent topic: Enabling Your Flex Application for Testing
Related concepts
Linking Automation Packages to Your Flex Application
Related tasks
Loading at Run-Time
Precompiling the Flex Application for Testing


Passing Parameters into a Flex Application

You can pass parameters into a Flex application using the following procedures.

  • Passing Parameters into a Flex Application Before Runtime
    Pass parameters into a Flex application before runtime using automation libraries.
  • Passing Parameters into a Flex Application at Runtime Using the Flex Automation Launcher
    Pass parameters into a Flex application at Runtime Using the Flex Automation Launcher.
Parent topic: Enabling Your Flex Application for Testing


Passing Parameters into a Flex Application Before Runtime

You can pass parameters into a Flex application before runtime using automation libraries.

  1. Compile your application with the appropriate automation libraries.
  2. Use the standard Flex mechanism for the parameter as you typically would.
Parent topic: Passing Parameters into a Flex Application
Related tasks
Precompiling the Flex Application for Testing


Passing Parameters into a Flex Application at Runtime Using the Flex Automation Launcher

Before you begin this task, prepare your application for run-time loading.

  1. Open the FlexAutomationLauncher.html file or create a file using FlexAutomationLauncher.html as an example.
  2. Navigate to the following section:
    <script language="JavaScript" type="text/javascript">

                AC_FL_RunContent(eef

                   "src", "FlexAutomationLauncher",

                   "width", "100%",

                   "height", "100%",

                   "align", "middle",

                   "id", "FlexAutomationLauncher",

                   "quality", "high",

                   "bgcolor", "white",

                   "name", "FlexAutomationLauncher",

                   "allowScriptAccess","sameDomain",

                   "type", "application/x-shockwave-flash",

                   "pluginspage", "http://www.adobe.com/go/getflashplayer",

                   "flashvars", "yourParameter=yourParameterValue"+ "&automationurl=YourApplication.swf"

                );

        </script>
    Note: Do not change the "FlexAutomationLauncher" value for "src", "id", or "name."
  3. Add your own parameter to "yourParameter=yourParameterValue".
  4. Pass the name of the Flex application that you want to test as value for the "& automationurl=YourApplication.swf" value.
  5. Save the file.
Parent topic: Passing Parameters into a Flex Application


Creating Testable Flex Applications

As a Flex developer, you can employ techniques to make Flex applications as "test friendly" as possible. These include:

  • Providing Meaningful Identification of Objects
  • Avoiding Duplication of Objects

Providing Meaningful Identification of Objects

To create "test friendly" applications, ensure that objects are identifiable in scripts. You can set the value of the ID property for all controls that are tested, and ensure that you use a meaningful string for that ID property.

To provide meaningful identification of objects:

  • Give all testable MXML components an ID to ensure that the test script has a unique identifier to use when referring to that Flex control.
  • Make these identifiers as human-readable as possible to make it easier for the user to identify that object in the testing script. For example, set the id property of a Panel container inside a TabNavigator to submit_panel rather than panel1 or p1.

When working with Silk Test Classic, an object is automatically given a name depending on certain tags, for instance, id, childIndex. If there is no value for the id property, Silk Test Classic uses other properties, such as the childIndex property. Assigning a value to the id property makes the testing scripts easier to read.

Avoiding Duplication of Objects

Automation agents rely on the fact that some properties of object instances will not be changed during run time. If you change the Flex component property that is used by Silk Test Classic as the object name at run time, unexpected results can occur. For example, if you create a Button control without an automationName property, and you do not initially set the value of its label property, and then later set the value of the label property, problems might occur. In this case, Silk Test Classic uses the value of the label property of Button controls to identify an object if the automationName property is not set. If you later set the value of the label property, or change the value of an existing label, Silk Test Classic identifies the object as a new object and does not reference the existing object.

To avoid duplicating objects:

  • Understand what properties are used to identify objects in the agent and avoid changing those properties at run time.
  • Set unique, human-readable id or automationName properties for all objects that are included in the recorded script.
  • Flex AutomationName and AutomationIndex Properties
    Describes how Silk Test uses the automationName and automationIndex properties.
  • Setting the Flex automationName Property
    Describes the benefits of setting the Flex automationName property.
  • Setting the Flex Select Method to Use Name or Index
    Record Flex Select methods using the Name or Index of the control that you select.
Parent topic: Enabling Your Flex Application for Testing


Flex AutomationName and AutomationIndex Properties

The Flex Automation API introduces the automationName and automationIndex properties. If you provide the automationName, Silk Test Classic uses this value for the recorded window declaration's name. Providing a meaningful name makes it easier for Silk Test Classic to identify that object. As a best practice, set the value of the automationName property for all objects that are part of the application's test.

Use the automationIndex property to assign a unique index value to an object. For instance, if two objects share the same name, assign an index value to distinguish between the two objects.
Note: The Silk Test Flex Automation SDK is based on the Automation API for Flex. The Silk Test Automation SDK supports the same components in the same manner that the Automation API for Flex supports them. For instance, when an application is compiled with automation code and successive SWF files are loaded, a memory leak occurs and the application runs out of memory eventually. The Flex Control Explorer sample application is affected by this issue. The workaround is to not compile the application SWF files that Explorer loads with automation libraries. For example, compile only the Explorer main application with automation libraries. Another alternative is to use the module loader instead of swfloader. For more information about using the Flex Automation API, see the Apache Flex Release Notes.
Parent topic: Creating Testable Flex Applications
Related concepts
Setting the Flex automationName Property
Related tasks
Setting the Flex Select Method to Use Name or Index


Setting the Flex automationName Property

The automationName property defines the name of a component as it appears in tests. The default value of this property varies depending on the type of component. For example, the automationName for a Button control is the label of the Button control. Sometimes, the automationName is the same as the id property for the control, but this is not always the case.

For some components, Flex sets the value of the automationName property to a recognizable attribute of that component. This helps testers recognize the component in their tests. Because testers typically do not have access to the underlying source code of the application, having a control's visible property define that control can be useful. For example, a Button labeled "Process Form Now" appears in the test as FlexButton("Process Form Now").

If you implement a new component, or derive from an existing component, you might want to override the default value of the automationName property. For example, UIComponent sets the value of the automationName to the component's id property by default. However, some components use their own methods for setting the value. For example, in the Flex Store sample application, containers are used to create the product thumbnails. A container's default automationName would not be very useful because it is the same as the container's id property. So, in Flex Store, the custom component that generates a product thumbnail explicitly sets the automationName to the product name to make testing the application easier.

Example

The following example from the CatalogPanel.mxml custom component sets the value of the automationName property to the name of the item as it appears in the catalog. This is more recognizable than the default automation name.

thumbs[i].automationName = catalog[i].name;

Example

The following example sets the automationName property of the ComboBox control to "Credit Card List"; rather than using the id property, the testing tool typically uses "Credit Card List" to identify the ComboBox in its scripts:
<?xml version="1.0"?>
<!-- at/SimpleComboBox.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script>
    <![CDATA[
      [Bindable]
      public var cards: Array = [
        {label:"Visa", data:1},
        {label:"MasterCard", data:2},
        {label:"American Express", data:3}
      ];

      [Bindable]
      public var selectedItem:Object;
      ]
   ]>
  </mx:Script>
  <mx:Panel title="ComboBox Control Example">
    <mx:ComboBox id="cb1" dataProvider="{cards}"
      width="150"
      close="selectedItem=ComboBox(event.target).selectedItem"
      automationName="Credit Card List"
    />
    <mx:VBox width="250">
      <mx:Text width="200" color="blue" text="Select a type of credit card." />
      <mx:Label text="You selected: {selectedItem.label}"/>
      <mx:Label text="Data: {selectedItem.data}"/>
    </mx:VBox>
  </mx:Panel>
</mx:Application>

Setting the value of the automationName property ensures that the object name will not change at run time. This helps to eliminate unexpected results.

If you set the value of the automationName property, tests use that value rather than the default value. For example, by default, Silk Test Classic uses a Button control's label property as the name of the Button in the script. If the label changes, the script can break. You can prevent this from happening by explicitly setting the value of the automationName property.

Buttons that have no label, but have an icon, are recorded by their index number. In this case, ensure that you set the automationName property to something meaningful so that the tester can recognize the Button in the script. After the value of the automationName property is set, do not change the value during the component's life cycle. For item renderers, use the automationValue property rather than the automationName property. To use the automationValue property, override the createAutomationIDPart() method and return a new value that you assign to the automationName property, as the following example shows:

<mx:List xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script>
    <![CDATA[
      import mx.automation.IAutomationObject;
      override public function
      createAutomationIDPart(item:IAutomationObject):Object {
        var id:Object = super.createAutomationIDPart(item);
        id["automationName"] = id["automationIndex"];
        return id;
      }
    ]]>
  </mx:Script>
</mx:List>

Use this technique to add index values to the children of any container or list-like control. There is no method for a child to specify an index for itself.

Parent topic: Creating Testable Flex Applications


Setting the Flex Select Method to Use Name or Index

You can record Flex Select methods using the Name or Index of the control that you select. By default, Silk Test records Select methods using the name of the control. However, you can change your environment to record Select events using the index for the control, or you can switch between the name and index for recording.

  1. Determine which class you want to modify to use the Index. You can record Select events using the index for the following controls:
    • FlexList
    • FlexTree
    • FlexDataGrid
    • FlexOLAPDataGrid
    • FlexComboBox
    • FlexAdvancedDataGrid
  2. Determine which XML file is related to the class that you want to modify. The XML files related to the preceding controls include: FlexCommonControls.xml, AdvancedDataGrid.xml, or OLAPDataGrid.xml.
  3. Navigate to the XML files that are related to the class that you want to modify. The XML files are located in the <Silk Test_install_directory>\ng\agent\plugins\com.borland.fastxd.techdomain.flex.agent_<version>\config\automationEnvironment folder.
  4. Make the following adaptations in the corresponding XML file.
    <ClassInfo Extends="FlexList" Name="FlexControlName"  EnableIndexBasedSelection=”true” >

…

</ClassInfo>
    For instance, you might use "FlexList" as the " FlexControlName" and modify the FlexCommonControls.xml file.

    With this adaption the IndexBasedSelection is used for recording FlexList::SelectIndex events.

    Note: Setting the EnableIndexBasedSelection= to false in the code or removing the boolean returns recording to using the name (FlexList::Select events).
  5. Re-start your Flex application and the Open Agent in order for these changes to become active.
Parent topic: Creating Testable Flex Applications
Related concepts
Overview of the Flex Select Method Using Name or Index


Coding Flex Containers

Containers differ from other kinds of controls because they are used both to record user interactions (such as when a user moves to the next pane in an Accordion container) and to provide unique locations for controls in the testing scripts.

  • Adding and Removing Containers from the Automation Hierarchy
    Describes when and how to remove containers from the automation hierarchy.
  • Multiview Containers
    Describes best practices for using multiview containers.
Parent topic: Enabling Your Flex Application for Testing
Related concepts
Testing Apache Flex Applications
Creating Testable Flex Applications


Adding and Removing Containers from the Automation Hierarchy

In general, the automated testing feature reduces the amount of detail about nested containers in its scripts. It removes containers that have no impact on the results of the test or on the identification of the controls from the script. This applies to containers that are used exclusively for layout, such as the HBox, VBox, and Canvas containers, except when they are being used in multiple-view navigator containers, such as the ViewStack, TabNavigator, or Accordion containers. In these cases, they are added to the automation hierarchy to provide navigation.

Many composite components use containers, such as Canvas or VBox, to organize their children. These containers do not have any visible impact on the application. As a result, you typically exclude these containers from testing because there is no user interaction and no visual need for their operations to be recordable. By excluding a container from testing, the related test script is less cluttered and easier to read.

To exclude a container from being recorded (but not exclude its children), set the container's showInAutomationHierarchy property to false. This property is defined by the UIComponent class, so all containers that are a subclass of UIComponent have this property. Children of containers that are not visible in the hierarchy appear as children of the next highest visible parent.

The default value of the showInAutomationHierarchy property depends on the type of container. For containers such as Panel, Accordion, Application, DividedBox, and Form, the default value is true; for other containers, such as Canvas, HBox, VBox, and FormItem, the default value is false.

The following example forces the VBox containers to be included in the test script's hierarchy:
<?xml version="1.0"?>
<!-- at/NestedButton.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Panel title="ComboBox Control Example">
<mx:HBox id="hb">
<mx:VBox id="vb1" showInAutomationHierarchy="true">
<mx:Canvas id="c1">
<mx:Button id="b1" automationName="Nested Button 1" label="Click Me" />
</mx:Canvas>
</mx:VBox>
<mx:VBox id="vb2" showInAutomationHierarchy="true">
<mx:Canvas id="c2">
<mx:Button id="b2" automationName="Nested Button 2" label="Click Me 2" />
</mx:Canvas>
</mx:VBox>
</mx:HBox>
</mx:Panel>
</mx:Application>
Parent topic: Coding Flex Containers
Related concepts
Multiview Containers


Multiview Containers

Avoid using the same label on multiple tabs in multiview containers, such as the TabNavigator and Accordion containers. Although it is possible to use the same labels, this is generally not an acceptable UI design practice and can cause problems with control identification in your testing environment.

Parent topic: Coding Flex Containers
Related concepts
Adding and Removing Containers from the Automation Hierarchy


Flex Automation Testing Workflow

The Silk Test Classic workflow for testing Flex applications includes:

  • Automated Testing Initialization
  • Automated Testing Recording
  • Automated Testing Playback
  • Flex Automated Testing Initialization
    Lists the initialization events that occur when the Flex application launches.
  • Flex Automated Testing Recording
    Describes the events that occur when a user records a test for a Flex application.
  • Flex Automated Testing Playback
    Describes the events that occur when a user runs a test for a Flex application.
Parent topic: Enabling Your Flex Application for Testing


Flex Automated Testing Initialization

When the user launches the Flex application, the following initialization events occur:
  1. The automation initialization code associates component delegate classes with component classes.
  2. The component delegate classes implement the IAutomationObject interface.
  3. An instance for the AutomationManager is created in the mixin init() method. (The AutomationManager is a mixin.)
  4. The SystemManager initializes the application. Component instances and their corresponding delegate instances are created. Delegate instances add event listeners for events of interest.
  5. The Silk Test Classic FlexTechDomain is a mixin. In the FlexTechDomain init() method, the FlexTechDomain registers for the SystemManager.APPLICATION_COMPLETE event. When the event is received, it creates a FlexTechDomain instance.
  6. The FlexTechDomain instance connects via a TCP/IP socket to the Silk Test Agent on the same machine that registers for record/playback functionality.
  7. The FlexTechDomain requests information about the automation environment. This information is stored in XML files and is forwarded from the Silk Test Agent to the FlexTechDomain.
Parent topic: Flex Automation Testing Workflow
Related concepts
Flex Automated Testing Recording
Flex Automated Testing Playback


Flex Automated Testing Recording

When the user records a new test in Silk Test Classic for a Flex application, the following events occur:

  1. Silk Test Classic calls the Silk Test Agent to start recording. The Agent forwards this command to the FlexTechDomain instance.
  2. FlexTechDomain notifies AutomationManager to start recording by calling beginRecording(). The AutomationManager adds a listener for the AutomationRecordEvent.RECORD event from the SystemManager.
  3. The user interacts with the application. For example, suppose the user clicks a Button control.
  4. The ButtonDelegate.clickEventHandler() method dispatches an AutomationRecordEvent event with the click event and Button instance as properties.
  5. The AutomationManager record event handler determines which properties of the click event to store based on the XML environment information. It converts the values into proper type or format. It dispatches the record event.
  6. The FlexTechDomain event handler receives the event. It calls the AutomationManager.createID() method to create the AutomationID object of the button. This object provides a structure for object identification. The AutomationID structure is an array of AutomationIDParts. An AutomationIDPart is created by using IAutomationObject. (The UIComponent.id, automationName, automationValue, childIndex, and label properties of the Button control are read and stored in the object. The label property is used because the XML information specifies that this property can be used for identification for the Button.)
  7. FlexTechDomain uses the AutomationManager.getParent() method to get the logical parent of Button. The AutomationIDPart objects of parent controls are collected at each level up to the application level.
  8. All the AutomationIDParts are included as part of the AutomationID object.
  9. The FlexTechDomain sends the information in a call to Silk Test Classic.
  10. When the user stops recording, the FlexTechDomain.endRecording() method is called.
Parent topic: Flex Automation Testing Workflow
Related concepts
Flex Automated Testing Initialization
Flex Automated Testing Playback


Flex Automated Testing Playback

When the user clicks the Playback button in Silk Test Classic, the following events occur:

  1. For each script call, Silk Test Classic contacts the Silk Test Agent and sends the information for the script call to be executed. This information includes the complete window declaration, the event name, and parameters.
  2. The Silk Test Agent forwards that information to the FlexTechDomain.
  3. The FlexTechDomain uses AutomaionManager.resolveIDToSingleObject with the window declaration information. The AutomationManager returns the resolved object based on the descriptive information (automationName, automationIndex, id, and so on).
  4. Once the Flex control is resolved, FlexTechDomain calls AutomationManager.replayAutomatableEvent() to replay the event.
  5. The AutomationManager.replayAutomatableEvent() method invokes the IAutomationObject.replayAutomatableEvent() method on the delegate class. The delegate uses the IAutomationObjectHelper.replayMouseEvent() method (or one of the other replay methods, such as replayKeyboardEvent()) to play back the event.
  6. If there are verifications in your script, FlexTechDomain invokes AutomationManager.getProperties() to access the values that must be verified.
Parent topic: Flex Automation Testing Workflow
Related concepts
Flex Automated Testing Initialization
Flex Automated Testing Recording


Testing the Component Explorer

Silk Test provides a sample Apache Flex test application called the Component Explorer. You can access the Component Explorer at http://demo.borland.com/flex/SilkTest18.5/3.5/Flex3TestApp_withAutomation/Flex3TestApp.html. The topics in this section describe how you can test the Component Explorer.

Silk Test provides several additional Apache Flex sample applications. To access the sample applications, go to http://demo.borland.com/flex/SilkTest18.5/index.html.

  • Configuring Security Settings for Your Local Flash Player
    Configure the security settings for your local Flash Player to run an Apache Flex application as a local application.
  • Launching the Component Explorer
    Describes how to launch the Component Explorer.
  • Creating a New Project
    Create a new project to test an application.
  • Configuring Web Applications
    Configure the application that you want to test to set up the environment that Silk Test Classic will create each time you record or replay a test case.
  • Recording a Sample Test Case for the Component Explorer
    Record a sample test case for the Component Explorer to get familiar with testing Apache Flexin Silk Test Classic.
  • Running a Test Case
    Describes how to run a test case.
  • Customizing Apache Flex Scripts
    Describes how to manually customize your Flex scrips.
Parent topic: Testing Apache Flex Applications


Launching the Component Explorer

Silk Test provides a sample Apache Flex application, the Component Explorer. Compiled with the Adobe Automation SDK and the Silk Test specific automation implementation, the Component Explorer is pre-configured for testing.

Before you launch the application for the first time, you must configure security settings for your local Flash Player.

To launch the Component Explorer in Internet Explorer, open http://demo.borland.com/flex/SilkTest18.5/3.5/Flex3TestApp_withAutomation/Flex3TestApp.html.

The application launches in Internet Explorer.

Parent topic: Testing the Component Explorer
Related tasks
Configuring Flex Applications to Run in Adobe Flash Player


Recording a Sample Test Case for the Component Explorer

Use the following procedure to become familiar with the sample Silk Test Classic Flex application, the Component Explorer.

To record a test case for the Component Explorer:

  1. Click Record Testcase on the Basic Workflow bar.
  2. In the Record Testcase dialog box, type the name of your test case into the Testcase name field. Test case names are case sensitive; they can have any length and consist of any combination of alphabetic characters, numerals, and underscore characters.
  3. From the Application State list box, select DefaultBaseState to have the built-in recovery system restore the default BaseState before the test case begins executing.
  4. Click Start Recording. Silk Test Classic closes the Record Testcase dialog box and displays the Flex sample application.
  5. When the Recording window opens, record the following scenario using the Flex sample application. It is essential that you perform these steps exactly as they are documented. Otherwise, your test case script may not match the sample provided later in this document.
  6. Click the [image] arrow next to the Visual Components tree element to expand the list.
  7. Click the [image] arrow next to the General Controls tree element to expand the list.
  8. Click the SimpleAlert tree element.
  9. In the Alert Control Example section, click Click Me near the top of the window and then click OK in the Hello World message box.
  10. Click the [image] arrow next to the General Controls tree element to hide the list.
  11. Click the [image] arrow next to the Visual Components tree element to hide the list.
  12. In the Recording window, click Stop. Silk Test Classic opens the Record Test Case dialog box, which contains the recorded script.
  13. Click Paste to Editor. The Update Files dialog box opens.
  14. Choose Paste test case and update window declaration(s) and then click OK.
Your test case should include the following calls:
WebBrowser.BrowserWindow.Application.CompLibTree.Open("Visual Components")
WebBrowser.BrowserWindow.Application.CompLibTree.Open("Visual Components>General Controls")
WebBrowser.BrowserWindow.Application.CompLibTree.Select("Visual Components>General Controls>SimpleAlert")
WebBrowser.BrowserWindow.Application.Button1.Click()
WebBrowser.BrowserWindow.Application.Ok.Click()
WebBrowser.BrowserWindow.Application.CompLibTree.Close("Visual Components>General Controls")
WebBrowser.BrowserWindow.Application.CompLibTree.Close("Visual Components")

The Silk Test Classic Flex Automation SDK is based on the Automation API for Flex. The Silk Test Classic Automation SDK supports the same components in the same manner that the Automation API for Flex supports them. For instance, when an application is compiled with automation code and successive .swf files are loaded, a memory leak occurs and the application runs out of memory eventually. The Flex Component Explorer sample application is affected by this issue. The workaround is to not compile the application .swf files that Explorer loads with automation libraries. For example, compile only the Explorer main application with automation libraries. Another alternative is to use the module loader instead of swfloader. For more information about using the Flex Automation API, refer to the Apache Flex Release Notes.

Parent topic: Testing the Component Explorer


Testing Flex Custom Controls

Silk Test Classic supports testing Flex custom controls. By default, Silk Test Classic provides record and playback support for the individual sub-controls of the custom control.

For testing custom controls, the following options exist:
Option
Description
Basic support

With basic support, you use dynamic invoke to interact with the custom control during replay. Use this low-effort approach when you want to access properties and methods of the custom control in the test application that Silk Test Classic does not expose. The developer of the custom control can also add methods and properties to the custom control specifically for making the control easier to test. A Silk Test Classic user can then call those methods or properties using the dynamic invoke feature.

The advantages of basic support include:
  • Dynamic invoke requires no code changes in the test application.
  • Using dynamic invoke is sufficient for most testing needs.
The disadvantages of basic support include:
  • No specific class name is included in the locator. For example, Silk Test Classic records //FlexBox rather than //FlexSpinner.
  • Only limited recording support.
  • Silk Test Classic cannot replay events.

For more details about dynamic invoke, including an example, see Dynamically Invoking Apache Flex Methods.

Advanced support
With advanced support, you create specific automation support for the custom control. This additional automation support provides recording support and more powerful play-back support. The advantages of advanced support include:
  • High-level recording and playback support, including the recording and replaying of events.
  • Silk Test Classic treats the custom control exactly the same as any other built-in Flex control.
  • Seamless integration into Silk Test Classic API.
  • Silk Test Classic uses the specific class name in the locator. For example, Silk Test Classic records //FlexSpinner.
The disadvantages of advanced support include:
  • Implementation effort is required. The test application must be modified and the Open Agent must be extended.
  • Defining a Custom Control in the Test Application
    Describes how to define a custom control in the test application.
  • Testing a Custom Control Using Dynamic Invoke
    Use dynamic invoke to access properties and methods of the custom control in the test application that Silk Test Classic does not expose.
  • Testing a Custom Control Using Automation Support
    Create automation support to use additional recording and play-back capabilities when you test a custom control in Flex.
  • Implementing Automation Support for a Custom Control
    Describes how to implement automation support for a custom control.
  • Flex Class Definition File
    Describes the Flex class definition file.
Parent topic: Testing Apache Flex Applications


Defining a Custom Control in the Test Application

Typically, the test application already contains custom controls, which were added during development of the application. If your test application already includes custom controls, you can proceed to Testing a Custom Control Using Dynamic Invoke or to Testing a Custom Control Using Automation Support.

This procedure shows how a Flex application developer can create a spinner custom control in Flex. The spinner custom control that we create in this topic is used in several topics to illustrate the process of implementing and testing a custom control in Silk Test Classic.

The spinner custom control includes two buttons and a text box, as shown in the following graphic.

Custom control example

The user can click Down to decrement the value that is displayed in the text field and click Up to increment the value in the text field.

The custom control offers a public CurrentValue property that can be set and retrieved.

To define the custom control:

  1. In the test application, define the layout of the control. For example, for the spinner control type:
    <customcontrols:SpinnerClass xmlns:mx="http://www.adobe.com/2006/mxml"
  xmlns:controls="mx.controls.*" xmlns:customcontrols="customcontrols.*">
  <controls:Button id="downButton" label="Down" />
  <controls:TextInput id="text" enabled="false" />
  <controls:Button id="upButton" label="Up"/>
</customcontrols:SpinnerClass>
  2. Define the implementation of the custom control. For example, for the spinner control type:
    package
customcontrols
{
  import flash.events.MouseEvent;
  import mx.containers.HBox;
  import mx.controls.Button;
  import mx.controls.TextInput;
  import mx.core.UIComponent;
  import mx.events.FlexEvent;
  [Event(name="increment", type="customcontrols.SpinnerEvent")]
  [Event(name="decrement", type="customcontrols.SpinnerEvent")]

  public class SpinnerClass extends HBox
  {
    public var downButton : Button;
    public var upButton : Button;
    public var text : TextInput;
    public var ssss: SpinnerAutomationDelegate;
    private var _lowerBound : int = 0;
    private var _upperBound : int = 5;
    private var _value : int = 0;
    private var _stepSize : int = 1;

    public function SpinnerClass()
    {
      addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
    }

    private function creationCompleteHandler(event:FlexEvent) : void
    {
      downButton.addEventListener(MouseEvent.CLICK, downButtonClickHandler);
      upButton.addEventListener(MouseEvent.CLICK, upButtonClickHandler);
      updateText();
    }

    private function downButtonClickHandler(event : MouseEvent) : void
    {
      if(currentValue - stepSize >= lowerBound)
      {
        currentValue = currentValue - stepSize;
      }
      else
      {
        currentValue = upperBound - stepSize + currentValue - lowerBound + 1;
      }
      var spinnerEvent : SpinnerEvent = new SpinnerEvent(SpinnerEvent.DECREMENT);
      spinnerEvent.steps = _stepSize;
      dispatchEvent(spinnerEvent);
    }

    private function upButtonClickHandler(event : MouseEvent) : void
    {
      if(currentValue <= upperBound - stepSize)
      {
        currentValue = currentValue + stepSize;
      }
      else
      {
        currentValue = lowerBound + currentValue + stepSize - upperBound - 1;
      }
      var spinnerEvent : SpinnerEvent = new SpinnerEvent(SpinnerEvent.INCREMENT);
      spinnerEvent.steps = _stepSize;
      dispatchEvent(spinnerEvent);
    }

    private function updateText() : void
    {
      if(text != null)
      {
        text.text = _value.toString();
      }
    }

    public function get currentValue() : int
    {
      return _value;
    }

    public function set currentValue(v : int) : void
    {
      _value = v;
      if(v < lowerBound)
      {
        _value = lowerBound;
      }
      else if(v > upperBound)
      {
        _value = upperBound;
      }
      updateText();
    }

    public function get stepSize() : int
    {
      return _stepSize;
    }

    public function set stepSize(v : int) : void
    {
      _stepSize = v;
    }

    public function get lowerBound() : int
    {
      return _lowerBound;
    }

    public function set lowerBound(v : int) : void
    {
      _lowerBound = v;
      if(currentValue < lowerBound)
      {
        currentValue = lowerBound;
      }
    }

    public function get upperBound() : int
    {
      return _upperBound;
    }

    public function set upperBound(v : int) : void
    {
      _upperBound = v;
      if(currentValue > upperBound)
      {
        currentValue = upperBound;
      }
    }
  }
}
  3. Define the events that the control uses. For example, for the spinner control type:
    package customcontrols
{
  import flash.events.Event;

  public class SpinnerEvent extends Event
  {
    public static const INCREMENT : String = "increment";
    public static const DECREMENT : String = "decrement";

    private var _steps : int;

    public function SpinnerEvent(eventName : String)
    {
      super(eventName);
    }

    public function set steps(value:int) : void
    {
      _steps = value;
    }

    public function get steps() : int
    {
      return _steps;
    }
  }
}
  4. Proceed to Implement Automation Support.
Parent topic: Testing Flex Custom Controls


Testing a Custom Control Using Dynamic Invoke

Silk Test Classic provides record and playback support for custom controls using dynamic invoke to interact with the custom control during replay. Use this low-effort approach when you want to access properties and methods of the custom control in the test application that Silk Test Classic does not expose. The developer of the custom control can also add methods and properties to the custom control specifically for making the control easier to test.

To test a custom control using dynamic invoke:

  1. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.
  2. Call dynamic methods on objects with the DynamicInvoke method.
  3. Call multiple dynamic methods on objects with the DynamicInvokeMethods method.
  4. To retrieve a list of supported dynamic properties for a control, use the GetPropertyList method.
  5. Retrieve dynamic properties with the GetProperty method and set dynamic properties with the SetProperty method.

Example

This example tests a spinner custom control that includes two buttons and a text box, as shown in the following graphic.

Custom control example

The user can click Down to decrement the value that is displayed in the text box and click Up to increment the value in the text box.

The custom control offers a public CurrentValue property that can be set and retrieved. The value in this example is 3.

To set the spinner's value to 4, type the following:
WINDOW spinner = Desktop.Find("//FlexBox[@className=customcontrols.Spinner]")
spinner.SetProperty("CurrentValue", 4)
Parent topic: Testing Flex Custom Controls


Testing a Custom Control Using Automation Support

Before you can test a custom control in Silk Test Classic, perform the following steps:

  • Define the custom control in the test application.
  • Implement automation support.

You can create specific automation support for the custom control. This additional automation support provides recording support and more powerful play-back support. To create automation support, the test application must be modified and the Open Agent must be extended.

After the test application has been modified and includes automation support, perform the following steps:

  1. Open an existing Flex project or create a new project.
  2. Click File > New. The New File dialog box opens.
  3. Choose 4Test include and then click OK. A new include file opens.
  4. Type the custom control class information in the INC file and then click Save.
    For example, the INC file for the FlexSpinner class looks like the following:
    winclass FlexSpinner : FlexBox
  tag "[FlexSpinner]"
  builtin void Increment(INTEGER steps)
  builtin void Decrement(INTEGER steps)
  property stepSize
    builtin INTEGER Get()
  property lowerBound
    builtin INTEGER Get()
  property currentValue
    builtin INTEGER Get()
    builtin Set(INTEGER value)
  property upperBound
    builtin INTEGER Get()
  5. Click Options > Runtime Options and in the Use Files field navigate to the custom control INC file.
  6. Record and replay tests for the custom control.
Parent topic: Testing Flex Custom Controls


Implementing Automation Support for a Custom Control

Before you can test a custom control, implement automation support, which is the automation delegate, in ActionScript for the custom control and compile that into the test application.

The following procedure uses a custom Flex spinner control to demonstrate how to implement automation support for a custom control. The spinner custom control includes two buttons and a text box, as shown in the following graphic.

Custom control example

The user can click Down to decrement the value that is displayed in the text box and click Up to increment the value in the text box.

The custom control offers a public CurrentValue property that can be set and retrieved.

  1. Implement automation support, which is the automation delegate, in ActionScript for the custom control.

    For further information about implementing an automation delegate, see the Adobe Live Documentation at http://livedocs.adobe.com/flex/3/html/help.html?content=functest_components2_14.html.

    In this example, the automation delegate adds support for the methods increment and decrement. The example code for the automation delegate looks like this:
    package customcontrols
{
  import flash.display.DisplayObject;
  import mx.automation.Automation;
  import customcontrols.SpinnerEvent;
  import mx.automation.delegates.containers.BoxAutomationImpl;
  import flash.events.Event;
  import mx.automation.IAutomationObjectHelper;
  import mx.events.FlexEvent;
  import flash.events.IEventDispatcher;
  import mx.preloaders.DownloadProgressBar;
  import flash.events.MouseEvent;
  import mx.core.EventPriority;

  [Mixin]
  public class SpinnerAutomationDelegate extends BoxAutomationImpl
  {
    public static function init(root:DisplayObject) : void
    {
      //register delegate for the automation
      Automation.registerDelegateClass(Spinner, SpinnerAutomationDelegate);
    }
    public function SpinnerAutomationDelegate(obj:Spinner)
    {
      super(obj);
      // listen to the events of interest (for recording)
      obj.addEventListener(SpinnerEvent.DECREMENT, decrementHandler);
      obj.addEventListener(SpinnerEvent.INCREMENT, incrementHandler);
    }

    protected function decrementHandler(event : SpinnerEvent) : void
    {
      recordAutomatableEvent(event);
    }

    protected function incrementHandler(event : SpinnerEvent) : void
    {
      recordAutomatableEvent(event);
    }

    protected function get spinner() : Spinner
    {
      return uiComponent as Spinner;
    }

    //----------------------------------
    // override functions
    //----------------------------------

    override public function get automationValue():Array
    {
      return [ spinner.currentValue.toString() ];
    }

    private function replayClicks(button : IEventDispatcher, steps : int) : Boolean
    {
      var helper : IAutomationObjectHelper = Automation.automationObjectHelper;
      var result : Boolean;
      for(var i:int; i < steps; i++)
      {
        helper.replayClick(button);
      }
      return result;
    }

    override public function replayAutomatableEvent(event:Event):Boolean
    {
      if(event is SpinnerEvent)
      {
        var spinnerEvent : SpinnerEvent = event as SpinnerEvent;
        if(event.type == SpinnerEvent.INCREMENT)
        {
          return replayClicks(spinner.upButton, spinnerEvent.steps);
        }
        else if
        {
          return replayClicks(spinner.downButton, spinnerEvent.steps);
        }
        else
        {
          return false;
        }
      }
      else
      {
        return super.replayAutomatableEvent(event);
      }
    }

    // do not expose the child controls, which are the buttons and the textfield, as individual controls
    override public function get numAutomationChildren():int
    {
      return 0;
    }
  }
}
  2. To introduce the automation delegate to the Open Agent, create an XML file that describes the custom control.

    The class definition file contains information about all instrumented Flex components. This file (or files) provides information about the components that can send events during recording and accept events for replay. The class definition file also includes the definitions for the supported properties.

    The XML file for the spinner custom control looks like this:
    <TypeInformation>
  <ClassInfo Name="FlexSpinner" Extends="FlexBox">
    <Implementation Class="customcontrols.Spinner" />
    <Events>
      <Event Name="Decrement">
        <Implementation Class="customcontrols.SpinnerEvent"
          Type="decrement" />
        <Property Name="steps">
          <PropertyType Type="integer" />
        </Property>
      </Event>
    </Events>
    <Properties>
      <Property Name="lowerBound" accessType="read">
        <PropertyType Type="integer" />
      </Property>
      <Property Name="upperBound" accessType="read">
        <PropertyType Type="integer" />
      </Property>
      <!-- expose read and write access for the currentValue property -->
      <Property Name="currentValue" accessType="both">
        <PropertyType Type="integer" />
      </Property>
      <Property Name="stepSize" accessType="read">
        <PropertyType Type="integer" />
      </Property>
    </Properties>
  </ClassInfo>
</TypeInformation>
  3. Include the XML file for the custom control in the folder that includes all the XML files, which describe all classes, methods, and properties for the supported Flex controls.

Silk Test Classic contains several XML files that describe all classes, methods, and properties for the supported Flex controls. Those XML files are located in the <silktest_install_directory>\ng\agent\com.borland.fastxd.techdomain.flex.agent\config\automationEnvironment folder.

If you provide your own XML file, you must copy your XML file into this folder. When the Open Agent starts and initializes support for Flex, it reads the contents of this directory.

To test the Flex Spinner sample control, you must copy the CustomControls.xml file into this folder. If the Open Agent is currently running, restart it after you copy the file into the folder.

Now, you can test the custom control using Silk Test Classic.

Parent topic: Testing Flex Custom Controls


Flex Class Definition File

The class definition file contains information about all instrumented Flex components. This file (or files) provides information about the components that can send events during recording and accept events for replay. The class definition file also includes the definitions for the supported properties.

Silk Test Classic contains several XML files that describe all classes, events, and properties for the common Flex common and specialized controls. Those XML files are located in the <silktest_install_directory>\ng\agent\plugins\com.borland.fastxd.techdomain.flex.agent_<version>\config\automationEnvironment folder.

If you provide your own XML file, you must copy your XML file into this folder. When the agent starts and initializes support for Apache Flex, it reads the contents of this directory.

The XML file has the following basic structure:
 <TypeInformation>
<ClassInfo>
<Implementation />
<Events>
<Event />
...
</Events>
<Properties>
<Property />
...
</Properties>
</ClassInfo>
</TypeInformation>
Parent topic: Testing Flex Custom Controls


Client/Server Application Support

Silk Test Classic provides built-in support for testing client/server applications including:
  • .NET WinForms
  • Java AWT applications
  • Java SWT/RCP application
  • Java Swing applications
  • Windows-based applications

In a client/server environment, Silk Test Classic drives the client application by means of an Agent process running on each application’s machine. The application then drives the server just as it always does. Silk Test Classic is also capable of driving the GUI belonging to a server or of directly driving a server database by running scripts that submit SQL statements to the database. These methods of directly manipulating the server application are intended to support testing in which the client application drives the server. For additional information on this capability, see Testing Databases.

  • Client/Server Testing Challenges
    Describes the testing methodology challenges that are raised by client/server testing.
  • Verifying Tables in ClientServer Applications
    Describes how you can verify a table in a client/server application.
  • Evolving a Testing Strategy
    Describes how you can evolve your testing strategy by moving your QA program from local to remote testing.
  • Incremental Functional Test Design
    Describes how Silk Test Classic implements the incremental functional testing methodology.
  • Network Testing Types
    Describes the kinds of automated application testing you can perform using Silk Test Classic in a networked environment.
  • How 4Test Handles Script Deadlock
    Describes how 4Test handles script deadlocks.
  • Troubleshooting Configuration Test Failures
    Describes how to troubleshoot configuration test failures.
Parent topic: Testing in Your Environment with the Open Agent
Related concepts
Open Agent
Testing Databases


Client/Server Testing Challenges

Silk Test Classic provides powerful support for testing client/server applications and 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 platforms.
  • Ensuring the reproducibility of client/server tests that modify a server database.
  • Verifying the server operations of a client application independently, without relying on the application under test.
  • Testing the concurrency features of a client/server application.
  • 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.
Parent topic: Client/Server Application Support


Verifying Tables in ClientServer Applications

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

When verifying a table in a client/server application, that is, an object of the Table class or of a class derived from Table, you can verify the value of every cell in a specified range in the table using the Table tab in the Verify Window dialog box. For additional information on verifying tables in Web applications, see Working with Borderless Tables.

Specifying the range

You specify the range of cells to verify in the Range text boxes using the following syntax for the starting and ending cells in the range:
row_number : column_name
or
row_number : column_number

Example

Specifying the following in the Range text boxes of the Verify Window dialog box causes the value of every cell in rows 1 through 3 to be verified, starting with the column named ID and ending with the column named Company_Name:

From field: 1 : id

To field: 3 : company_name

After you specify a cell range in the Verify Window dialog box, you can click Update to display the values in the specified range.

Specifying a file to store the values

You specify a file to store the current values of the selected range in the Table File Name text box.

What happens

When you dismiss the Verify Window dialog box and paste the code into your script, the following occurs:
  • The values that are currently in the table's specified cell range are stored in the file named in the Table File Name text box in the Verify Window dialog box.
  • A VerifyFileRangeValue method is pasted in your script that references the file and the cell range you specified.
For example, the following VerifyFileRangeValue method call would be recorded for the preceding example:
table.VerifyFileRangeValue ("file.tbl", {{"1",
"id"}, {"3", "company_name"}})

When you run your script, the values in the range specified in the second argument to VerifyFileRangeValue are compared to the values stored in the file referenced in the first argument to VerifyFileRangeValue.

For additional information, see the VerifyFileRangeValue method.

Parent topic: Client/Server Application Support


Evolving a Testing Strategy

There are several reasons for moving your QA program from local to remote testing:
  • You may have a stand-alone application that runs on many different platforms and now you want to simultaneously drive testing on all the platforms from one Silk Test Classic host system.
  • You may have been testing a client/server application as a single local application and now you want to drive multiple instances of the application so as to apply a heavier load to the server.
  • You may want to upgrade your client/server testing so that your test cases can automatically initialize the server and recover from server failures— in addition to driving multiple application instances.
  • You may need to test applications that have different user interfaces and that communicate as peers.

If you are already a Silk Test Classic user, you will find that your testing program can evolve in any of these directions while preserving large portions of your existing tests. This topic and related topics help you to evolve your testing strategy by showing the incremental steps you can take to move into remote testing.

Parent topic: Client/Server Application Support


Incremental Functional Test Design

Silk Test Classic simplifies and automates the classic QA testing methodology in which testing proceeds from the simplest cases to the most complex. This incremental functional testing methodology applies equally well in the client/ server environment, where testing scenarios typically proceed from the simplest functional testing of one instance of a client application, to functional and performance testing of a heavily loaded, multi-client configuration. Therefore, we recommend the following incremental progression for client/server testing:
  • Perform functional testing on a single client application that is running on the same system as Silk Test Classic, with the server application on the same system (if possible).
  • Perform functional testing on a single remote client application, with the server application on a separate system.
  • Perform functional and concurrency testing on two remote client applications.
  • Perform stress testing on a single client application running locally or remotely.
  • Perform volume load testing on a configuration large enough to stress the server application.
  • Perform peak load testing on a large configuration, up to the limits of the server, if possible.
  • Perform performance testing on several sets of loads until you can predict performance.
Parent topic: Client/Server Application Support


Network Testing Types

Software testing can be categorized according to the various broad testing goals that are the focus of the individual tests. At a conceptual level, the kinds of automated application testing you can perform using Silk Test Classic in a networked environment are:
  • Functional
  • Configuration
  • Concurrency

The ordering of this list conforms to the incremental functional testing methodology supported by Silk Test Classic. Each stage of testing depends for its effectiveness on the successful completion of the previous stage. Functional, configuration, and concurrency testing are variations of regression testing, which is a prerequisite for any type of load testing. You can use Silk Performer for load testing, stress testing, and performance testing.

You can perform functional testing with a single client machine. You can perform the first four types of test with a testbed containing only two clients. The last two testing types require a heavy multi-user load and so need a larger testbed.

  • Concurrency Testing
    Describes how you can test two clients using the same server.
  • Configuration Testing
    Describes how you can test that every possible client platform can operate with every possible server platform.
  • Functional Testing
    Describes how you can test the functional operation of a single instance of an application.
  • Peak Load Testing
    Describes how to place a load on the server for a short time to emulate the heaviest demand that would be generated at peak user times.
  • Volume Testing
    Describes how you can place a heavy load on the server, with a high volume of data transfers.
Parent topic: Client/Server Application Support


Concurrency Testing

Concurrency testing tests 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 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 databases at the same time. Your goal is to encounter faulty read/write locks, software deadlocks, or other concurrency problems.

Once the application passes the functional tests, you can test the boundary conditions that might be reached by large numbers of transactions.

Parent topic: Network Testing Types
Related concepts
Concurrency Test Example Code


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.
Parent topic: Network Testing Types


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 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.

Parent topic: Network Testing Types


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.

Parent topic: Network Testing Types


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 to delete data to keep the size of the database at an appropriate level. In such a case, you need to synchronize the verification scripts to wait for the generation scripts. The 4Test script language makes this easy. Usually, you would need a very large test set to drive this type of server load, but if you under-configure your server you will be able to test the sections of the software that handle the outer limits of data capacity.

Parent topic: Network Testing Types


How 4Test Handles Script Deadlock

It is possible for a multi-threaded 4Test script to reach a state in which competing threads block one another, so that the script cannot continue. This is called a script deadlock. When the 4Test runtime environment detects a deadlock, it raises an exception and halts the deadlocked script.

Example

The following script will never exit successfully.
share INTEGER iIndex1 = 0
share INTEGER iIndex2 = 0

main ()
  parallel
    access iIndex1
      Sleep (1)
        access iIndex2
          Print ("Accessed iIndex1 and iIndex2")
    access iIndex2
      Sleep (1)
        access iIndex1
          Print ("Accessed iIndex2 and iIndex1")
Parent topic: Client/Server Application Support


Troubleshooting Configuration Test Failures

The test of your application may have failed for one of the reasons below. If the following suggestions do not address the problem, you can enable your extension manually.

Note: Unsupported and embedded browsers, other than AOL, are recognized as client/server applications.

The application may not have been ready to test

  1. Click Enable Extensions on the Basic workflow bar.
  2. On the Enable Extensions dialog box, select the application for which you want to enable extensions.
  3. Close and restart your application. Make sure the application has finished loading, and then click Test.

Embedded browsers, other than AOL, are recognized as Client/Server applications

If you want to work with a web browser control embedded within an application, you must enable the extension manually.

Parent topic: Client/Server Application Support


Testing .NET Applications with the Open Agent

Silk Test Classic provides built-in support for testing .NET applications with the Open Agent.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

  • Windows Forms Applications
    Provides an overview for testing .NET Windows Forms (Win Forms) applications.
  • WPF Applications
    Provides an overview of how Silk Test Classic provides support for testing Windows Presentation Foundation (WPF) applications with the Open Agent.
  • Microsoft Silverlight Applications
    Describes the Microsoft Silverlight application support.
Parent topic: Testing in Your Environment with the Open Agent


Windows Forms Applications

Silk Test Classic provides built-in support for testing .NET Windows Forms (Win Forms) applications using the Open Agent as well as built-in support for testing .NET standalone and No-Touch Windows Forms (Win Forms) applications using the Classic Agent. However, side-by-side execution is supported only on standalone applications.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

  • Locator Attributes for Windows Forms Applications
    Describes the attributes that are available for Windows Forms applications.
  • Dynamically Invoking Windows Forms Methods
    Explains how to call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose by using the dynamic invoke feature.
  • Suppressing Controls (Open Agent)
    Suppress controls to ignore them during recording and playback.
  • Determining the priorLabel in the Windows Forms Technology Domain
    Describes how the priorLabel is determined in the .NET Windows Forms (Win Forms) technology domain.
Parent topic: Testing .NET Applications with the Open Agent
Related concepts
Open Agent
Dynamic Object Recognition
Related tasks
Recording Test Cases for Standard and Web Applications
Related reference
Windows Forms Classes Used by the Open Agent


Locator Attributes for Windows Forms Applications

This functionality is supported only if you are using the Open Agent.

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.

The attributes that Silk Test Classic supports for Windows Forms include:
  • automationId
  • caption. Supports wildcards ? and * .
  • windowid
  • priorlabel. For controls that do not have a caption, the priorlabel is used as the caption automatically. For controls with a caption, it may be easier to use the caption.
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.
Parent topic: Windows Forms Applications
Related concepts
Dynamic Object Recognition
Determining the priorLabel in the Windows Forms Technology Domain
Related tasks
Defining which Custom Locator Attributes to Use for Recognition


Dynamically Invoking Windows Forms Methods

This functionality is supported only if you are using the Open Agent.

Dynamic invoke enables you to directly call methods, retrieve properties, or set properties, on an actual instance of a control in the application under test. You can also call methods and properties that are not available in the Silk Test Classic API for this control. Dynamic invoke is especially useful when you are working with custom controls, where the required functionality for interacting with the control is not exposed through the Silk Test Classic API.

Call dynamic methods on objects with the DynamicInvoke method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.

Call multiple dynamic methods on objects with the DynamicInvokeMethods method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.

Retrieve dynamic properties with the GetProperty method and set dynamic properties with the SetProperty method. To retrieve a list of supported dynamic properties for a control, use the GetPropertyList method.

For example, to call a method named SetTitle, which requires the title to be set as an input parameter of type string, on an actual instance of a control in the application under test, type the following:
control.DynamicInvoke("SetTitle", {"my new title"})
Note: Typically, most properties are read-only and cannot be set.
Note: Reflection is used in most technology domains to call methods and retrieve properties.

The DynamicInvoke Method

For a Windows Forms or a WPF control, you can use the DynamicInvoke method to call the following methods:
  • Public methods that the MSDN defines for the control.
  • Public static methods that the MSDN defines.
  • User-defined public static methods of any type.

First Example for the DynamicInvoke Method

For an object of the Silk Test Classic type DataGrid, you can call all methods that MSDN defines for the type System.Windows.Forms.DataGrid.

To call the method IsExpanded of the System.Windows.Forms.DataGrid class, use the following code:
//4Test code
BOOLEAN isExpanded = (BOOLEAN) dataGrid.DynamicInvoke("IsExpanded", {3})

Second Example for the DynamicInvoke Method

To invoke the static method String.Compare(String s1, String s2) inside the AUT, use the following code:
//4Test code
INTEGER result = mainWindow.DynamicInvoke("System.String.Compare", {"a", "b"});

The DynamicInvokeMethods Method

For a Windows Forms or a WPF control, you can use the DynamicInvokeMethods method to invoke a sequence of nested methods. You can call the following methods:
  • Public methods that the MSDN defines for the control.
  • Public static methods that the MSDN defines.
  • User-defined public static methods of any type.

Example: Getting the Text Contents of a Cell in a Custom Data Grid

To get the text contents of a cell of a custom data grid from the Infragistics library, you can use the following C# code in the AUT:
string cellText = dataGrid.Rows[rowIndex].Cells[columnIndex].Text;
The following C# code sample gets the text contents of the third cell in the first row:
string cellText = dataGrid.Rows[0].Cells[2];
Scripting the same example by using the DynamicInvokeMethods method generates a relatively complex script, because you have to pass five methods with their corresponding parameters to the DynamicInvokeMethods method:
INTEGER rowIndex = 0
INTEGER columnIndex = 2

LIST OF STRING names = { ... }
  "Rows"         // Get the list of rows from the grid.
  "get_Item"     // Get a specific row from the list of rows by using the indexer method.
  "Cells"        // Get the list of cells from the the row.
  "get_Item"     // Get a specific cell from the list of cells by using the indexer method.
  "Text"         // Get the text of the cell.

LIST OF LIST parameters = { ... }
  {}             // Parameters for the Rows property.
  {rowIndex}     // Parameters for the get_Item method.
  {}             // Parameters for the Cells property.
  {columnIndex}  // Parameters for the get_Item method.
  {}             // Parameters for the Text property.

dataGrid.DynamicInvokeMethods(names, parameters)

Supported Methods and Properties

The following methods and properties can be called:
  • Methods and properties that Silk Test Classic supports for the control.
  • All public methods and properties that the MSDN defines for the control.
  • If the control is a custom control that is derived from a standard control, all methods and properties from the standard control can be called.

Supported Parameter Types

The following parameter types are supported:
  • All built-in Silk Test Classic types

    Silk Test Classic types includes primitive types (such as boolean, int, string), lists, and other types (such as Point and Rect).

  • Enum types

    Enum parameters must be passed as string. The string must match the name of an enum value. For example, if the method expects a parameter of the .NET enum type System.Windows.Visiblity you can use the string values of Visible, Hidden, or Collapsed.

  • .NET structs and objects

    .NET struct and object parameters must be passed as a list. The elements in the list must match one constructor for the .NET object in the test application. For example, if the method expects a parameter of the .NET type System.Windows.Vector, you can pass a list with two integers. This works because the System.Windows.Vector type has a constructor with two integer arguments.

Returned Values

The following values are returned for properties and methods that have a return value:
  • The correct value for all built-in Silk Test Classic types. These types are listed in the Supported Parameter Types section.
  • All methods that have no return value return NULL.
Parent topic: Windows Forms Applications
Related concepts
Dynamic Invoke


Suppressing Controls (Open Agent)

This functionality is supported only if you are using the Open Agent.

To simplify the object hierarchy and to shorten the length of the lines of code in your test scripts and functions, you can suppress the controls for certain unnecessary classes in the following technologies:
  • Win32.
  • Java AWT/Swing.
  • Java SWT/Eclipse.
  • Windows Presentation Foundation (WPF).

For example, you might want to ignore container classes to streamline your test cases.

To suppress specific controls:

  1. Click Options > Recorder. The Recording Options dialog box opens.
  2. Click the Transparent Classes tab.
  3. Type the name of the class that you want to ignore during recording and playback into the text box.

    If the text box already contains classes, add the new classes to the end of the list. Separate the classes with a comma. For example, to ignore both the AOL Toolbar and the _AOL_Toolbar class, type AOL Toolbar, _AOL_Toolbar into the text box.

    The OPT_TRANSPARENT_CLASSES option is set to true for these classes.

  4. Click OK. The OPT_TRANSPARENT_CLASSES option is set to true for these classes, which means the classes are added to the list of the classes that are ignored during recording and playback.
Parent topic: Windows Forms Applications
Parent topic: Testing Java SWT and Eclipse Applications with the Open Agent
Parent topic: Testing Windows API-Based Applications
Related concepts
Invisible Containers
Related tasks
Suppressing Controls (Classic Agent)


Determining the priorLabel in the Windows Forms Technology Domain

To determine the priorLabel in the Windows Forms technology domain, all labels and groups in the same window as the target control are considered. The decision is then made based upon the following criteria:
  • Only labels either above or to the left of the control, and groups surrounding the control, are considered as candidates for a priorLabel.
  • In the simplest case, the label closest to the control is used as the priorLabel.
  • If two labels have the same distance to the control, the priorLabel is determined based upon the following criteria:
    • If one label is to the left and the other above the control, the left one is preferred.
    • If both levels are to the left of the control, the upper one is preferred.
    • If both levels are above the control, the left one is preferred.
  • If the closest control is a group control, first all labels within the group are considered according to the rules specified above. If no labels within the group are eligible, then the caption of the group is used as the priorLabel.
Parent topic: Windows Forms Applications
Related concepts
Locator Attributes for Windows Forms Applications


WPF Applications

This functionality is supported only if you are using the Open Agent.

Silk Test Classic provides built-in support for testing Windows Presentation Foundation (WPF) applications using the Open Agent. Silk Test Classic supports standalone WPF applications and can record and play back controls in .NET version 3.5 or later.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

WPF applications support hierarchical object recognition and dynamic object recognition. You can create tests for both dynamic and hierarchical object recognition in your test environment. You can use both recognition methods within a single test case if necessary. Use the method best suited to meet your test requirements.

When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations.

Existing test cases that use dynamic object recognition without locator keywords in an INC file will continue to be supported. You can replay these tests, but you cannot record new tests with dynamic object recognition without locator keywords in an INC file.

When you create a new WPF project, Silk Test Classic uses the Open Agent by default.

  • Supported Controls for WPF
    Describes the WPF controls that Silk Test Classic supports.
  • Locator Attributes for Windows Presentation Foundation (WPF) Controls
    Lists the locator attributes that are supported for Windows Presentation Foundation (WPF) controls.
  • Classes that Derive from the WPFItemsControl Class
    Describes how you can work with classes that derive from WPFItemsControl.
  • Custom WPF Controls
    Describes how Silk Test Classic supports custom WPF controls.
  • Setting WPF Classes to Expose During Recording and Playback
    Expose classes to record, playback, find, verify properties, and perform any other supported actions for the classes.
  • Dynamically Invoking WPF Methods
    Explains how to call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose by using the dynamic invoke feature.
  • Setting Pre-Fill During Recording and Replaying
    Turn pre-fill on during recording and replaying to access items that are not accessible without scrolling them into view.
  • WPF Class Reference
    Lists the classes for WPF support.
Parent topic: Testing .NET Applications with the Open Agent
Related concepts
Open Agent
Dynamic Object Recognition
Related tasks
Recording Test Cases for Standard and Web Applications
Recording Test Cases for Mobile Applications


Supported Controls for WPF

Silk Test Classic includes record and replay support for WPF controls. In Silk Test 2009, WPF replay support was provided. However, with the release of Silk Test 2010, the earlier WPF controls, which were prefixed with MSUIA, are deprecated and users should use the new WPF technology domain instead. When you record new test cases, Silk Test Classic automatically uses the new WPF technology domain.

Note: If you have an existing project that includes scripts that use the earlier MSUIA technology domain, the test cases will no longer work.

For a complete list of the controls available for WPF testing, see the WPF Class Reference.

Parent topic: WPF Applications


Locator Attributes for Windows Presentation Foundation (WPF) Controls

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.

Silk Test Classic supports the following locator attributes for WPF controls:

  • automationId
  • caption
  • className
  • name
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.

Dynamic Object Recognition

To identify components within WPF scripts, you can specify the automationId, caption, className, or name. The name that is given to an element in the application is used as the automationId attribute for the locator if available. As a result, most objects can be uniquely identified using only this attribute. For example, a locator with an automationId might look like: //WPFButton[@automationId='okButton']".

If you define an automationId and any other attribute, only the automationId is used during replay. If there is no automationId defined, the name is used to resolve the component. If neither a name nor an automationId are defined, the caption value is used. If no caption is defined, the className is used. We recommend using the automationId because it is the most useful property.

Attribute Type Description Example
automationId

An ID that was provided by the developer of the test application.

//WPFButton[@automationId='okButton']"
name The name of a control. The Visual Studio designer automatically assigns a name to every control that is created with the designer. The application developer uses this name to identify the control in the application code.
//WPFButton[@name='okButton']"
caption

The text that the control displays. When testing a localized application in multiple languages, use the automationId or name attribute instead of the caption.

//WPFButton[@automationId='Ok']"
className

The simple .NET class name (without namespace) of the WPF control. Using the class name attribute can help to identify a custom control that is derived from a standard WPF control that Silk Test Classic recognizes.

//WPFButton[@className='MyCustomButton']"

During recording, Silk Test Classic creates a locator for a WPF control by using the automationId, name, caption, or className attributes in the order that they are listed in the preceding table. For example, if a control has a automationId and a name, Silk Test Classic uses the automationId when creating the locator.

The following example shows how an application developer can define a name and an automationId for a WPF button in the XAML code of the application:
<Button Name="okButton" AutomationProperties.AutomationId="okButton"
Click="okButton_Click">Ok</Button>
Parent topic: WPF Applications
Related concepts
Dynamic Object Recognition
Related tasks
Defining which Custom Locator Attributes to Use for Recognition


Classes that Derive from the WPFItemsControl Class

Silk Test Classic can interact with classes that derive from WPFItemsControl, such as WPFListBox, WPFTreeView, and WPFMenu, in two ways:
Working with the control
Most controls contain methods and properties for typical use cases. The items are identified by text or index.
For example:
listBox.Select("Banana")
listBox.Select(2)
tree.Expand("/Fruit/Banana")
Working with individual items
For example WPFListBoxItem, WPFTreeViewItem, or WPFMenuItem. For advanced use cases, use individual items. For example, use individual items for opening the context menu on a specific item in a list box, or clicking a certain position relative to an item.
Parent topic: WPF Applications


Custom WPF Controls

Generally, Silk Test Classic provides record and playback support for all standard WPF controls.

Silk Test Classic handles custom controls based on the way the custom control is implemented. You can implement custom controls by using the following approaches:
Deriving classes from UserControl
This is a typical way to create compound controls. Silk Test Classic recognizes these user controls as WPFUserControl and provides full support for the contained controls.
Deriving classes from standard WPF controls, such as ListBox
Silk Test Classic treats these controls as an instance of the standard WPF control that they derive from. Record, playback, and recognition of children may not work if the user control behavior differs significantly from its base class implementation.
Using standard controls that use templates to change their visual appearance
Low-level replay might not work in certain cases. Switch to high-level replay in such cases.

Silk Test Classic filters out certain controls that are typically not relevant for functional testing. For example, controls that are used for layout purposes are not included. However, if a custom control derives from an excluded class, specify the name of the related WPF class to expose the filtered controls during recording and playback.

Parent topic: WPF Applications
Related tasks
Setting WPF Classes to Expose During Recording and Playback


Setting WPF Classes to Expose During Recording and Playback

Silk Test Classic filters out certain controls that are typically not relevant for functional testing. For example, controls that are used for layout purposes are not included. However, if a custom control derives from an excluded class, specify the name of the related WPF class to expose the filtered controls during recording and playback.

Specify the names of any WPF classes that you want to expose during recording and playback. For example, if a custom class called MyGrid derives from the WPF Grid class, the objects of the MyGrid custom class are not available for recording and playback. Grid objects are not available for recording and playback because the Grid class is not relevant for functional testing since it exists only for layout purposes. As a result, Grid objects are not exposed by default. In order to use custom classes that are based on classes that are not relevant to functional testing, add the custom class, in this case MyGrid, to the OPT_WPF_CUSTOM_CLASSES option. Then you can record, playback, find, verify properties, and perform any other supported actions for the specified classes.
  1. Click Options.
  2. Click Recorder.
  3. In the Custom WPF class names grid, type the name of the class that you want to expose during recording and playback. Separate class names with a comma.
  4. Click OK.
Parent topic: WPF Applications
Related concepts
WPF Applications
Custom WPF Controls
Related tasks
Setting Recording Options for the Open Agent
Setting Replay Options for the Open Agent


Dynamically Invoking WPF Methods

Dynamic invoke enables you to directly call methods, retrieve properties, or set properties, on an actual instance of a control in the application under test. You can also call methods and properties that are not available in the Silk Test Classic API for this control. Dynamic invoke is especially useful when you are working with custom controls, where the required functionality for interacting with the control is not exposed through the Silk Test Classic API.

Call dynamic methods on objects with the DynamicInvoke method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.

Call multiple dynamic methods on objects with the DynamicInvokeMethods method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.

Retrieve dynamic properties with the GetProperty method and set dynamic properties with the SetProperty method. To retrieve a list of supported dynamic properties for a control, use the GetPropertyList method.

For example, to call a method named SetTitle, which requires the title to be set as an input parameter of type string, on an actual instance of a control in the application under test, type the following:
control.DynamicInvoke("SetTitle", {"my new title"})
Note: Typically, most properties are read-only and cannot be set.
Note: Reflection is used in most technology domains to call methods and retrieve properties.

The DynamicInvoke Method

For a Windows Forms or a WPF control, you can use the DynamicInvoke method to call the following methods:
  • Public methods that the MSDN defines for the control.
  • Public static methods that the MSDN defines.
  • User-defined public static methods of any type.

First Example for the DynamicInvoke Method

For an object of the Silk Test Classic type DataGrid, you can call all methods that MSDN defines for the type System.Windows.Forms.DataGrid.

To call the method IsExpanded of the System.Windows.Forms.DataGrid class, use the following code:
//4Test code
BOOLEAN isExpanded = (BOOLEAN) dataGrid.DynamicInvoke("IsExpanded", {3})

Second Example for the DynamicInvoke Method

To invoke the static method String.Compare(String s1, String s2) inside the AUT, use the following code:
//4Test code
INTEGER result = mainWindow.DynamicInvoke("System.String.Compare", {"a", "b"});

The DynamicInvokeMethods Method

For a Windows Forms or a WPF control, you can use the DynamicInvokeMethods method to invoke a sequence of nested methods. You can call the following methods:
  • Public methods that the MSDN defines for the control.
  • Public static methods that the MSDN defines.
  • User-defined public static methods of any type.

Example: Getting the Text Contents of a Cell in a Custom Data Grid

To get the text contents of a cell of a custom data grid from the Infragistics library, you can use the following C# code in the AUT:
string cellText = dataGrid.Rows[rowIndex].Cells[columnIndex].Text;
The following C# code sample gets the text contents of the third cell in the first row:
string cellText = dataGrid.Rows[0].Cells[2];
Scripting the same example by using the DynamicInvokeMethods method generates a relatively complex script, because you have to pass five methods with their corresponding parameters to the DynamicInvokeMethods method:
INTEGER rowIndex = 0
INTEGER columnIndex = 2

LIST OF STRING names = { ... }
  "Rows"         // Get the list of rows from the grid.
  "get_Item"     // Get a specific row from the list of rows by using the indexer method.
  "Cells"        // Get the list of cells from the the row.
  "get_Item"     // Get a specific cell from the list of cells by using the indexer method.
  "Text"         // Get the text of the cell.

LIST OF LIST parameters = { ... }
  {}             // Parameters for the Rows property.
  {rowIndex}     // Parameters for the get_Item method.
  {}             // Parameters for the Cells property.
  {columnIndex}  // Parameters for the get_Item method.
  {}             // Parameters for the Text property.

dataGrid.DynamicInvokeMethods(names, parameters)

Supported Methods and Properties

The following methods and properties can be called:
  • Methods and properties that Silk Test Classic supports for the control.
  • All public methods and properties that the MSDN defines for the control.
  • If the control is a custom control that is derived from a standard control, all methods and properties from the standard control can be called.

Supported Parameter Types

The following parameter types are supported:
  • All built-in Silk Test Classic types

    Silk Test Classic types includes primitive types (such as boolean, int, string), lists, and other types (such as Point and Rect).

  • Enum types

    Enum parameters must be passed as string. The string must match the name of an enum value. For example, if the method expects a parameter of the .NET enum type System.Windows.Visiblity you can use the string values of Visible, Hidden, or Collapsed.

  • .NET structs and objects

    .NET struct and object parameters must be passed as a list. The elements in the list must match one constructor for the .NET object in the test application. For example, if the method expects a parameter of the .NET type System.Windows.Vector, you can pass a list with two integers. This works because the System.Windows.Vector type has a constructor with two integer arguments.

Returned Values

The following values are returned for properties and methods that have a return value:
  • The correct value for all built-in Silk Test Classic types. These types are listed in the Supported Parameter Types section.
  • All methods that have no return value return NULL.
  • A string for all other types

    Call ToString on returned .NET objects to retrieve the string representation

Example

A custom calculator control has a Reset method and an Add method, which performs an addition of two numbers. You can use the following code to call the methods directly from your tests:
customControl.DynamicInvoke("Reset")
REAL sum = customControl.DynamicInvoke("Add",{1,2})
The calculator control also has a LastCalculationResult property. You can use the following code to read the property:
REAL lastResult =
customControl.GetProperty("LastCalculationResult")
Parent topic: WPF Applications
Related concepts
Dynamic Invoke


Setting Pre-Fill During Recording and Replaying

This functionality is supported only if you are using the Open Agent.

Defines whether items in a WPFItemsControl, like WPFComboBox or WPFListBox, are pre-filled during recording and playback. WPF itself lazily loads items for certain controls, so these items are not available for Silk Test Classic if they are not scrolled into view. Turn pre-filling on, which is the default setting, to additionally access items that are not accessible without scrolling them into view. However, some applications have problems when the items are pre-filled by Silk Test Classic in the background, and these applications can therefore crash. In this case turn pre-filling off.

  1. Click Options.
  2. Click Recorder.
  3. In the Pre-fill items area, check the OPT_WPF_PREFILL_ITEMS check box.
  4. Click OK.
Parent topic: WPF Applications
Related concepts
WPF Applications
Related tasks
Setting Recording Options for the Open Agent
Setting Replay Options for the Open Agent


WPF Class Reference

When you configure a WPF application, Silk Test Classic automatically provides built-in support for testing standard WPF controls.

Parent topic: WPF Applications
Related reference
WPF Class Reference


Microsoft Silverlight Applications

Microsoft Silverlight (Silverlight) is an application framework for writing and running rich internet applications, with features and purposes similar to those of Adobe Flash. The run-time environment for Silverlight is available as a plug-in for most web browsers.

Silk Test Classic provides built-in support for testing Silverlight applications with the Open Agent. Silk Test Classic supports Silverlight applications that run in a browser as well as out-of-browser and can record and play back controls in Silverlight.

The following applications, that are based on Silverlight, are supported:
  • Silverlight applications that run in Internet Explorer.
  • Silverlight applications that run in Mozilla Firefox.
  • Out-of-Browser Silverlight applications.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Silverlight applications support dynamic object recognition. You can create tests for dynamic object recognition in your test environment.

When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations.

Silk Test Classic includes record and replay support for Silverlight controls. For a complete list of the controls available for Silverlight testing, see the Silverlight Class Reference.

The support for testing Silverlight applications in Microsoft Windows XP requires the installation of Service Pack 3 and the Update for Windows XP with the Microsoft User Interface Automation that is provided in Windows 7. You can download the update from http://www.microsoft.com/download/en/details.aspx?id=13821.

Note: The Microsoft User Interface Automation needs to be installed for the Silverlight support. If you are using a Windows operating system and the Silverlight support does not work, you can install the update with the Microsoft User Interface Automation, which is appropriate for your operating system, from http://support.microsoft.com/kb/971513.
  • Locator Attributes for Silverlight Controls
    Describes the locator attributes that are supported for identifying Silverlight controls.
  • Dynamically Invoking Silverlight Methods
    Describes how you can call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose by using the dynamic invoke feature.
  • Scrolling in Silverlight
    Describes how scrolling is handled in Silverlight controls.
  • Troubleshooting when Testing Silverlight Applications
    Provides useful information on handling potential difficulties when testing Silverlight applications.
  • Silverlight Class Reference
    Lists the Visual Basic classes for Silverlight support.
Parent topic: Testing .NET Applications with the Open Agent
Related concepts
Open Agent
Dynamic Object Recognition
Related tasks
Recording Test Cases for Standard and Web Applications


Locator Attributes for Silverlight Controls

Silk Test Classic supports the following locator attributes for Silverlight controls:
  • automationId
  • caption
  • className
  • name
  • All dynamic locator attributes
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.

Dynamic Object Recognition

To identify components within Silverlight scripts, you can specify the automationId, caption, className, name or any dynamic locator attribute. The automationId can be set by the application developer. For example, a locator with an automationId might look like //SLButton[@automationId="okButton"].

We recommend using the automationId because it is typically the most useful and stable attribute.

Attribute Type | Description | Example
automationId | An identifier that is provided by the developer of the application under test. The Visual Studio designer automatically assigns an automationId to every control that is created with the designer. The application developer uses this ID to identify the control in the application code. | //SLButton[@automationId="okButton"]
caption | The text that the control displays. When testing a localized application in multiple languages, use the automationId or name attribute instead of the caption. | //SLButton[@caption="OK"]
className | The simple .NET class name (without namespace) of the Silverlight control. Using the className attribute can help to identify a custom control that is derived from a standard Silverlight control that Silk Test recognizes. | //SLButton[@className='MyCustomButton']
name | The name of a control. Can be provided by the developer of the application under test. | //SLButton[@name="okButton"]
Attention: The name attribute in XAML code maps to the locator attribute automationId, not to the locator attribute name.

During recording, Silk Test Classic creates a locator for a Silverlight control by using the automationId, name, caption, or className attributes in the order that they are listed in the preceding table. For example, if a control has a automationId and a name, Silk Test Classic uses the automationId when creating the locator.

The following table shows how an application developer can define a Silverlight button with the text Ok in the XAML code of the application:

XAML Code for the Object | Locator to Find the Object from Silk Test
<Button>Ok</Button> | //SLButton[@caption="OK"]
<Button Name="okButton">Ok</Button> | //SLButton[@automationId="okButton"]
<Button AutomationProperties.AutomationId="okButton">Ok</Button> | //SLButton[@automationId="okButton"]
<Button AutomationProperties.Name="okButton">Ok</Button> | //SLButton[@name="okButton"]
Parent topic: Microsoft Silverlight Applications
Related concepts
Dynamic Object Recognition
Related tasks
Defining which Custom Locator Attributes to Use for Recognition


Dynamically Invoking Silverlight Methods

You can call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose by using the dynamic invoke feature. This feature is useful for working with custom controls and for working with controls that Silk Test Classic supports without customization.

Call dynamic methods on Silverlight objects with the DynamicInvoke method. To retrieve a list of supported dynamic methods for a Silverlight control, use the GetDynamicMethodList() method.

Call multiple dynamic methods on objects with the DynamicInvokeMethods method. To retrieve a list of supported dynamic methods for a Silverlight control, use the GetDynamicMethodList() method.

Retrieve dynamic properties with the GetProperty method and set dynamic properties with the SetProperty() method. To retrieve a list of supported dynamic properties for a Silverlight control, use the GetPropertyList() method.

Note: Typically, most properties are read-only and cannot be set.

Supported Parameter Types

All built-in Silk Test Classic types
Silk Test Classic types include primitive types, for example boolean, int, and string, lists, and other types, for example Point and Rect.
Enum types
Enum parameters must be passed as string. The string must match the name of an enum value. For example, if the method expects a parameter of the .NET enum type System.Windows.Visiblity you can use the string values of Visible, Hidden, or Collapsed.
.NET structs and objects
Pass .NET struct and object parameters as a list. The elements in the list must match one constructor for the .NET object in the test application. For example, if the method expects a parameter of the .NET type System.Windows.Vector, you can pass a list with two integers. This works because the System.Windows.Vector type has a constructor with two integer arguments.
Other controls
Control parameters can be passed as TestObject.

Returned Values

The following values are returned for properties and methods that have a return value:

  • The correct value for all built-in Silk Test Classic types.

  • All methods that have no return value return NULL.

  • A string for all other types.

    To retrieve this string representation, call the ToString() method on returned .NET objects in the application under test.

Example

A TabItem in Silverlight, which is an item in a TabControl.

tabItem.DynamicInvoke("SelectionItemPattern.Select")
mySilverligtObject.GetProperty("IsPassword")
Parent topic: Microsoft Silverlight Applications
Related concepts
Dynamic Invoke


Scrolling in Silverlight

Silk Test Classic provides two different sets of scrolling-related methods and properties, depending on the Silverlight control.
  • The first type of controls includes controls that can scroll by themselves and therefore do not expose the scrollbars explicitly as children. For example combo boxes, panes, list boxes, tree controls, data grids, auto complete boxes, and others.
  • The second type of controls includes controls that cannot scroll by themselves but expose scrollbars as children for scrolling. For example text fields.
This distinction in Silk Test Classic exists because the controls in Silk Test Classic implement scrolling in those two ways.

Controls that support scrolling

In this case, scrolling-related methods and property are available for the control that contains the scrollbars. Therefore, Silk Test Classic does not expose scrollbar objects.

Examples

The following command scrolls a list box to the bottom:
listBox.SetVerticalScrollPercent(100)
The following command scrolls the list box down by one unit:
listBox.ScrollVertical(ScrollAmount.SmallIncrement)

Controls that do not support scrolling

In this case the scrollbars are exposed. No scrolling-related methods and properties are available for the control itself. The horizontal and vertical scrollbar objects enable you to scroll in the control by specifying the increment or decrement, or the final position, as a parameter in the corresponding API functions. The increment or decrement can take the values of the ScrollAmount enumeration. For additional information, refer to the Silverlight documentation. The final position is related to the position of the object, which is defined by the application designer.

Examples

The following command scrolls a vertical scrollbar within a text box to position 15:
 textBox.SLVerticalScrollBar().ScrollToPosition(15)
The following command scrolls a vertical scrollbar within a text box to the bottom:
 textBox.SLVerticalScrollBar().ScrollToMaximum()
Parent topic: Microsoft Silverlight Applications


Troubleshooting when Testing Silverlight Applications

Silk Test Classic cannot see inside the Silverlight application and no green rectangles are drawn during recording

The following reasons may cause Silk Test Classic to be unable to see inside the Silverlight application:
Reason | Solution
You use a Mozilla Firefox version prior to 4.0. | Use Mozilla Firefox 4.0 or later.
You use a Silverlight version prior to 3. | Use Silverlight 3 (Silverlight Runtime 4) or Silverlight 4 (Silverlight Runtime 4).
Your Silverlight application is running in windowless mode. Silk Test Classic does not support Silverlight applications that run in windowless mode. To test such an application, you need to change the Web site where your Silverlight application is running. Therefore you need to set the windowless parameter in the object tag of the HTML or ASPX file, in which the Silverlight application is hosted, to false.
The following sample code sets the windowless parameter to false:
<object ...>
  <param name="windowless" value="false"/>
  ...
</object>
Parent topic: Microsoft Silverlight Applications


Silverlight Class Reference

When you configure a Silverlight application, Silk Test Classic automatically provides built-in support for testing standard Silverlight controls.

Parent topic: Microsoft Silverlight Applications
Related reference
Silverlight Class Reference


Testing Java AWT/Swing Applications with the Open Agent

Silk Test Classic provides built-in for testing stand-alone Java applications developed using supported Java virtual machines and for testing Java applets using supported browsers. You must configure Silk Test Classic Java support before using it. When you configure a Java AWT/Swing application or applet, Silk Test Classic automatically provides support for testing standard Java AWT/Swing controls. You can also test Java SWT controls embedded in Java AWT/Swing applications or applets as well as Java AWT/Swing controls embedded in Java SWT applications.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

  • Testing Standard Java Objects and Custom Controls
    Describes how Silk Test Classic supports testing standard Java objects and custom controls.
  • Recording and Playing Back JFC Menus
    Describes how Silk Test Classic supports recording and playing back JFC menus.
  • Recording and Playing Back Java AWT Menus
    Describes how Silk Test Classic providews support for recording and playing back Java AWT menus.
  • Object Recognition for Java AWT/Swing Applications
    Describes the support for object recognition in Java AWT/Swing applications.
  • Agent Support for Java AWT/Swing Applications
    Describes the agent support for Java AWT/Swing applications.
  • Configuring a Test Application that Uses the Java Network Launching Protocol (JNLP)
    Configure a test application to start the actual application as well as the application that launches the "Web Start".
  • Custom Attributes
    Describes custom attributes that you can add to test applications.
  • Locator Attributes for Java AWT/Swing Controls
    Describes the locator attributes that are supported for identifying Java AWT and Swing controls.
  • Dynamically Invoking Java Methods
    Describes how you can use the dynamic invoke feature to call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose.
  • Determining the priorLabel in the Java AWT/Swing Technology Domain
    Describes how the priorLabel is determined in the Java AWT/Swing technology domain.
  • Supported Browsers for Testing Java Applets
    Lists the supported browsers for testing Java applets.
  • Overview of JavaScript Support
    Describes how Silk Test Classic provides support for executing JavaScript code within a Web application.
  • Oracle Forms Support
    Describes the support that Silk Test Classic provides for testing applications that are based on Oracle Forms.
  • Classes in Object-Oriented Programming Languages
    Provides an overview for classes in object-oriented programming languages.
  • Configuring Silk Test Classic to Test Java
    Describes how to configure Silk Test Classic to test Java applications.
  • Testing Java Applications and Applets
    Describes how to test Java applications and applets.
  • Frequently Asked Questions About Testing Java Applications
    Provides answers to frequently asked questions about testing Java applications.
Parent topic: Testing in Your Environment with the Open Agent
Related concepts
Prerequisites for Testing Java Applications
Related reference
Java AWT and Swing Class Reference


Testing Standard Java Objects and Custom Controls

Any single Java application or applet may contain a mix of standard and custom Java objects. With Java support, you can test both types of visible Java objects in applications and applets that you develop using the Java Development Kit (JDK)/Java Runtime Environment (JRE).

Standard Java objects are often defined in class libraries. The Java support of Silk Test Classic lets you record and play back tests against standard controls by providing 4Test definitions for many Java classes defined in the following class libraries:
  • Abstract Windowing Toolkit (AWT)
  • Java Foundation Class (JFC), which includes the Swing set of GUI components
  • Standard Widget Toolkit (SWT)
  • Symantec Visual Café Itools (only for the Classic Agent)

If you are using the Classic Agent, you can use the setName("<desiredwindow ID>") method to create a window ID that Silk Test Classic will detect. setName() is a method inherited from class java.awt.Component, so it should work for most, if not all, of the Java classes that Silk Test Classic can detect. If you are using the Open Agent, the equivalent of the setName method is the Name property of the AWTComponent class.

By contrast, custom controls often use native properties and native methods written in Java. Increasingly, custom controls also take the form of JavaBeans, which are reusable platform-independent software components written in Java. Developers frequently design custom controls to achieve functionality that is not available in standard class libraries. You can test custom Java objects, including JavaBeans, using the Silk Test Classic Java support.

The Silk Test Classic approach to testing custom Java objects is to give you direct access to their native methods and properties. A major advantage of this methodology is that it obviates the need to write your own native methods.

The procedure for testing custom Java objects is simple: Record a class for the custom control, then save the class definition in an include file. The class definition includes the native methods you can call and native properties you can verify from your 4Test script.

The predefined property sets supplied with Silk Test Classic have not been customized for Java; however, you can modify these property sets. For additional information about editing existing property sets or creating new property sets, see Creating a Property Set.

Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Related reference
Abstract Windowing Toolkit
Java Foundation Classes (JFC)
Standard Widget Toolkit (SWT)


Recording and Playing Back JFC Menus

For Sun JDK v1.4 or later, Silk Test Classic can record and play back regular menus that conform to the Windows standard, as well as JFC heavyweight and lightweight pop-up menus.

Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Related concepts
Configuring Silk Test Classic Java Support for the Sun JDK


Recording and Playing Back Java AWT Menus

Unlike JFC menus, AWT menus are not conform to the Java component-container paradigm. Therefore, their behavior is different than that of the JFC menus, and is independent of the JVM version. Silk Test Classic can record regular AWT menus for all versions of the JDK.

For context menus that are conform to the Windows standard, which means that they can be opened with a right-click, Silk Test Classic can play back, but not record, the context menus for all versions of the JDK.

For AWT popup menus that are not conform to the Windows standard, Silk Test Classic cannot record or play back for all versions of the JDK. The JavaAwtPopupMenu class is available for playback only. Silk Test Classic is not able to record it and you must hand script any interaction with such a menu.

Parent topic: Testing Java AWT/Swing Applications with the Open Agent


Object Recognition for Java AWT/Swing Applications

Java AWT/Swing applications support hierarchical object recognition and dynamic object recognition. You can create tests for both dynamic and hierarchical object recognition in your test environment. Use the method best suited to meet your test requirements.

When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations.

Using custom class attributes becomes even more powerful when it is used in combination with dynamic object recognition.

To test Java AWT/Swing applications using hierarchical object recognition, record a test for the application that you want to test. Then, replay the tests at your convenience.

Parent topic: Testing Java AWT/Swing Applications with the Open Agent


Agent Support for Java AWT/Swing Applications

You can test Java AWT/Swing applications using the Classic Agent or the Open Agent. When you create a new Java AWT/Swing project, Silk Test Classic uses the Open Agent by default. However, you can use both the Open Agent and the Classic Agent within a single Java AWT/Swing environment. Certain functions and methods run on the Classic Agent only. As a result, if you are running an Open Agent project, the Classic Agent may also open because a function or method requires the Classic Agent.

When you are using the Classic agent to test Java AWT/Swing applications, Silk Test Classic uses the Sun JDK by default.

  • Supported Controls for Java AWT/Swing Applications
    Describes the controls that are supported for Java AWT/Swing applications.
  • Java AWT and Swing Class Reference
    Lists the Visual Basic classes for Java AWT and Swing support.
Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Related concepts
Open Agent
Related reference
Differences in the Classes Supported by the Silk Test Agents


Supported Controls for Java AWT/Swing Applications

For a complete list of the record and replay controls available for Java AWT/Swing testing with the Open Agent, refer to the Java AWT and Swing Class Reference in the 4Test Language section of the Help.

For a complete list of the record and replay controls available for Java AWT/Swing testing with the Classic Agent, refer to the Java AWT Classes for the Classic Agent and the Java JFC Classes in the 4Test Language section of the Help.

Parent topic: Agent Support for Java AWT/Swing Applications


Java AWT and Swing Class Reference

When you configure a Java AWT/Swing application, Silk Test Classic automatically provides built-in support for testing standard Java AWT/Swing controls.

Parent topic: Agent Support for Java AWT/Swing Applications


Configuring a Test Application that Uses the Java Network Launching Protocol (JNLP)

This functionality is supported only if you are using the Open Agent.

Applications that start using the Java Network Launching Protocol (JNLP) require additional configuration in Silk Test Classic. Because these applications are started from the Web, you must manually configure the application configuration to start the actual application as well as the application that launches the "Web Start". Otherwise, the test will fail on playback unless the application is already running.

  1. Record a test case for the application that you want to test.
  2. In the INC file, replace the const sCmdLine = value with the command line pattern that includes the absolute path to javaws.exe and the URL to the Web Start.

    For example, to use the SwingSet3 JNLP application, type const sCmdLine = "%ProgramFiles%\Java\jre6\bin\javaws.exe http://download.java.net/javadesktop/swingset3/SwingSet3.jnlp"

    When you replay the test case, the JNLP application starts as expected.
Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Related concepts
Dynamic Object Recognition
Related tasks
Recording Test Cases for Standard and Web Applications
Recording Test Cases for Mobile Applications
Configuring Standard Applications


Locator Attributes for Java AWT/Swing Controls

This functionality is supported only if you are using the Open Agent.

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.

Silk Test Classic supports the following locator attributes for Java AWT/Swing controls:
  • caption
  • name
  • accessibleName
  • priorlabel (For controls that do not have a caption, the priorlabel is used as the caption automatically. For controls with a caption, it may be easier to use the caption.)
  • Swing only: All custom object definition attributes set in the widget with SetClientProperty("propertyName", "propertyValue").
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.
Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Related concepts
Dynamic Object Recognition
Determining the priorLabel in the Java AWT/Swing Technology Domain
Related tasks
Defining which Custom Locator Attributes to Use for Recognition


Dynamically Invoking Java Methods

This functionality is supported only if you are using the Open Agent.

You can call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose by using the dynamic invoke feature. This feature is useful for working with custom controls and for working with controls that Silk Test Classic supports without customization.

Call dynamic methods on objects with the DynamicInvoke method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList() method.

Call multiple dynamic methods on objects with the DynamicInvokeMethods method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.

Retrieve dynamic properties with the GetProperty method and set dynamic properties with the SetProperty() method. To retrieve a list of supported dynamic properties for a control, use the GetPropertyList() method.

Note: Typically, most properties are read-only and cannot be set.

Supported Methods and Properties

The following methods and properties can be called:
  • Methods and properties that Silk Test Classic supports for the control.
  • All public methods of the SWT, AWT, or Swing widget.
  • If the control is a custom control that is derived from a standard control, all methods and properties from the standard control can be called.

Supported Parameter Types

The following parameter types are supported:
All built-in Silk Test Classic types.
Silk Test Classic types includes primitive types (such as boolean, int, string), lists, and other types (such as Point and Rect).
Enum types.
Enum parameters must be passed as string. The string must match the name of an enum value. For example, if the method expects a parameter of the enum type, java.sql.ClientInfoStatus you can use the string values of REASON_UNKNOWN, REASON_UNKNOWN_PROPERTY, REASON_VALUE_INVALID, or REASON_VALUE_TRUNCATED.

Example

A custom calculator control has a Reset method and an Add method, which performs an addition of two numbers. You can use the following code to call the methods directly from your tests:
customControl.Invoke("Reset")
REAL sum = customControl.DynamicInvoke("Add",{1,2})
Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Parent topic: Testing Java SWT and Eclipse Applications with the Open Agent
Related concepts
Testing Java SWT and Eclipse Applications with the Open Agent
Dynamic Invoke


Determining the priorLabel in the Java AWT/Swing Technology Domain

This functionality is supported only if you are using the Open Agent.

To determine the priorLabel in the Java AWT/Swing technology domain, all labels and groups in the same window as the target control are considered. The decision is then made based upon the following criteria:
  • Only labels either above or to the left of the control, and groups surrounding the control, are considered as candidates for a priorLabel.
  • If a parent of the control is a JViewPort or a ScrollPane, the algorithm works as if the parent is the window that contains the control, and nothing outside is considered relevant.
  • In the simplest case, the label closest to the control is used as the priorLabel.
  • If two labels have the same distance to the control, and one is to the left and the other above the control, the left one is preferred.
  • If no label is eligible, the caption of the closest group is used.
Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Related concepts
Locator Attributes for Java AWT/Swing Controls


Supported Browsers for Testing Java Applets

Silk Test Classic supports the following browsers for testing Java applets:

  • For the Classic Agent: Internet Explorer 7 using the Java plug-in.
  • For the Open Agent: All supported versions of Internet Explorer and Mozilla Firefox.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Parent topic: Testing Java AWT/Swing Applications with the Open Agent


Overview of JavaScript Support

Silk Test Classic provides support for executing JavaScript code within a Web application. You can test applications that include JavaScript by performing one of the following tasks:

  • Configuring an xBrowser application that uses the Open Agent.
  • Enabling extensions for a generic application that uses the Classic Agent.

The type of agent that you use determines the classes that are available for you to create tests with.

As a best practice, we recommend using xBrowser rather than the Web application because xBrowser uses the Open Agent and dynamic object recognition.

We recommend recording test cases using dynamic object recognition. Then, replay the tests at your convenience.

JavaScript Support for the Open Agent

With the Open Agent, you can use ExecuteJavaScript to test anything that uses JavaScript. You can:

  • Call any function already contained in a document.
  • Inject new functions into a document and call them.
  • Trigger Document Object Model (DOM) events, such as calling onmouseover directly for an element.
  • Modify the DOM tree.

JavaScript Support for the Classic Agent

If you use the Classic Agent, you can test JavaScript using the following methods:

  • ExecLine
  • ExecMethod
  • ExecScript
Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Related concepts
Configuring Applications
Open Agent
Dynamic Object Recognition
Prerequisites for Testing Java Applications
Testing Java SWT and Eclipse Applications with the Open Agent


Oracle Forms Support

This functionality is supported only if you are using the Open Agent.

Silk Test Classic provides built-in support for testing applications that are based on Oracle Forms.

Note: For some controls, Silk Test Classic provides only low-level recording support.

For information on the supported versions and browsers for Oracle Forms, refer to the Release Notes.

  • Prerequisites for Testing Oracle Forms
    Lists the prerequisites for testing Oracle Forms
  • Attributes for Oracle Forms Applications
    Lists the attributes supported for applications that are based on Oracle Forms.
Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Related concepts
Does Silk Test Classic Support Oracle Forms?
Related reference
Java AWT and Swing Class Reference


Prerequisites for Testing Oracle Forms

To test an application that is built with Oracle Forms, the following prerequisites need to be fulfilled:
  • The next-generation Java Plug-In needs to be enabled. This setting is enabled by default. You can change the setting in the Java Control Panel. For additional information on the next-generation Java Plug-In, refer to the Java documentation.
  • To prevent Java security dialogs from displaying during a test run, the Applet needs to be signed.
  • Micro Focus recommends enabling the Names property. When this property is enabled, the Oracle Forms runtime exposes the internal name, which is the name that the developer of the control has specified for the control, as the Name property of the control. Otherwise, the Name property will hold a calculated value, which usually consists of the class name of the control plus an index. This enables Silk Test Classic to generate stable locators for controls.
Parent topic: Oracle Forms Support


Attributes for Oracle Forms Applications

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.

Supported attributes for Oracle Forms include:
  • priorlabel: Helps to identify text input fields by the text of its adjacent label field. Every input field of a form usually has a label that explains the purpose of the input. For controls that do not have a caption, the attribute priorlabel is automatically used in the locator. For the priorlabel value of a control, for example a text input field, the caption of the closest label at the left side or above the control is used.
  • name
  • accessibleName
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.
Parent topic: Oracle Forms Support


Classes in Object-Oriented Programming Languages

Classes are the core of object-oriented programming languages, such as Java. Applets or applications developed in Java are built around objects, which are reusable components of code that include methods and properties. Methods are tasks that can be performed on objects. Properties are characteristics of an object that you can access directly.

Each object is an instance of a class of objects. GUI objects in Java, for example, may belong to such classes as Menu, Dialog, and Checkbox. Each class defines the methods and properties for objects that are part of that class. For example, the JavaAwtCheckBox class defines the methods and properties for all Java Abstract Windowing Toolkit check boxes. The methods and properties defined for JavaAwtCheckboxes work only on these check boxes, not on other Java objects.

Parent topic: Testing Java AWT/Swing Applications with the Open Agent
Related concepts
Frequently Asked Questions About Testing Java Applications
Related reference
Abstract Windowing Toolkit


Configuring Silk Test Classic to Test Java

This section describes how to configure Silk Test Classic to test Java applications.

  • Prerequisites for Testing Java Applications
    Describes the required prerequisites to test Java applications.
  • Enabling Java Support
    Describes how you can enable Java support.
  • Configuring Silk Test Classic Java Support for the Sun JDK
    Describes how Silk Test Classic supports the Sun JDK.
  • Java Security Privileges Required by Silk Test Classic
    Describes the Java security privileges that are required to load the Silk Test Classic Java support files.
Parent topic: Testing Java AWT/Swing Applications with the Open Agent


Prerequisites for Testing Java Applications

To test… | Install…
standalone Java applications | JDK/JRE
Java applets | JDK, supported browser, and plug-in (if necessary)
Java applets using the Java Applet Viewer | JDK and plug-in
Note:
  • When you are using the Classic Agent, Java support is configured automatically when you use Enable Extensions in the Basic Workflow bar.
  • When you are using the Open Agent, Java support is configured automatically when you use Configure Applications in the Basic Workflow bar.
  • You can use the Basic Workflow bar to configure your application or applet or manually configure Java Support. If you choose to manually configure Java support, you may need to change the CLASSPATH environment variable. For JVM/JRE 1.2 or later, you must also copy the applicable Silk Test Classic .jar file to the lib\ext folder of your JVM/JRE.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Parent topic: Configuring Silk Test Classic to Test Java


Enabling Java Support

There are several ways to enable Java support for testing standalone Java applications. Pick the scenario that fits your runtime environment and testing needs.

Scenario | How to enable Java support

You need to test your application on the 32-bit Windows host machine using a JVM that is invoked from a java.exe, jre.exe, jrew.exe, or vcafe.exe executable, including:

  • JDK/JRE
  • Symantec Visual Café (only if you are using the Classic Agent)
Enable the default Java application.
You need to test your application on a remote 32-bit Windows machine using a JVM that is invoked from ajava.exe, jre.exe, jrew.exe, or vcafe.exe executable. | Install Silk Test Classic on your remote machine and enable the default Java application on your host machine.
You need to test your application on the 32-bit Windows host machine using a JVM that is not invoked from a java.exe, jre.exe, jrew.exe, or vcafe.exe executable. | Enable a new Java application.
You need to test your application on a remote 32-bit Windows machine using a JVM that is not invoked from a java.exe, jre.exe, jrew.exe, or vcafe.exe executable. | Install Silk Test Classic on your target machine and enable a new Java application.
Parent topic: Configuring Silk Test Classic to Test Java
Related concepts
Configuring Applications
Testing Java Applications and Applets


Configuring Silk Test Classic Java Support for the Sun JDK

When you are using the Classic Agent, Java support is configured automatically when you use Enable Extensions in the Basic Workflow bar. When you are using the Open Agent, Java support is configured automatically when you use Configure Applications in the Basic Workflow bar. We recommend that you use the basic workflow bar to configure your application or applet, but it is also possible to manually configure Java support.

If you incorrectly alter files that are part of the JVM extension, such as the accessibility.properties file, in the Java\lib folder, or any of the files in the jre\lib\ext directory, such as SilkTest_Java3.jar, unpredictable behavior may occur. There are two methods for configuring Silk Test Classic Java Support:
  • Manually configuring Silk Test Classic Java support.
  • Configuring Standalone Java Applications and Java Applets.
  • Manually Configuring Silk Test Classic Java Support
    Describes how you can manually configure Silk Test Classic to support the Sun JDK.
  • Configuring Standalone Java Applications and Java Applets
    Configure standalone Java applications and Java Applets to recognize Java controls.
Parent topic: Configuring Silk Test Classic to Test Java
Related reference
Basic Workflow for the Open Agent


Manually Configuring Silk Test Classic Java Support

If you want to enable Java support manually, or if the Basic Workflow does not support your configuration, perform the following tasks:
If you are using the Classic Agent
Click Options > Extensions to open the Extensions dialog box and enable Java applet or application support by checking or un-checking the Java check box for your application. The Java check box can be checked or un-checked for a specific application or applet. If you check or un-check this check box for one extension, it is checked or un-checked for all.
If you are using the Open Agent
Click Options > Application Configurations to open the Edit Application Configuration and add a standard test configuration for your Java application.
Parent topic: Configuring Silk Test Classic Java Support for the Sun JDK
Related tasks
Configuring Standard Applications


Configuring Standalone Java Applications and Java Applets

In order for Silk Test Classic to recognize Java controls, you may need to change the CLASSPATH environment variable. For JVM/JRE 1.3 or later, you must also copy the applicable SilkTest.jar file to the lib\ext folder of your JVM/JRE. The SilkTest.jar file is located in the <SilkTest Install Directory>\JavaEx directory.

  1. If you are using JVM/JRE 1.3 or later, use SilkTest_Java3.jar. For information about new features, supported platforms, and tested versions, refer to the Release Notes.
  2. For Java 1.3 or later, you should not set a specific classpath variable – instead, use the default CLASSPATH=.;. Copy the SilkTest_Java3.jar file to the lib\ext folder of your JVM/JRE, and remove any previous Silk Test Classic JAR files.
  3. In the Silk Test Classic folder, rename the file access3.prop to accessibility.properties and copy it to the Java…\lib folder.
  4. Finally, qapjconn.dll and qapjarex.dll are new DLL files that must be installed in the Windows\System32 directory. The Silk Test Classic installer places these files in the Windows\System32 folder, and also places copies of these files in the SilkTest\Extend folder. If the default directory for your library files is in a location other than Windows\System32, you must also copy qapjconn.dll and qapjarex.dll to the alternate location.
Note:
  • The Java recorder does not support applets for embedded Internet Explorer browsers(AOL).
  • It is not possible, using normal configuration methods, to gain recognition of Java applications that use .ini files to set the environment. However, if your application sets the Java library path using the JVM launcher directive Djava.library.path=< path >, you can obtain full recognition by copying qapjarex.dll and qapjconn.dll from the System32 directory into the location pointed to by the JVM launcher directive.
Parent topic: Configuring Silk Test Classic Java Support for the Sun JDK


Java Security Privileges Required by Silk Test Classic

Before reviewing your security privileges, make sure that you have configured Silk Test Classic Java support.

Required security privileges

In order to load the Silk Test Classic Java support files, Silk Test Classic must have the appropriate Java security privileges. At a minimum, Silk Test Classic requires the following abilities:
  • Create a new thread.
  • Access members of classes loaded by your application.
  • Create, read from, and write to file on a local drive.
  • Access, connect, listen and send information through sockets.
  • Access AWT event queue.
  • Access system properties.
For standalone applications, the security policy is set in the java.security file which is located in JRE/lib/security. By default this file contains the following line:
Policy.provider = sun.security.provider.PolicyFile
which means that the standard policy file should be used. The standard policy file, java.policy, is located in the same folder, JRE/lib/security. It contains the following code that gives all necessary permission to any file located in lib\ext directory:
// Standard extensions get all permissions by default
grant codeBase "file:${java.home}/lib/ext/*"{permission java.security.AllPermission;};

Silk Test Classic has the necessary privileges, if the SilkTest_Java3.jar file is in this directory and the JVM runs with the default set of security permissions.

If you have changed the Java security policy

The system administrator can change security policy by starting the JVM with the following option:
java _Djava.security.policy=Myown.policy MyApp
In this case the custom policy file Myown.policy should contain the following lines that grant all permission to classes from the lib\ext directory:
grant codeBase "file:${java.home}/lib/ext/*"{permission java.security.AllPermission;};

The default java.policy may also be changed implicitly, for example, when the application uses an RMI server with the custom RMISecurityManager and the client security policy. In cases like these, the client security policy should grant all required permissions to Silk Test Classic by including the code listed above.

In some cases, setting these permissions may not provide Silk Test Classic with the necessary security privileges. The cause of the problem may be that permissions are frame specific. So if Silk Test Classic runs in the context of frames (thread) in which it does not have the necessary permissions, it may fail. In cases like this in which the client does not trust code running in the context of the AWT event thread, you need to set the parameter ThreadSafe=False in the javaex.ini in the <Silk Test installation>/extend directory. This prevents the Silk Test Classic Java code from running in the context of the AWT event thread, preserving permissions granted to Silk Test Classic, but could make the GUI less responsive.

Parent topic: Configuring Silk Test Classic to Test Java
Related concepts
What Can I Do If Java Controls In an Applet Are Not Recognized?


Testing Java Applications and Applets

Silk Test Classic supports testing Java applications that use the Sun JDK. By default, Silk Test Classic uses the Sun JDK with the Classic Agent.

  • Preparing for Testing Stand-Alone Java Applications and Applets
    Enable extensions to prepare for testing Java applications and applets.
  • Indexed Values in Test Scripts
    Describes the incompatible indexing schemes in 4Test methods and native Java methods.
  • When to Use 4Test Versus Native Java Controls
    Describes when you should use 4Test versus native Java controls.
  • Predefined Class Definition File for Java
    Describes the predefined class definition file which you can use to quickly get started with testing your Java applications.
  • Troubleshooting Java Applications
    Help and troubleshooting information for working with Java applications.
  • Supported Java Classes
    Describes the classes that are supported for testing Java applications.
  • Invoking Java Applications and Applets
    Describes how you can invoke Java applications and applets.
  • Accessing Java Objects and Methods
    Describes how you can access Java objects and methods.
Parent topic: Testing Java AWT/Swing Applications with the Open Agent


Preparing for Testing Stand-Alone Java Applications and Applets

To prepare for testing stand-alone Java applications using Silk Test Classic:
  1. In the Basic Workflow bar:
    • If you are using the Classic Agent, enable extensions for Java support for application and applet testing.
    • If you are using the Open Agent, configure your Java application.
  2. If you do not plan to test applets during the session, disable browser support.
  3. Identify the custom controls in your Java application.
  4. If you are testing Java applications with the Classic Agent, enable the recovery system.
  5. Record classes for any custom controls you want to test in a new class include file or in your test frame file. If Silk Test Classic does not recognize some of your custom objects, see Recording Classes for Ignored Java Objects.
  6. If you are testing standalone Java applications with the Classic Agent, record window declarations for your Java application, including declarations for any new classes you defined.
Parent topic: Testing Java Applications and Applets
Related concepts
Configuring Applications
Prerequisites for Testing Java Applications


Indexed Values in Test Scripts

4Test methods use a 1-based indexing scheme, where the first indexed value is stored in position 1. Native Java methods use a 0-based indexing scheme, where the first indexed value is stored in position 0. This incompatibility can create challenges in coding test scripts that access indexed values using both native methods and 4Test methods.

Parent topic: Testing Java Applications and Applets


When to Use 4Test Versus Native Java Controls

Silk Test Classic provides a predefined set of Java classes, including Abstract Windowing Toolkit (AWT) controls, Java Foundation Class (JFC) controls, and Symantec Visual Café controls. To test these controls, you can use their inherited 4Test methods. Inherited methods are the 4Test methods associated with the class from which the control is derived.

For custom Java controls, we provide access to native Java methods, as defined in JDK 1.1.2 or later. You can also access native methods for predefined Java classes.

When both 4Test methods and native methods are available for all controls you want to test, we recommend using 4Test methods in your test scripts. 4Test provides a richer, more efficient set of methods that more closely mirror user interaction with the GUI elements of an application. For the JavaAwtPushButton, for example, use the 4Test methods associated with the PushButton class.

When you must use native methods for controls that are not supported in 4Test, refer to the Java API documentation to gain a full understanding of how the native method works. For example, 4Test methods and native Java methods use incompatible array indexing schemes so you must use caution when accessing indexed values.

Note: We recommend not to mix 4Test and native methods because of incompatibilities between Java and 4Test.
Parent topic: Testing Java Applications and Applets
Related reference
Abstract Windowing Toolkit
Java Foundation Classes (JFC)


Predefined Class Definition File for Java

The file javaex.inc includes 4Test class definitions for the following controls:

  • Abstract Windowing Toolkit (AWT) controls
  • Java Foundation Class (JFC) library controls
  • Symantec Visual Café Itools controls
  • Java-equivalent window controls

We provide these class definitions to help you quickly get started with testing your Java applications. You can record additional classes if you determine that additional controls are necessary to test your application.

The file javaex.inc is installed in the Extend subdirectory under the directory where you installed Silk Test Classic.

Parent topic: Testing Java Applications and Applets
Related concepts
Supported Java Classes


Troubleshooting Java Applications

This section provides solutions for common reasons that might lead to a failure of the test of your standalone Java application or applet. If these do not solve the specific problem that you are having, you can enable your extension manually.

The test of your standalone Java application or applet may fail if the application or applet was not ready to test, the Java plug-in was not enabled properly, if there is a Java recognition issue, or if the Java applet does not contain any Java controls within the JavaMainWin.

  • What Can I Do If the Silk Test Java File Is Not Included in a Plug-In?
    If the SilkTest_Java3.jar file is not included in the lib/ext directory of the plug-in that you are using, copy the file from the Silk Test installation directory into the plug-in.
  • What Can I Do If Java Controls In an Applet Are Not Recognized?
    If Silk Test Classic cannot recognize any Java children within the applet that you are testing, map all custom classes to standard classes and set the Java security privileges that are required by Silk Test Classic.
Parent topic: Testing Java Applications and Applets
Parent topic: Troubleshooting the Open Agent


What Can I Do If the Silk Test Java File Is Not Included in a Plug-In?

If the SilkTest_Java3.jar file is not included in the lib/ext directory of the plug-in that you are using:
  1. Locate the lib/ext directory of the plug-in that you are using and check if the SilkTest_Java3.jar file is included in this folder.
  2. If the SilkTest_Java3.jar file is not included in the folder, copy the file from the javaex folder of the Silk Test installation directory into thelib\ext directory of the plug-in.
Parent topic: Troubleshooting Java Applications


What Can I Do If Java Controls In an Applet Are Not Recognized?

Silk Test Classic cannot recognize any Java children within an applet if your applet contains only custom classes, which are Java classes that are not recognized by default, for example a frame containing only an image. For information about mapping custom classes to standard classes, see Mapping Custom Classes to Standard Classes. Additionally, you have to set the Java security privileges that are required by Silk Test Classic.

Parent topic: Troubleshooting Java Applications
Related concepts
Java Security Privileges Required by Silk Test Classic


Supported Java Classes

We provide 4Test definitions in our class definition file for the following Java classes:

  • Abstract Windowing Toolkit (AWT) classes
  • Java Foundation Class (JFC) library classes
  • Symantec Visual Café Itools classes (only for the Classic Agent)
  • Java-equivalent window classes

Each of these predefined classes inherits 4Test properties and methods, which are referenced in the class descriptions in this Help. Not all inherited methods have been implemented for Java controls.

You can also access the native methods of the supported classes by removing the 4Test definition and re-recording the class.

The only assumption that the Java extension makes about the implementation of the Java classes in an AUT is that the classes do not violate the standard Swing or AWT models. The Java extension should be able to recognize and manipulate a Java class in an application, as long as the class extends one of the components that the Java extension supports, and any customization does not violate the API of that component. For example, changing a method from public to private violates the API of the component.

  • Predefined Java-Equivalent Window Classes
    Lists the predefined Java-equivalent window classes.
  • Predefined AWT Classes
    Lists the predefined AWT classes.
  • Predefined JFC Classes
    Lists the predefined JFC classes.
Parent topic: Testing Java Applications and Applets
Related reference
Differences in the Classes Supported by the Silk Test Agents


Predefined Java-Equivalent Window Classes

The following 4Test classes are provided for testing Java-equivalent window controls:
Classic Agent | Open Agent
JavaApplet | AppletContainer
JavaDialogBox | AWTDialog JDialog
JavaMainWin | AWTFrame JFrame
Parent topic: Supported Java Classes


Predefined AWT Classes

The following 4Test classes are provided for testing Abstract Windowing Toolkit (AWT) controls:
Classic Agent | Open Agent
JavaAwtCheckBox | AWTCheckBox
JavaAwtListBox | AWTList
JavaAwtPopupList | AWTChoice
JavaAwtPopupMenu | No corresponding class.
JavaAwtPushButton | AWTPushButton
JavaAwtRadioButton | AWTRadioButton
JavaAwtRadioList | No corresponding class.
JavaAwtScrollBar | AWTScrollBar
JavaAwtStaticText | AWTLabel
JavaAwtTextField | AWTTextField AWTTextArea
Parent topic: Supported Java Classes
Related reference
Abstract Windowing Toolkit


Predefined JFC Classes

The following 4Test classes are provided for testing Java Foundation Class (JFC) controls:
Classic Agent | Open Agent
JavaJFCCheckBox | JCheckBox
JavaJFCCheckBoxMenuItem | JCheckBoxMenuItem
JavaJFCChildWin | No corresponding class.
JavaJFCComboBox | JComboBox
JavaJFCImage | No corresponding class.
JavaJFCListBox | JList
JavaJFCMenu | JMenu
JavaJFCMenuItem | JMenuItem
JavaJFCPageList | JTabbedPane
JavaJFCPopupList | JList
JavaJFCPopupMenu | JPopupMenu
JavaJFCProgressBar | JProgressBar
JavaJFCPushButton | JButton
JavaJFCRadioButton | JRadioButton
JavaJFCRadioButtonMenuItem | JRadioButtonMenuItem
JavaJFCRadioList | No corresponding class.
JavaJFCScale | JSlider
JavaJFCScrollBar | JScrollBar JHorizontalScrollBar JVerticalScrollBar
JavaJFCSeparator | JComponent
JavaJFCStaticText | JLabel
JavaJFCTable | JTable
JavaJFCTextField | JTextField JTextArea
JavaJFCToggleButton | JToggleButton
JavaJFCToolBar | JToolBar
JavaJFCTreeView | JTree
JavaJFCUpDown | JSpinner
Parent topic: Supported Java Classes
Related reference
Java Foundation Classes (JFC)


Invoking Java Applications and Applets

This section describes how you can invoke Java applications and applets.

  • Invoking Java Applets
    Describes how you can invoke Java applets.
  • Invoking JRE Applications
    Describes how you can invoke JRE applications.
  • Invoking JRE Applications Using -classpath
    Describes how you can invoke JRE applications using -classpath.
  • invokeMethods Example: Draw a Line in a Text Field
    Describes how you can draw a line in a multiline text field.
Parent topic: Testing Java Applications and Applets


Invoking Java Applets

To invoke the Java applet from within a supported browser, perform the following tasks:
  • If you are using the Classic Agent, configure Silk Test Classic for Java support and enable the Java extension.
  • If you are using the Open Agent, configure the application.
Parent topic: Invoking Java Applications and Applets
Related concepts
Configuring Silk Test Classic Java Support for the Sun JDK


Invoking JRE Applications

Once you set CLASSPATH for testing standalone Java applications, you are ready to invoke your application using the Java Runtime Environment (JRE).

Note: The JRE ignores the CLASSPATH environment variable. As a result, you must invoke JRE applications with command line arguments to pick up the value of CLASSPATH.

The following table describes the commands you can use:

Command | Description
-cp | Searches first through directories and files specified, then through standard JRE directories.
-classpath | Ignores the value of your CLASSPATH environment variable. You must specify a complete search path on the command line. Does not search the standard JRE directories.

To invoke JRE applications using -cp

Enter the following command:
jre -cp %CLASSPATH%;<other directories, if any> <name of application>

Example

Assuming your CLASSPATH is set to the complete search path including the Java support path, you would launch the application MyJREapp by entering:
jre -cp %CLASSPATH% MyJREapp
Parent topic: Invoking Java Applications and Applets
Related concepts
Configuring Silk Test Classic Java Support for the Sun JDK


Invoking JRE Applications Using -classpath

To invoke JRE applications using –classpath, enter the following command:
jre -classpath <Java support path>;<other directories, if any>

Example

Assuming you installed Silk Test Classic in the default directory c:\Program Files\Silk\SilkTest, you are using JRE 1.1.5 as your Java Virtual Machine (JVM), and your CLASSPATH contains only the Java support path, you would launch the application MyJREapp by entering:
Java -classpath c:\Progra~1\Silk\SilkTest\JavaEx\SilkTest_Java3.jar MyJREapp
Parent topic: Invoking Java Applications and Applets
Related concepts
Configuring Silk Test Classic Java Support for the Sun JDK


invokeMethods Example: Draw a Line in a Text Field

To draw a line in a multiline text field, you need to access a graphics object inside the text field by calling the following methods in Java:
main()
{
  TextField multiLine = ...; // get reference to multiline text field
  Graphics graphObj = multiLine.getGraphics();
  graphObj.drawLine(10, 10, 20, 20);
}
However, you cannot call the above sequence of methods from 4Test because Graphics is not 4Test-compatible. Instead, you can insert the invokeMethods prototype in the TextField class declaration, then add invokeMethods by hand to your test script to draw a line in the Graphics object nested inside the multiline text field, as shown in this 4Test function:
DrawLineInTextField()
MyDialog.Invoke() // Invoke Java dialog that contains the text field
MyDialog.TheTextField.invokeMethods ({"getGraphics", "drawLine"}, {{}, {10, 10, 20, 20}})

In this code, the following methods are called in Java:

  • getGraphics is invoked on the multiline text field TheTextField with an empty argument list, returning a Graphics object.
  • drawLine is invoked on the Graphics object, to draw a line starting from (x,y) coordinates (10,10) and continuing to (x,y) coordinates (20,20).
Parent topic: Invoking Java Applications and Applets


Accessing Java Objects and Methods

This section describes how you can access Java objects and methods.

  • Accessing Nested Java Objects
  • Calling Nested Methods
    Describes nested methods when you cannot retrieve 4Test-compatible information about a Java control with a single call to a 4Test method.
  • Testing Java Scroll Panes
    Describes how you can test Java scroll panes.
Parent topic: Testing Java Applications and Applets


Accessing Nested Java Objects

Sometimes you cannot retrieve 4Test-compatible information about a Java control with a single call to a 4Test method; instead, you need to call several nested methods, each returning an intermediate object to be passed to the next method. If any of these methods returns intermediate results that are not 4Test-compatible, you will not be able to perform these nested calls from 4Test.

You can use the following methods to access nested Java objects:

Method | Agent | What it does
InvokeJava | Classic Agent | This method allows you to invoke a Java class from 4Test for manipulating a nested Java object.
invokeMethods | Classic Agent Open Agent | Allows you to perform nested calls inside Java, even if intermediate results are not 4Test-compatible.You can call invokeMethods for any Java object as long as you add the invokeMethods prototype inside the object's class declaration.
Parent topic: Accessing Java Objects and Methods
Related concepts
invokeMethods Example: Draw a Line in a Text Field


Calling Nested Methods

Sometimes you cannot retrieve 4Test-compatible information about a Java control with a single call to a 4Test method; instead, you need to call several nested methods, each returning an intermediate object to be passed to the next method. If any of these methods returns intermediate results that are not 4Test-compatible, you will not be able to perform these nested calls from 4Test.

You can use the following methods to call nested methods:
Method | Agent | What it does
InvokeJava | Classic Agent | This method allows you to invoke a Java class from 4Test for manipulating a nested Java object.
invokeMethods | Classic Agent Open Agent | Allows you to perform nested calls inside Java, even if intermediate results are not 4Test-compatible.You can call invokeMethods for any Java object as long as you add the invokeMethods prototype inside the object's class declaration.

Example: How to add an invokeMethods prototype to your script

This example shows how to add an invokeMethods prototype inside the declaration for a JavaAwtListBox in javaex.inc.
winclass JavaAwtListBox : ListBox
  tag "[JavaAwtListBox]"

  setting MultiTags = {TAG_CAPTION}

  obj AnyType invokeMethods(list of Strings stra, List of List of Anytype anyaa)
Parent topic: Accessing Java Objects and Methods
Related reference
4Test-Compatible Information or Methods


Testing Java Scroll Panes

A scroll pane in Java is a container that holds a single child component. If the scroll pane is smaller than the child component, you can scroll vertically and horizontally to see all parts of that component.

The state of the scroll bars in a scroll pane is managed by internal objects that implement the Adjustable interface. To manipulate the scroll bars, you must first get an Adjustable object, and then use Adjustable and scroll bar methods to move them.

To test scroll bars in a scroll pane, use invokeMethods, a method that allows you to perform nested calls inside Java to access Adjustable objects.

Parent topic: Accessing Java Objects and Methods


Frequently Asked Questions About Testing Java Applications

This section provides answers to frequently asked questions about classpath and testing Java applications and applets.

  • Can I Invoke Java Code from 4Test Scripts?
    Describes how you can invoke Java code from a 4Test script.
  • Can I Test JavaScript Objects?
    Describes how you can test JavaScript objects.
  • Can I test JDeveloper and JBuilder with Silk Test Classic?
    Describes how you can test JDeveloper and JBuilder with Silk Test Classic.
  • Can I Use the Java Plug-In to Test Applets Outside My Browsers Native JVM?
    Describes whether you can use the Java plug-in to run applets outside the native JVM of your browser.
  • How Can I Record AWT Menus?
    Describes how you can record AWT menus.
  • How Do I Decide Whether to Use 4Test Methods or Native Methods?
    Describes how you can decide to use 4Test methods or native Java methods.
  • Why Do I See so Many Java CustomWin Objects?
    Describes how Silk Test Classic recognizes objects that do not belong to any of the predefined Java classes.
  • Why Do I Need to Disable the Classpath if I have Java Installed but Am not Testing It?
    Describes why you need to disable the classpath when you have Java installed and you are not testing Java.
Parent topic: Testing Java AWT/Swing Applications with the Open Agent


Can I Invoke Java Code from 4Test Scripts?

  • If you are using the Classic Agent, you can invoke Java code from 4Test scripts using the method InvokeJava.
  • You can invoke Java code from 4Test scripts using the method invokeMethods, for both the Classic Agent and the Open Agent.
Parent topic: Frequently Asked Questions About Testing Java Applications
Related concepts
Configuring Silk Test Classic Java Support for the Sun JDK


Can I Test JavaScript Objects?

With the Classic Agent, you can use InvokeJava to access methods for testing JavaScript objects, if these objects reside on a Web page that contains an applet.

With the Open Agent, you can use ExecuteJavaScript to test anything that uses JavaScript.

Parent topic: Frequently Asked Questions About Testing Java Applications
Related concepts
Configuring Silk Test Classic Java Support for the Sun JDK


Can I test JDeveloper and JBuilder with Silk Test Classic?

When using the Open Agent, Silk Test Classic supports test JDeveloper and JBuilder out of the box, just like any other supported Java AWT/Swing application.
Parent topic: Frequently Asked Questions About Testing Java Applications


Can I Use the Java Plug-In to Test Applets Outside My Browsers Native JVM?

For testing purposes, you can use the Java plug-in to run applets outside the native Java virtual machine of your browser.

Parent topic: Frequently Asked Questions About Testing Java Applications
Related concepts
Configuring Silk Test Classic Java Support for the Sun JDK


How Can I Record AWT Menus?

You cannot use the JavaAwtPopupMenu class to record AWT menus. It is available for playback only. You must manually script any interaction with AWT menus.

Parent topic: Frequently Asked Questions About Testing Java Applications


How Do I Decide Whether to Use 4Test Methods or Native Methods?

For information on when to use 4Test methods or native methods, see When to Use 4Test Versus Native Java Controls.

Parent topic: Frequently Asked Questions About Testing Java Applications
Related concepts
When to Use 4Test Versus Native Java Controls
Indexed Values in Test Scripts
Configuring Silk Test Classic Java Support for the Sun JDK


Why Do I See so Many Java CustomWin Objects?

Objects that do not belong to any of our predefined Java classes are custom controls, which are identified as CustomWin objects by Silk Test Classic. Most Java applications and applets use many custom controls to fine tune functionality and the user interface.

To manipulate a custom Java object for testing, you do not need to write your own extensions. Instead, you can use the object's own native methods and properties. Our Java support lets you access native methods and properties, by recording classes for custom controls.

Parent topic: Frequently Asked Questions About Testing Java Applications
Related concepts
Supported Java Classes
Configuring Silk Test Classic Java Support for the Sun JDK


Why Do I Need to Disable the Classpath if I have Java Installed but Am not Testing It?

If you are not testing Java but do have Java installed, we recommend that you disable the classpath before using Silk Test Classic. If you do not disable the classpath, Silk Test Classic checks for a Java classpath every time you run a test plan. To disable the classpath during the Silk Test Classic installation, select None on the Java dialog box. To verify that you have disabled the classpath, verify that the path to the Java extension is disabled in the Java variable, which is stored in the system variables.

For example, to verify that the path to the Java extension is disabled on Microsoft Windows 7, perform the following steps:
  1. Click Start > Control Panel.
  2. In the Control Panel, click System and Security.
  3. In the System and Security pane, click System.
  4. In the System pane, click Advanced System Settings.
  5. In the System Properties dialog box, click Environment Variables.
  6. In the System variables area of the Environment Variables dialog box, select the Java variable.
  7. Disable the path to the Java extension, by placing an underscore at the beginning of the path.
Parent topic: Frequently Asked Questions About Testing Java Applications
Related concepts
Configuring Silk Test Classic Java Support for the Sun JDK


Testing Java SWT and Eclipse Applications with the Open Agent

Silk Test Classic provides built-in support using the Basic Workflow for testing applications that use widgets from the Standard Widget Toolkit (SWT) controls. When you configure a Java SWT/RCP application, Silk Test Classic automatically provides support for testing standard Java SWT/RCP controls.

Silk Test Classic supports:
  • Testing Java SWT controls embedded in Java AWT/Swing applications as well as Java AWT/Swing controls embedded in Java SWT applications.
  • Standalone SWT applications that use the EXT or CLASSPATH configuration.
  • Testing Java SWT applications that use the IBM JDK or the Sun JDK.
  • Any Eclipse-based application that uses SWT widgets for rendering. Silk Test Classic supports both Eclipse IDE-based applications and RCP-based applications.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Java SWT applications support dynamic object recognition. When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations.

Existing test cases that use dynamic object recognition without locator keywords in an INC file will continue to be supported. You can replay these tests, but you cannot record new tests with dynamic object recognition without locator keywords in an INC file.

Using custom class attributes becomes even more powerful when it is used in combination with dynamic object recognition.

For a complete list of the widgets available for SWT testing, see Supported SWT Widgets for the Open Agent.

For a complete list of the record and replay controls available for Java SWT testing, view the SWT.inc and JavaSWT.inc file. To access the JavaSWT.inc file that is used with the Open Agent, navigate to the <SilkTest directory>\extend\JavaSWT directory. By default, this file is located in C:\Program Files\Silk\SilkTest\extend\JavaSWT\JavaSWT.inc. To access the SWT.inc file, navigate to the <SilkTest directory>\extend\ directory. By default, this file is located in C:\Program Files\Silk\SilkTest\extend\SWT.inc.

  • Suppressing Controls (Open Agent)
    Suppress controls to ignore them during recording and playback.
  • Custom Attributes
    Describes custom attributes that you can add to test applications.
  • Locator Attributes for Java SWT Controls
    Describes the locator attributes that are supported for identifying Java SWT controls.
  • Dynamically Invoking Java Methods
    Describes how you can use the dynamic invoke feature to call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose.
  • Supported SWT Widgets for the Open Agent
    Lists the Java SWT/RCP widgets that Silk Test Classic supports with the Open Agent and their related 4Test classes.
  • Java SWT Classes for the Open Agent
    Includes classes for Java SWT used by the Open Agent
  • Troubleshooting Java SWT and Eclipse Applications
    Provides useful information on handling potential difficulties when testing Silverlight applications.
Parent topic: Testing in Your Environment with the Open Agent
Related concepts
Dynamic Object Recognition
Configuring Applications
Related tasks
Recording Test Cases for Standard and Web Applications
Related reference
Basic Workflow for the Open Agent


Locator Attributes for Java SWT Controls

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.

Silk Test Classic supports the following locator attributes for Java SWT controls:
  • caption
  • all custom object definition attributes
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.
Parent topic: Testing Java SWT and Eclipse Applications with the Open Agent
Related concepts
Dynamic Object Recognition
Related tasks
Defining which Custom Locator Attributes to Use for Recognition


Supported SWT Widgets for the Open Agent

When you configure a Java SWT/RCP application, Silk Test Classic automatically provides built-in support for testing standard Java SWT/RCP controls.

The following table lists the Java SWT/RCP widgets that Silk Test Classic supports with the Open Agent and their related 4Test classes:

Widget Name | Related 4Test Classes
Browser | SWTBrowser
CBanner | CBanner
CoolBar | CoolBar
CoolItem | CoolItem
CTabFolder | CTabFolder
CTabItem | CTabItem
DateTime | SWTDateTime
ExpandBar | ExpandBar
ExpandItem | ExpandItem
Sash
  • HorizontalSash
  • Sash
  • VerticalSash
SashForm | SashForm
ScrollableControl | ScrollableControl
ScrolledComposite | ScrolledComposite
Shell | Shell
Spinner | Spinner
StyledText | StyledText
TabControl | SWTTabControl
TabItem | SWTTabItem
Table | SWTTable
TableColumn | SWTTableColumn
TableRow | SWTTableRow
Tree | SWTTree
TreeColumn | SWTTreeColumn
ViewForm | ViewForm

You can also view a list of the supported Java SWT/RCP controls in the JavaSWT.inc file. To access the file, navigate to the <Silk Test Classic directory>\extend\JavaSWT directory. By default, this file is located in C:\Program Files\Silk Test Classic\Silk Test Classic\extend\JavaSWT\JavaSWT.inc.

For additional information about the controls, refer to the Eclipse Platform Plug-in Developer Guide.

Note: Any known problems with SWT controls can be reproduced in Silk Test Classic.
Parent topic: Testing Java SWT and Eclipse Applications with the Open Agent
Related reference
Java SWT Classes for the Open Agent


Java SWT Classes for the Open Agent

  • CBanner Class
    CBanner is the class used to layout the toolbar area and perspective switching toolbar in the workbench.
  • CheckBoxToolItem Class
    The class for a check box element in a toolbar control.
  • CoolBar Class
    The container class that contains SWT widgets, primarily toolbars.
  • CoolItem Class
    The class that contains selectable user interface objects that represent the areas of a CoolBar that can be dynamically positioned.
  • CTabFolder Class
    The class for an enhanced tab folder, typically having decorated tabs and the minimize, maximize, and close buttons.
  • CTabItem Class
    The class for an enhanced tab within a CTabFolder.
  • DropDownToolItem Class
    The class for drop-down element in a toolbar control.
  • ExpandBar Class
    The class for widgets that expand and close by clicking on a header.
  • ExpandItem Class
    The class that contains the expandable items in an ExpandBar.
  • Group Class
    Group is the class used to combine controls to give the user visual hints that those controls belong together.
  • HorizontalSash Class
    The class for the horizontal border around a window pane that can be dragged to adjust the window size.
  • Item Class
    The class for abstract base classes, such as RadioListToolItem.
  • Link Class
    Link is the class that opens the topic location referenced in the source.
  • PushToolItem Class
    The class for a pushbutton element in a toolbar control.
  • RadioListToolItem Class
    RadioListToolItem is the class for a radio button element in a toolbar control.
  • Sash Class
    The class for the border around a window pane that can be dragged to adjust the window size.
  • SashForm Class
    The class for the border around a form that can be dragged to adjust the size of the form.
  • ScrollableControl Class
    The class for controls that are scrollable.
  • ScrolledComposite Class
    The class for scrollbars and scrolls the content when the user uses the scrollbars.
  • Shell Class
    The class for windows that the desktop or window manager is managing.
  • Spinner Class
    The class to enter and modify numeric values for up/down controls.
  • StyledText Class
    The class for an editable user interface object that displays lines of text.
  • SWTBrowser Class
    The class for the browser widget.
  • SWTDateTime Class
    The class for SWT date and time elements in a calendar, date, or time control.
  • SWTTabControl Class
    The class for tab controls in an SWT multi-page dialog.
  • SWTTabItem Class
    The class for an enhanced tab within a SWTTabControl.
  • SWTTable Class
    The class for SWT tables.
  • SWTTableColumn Class
    The class for columns in an SWT table.
  • SWTTableRow Class
    The class for rows in an SWT table.
  • SWTTree Class
    The class for SWT tree-widgets.
  • SWTTreeColumn Class
    The class for columns in a tree widget.
  • ToggleButton Class
    The class for buttons that have a state that can be changed by selecting the button.
  • ToolItem Class
    The class for a tool item in a toolbar control.
  • VerticalSash Class
    The class for the vertical border around a window pane that can be dragged to adjust the window size.
  • ViewForm Class
    The class to lay out a view's label, menu, or toolbar-local bar in the workbench.
Parent topic: Testing Java SWT and Eclipse Applications with the Open Agent
Parent topic: Java Classes
Related reference
Supported SWT Widgets for the Open Agent


Troubleshooting Java SWT and Eclipse Applications

Some SWTTree methods do not replay with low-level playback

When using low-level playback, some SWTTree methods, for example Expand and Collapse, do not replay.

To solve this problem, set the replay mode to Default. For additional information, see Setting Replay Options for the Open Agent .

Selecting a non-visible node in an SWTTree

When using low-level playback, Silk Test Classic cannot interact with non-visible nodes in an SWTTree.

To solve this problem, set the replay mode to Default. For additional information, see Setting Replay Options for the Open Agent .

Parent topic: Testing Java SWT and Eclipse Applications with the Open Agent


Testing Mobile Applications

Silk Test Classic enables you to automatically test your native mobile applications (apps) and mobile web applications. Automatically testing your mobile applications with Silk Test Classic provides the following benefits:
  • It can significantly reduce the testing time of your mobile applications.
  • You can create your tests once and then test your mobile applications on a large number of different devices and platforms.
  • You can ensure the reliability and performance that is required for enterprise mobile applications.
  • It can increase the efficiency of QA team members and mobile application developers.
  • Manual testing might not be efficient enough for an agile-focused development environment, given the large number of mobile devices and platforms on which a mobile application needs to function.
Note: To test native mobile applications or hybrid applications with Silk Test Classic, you require a native mobile license. For additional information, see Licensing Information.
Note: Silk Test Classic provides support for testing mobile apps on both Android and iOS devices.

For information on the supported operating system versions and the supported browsers for testing mobile applications, refer to the Release Notes.

  • Android
    Describes how you can test mobile applications on the Android platform.
  • iOS
    Describes how you can test mobile applications on the iOS platform.
  • Testing an Installed App
    To test a native mobile app that is already installed on a device, an Emulator, or a Simulator, specify the app in the connection string.
  • Recording Mobile Applications
    Describes how you can record a test against a mobile application on a mobile device or an Androidemulator.
  • Selecting the Mobile Device for Test Replay
    Describes how you can define the mobile device, Android Emulator, or iOS Simulator that is used for the replay of a test.
  • Using Devices from Mobile Center
    Integrate Silk Test Classic and Silk Central and use Mobile Center devices to test mobile applications.
  • Using SauceLabs Devices
    Integrate Silk Test Classic and Silk Central and use SauceLabs devices to test mobile applications.
  • Connection String for a Mobile Device
    Describes how you can specify a connection string to connect to a mobile device.
  • Interacting with a Mobile Device
    Use the Show Mobile Device Actions button in the Recording window to interact with the mobile device.
  • Releasing a Mobile Device
    Describes why you have to release a mobile device after recording or playing back a test.
  • Troubleshooting when Testing Mobile Applications
    Provides useful information on handling potential difficulties when testing mobile applications.
  • Limitations for Testing Mobile Web Applications
    Lists the known limitations for playing back tests and recording locators for mobile web applications.
  • Limitations for Testing Native Mobile Applications
    Lists the known limitations for playing back tests and recording locators for native mobile applications.
  • Clicking on Objects in a Mobile Website
    Describes how Silk Test Classic handles clicks on objects in a mobile website while recording and replaying tests.
  • Using Existing Mobile Web Tests
    Describes how you can edit your mobile web tests so that you can continue to use them with Silk Test 17.0 or later.
Parent topic: Testing in Your Environment with the Open Agent
Related tasks
Recording Test Cases for Mobile Applications
Related reference
Mobile Class Reference


Android

Silk Test Classic enables you to test a mobile application on an Android device or an Android emulator.

  • Prerequisites for Testing Mobile Applications on Android
    Lists the prerequisites for testing mobile applications on Android.
  • Testing Mobile Applications on Android
    Configure your testing environment to test mobile applications on a physical Android device or on an Android emulator.
  • Testing Hybrid Applications on Android
    Describes how you can use Silk Test Classic to test hybrid applications on Android.
  • Installing a USB Driver
    Install the appropriate USB driver on your local machine before you connect an Android device for the first time to test your mobile applications.
  • Enabling USB-Debugging
    Enable USB debugging to communicate with an Android device over the Android Debug Bridge (adb).
  • Recommended Settings for Android Devices
    Lists the settings that should be set on an Android device to optimize testing.
  • Configuring the Android Emulator for Silk Test Classic
    Configure the Android emulator to test mobile applications with Silk Test Classic.
  • Tested Configurations for Parallel Test Execution
    This topic defines sample test configurations for running tests on multiple Android devices in parallel.
Parent topic: Testing Mobile Applications
Related reference
Mobile Class Reference


Prerequisites for Testing Mobile Applications on Android

Before you can test a mobile application (app) on an Android device or on an Android emulator, ensure that the following prerequisites are met:
  • Ensure that Java is installed on the machine on which Silk Test Classic is running, and that the path to Java is added to the Path environment variable. Silk Test Classic requires either a JRE or a JDK for mobile testing. If Java is not installed, add C:\Program Files (x86)\Silk\SilkTest\ng\jre\bin to the Path.
  • If you have created your own hybrid app by adding a web view to a native mobile app, add the following code to the app to make your app testable with Silk Test Classic:
    WebView.setWebContentsDebuggingEnabled(true);
webView.getSettings().setJavaScriptEnabled(true);
  • Silk Test Classic does not support showing a live view of the device screen for Android 4.4. Micro Focus recommends using Android 5 or later.
Parent topic: Android
Related tasks
Testing Mobile Applications on Android
Related reference
Troubleshooting when Testing Mobile Applications


Testing Mobile Applications on Android

To test a mobile application on a physical Android device or on an Android emulator, perform the following tasks:

  1. Ensure that you have met the prerequisites for testing mobile applications on Android. For additional information, see Prerequisites for Testing Mobile Applications on Android.
  2. If you want to test the mobile application on an Android emulator, configure the emulator settings for Silk Test Classic. For additional information, see Configuring the Android Emulator for Silk Test.
  3. Start the Android emulator or connect the device to the machine on which Silk Test Classic is installed.
  4. If you want to test the mobile application on a physical Android device that you are using for the first time on this machine, install the appropriate Android USB Driver on the machine. For additional information, see Installing a USB Driver.
  5. If you want to test the mobile application on a physical Android device, enable USB-debugging on the Android device. For additional information, see Enabling USB-Debugging.
  6. Create a Silk Test Classic project for your mobile application.
  7. Create a test for your mobile application.
  8. Record the actions that you want to execute in the test. When you start the Recording window, the Select Application dialog box opens.
  9. To test a mobile web application:
    1. Select the Web tab.
    2. Select the mobile browser that you want to use.
    3. Specify the web page to open in the Enter URL to navigate text box.
  10. To test a native mobile application or a Hybrid application:
    Note: To test native mobile applications or hybrid applications with Silk Test Classic, you require a native mobile license. For additional information, see Licensing Information.
    1. Select the Mobile tab.
    2. Select the mobile device, on which you want to test the app, from the list.
    3. Click Browse to select the app file or enter the full path to the app file into the Mobile app file text field. Silk Test Classic supports HTTP and UNC formats for the path. Silk Test Classic installs the app on the mobile device or emulator.
  11. Click OK. An Android device or emulator must not be screen-locked during testing. To keep the device awake while it is connected to a machine, open the settings and tap Developer Options. Then check Stay awake or Stay awake while charging.
  12. Use the Recording window to record the test against the mobile application. For additional information, see Recording Mobile Applications.
  13. When you have recorded all the actions, stop the recording.
  14. Replay the test.
  15. Analyze the test results.
Parent topic: Android
Related concepts
Recording Mobile Applications
Troubleshooting when Testing Mobile Applications
Related tasks
Enabling USB-Debugging
Related reference
Prerequisites for Testing Mobile Applications on Android


Testing Hybrid Applications on Android

Hybrid applications (apps) are apps that are run on the device, like native applications, but are written with web technologies, for example HTML5, CSS, and JavaScript.

Silk Test Classic provides full browser support for testing debug hybrid apps that consist of a single web view, which is embedded in a native container. A common example of such a hybrid app would be an Apache Cordova application.

To prepare a non-debug hybrid app for testing, enable remote debugging in the app by adding the following code to the app:
WebView.setWebContentsDebuggingEnabled(true);
webView.getSettings().setJavaScriptEnabled(true);
To test non-debug hybrid apps without remote debugging enabled or hybrid apps that include more than one web view, enable the Silk Test Classic fallback support by setting the option OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT to TRUE. For additional information, see Setting Advanced Options. With the fallback support enabled, Silk Test Classic recognizes and handles the controls in a web view as native mobile controls instead of browser controls. For example, the following code clicks on a link when using browser support:
Agent.SetOption(OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT, false)
Desktop.Find("//BrowserApplication//BrowserWindow//INPUT[@id='email']").Click()
With the fallback support enabled, the following code clicks on the same link:
Agent.SetOption(OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT, true)
Desktop.Find("//BrowserApplication//BrowserWindow//MobileTextField[@resource-id='email']").Click()
Silk Test Classic can detect web views that support Chrome remote debugging. Silk Test Classic can detect web views with either the package com.android.webview or the package com.google.android.webview, which are the default packages on most Android devices.
Note: Silk Test Classic supports testing hybrid apps on Android 4.4 or later. To test hybrid apps on Android, Android System WebView version 51 or later is required.

The process for testing a hybrid app on Android is the same as the process for testing a mobile native application. For additional information, see Testing Mobile Applications on Android.

Parent topic: Android
Related concepts
Testing Hybrid Applications on iOS
Related tasks
Setting Advanced Options
Related reference
Prerequisites for Testing Mobile Applications on Android


Installing a USB Driver

To connect an Android device for the first time to your local machine to test your mobile applications, you need to install the appropriate USB driver.

The device manufacturer might provide an executable with all the necessary drivers for the device. In this case you can just install the executable on your local machine. If the manufacturer does not provide such an executable, you can install a single USB driver for the device on the machine.

To install the Android USB driver:

  1. Download the appropriate driver for your device. For example, for information on finding and installing a USB driver for a Google Nexus device, see http://developer.android.com/tools/extras/oem-usb.html.
  2. Connect your Android device to a USB port on your local machine.
  3. From your desktop or Windows Explorer, right-click Computer and select Manage.
  4. In the left pane, select Device Manager.
  5. In the right pane, locate and expand Other device.
  6. Right-click the device name, for example Nexus 5x, and select Update Driver Software. The Hardware Update Wizard opens.
  7. Select Browse my computer for driver software and click Next.
  8. Click Browse and navigate to the folder to which you have downloaded the USB driver.
  9. Select the USB driver.
  10. Click Next to install the driver.
Parent topic: Android


Enabling USB-Debugging

To communicate with an Android device over the Android Debug Bridge (adb), enable USB debugging on the device.
  1. On the Android device, open the settings.
  2. Tap Developer Settings. The developer settings are hidden by default. If the developer settings are not included in the settings menu of the device:
    1. Depending on whether the device is a phone or a pad, scroll down and tap About phone or About Pad.
    2. Scroll down again and tap Build Number seven times.
  3. In the Developer settings window, check USB-Debugging.
  4. Set the USB mode of the device to Media device (MTP), which is the default setting. For additional information, refer to the documentation of the device.
Parent topic: Android
Related tasks
Testing Mobile Applications on Android


Recommended Settings for Android Devices

To optimize testing with Silk Test Classic, configure the following settings on the Android device that you want to test:
  • Enable USB-debugging on the Android device. For additional information, see Enabling USB-Debugging
  • An Android device must be connected as a media device to the machine on which the Open Agent is running. The USB mode of the Android device must be set to Media device (MTP).
  • An Android device or emulator must not be screen-locked during testing. To keep the device awake while it is connected to a machine, open the settings and tap Developer Options. Then check Stay awake or Stay awake while charging.
Parent topic: Android
Related reference
Recommended Settings for iOS Devices


Configuring the Android Emulator for Silk Test Classic

Note: When using an Android emulator, an additional adb server is running in addition to the one that is used by Silk Test Classic. If the running adb servers have different versions, the connection between the Open Agent and the device might become unstable or even break. To avoid version mismatch errors, specify the path to the Android SDK directory by setting the environment variable SILK_ANDROID_HOME, for example to C:\Users\<user>\AppData\Local\Android\android-sdk. If the information service was running during this change, use the Windows Service Manager to restart the Silk Test information service with the updated environment variable. If the environment variable is not set, Silk Test Classic uses the adb version that is shipped with Silk Test Classic.
When you want to test mobile applications on an Android emulator with Silk Test Classic, you have to configure the emulator for testing:
  1. Install the latest version of the Android SDK. For information on how to install and configure the Android SDK, see Get the Android SDK.
  2. Install Android Studio 2.
    Tip: You can skip installing Android Studio 2 and use the emulator provided with the Android SDK. However, Micro Focus recommends installing Android Studio 2 for improved emulator performance. The remaining steps in this topic require Android Studio 2 to be installed.
  3. From Android Studio 2, start the AVD Manager.
  4. Click Create Virtual Device.
  5. Select a virtual device.
  6. Click Next.
  7. Download and select a system image of Android that includes Google APIs.
  8. Click Next.
  9. Configure the virtual device according to your requirements.
  10. Click Show Advanced Settings.
  11. Adjust the RAM size and the heap space used by the emulator to an amount that is manageable by your machine.
    Tip: Micro Focus recommends using at least 1 GB RAM and 256 MB heap space.
  12. Select Auto from the list in the Emulated Performance area.

  13. Click Finish.
Parent topic: Android


Tested Configurations for Parallel Test Execution

With Silk Test Classic, you can run automated tests on multiple Android devices in parallel. The amount of Android devices that you are able to use in parallel depends on the available hardware. Micro Focus has successfully tested the following hardware configurations:

Configuration with a single test machine

Using a single test machine directly connected to the Android devices through USB, we tested up to 8 physical Android devices in parallel.

The test machine was a Lenovo ThinkPad T450 with the following hardware specifications:
  • Intel® Core™ i7 - 5600U CPU @ 2.60 GHz
  • 2 cores (4 threads)
  • 8 GB RAM

Configuration with two test machines

Here we are using two test machines, one with Silk Test Classic installed and another, which is configured as a remote location for the first machine and has the Silk Test Information Service installed. Using such a configuration, we tested up to 10 physical Android devices in parallel.

Test machine 1 was a Lenovo ThinkPad T450 with the following hardware specifications:
  • Intel® Core™ i7 - 5600U CPU @ 2.60 GHz
  • 2 cores (4 threads)
  • 8 GB RAM
Test machine 2 was a Dell Precision T1700 with the following hardware specifications:
  • Intel® Core™ i7 - 4770 CPU @ 3.40 GHz
  • 4 cores (8 threads)
  • 16 GB RAM

Configuration with a Windows machine and a Mac

Here we are using two test machines, a Windows machine with Silk Test Classic installed and a Mac, which is configured as a remote location for the first machine and has the Silk Test Information Service installed. Using such a configuration, we tested up to 10 physical Android devices in parallel.

Test machine 1 was a Lenovo ThinkPad T450 with the following hardware specifications:
  • Intel® Core™ i7 - 5600U CPU @ 2.60 GHz
  • 2 cores (4 threads)
  • 8 GB RAM
Test machine 2 was an Apple Mac Mini with the following hardware specifications:
  • Intel® Core™ i5 - 4782U CPU @ 2.60 GHz
  • 2 cores (4 threads)
  • 16 GB RAM
Parent topic: Android


iOS

Silk Test Classic enables you to test a mobile application on an iOS device or an iOS Simulator.

Because of significant changes by Apple in iOS 9.3 in comparison to the previous versions of iOS, Silk Test supports testing mobile applications on iOS 9.3 or later. For a list of the supported iOS versions, refer to the Release Notes.

Note: Testing mobile applications on iOS 11 requires Xcode 9. When using Xcode 9 on a Mac, testing on physical devices and Simulators with iOS versions prior to iOS 11 that are connected to or running on this Mac is not supported. Use Xcode 8.3 to test physical devices and Simulators with iOS 9.3 and iOS 10.
Tip: To test on iOS versions prior to iOS 9.3, you can use Silk Test 17.5. The following table shows the major changes when testing on iOS with Silk Test 18.5 in comparison to Silk Test 17.5:
Silk Test 18.5 | Silk Test 17.5
Supports iOS 9.3, iOS 10, and iOS 11. | Supports iOS 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, 9.2, and 9.3
Supports Xcode 8.3 and Xcode 9. | Supports Xcode 6 and Xcode 7.
Supports testing multiple physical iOS devices in the same user session. Tip: If you have created multiple user sessions to test with Silk Test 17.5, Micro Focus recommends removing all user sessions except one. | Requires multiple user sessions on a Mac to test multiple physical iOS devices.
  • Prerequisites for Testing Mobile Applications on iOS
    Lists the prerequisites for testing mobile applications on iOS.
  • Testing Native Mobile Applications on a Physical iOS Device
    Configure your testing environment to test native mobile applications or hybrid applications on a physical iOS device.
  • Testing Native Mobile Applications on an iOS Simulator
    Configure your testing environment to test native mobile applications or hybrid applications on an iOS Simulator.
  • Testing Mobile Web Applications on a Physical iOS Device
    Configure your testing environment to test mobile web applications on a physical iOS device.
  • Testing Mobile Web Applications on an iOS Simulator
    Configure your testing environment to test mobile web applications on an iOS Simulator.
  • Testing Hybrid Applications on iOS
    Describes how you can use Silk Test Classic to test hybrid applications on iOS.
  • Preparing an iOS Device for Testing
    Prepare an iOS device to test mobile applications.
  • Preparing an iOS App for Testing
    Describes how you can prepare your iOS app to be able to test the app with Silk Test Classic.
  • Installing the Silk Test Information Service on a Mac
    Install the information service on a Mac to test Apple Safari or mobile applications on iOS with Silk Test Classic.
  • Preparing a Mac to Test Mobile Applications on iOS
    Prepare an Mac to test mobile applications on iOS.
  • Using a Personal Team Profile for Testing on Physical iOS Devices
    Use a personal team profile to test an application on a physical iOS device, if you have no membership in the Apple Developer Program.
  • Editing the Properties of the Silk Test Information Service
    Use the infoservice.properties file to specify the port for the Silk Test Information Service or capabilities that are applied each time Silk Test executes a test on the machine on which the Silk Test Information Service is running.
  • Uninstalling the Silk Test Information Service from a Mac
    Uninstall the information service from a Mac to no longer test Apple Safari or mobile applications on iOS with Silk Test Classic on this Mac.
  • Recommended Settings for iOS Devices
    Lists the settings that should be set on an iOS device to optimize testing.
  • Running Existing Scripts on iOS Using XCUITest
    Describes how you can change your scripts to adapt to the changes introduced with iOS 10.
Parent topic: Testing Mobile Applications


Prerequisites for Testing Mobile Applications on iOS

Before you can test a mobile application (app) on an iOS device or on an iOS Simulator, ensure that the following prerequisites are met:
  • The current version of the Silk Test information service is installed on the Mac. For additional information, see Installing the Silk Test Infoservice on a Mac.
  • If you want to test your application on a physical iOS device, ensure the following:
    • The device is connected to the Mac.
    • The device has a supported version of iOS. For a list of the supported iOS versions, refer to the Release Notes.
  • If you want to test your application on an iOS Simulator, ensure the following:
    • The iOS Simulator image is installed on the Mac.
    • The iOS Simulator image has a supported version of iOS. For a list of the supported iOS versions, refer to the Release Notes.
  • If you want to test your application on an physical iOS device, ensure that the same time zone is set on the device and the Mac.
  • A supported version of Xcode is installed on the Mac.
  • Silk Test Classic is installed on a Windows machine.
  • The Mac is located in the same network as the Windows machine and is added as a remote location to the Windows machine.
  • To test a native mobile app on an iOS device, ensure that the .ipa file of your app has been signed with a developer account. For additional information, see Preparing an iOS App for Testing.
  • To test a native mobile app on an iOS Simulator, ensure that the app has been zipped. For additional information, see Testing Native Mobile Applications on an iOS Simulator.
  • To test a native mobile app on both an iOS device and an iOS Simulator, ensure that both the signed .ipa file and the zipped .app directory are located in the same folder.
  • To test a native mobile app, ensure that the ID of the iOS device is associated with the developer profile which was used to sign the app.
  • The iOS device must not fall into sleep mode during testing. To turn the screen lock and password off, select Settings > General > Passcode Lock.
  • The Mac should not switch off the screen during testing, otherwise the Playback Status dialog box will not display anything.
  • To test a mobile application on an iOS Simulator, deactivate the display sleep on the Mac during testing.
  • To test a native mobile app on a physical iOS device, enable the UI automation on the device. For additional information, see Preparing an iOS Device for Testing.
  • To test a mobile web application with Apple Safari on a physical iOS device, activate the Web Inspector. For additional information, see Preparing an iOS Device for Testing.
  • Micro Focus recommends using iOS devices which have a Lightning connector. Silk Test Classic does not support showing a live view of the device screen for iOS devices that are not connected to a Mac through a Lightning cable.
Parent topic: iOS
Related concepts
Preparing an iOS App for Testing
Related tasks
Preparing Apple Safari for Testing
Installing the Silk Test Information Service on a Mac
Related reference
Prerequisites for Testing with Apple Safari on a Mac


Testing Native Mobile Applications on a Physical iOS Device

Note: To test native mobile applications or hybrid applications with Silk Test Classic, you require a native mobile license. For additional information, see Licensing Information.

For information on the prerequisites for testing mobile applications on iOS, see Prerequisites for Testing Mobile Applications on iOS. For information on the known limitations when testing native mobile applications, see Limitations for Testing Mobile Native Applications.

To test a native mobile application (app) or a hybrid application on a physical iOS device, perform the following tasks:
  1. Prepare the iOS device for testing. For additional information, see Preparing an iOS Device for Testing.
  2. Prepare the app for testing. For additional information, see Preparing an iOS App for Testing.
  3. Prepare the Mac for testing. For additional information, see Preparing a Mac for Testing Mobile Applications on iOS.
  4. Add the Mac, to which the iOS device is connected, as a remote location to the Windows machine on which Silk Test is installed. For additional information, see Editing Remote Locations.
    Note: At any given point in time, you can test on multiple physical iOS devices that are connected to the Mac, but only on one iOS Simulator that is running on the Mac. With Silk Test 17.5 Hotfix 1 or later, you are no longer required to use multiple user sessions on a Mac to test mobile applications on iOS.
  5. Create a Silk Test Classic project for your mobile application.
  6. Create a test for your mobile application.
  7. Record the actions that you want to execute in the test. When you start the Recording window, the Select Application dialog box opens.
  8. Select the Mobile tab.
  9. Select the mobile device, on which you want to test the app, from the list.
  10. Click Browse to select the app file or enter the full path to the app file into the Mobile app file text field. Silk Test Classic supports HTTP and UNC formats for the path. Silk Test Classic installs the app on the mobile device.
  11. Click OK. An iOS device or Simulator must not fall into sleep mode during testing. To turn the screen lock and password off, select Settings > General > Passcode Lock.
  12. When you have recorded all actions, stop recording.
  13. Replay the test.
  14. Analyze the test results.
Note: To test a native mobile app on both an iOS device and an iOS Simulator, ensure that both the signed .ipa file and the zipped .app directory are located in the same folder.
Parent topic: iOS
Related concepts
Preparing an iOS App for Testing
Related tasks
Testing Native Mobile Applications on an iOS Simulator
Testing Mobile Web Applications on a Physical iOS Device
Testing Mobile Web Applications on an iOS Simulator
Related reference
Prerequisites for Testing Mobile Applications on iOS
Recommended Settings for iOS Devices


Testing Native Mobile Applications on an iOS Simulator

Note: To test native mobile applications or hybrid applications with Silk Test Classic, you require a native mobile license. For additional information, see Licensing Information.

For information on the prerequisites for testing mobile applications on iOS, see Prerequisites for Testing Mobile Applications on iOS. For information on the known limitations when testing native mobile applications, see Limitations for Testing Mobile Native Applications.

To test a native mobile application (app) or a hybrid application on an iOS Simulator, perform the following tasks:
  1. Prepare the Mac for testing. For additional information, see Preparing a Mac for Testing Mobile Applications on iOS.
  2. In the Xcode project of the app, compile the app for the iOS Simulator. You can compile the app either from the Xcode UI or from the command line. For example, to compile the app through the command line for an iOS Simulator with iOS 10.0, execute the following command:
    xcodebuild -sdk iphonesimulator10.0
  3. Zip up the .app directory of the app into a .zip file. By default, the .app directory is located in the directory ~/Library/Developer/Xcode/DerivedData. You can click File > Project Settings in Xcode to see into which location the directory is stored.
  4. Add the Mac, on which the iOS Simulator is installed, as a remote location to the Windows machine on which Silk Test Classic is installed. For additional information, see Editing Remote Locations.
    Note: You can only test on one iOS Simulator that is installed on a Mac. Multiple Silk Test Classic users cannot simultaneously test on multiple iOS Simulators that are installed on the same Mac.
  5. Create a Silk Test Classic project for your mobile application.
  6. Create a test for your mobile application.
  7. Record the actions that you want to execute in the test. When you start the Recording window, the Select Application dialog box opens.
  8. Select the Mobile tab.
  9. Select the iOS Simulator from the list.
  10. Click Browse to select the zipped app file or enter the full path to the zipped app file into the Mobile app file text field. Silk Test Classic supports HTTP and UNC formats for the path. Silk Test Classic installs the app on the iOS Simulator.
  11. Click OK. An iOS device or Simulator must not fall into sleep mode during testing. To turn the screen lock and password off, select Settings > General > Passcode Lock.
  12. When you have recorded all actions, stop recording.
  13. Replay the test.
  14. Analyze the test results.
Note: To test a native mobile app on both an iOS device and an iOS Simulator, ensure that both the signed .ipa file and the zipped .app directory are located in the same folder.
Parent topic: iOS
Related tasks
Testing Native Mobile Applications on a Physical iOS Device
Testing Mobile Web Applications on a Physical iOS Device
Testing Mobile Web Applications on an iOS Simulator
Related reference
Prerequisites for Testing Mobile Applications on iOS


Testing Mobile Web Applications on a Physical iOS Device

For information on the prerequisites for testing mobile applications on iOS, see Prerequisites for Testing Mobile Applications on iOS. For information on the known limitations when testing mobile web applications, see Limitations for Testing Mobile Web Applications.
To test a mobile web application on a physical iOS device, perform the following tasks:
  1. Prepare the iOS device for testing. For additional information, see Preparing an iOS Device for Testing.
  2. Prepare the Mac for testing. For additional information, see Preparing a Mac for Testing Mobile Applications on iOS.
  3. Add the Mac, to which the iOS device is connected, as a remote location to the Windows machine on which Silk Test is installed. For additional information, see Editing Remote Locations.
    Note: At any given point in time, you can test on multiple physical iOS devices that are connected to the Mac, but only on one iOS Simulator that is running on the Mac. With Silk Test 17.5 Hotfix 1 or later, you are no longer required to use multiple user sessions on a Mac to test mobile applications on iOS.
  4. Create a Silk Test Classic project for your mobile application.
  5. Create a test for your mobile application.
  6. Record the actions that you want to execute in the test. When you start the Recording window, the Select Application dialog box opens.
  7. To test a mobile web application:
    1. Select the Web tab.
    2. Select the mobile browser that you want to use.
    3. Specify the web page to open in the Enter URL to navigate text box.
  8. Click OK. An iOS device or Simulator must not fall into sleep mode during testing. To turn the screen lock and password off, select Settings > General > Passcode Lock.
  9. When you have recorded all actions, stop recording.
  10. Replay the test.
  11. Analyze the test results.
Parent topic: iOS
Related tasks
Testing Native Mobile Applications on a Physical iOS Device
Testing Native Mobile Applications on an iOS Simulator
Testing Mobile Web Applications on an iOS Simulator
Related reference
Prerequisites for Testing Mobile Applications on iOS


Testing Mobile Web Applications on an iOS Simulator

For information on the known limitations when testing mobile web applications, see Limitations for Testing Mobile Web Applications.

To test a mobile web application on an iOS Simulator, perform the following tasks:

  1. Prepare the Mac for testing. For additional information, see Preparing a Mac for Testing Mobile Applications on iOS.
  2. Add the Mac, on which the iOS Simulator is installed, as a remote location to the Windows machine on which Silk Test is installed. For additional information, see Editing Remote Locations.
    Note: At any given point in time, you can test on multiple physical iOS devices that are connected to the Mac, but only on one iOS Simulator that is running on the Mac. With Silk Test 17.5 Hotfix 1 or later, you are no longer required to use multiple user sessions on a Mac to test mobile applications on iOS.
  3. Create a Silk Test Classic project for your mobile application.
  4. Create a test for your mobile application.
  5. Record the actions that you want to execute in the test. When you start the Recording window, the Select Application dialog box opens.
  6. To test a mobile web application:
    1. Select the Web tab.
    2. Select the mobile browser that you want to use.
    3. Specify the web page to open in the Enter URL to navigate text box.
  7. Click OK. An iOS device or Simulator must not fall into sleep mode during testing. To turn the screen lock and password off, select Settings > General > Passcode Lock.
  8. When you have recorded all actions, stop recording.
  9. Replay the test.
  10. Analyze the test results.
Parent topic: iOS
Related tasks
Testing Native Mobile Applications on a Physical iOS Device
Testing Native Mobile Applications on an iOS Simulator
Testing Mobile Web Applications on a Physical iOS Device
Related reference
Prerequisites for Testing Mobile Applications on iOS


Testing Hybrid Applications on iOS

Hybrid applications (apps) are apps that are run on the device, like native applications, but are written with web technologies, for example HTML5, CSS, and JavaScript.

Silk Test Classic provides full browser support for testing debug hybrid apps that consist of a single web view, which is embedded in a native container. A common example of such a hybrid app would be an Apache Cordova application.

To test non-debug hybrid apps without remote debugging enabled or hybrid apps that include more than one web view, enable the Silk Test Classic fallback support by setting the option OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT to TRUE. For additional information, see Setting Advanced Options. With the fallback support enabled, Silk Test Classic recognizes and handles the controls in a web view as native mobile controls instead of browser controls. For example, the following code clicks on a link when using browser support:
Agent.SetOption(OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT, false)
Desktop.Find("//BrowserApplication//BrowserWindow//INPUT[@id='email']").Click()
With the fallback support enabled, the following code clicks on the same link:
Agent.SetOption(OPT_ENABLE_MOBILE_WEBVIEW_FALLBACK_SUPPORT, true)
Desktop.Find("//BrowserApplication//BrowserWindow//MobileTextField[@resource-id='email']").Click()

The process for testing a hybrid app on iOS is the same as the process for testing a mobile native application. For additional information, see Testing Native Mobile Applications on a Physical iOS Device or Testing Native Mobile Applications on an iOS Simulator.

Before testing a hybrid app on an iOS device, ensure that the Web Inspector is activated on the device.

Parent topic: iOS
Related concepts
Testing Hybrid Applications on Android
Related tasks
Setting Advanced Options


Preparing an iOS Device for Testing

Note: To test native mobile applications or hybrid applications with Silk Test Classic, you require a native mobile license. For additional information, see Licensing Information.

To prepare the iOS device to test mobile applications:

  1. Start Xcode on the Mac.
  2. Connect the iOS device to the Mac.
  3. On the iOS device, click Settings > Developer.
    Tip: If the Developer menu is not displayed on the iOS device, restart the device and the Mac.
  4. Activate Enable UI Automation.
  5. To test a mobile web application on Apple Safari, click Settings > Safari > Advanced.
  6. Activate the Web Inspector.
  7. If you want to test on an iOS Simulator, enable Rotate Device Automatically.
    1. On the Mac, start the iOS Simulator.
    2. With Xcode 9 or later, expand the Hardware menu. With prior versions of Xcode, expand the Debug menu.
    3. Check Rotate Device Automatically.
  8. If you want to test on an iOS Simulator with Xcode 9 or later, disable Show Device Bezels.
    1. On the Mac, start the iOS Simulator.
    2. Expand the Window menu.
    3. Uncheck Show Device Bezels.
Parent topic: iOS


Preparing an iOS App for Testing

This functionality is supported only if you are using the Open Agent.

To be able to test a specific iOS app on a specific iOS device with Silk Test Classic, consider the following:
  • Test automation is only possible with iOS apps that can be installed manually on specific iOS devices. To be able to sign an iOS app, you require a membership in the Apple Developer Program. For additional information, see Choosing a Membership. To test without having a membership in the Apple Developer Program, see Using a Personal Team Profile for Testing on Physical iOS Devices.
    Note: You cannot automatically test iOS apps that are created for publication in the App Store, as well as apps that can be installed manually on any iOS device.
  • Before you can install and execute an iOS app on a specific iOS device, you have to register the iOS device with your Apple Developer account.
  • You have to use Xcode to create an IPA file of the iOS app, which you can then install on the iOS device. To create IPA files for testing on a specific iOS device, members of the Apple Developer Program can use the Archive mechanism of Xcode, by using one of the following two options:
    • If you are a member of the Apple Developer Enterprise Program, you can use the Save for Ad Hoc Deployment option.
    • If you are a member of the Apple Developer Program, but not of the Apple Developer Enterprise Program, you can use the Save for Development Deployment option.
    For additional information, see Exporting Your App for Testing (iOS, tvOS, watchOS).

To be able to test a specific iOS app on an iOS Simulator with Silk Test Classic, use Xcode to create a ZIP file of the iOS app, which you can then install on the iOS Simulator. For additional information, refer to the Xcode documentation.

Parent topic: iOS
Related tasks
Installing the Silk Test Information Service on a Mac
Testing Native Mobile Applications on a Physical iOS Device
Related reference
Prerequisites for Testing Mobile Applications on iOS


Installing the Silk Test Information Service on a Mac

Note: To install the information service on a Mac, you require administrative privileges on the Mac.

This functionality is supported only if you are using the Open Agent.

To create and execute tests against Apple Safari on a Mac, or against mobile applications on an iOS or Android device that is connected to a Mac, install the Silk Test information service (information service) on the Mac, and then use the Remote Locations dialog box to connect a Windows machine, on which Silk Test Classic is installed, to the Mac.

To install the information service on a Mac:

  1. Ensure that a Java JDK is installed on the Mac.
  2. If you want to test mobile applications on an iOS device, ensure that Xcode is installed on the Mac.
  3. Access the information service setup file, SilkTestInformationService<Version>-<Build Number>.pkg.
    • If you have downloaded the information service setup file while installing Silk Test, open the folder macOS in the Silk Test installation directory, for example C:\Program Files (x86)\Silk\SilkTest.
    • If you have not downloaded the information service setup file while installing Silk Test, you can download the setup file from Micro Focus SupportLine.
  4. Copy the file SilkTestInformationService<Version>-<Build Number>.pkg to the Mac.
  5. Execute SilkTestInformationService<Version>-<Build Number>.pkg to install the information service.
  6. Follow the instructions in the installation wizard.
  7. When asked for the password, provide the password of the currently signed in Mac user.
  8. When Apple Safari opens and a message box asks whether to trust the SafariDriver, click Trust.
    Note: You can only install the SafariDriver if you are directly logged in to the Mac, and not connected through a remote connection.
To complete the installation, the installer logs the current Mac user out. To verify that the information service was installed correctly, log in to the Mac and click on the Silk Test icon in the top-right corner of the screen to see the available devices and browsers.
Tip: If the Silk Test icon does not appear, restart the Mac.
Parent topic: iOS
Parent topic: Testing with Apple Safari on a Mac
Related concepts
Preparing an iOS App for Testing
Related tasks
Editing Remote Locations
Related reference
Prerequisites for Testing with Apple Safari on a Mac
Prerequisites for Testing Mobile Applications on iOS


Preparing a Mac to Test Mobile Applications on iOS

Note: To test native mobile applications or hybrid applications with Silk Test Classic, you require a native mobile license. For additional information, see Licensing Information.

To test mobile applications on iOS, you require a Mac to which you can connect the iOS device, or on which the iOS Simulator is running. This Mac requires Xcode to be installed. For additional information on the prerequisites for testing mobile applications on iOS, see Prerequisites for Testing Mobile Applications on iOS.

To execute iOS tests on a physical iOS device, follow the instructions in the Silk Test Configuration Assistant to configure the WebDriverAgentRunner Xcode project. To open the Configuration Assistant, click on the Silk Test icon in the status menus and select Configuration Assistant.

If for any reason you want to manually build the WebDriverAgentRunner Xcode project, perform the following actions:

  1. Start Xcode on the Mac.
  2. Select Xcode > Preferences.

  3. In the Preferences window, select your account.
    1. Select the Accounts tab.
    2. Choose your Apple ID.
    3. Choose your Team.
    4. Click View Details.

  4. Access the Apple Member Center and retrieve your development team.
  5. In a terminal, navigate to ~/.silk/silktest/conf/.
  6. Rename the xcconfig file template silktest.xcconfig.sample to silktest.xcconfig.
  7. Add your development team to the silktest.xcconfig file.
    DEVELOPMENT_TEAM = <your development team>
  8. Execute the following commands in a terminal on the Mac to verify that you have prepared the WebDriverAgentRunner project correctly:
    1. Determine the unique device id (udid) of your physical iOS device:
      idevice_id -l
    2. Navigate to the WebDriverAgentRunner project:
      cd /Application/Silk/Mobile/common/Appium/node_modules/appium-xcuitest-driver/WebDriverAgent
    3. Test that the WebDriverAgent can be built:
      xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner –xcconfig ~/.silk/silktest/conf/silktest.xcconfig -destination 'id=<udid>' test
      Replace the <udid> with the unique device id that you have determined previously.
      Tip: If the xcodebuild command fails, follow the instructions in the error message. Additionally, open the Preferences window of the WebDriverAgentRunner project and ensure that the Automatically manage signing check box in the General tab is not checked.
  9. Optional: In the infoservice.properties file, you can specify the port for the Silk Test Information Service or capabilities which are used during all test runs on the Mac. For additional information, see Editing the Properties of the Silk Test Information Service.
Parent topic: iOS


Using a Personal Team Profile for Testing on Physical iOS Devices

If you have no membership in the Apple Developer Program, you can use a personal team profile to test an application on a physical iOS device:
  1. On the Mac, navigate to /Application/Silk/Mobile/common/Appium/node_modules/appium-xcuitestdriver/WebDriverAgent.
  2. Open WebDriverAgent.xcodeproj project in Xcode.
  3. From the TARGETS list, select the WebDriverAgentLib target:
    1. Click the General tab.
    2. Select Automatically manage signing.
    3. Select your development team.
    The Signing Certificate is automatically selected.
  4. From the TARGETS list, select the WebDriverAgentRunner target:
    1. Click the General tab.
    2. Select Automatically manage signing.
    3. Select your development team.
    The Signing Certificate is automatically selected.
  5. If Xcode fails to create a provisioning profile for the WebDriverAgentRunner target, manually change the bundle id for the target.
    1. Click the Build Settings tab.
    2. Change the Product Bundle Identifier to something that Xcode accepts. For example, if the Product Bundle Identifier is com.facebook.WebDriverAgentRunner, change it to io.appium.WebDriverAgentRunner or io.borland.WebDriverAgentRunner.
    3. Click the General tab.
    The target should now have a provisioning profile.
  6. Save the WebDriverAgent.xcodeproj project.
  7. To verify that everything works as expected, build the project:
    xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test IPHONEOS_DEPLOYMENT_TARGET=10.3
Although the WebDriverAgentRunner is successfully installed on the device, an error message like the following might appear in the console or the Appium log files:
2017-01-24 09:02:18.358 xcodebuild[30385:339674] Error
Domain=com.apple.platform.iphoneos
Code=-12 "Unable to launch com.apple.test.WebDriverAgentRunner-Runner"
UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner,
NSUnderlyingError=0x7fa839cadc60 {Error Domain=DTXMessage Code=1 "(null)"
UserInfo={DTXExceptionKey=The operation couldn't be completed. Unable to launch
com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature,
inadequate entitlements or its profile has not been explicitly trusted by the user. :
Failed to launch process with bundle identifier 'com.apple.test.WebDriverAgentRunner-Runner'}}}
2017-01-24 09:02:18.358 xcodebuild[30385:339674] Error
Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation
never finished bootstrapping - no restart will be attempted"
UserInfo={NSLocalizedDescription=Early unexpected exit,
operation never finished bootstrapping - no restart will be attempted}

Testing failed:
Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never
finished bootstrapping - no restart will be attempted)
The problem is that the developer is not trusted on the device. If you manually try to run the WebDriverAgentRunner app on the device, you will see an Untrusted Developer message.

To solve this issue on the device, go to Settings > General > Profiles or Settings > General > Device Management, depending on the device type and the iOS version. Then trust the developer and allow the WebDriverAgentRunner app to be run.

Parent topic: iOS


Editing the Properties of the Silk Test Information Service

You can use the infoservice.properties file to specify the port for the Silk Test Information Service or various capabilities. These capabilities are applied each time Silk Test executes a test on the machine on which the Silk Test Information Service is running.
  1. Navigate to the directory in which the infoservice.properties.sample file is located. For example, on a Mac, navigate to ~/.silk/silktest/conf/. On a Windows machine, navigate to C:\ProgramData\Silk\SilkTest\conf.
  2. Rename the file infoservice.properties.sample to infoservice.properties.
  3. Specify a port that is not in use. The default port for the Silk Test Information Service is 22901.
  4. To specify capabilities, add the following line to the infoservice.properties file:
    customCapabilities=<custom capability_1>;<custom_capability_2>;...

Example: Running an iOS Simulator in a Specified Language

To always run a specific iOS Simulator on a Mac in the same language, for example Japanese, specify the custom capabilities language and locale. To do so, add the following line to the infoservice.properties file:
customCapabilities=language=ja;locale=ja_JP
Parent topic: iOS


Uninstalling the Silk Test Information Service from a Mac

This functionality is supported only if you are using the Open Agent.

To uninstall the Silk Test information service (information service) from a Mac, for example if you no longer want to execute tests against Apple Safari on the Mac:

  1. Create a new shell file, for example uninstallInfoService.sh.
  2. Type the following code into the new file:
    #!/bin/sh

if launchctl list | grep com.borland.infoservice ; then
  launchctl unload /Library/LaunchAgents/com.borland.infoservice.plist
  echo "unloading Launch Daemon"
fi

if [ -d "/Applications/Silk" ]
then
  sudo rm -rf /Applications/Silk
fi

if [ -f "/Library/LaunchAgents/com.borland.infoservice.plist" ]
then
  sudo rm /Library/LaunchAgents/com.borland.infoservice.plist
fi

if [ -f "/usr/local/bin/ideviceinstaller" ]
then
  sudo rm /usr/local/bin/ideviceinstaller
fi

exit 0
  3. In the command line, type chmod +x uninstallInfoService.sh to make the shell file executable.
  4. Execute the shell file from the command line.
Parent topic: iOS
Parent topic: Testing with Apple Safari on a Mac


Recommended Settings for iOS Devices

To optimize testing with Silk Test Classic, configure the following settings on the iOS device that you want to test:
  • To make the testing reflect the actions an actual user would perform, disable AutoFill and remembering passwords for Apple Safari. Tap Settings > Safari > Passwords & AutoFill and turn off the Names and Passwords setting.
  • The iOS device must not fall into sleep mode during testing. To turn the screen lock and password off, select Settings > General > Passcode Lock.
Parent topic: iOS
Related tasks
Testing Native Mobile Applications on a Physical iOS Device
Related reference
Recommended Settings for Android Devices


Running Existing Scripts on iOS Using XCUITest

Attention: Prior Silk Test Classic versions used Instruments to automate iOS devices. With iOS 9.3, Apple has replaced the support for Instruments with support for the XCUITest framework, causing Silk Test Classic to also no longer support Instruments. Because of this change, existing iOS test scripts might break when executed from the current version of Silk Test Classic.
  • The behavior of the classname attribute in XCUITest is different to the behavior in Instruments. In most cases, Silk Test Classic will automatically handle this change. However, if an existing test script breaks because of such a classname attribute, you will have to record a new locator for the corresponding object.
  • The object hierarchy has changed.
Parent topic: iOS


Testing an Installed App

To test a native mobile app that is already installed on a device, an Emulator, or a Simulator, specify the app in the connection string.
  1. Open an existing project that tests a native mobile app.
  2. Open the Edit Application Configuration dialog box.
  3. Replace the existing app in the connection string with one of the following:
    • If you want to test an iOS app, replace the app with the bundleId, for example replace app=MyApp.ipa with bundleId=silktest.InsuranceMobile.
    • If you want to test an Android app, replace the app with the appActivity and the appPackage. For example, replace app=MyApp.apk with appActivity=.LoginActivity;appPackage=silktest.insurancemobile.
For additional information, see Connection String.
Parent topic: Testing Mobile Applications


Recording Mobile Applications

Once you have established the connection between Silk Test Classic and a mobile device or an emulator, you can record the actions that are performed on the device. To record mobile applications, Silk Test Classic uses a Recording window that provides the following functionality:

  • Displays the screen of the mobile device or Android emulator which you are testing.
  • When you perform an action in the Recording window, the same action is performed on the mobile device.
  • When you interact with a control on the screen, the Recording window preselects the default action.
    • If the default action is a Click, and you left-click on the control, the action is executed. You can perform a right-click to show a list of the available actions against the control. You can then select the action that you want to perform and click OK.
    • If the default action is not a Click, a list of all the available actions against the control displays, and you can select the action that you want to perform or simply accept the preselected action by clicking OK.
    When you have selected an action from the list, you can type values for the parameters of the selected action into the parameter fields. Silk Test Classic automatically validates the parameters.
  • During recording, Silk Test Classic displays the mouse position next to the recording window. You can toggle the location to switch between displaying the absolute mouse position on the device display and the mouse position in relation to the active object.
  • When you pause the recording, you can perform actions in the screen which are not recorded to bring the device into a state from which you want to continue recording.
  • When you stop recording, a script is generated with your recorded actions, and you can proceed with replaying the test.
Parent topic: Testing Mobile Applications
Related concepts
Limitations for Testing Mobile Web Applications
Limitations for Testing Native Mobile Applications
Related tasks
Running a Test Case
Testing Mobile Applications on Android
Interacting with a Mobile Device


Selecting the Mobile Device for Test Replay

You can define the mobile device that is used for the replay of a test in the following ways:
  • If you execute a script from the command line or from a Continuous Integration (CI) server, specify the connection string in the application configuration of the script.
  • If you execute a test from Silk Central, specify the mobile device in the Mobile Device Selection area of the Deployment tab of the execution definition in Silk Central instead of specifying a connection string. For additional information, refer to the Silk Central Help.
You can use the connection string to specify a specific mobile device, or you can filter a subset of the available devices, for example if you have a device pool. The first matching device is used for replay. If not specified otherwise, mobile devices are matched by using the following rules, with declining priority:
  • Matching mobile devices connected to the local machine are preferred over mobile devices connected to remote locations.
  • If the browser type is specified in the connection string, newer browser versions are preferred over older versions.
  • Newer platforms are preferred over older platforms.
  • A physical device is preferred to an Emulator or Simulator.
  • A device with a device name that is alphabetically later is preferred. For example, a device named "iphone 6" is preferred to a device named "iphone 5".

Example: Connection string for an app on an Android device that is connected to a remote machine

To test the app MyApp.apk on an Android device that is connected to a remote machine, the connection string would look like the following:
"platformName=Android;deviceName=MotoG3;host=http://10.0.0.1;app=MyApp.apk"

Example: Connection string for an app on an iOS Simulator on a Mac

"platformName=iOS;platformVersion=10.0;deviceName=iPhone6;host=10.0.0.1;app=MyApp.ipa;isSimulator=true"
Parent topic: Testing Mobile Applications
Related concepts
Connection String for a Mobile Device
Related tasks
Setting the Browser when Running Automated Tests
Using SauceLabs Devices
Using Devices from Mobile Center


Using Devices from Mobile Center

Mobile Center is a mobility gateway that enables you to manage the testing of your mobile devices.

To access the devices that are managed through the Mobile Center from Silk Test Classic, perform the following actions:

  1. Integrate Silk Test Classic with Silk Central. For additional information, see Integrating Silk Test Classic with Silk Central.
  2. Configure Silk Central to use Mobile Center.
    Note: While installing Mobile Center, ensure that the appropriate Android SDK version is used. Ensure that the same version is used in Silk Test Classic by setting the environment variable SILK_ANDROID_HOME, for example to C:\Users\<user>\AppData\Local\Android\android-sdk. For additional information, refer to the Silk Central Help.
  3. To test on iOS, ensure that the following IPA files are signed:
    • HP4M-Agent.ipa
    • HPMC-AgentLauncher.ipa
    • WebDriverAgentRunner-Runner.ipa
    Note: Silk Test Classic does not support testing iOS simulators through Mobile Center.
In the Select Applications dialog, you can now select the Mobile Center device on which you want to test.
Note: You cannot test a mobile device with both Silk Test Classic and Mobile Center at the same time. Restart a mobile device that you have tested with Silk Test Classic, if you want to continue testing the device from Mobile Center.
Note: When testing on a device that is managed through the Mobile Center, Silk Test Classic does not support using the methods TypeKeys or SetText to type key codes like ENTER. Additionally, Silk Test Classic does not support pressing the Home button on iOS devices.
Note: When testing on an Android Emulator, disable the GPU HW Acceleration.
Parent topic: Testing Mobile Applications
Related concepts
Selecting the Mobile Device for Test Replay
Related tasks
Integrating Silk Test Classic with Silk Central


Using SauceLabs Devices

SauceLabs provides an automated testing platform, enabling you to test on various mobile devices and mobile platform versions without having to purchase and maintain your own infrastructure.

To access SauceLabs devices through Silk Central, perform the following actions:

  1. Ensure that Silk Test Classic is integrated with Silk Central. For additional information, see Integrating Silk Test Classic with Silk Central.
  2. Ensure that Silk Central is configured to use SauceLabs. For additional information, refer to the Silk Central Help.
In the Select Applications dialog, you can now select the SauceLabs device on which you want to test.
Parent topic: Testing Mobile Applications
Related concepts
Selecting the Mobile Device for Test Replay
Related tasks
Integrating Silk Test Classic with Silk Central


Connection String for a Mobile Device

The connection string specifies which mobile device is used for testing. When performing mobile testing, Silk Test Classic uses the connection string to connect to the mobile device. The connection string is typically part of the application configuration. You can set the connection string when you configure your application under test. To change the connection string, you can use the Edit Application Configuration dialog box.

Note: If you execute a test from Silk Central, specify the mobile device in the Mobile Device Selection area of the Deployment tab of the execution definition in Silk Central instead of specifying a connection string. For additional information, refer to the Silk Central Help.
You can use the connection string to specify a specific mobile device, or you can filter a subset of the available devices, for example if you have a device pool. The first matching device is used for replay. If not specified otherwise, mobile devices are matched by using the following rules, with declining priority:
  • Matching mobile devices connected to the local machine are preferred over mobile devices connected to remote locations.
  • If the browser type is specified in the connection string, newer browser versions are preferred over older versions.
  • Newer platforms are preferred over older platforms.
  • A physical device is preferred to an Emulator or Simulator.
  • A device with a device name that is alphabetically later is preferred. For example, a device named "iphone 6" is preferred to a device named "iphone 5".

The following components are available for the connection string:

Component | Description
deviceName | The name of the mobile device. When testing on a physical mobile device, the device ID can be used instead. Supports wildcards. Case-insensitive.
platformName | Android or iOS. Required.
deviceId | Optional: The ID of the mobile device. Can be used instead of the device name, when testing on a physical mobile device. Supports wildcards. Case-insensitive.
platformVersion | Optional: The Android or iOS version. Specify the version to test only on mobile devices that have a specific Android or iOS version. Supports wildcards. Case-insensitive.
browserVersion | Optional: Can be used in combination with the browser type to test only on the specified browser version. Supports wildcards. Case-insensitive.
host | Optional: If not set, any specified remote location can be used as the host. Supports wildcards. Case-insensitive.
  • app
  • appActivity
  • appPackage
Required for testing native mobile applications on Android. Either the full path to the app, or a combination of appActivity and appPackage. For example app=MyApp.apk or appActivity=.LoginActivity;appPackage=silktest.insurancemobile
  • app
  • bundleId
Required for testing native mobile applications on iOS. Either the full path to the app or the bundleId. For example app=MyApp.ipa or bundleId=silktest.InsuranceMobile
noReset | Optional: Can be set when testing native mobile applications. Is only valid if the app is specified. True if the app should not be reinstalled before testing. False if the app should be reinstalled before testing. The default value is False.
isSimulator | Optional: Used to specify that the test should only be executed on an iOS Simulator. The device name can be used instead.
isPhysicalDevice | Optional: Used to specify that the test should only be executed on a physical device. The device name can be used instead.

When using a pool of devices and to find out which device is actually used for testing, you can use the return value of the GenerateConnectionString method of MobileDevice class.

Testing a mobile web application on a mobile device or on an Android Emulator

When testing a mobile web application on a mobile device or on an Android Emulator, the connection string consists of the following parts:

  1. The mobile device name, for example MotoG3, or the device ID, for example 11111111.
    Note: If the device name is unique, Micro Focus recommends to use the device name in the connection string, because the device ID is less readable.
  2. The platform name.
  3. The browser version. This can only be used in combination with setting the browser type
  4. The IP address or the host name of a specific remote machine, for example 10.0.0.1. You can also use the name of a remote location that is specified in the Edit Remote Locations dialog box as the host name, for example MyRemoteLocation. When using the remote location name, you can also use wildcards. To test an Android device that is connected to the local machine, specify the IP address or the host name of the local machine.

Example: Connection string for any available Android device

"platformName=Android"

Example: Connection string for a browser on an Android device that is connected to the local machine

To test a mobile browser on an Android device that is connected to the local machine, the connection string should look similar to the following:
"deviceName=MotoG3;platformName=Android;host=localhost"
or
"platformName=Android;deviceId=11111111;host=localhost"

Example: Connection string for a browser on an Android device that is connected to a remote machine

To test a mobile browser on a remote Android device, the connection string should look similar to the following:
"deviceName=MotoG3;platformName=Android;host=10.0.0.1"
"deviceName=MotoG3;platformName=Android;host=MyRemoteLocation*"

Example: Connection string for a browser on an iOS device that is connected to a Mac

To test a mobile browser on a remote iOS device, the connection string would look like the following:
"deviceName=myiPhone6;platformName=iOS;host=10.0.0.1"

Testing a native mobile application on a mobile device or on an Android Emulator

When testing a native mobile application on a mobile device or on an Android Emulator, the connection string consists of the following parts:
  1. The mobile device name, for example MotoG3, or the device ID, for example 11111111.
    Note: If the device name is unique, Micro Focus recommends to use the device name in the connection string, because the device ID is less readable.
  2. The platform name.
  3. The IP address or the host name of a specific remote machine, for example 10.0.0.1. You can also use the name of a remote location that is specified in the Edit Remote Locations dialog box as the host name, for example MyRemoteLocation. When using the remote location name, you can also use wildcards. To test an Android device that is connected to the local machine, specify the IP address or the host name of the local machine.
  4. The name of the file of the app that you want to test, or the URL of the file, if the file is located on a web server. For example C:/MyApp.apk or MyApp.ipa.
    • Android apps are always .apk files.
    • iOS apps on a real device are always .ipa files.
    • iOS apps on a Simulator are either a zipped file or a directory with the name app.

Example: Connection string for an app on an Android device that is connected to a remote machine

To test the app MyApp.apk on an Android device that is connected to a remote machine, the connection string would look like the following:
"platformName=Android;deviceName=MotoG3;host=http://10.0.0.1;app=MyApp.apk"

Example: Connection string for an app on an iOS device that is connected to a Mac

To test the app MyApp.ipa on an iOS device that is connected to a remote machine, the connection string would look like the following:
"platformName=iOS;deviceName=MyiPhone;host=http://10.0.0.1;app=MyApp.ipa"

Testing a mobile web application on an iOS Simulator

When testing a mobile web application on an iOS Simulator, the connection string consists of the following parts:
  1. The platform name, which is iOS.
  2. The platform version, for example 10.0.
  3. The mobile device name, for example iPhone6.
  4. The IP address or the host name of the Mac, on which the iOS Simulator is running.

Example: Connection string for a browser on an iOS Simulator on a Mac

"platformName=iOS;platformVersion=10.0;deviceName=iPhone6;host=10.0.0.1;isSimulator=true"

Testing a native mobile application on an iOS Simulator

When testing a native mobile application on an iOS Simulator on a Mac, the connection string consists of the following parts:
  1. The platform name, which is iOS.
  2. The platform version, for example 10.0.
  3. The mobile device name, for example iPhone6.
  4. The IP address or the host name of the remote machine, for example 10.0.0.1.
  5. The name of the app that you want to test, for example MyApp.ipa.

Example: Connection string for an app on an iOS Simulator on a Mac

"platformName=iOS;platformVersion=10.0;deviceName=iPhone6;host=10.0.0.1;app=MyApp.ipa;isSimulator=true"
Parent topic: Testing Mobile Applications
Related concepts
Connection String for a Remote Desktop Browser
Select Application Dialog Box
Selecting the Mobile Device for Test Replay
Related tasks
Setting the Browser when Running Automated Tests


Interacting with a Mobile Device

To interact with a mobile device and to perform an action like a swipe in the application under test:
  1. In the Recording window, click Show Mobile Device Actions. All the actions that you can perform against the mobile device are listed.
  2. Select the action that you want to perform from the list.
  3. To record a swipe on an Android device or emulator, move the mouse while holding down the left mouse button.
  4. Continue with the recording of your test.
Parent topic: Testing Mobile Applications
Related concepts
Recording Mobile Applications


Releasing a Mobile Device

When recording or playing back a test against a mobile device, the Open Agent instance takes ownership of the device. By doing so, the Open Agent is preventing other Silk Test users from using the device. To enable other Silk Test users to use the device after you have finished recording or replaying tests on the device, Silk Test automatically releases the device when the Silk Test client is closed, when an unattended test process finishes, or when the Open Agent is closed. You can also manually release the device.

Note: Releasing a mobile device will close the application under test (AUT) on the mobile device.
  • Releasing a Mobile Device After Recording
    Release a mobile device after recording to enable other Silk Test users to test on the device.
  • Releasing a Mobile Device After Replay
    Release a mobile device after replay to enable other Silk Test users to test on the device.
Parent topic: Testing Mobile Applications


Releasing a Mobile Device After Recording

Release a mobile device after recording to enable other Silk Test users to test on the device.

To release a mobile device after you have finished recording, perform one of the following actions:
  • Stop the Open Agent from the System Tray.
  • Close the current project.
  • Close Silk Test Classic. The device is only released by this action when parallel testing is enabled.
Note: Releasing a mobile device will close the application under test (AUT) on the mobile device.
Parent topic: Releasing a Mobile Device


Releasing a Mobile Device After Replay

Release a mobile device after replay to enable other Silk Test users to test on the device.

To manually release a mobile device after replaying is complete, type the following into the test script:
[-] ScriptExit(BOOLEAN bException)
    [ ] // To test a mobile web application:
    [ ] // WebBrowser.Close()
    [ ] // To test a native mobile application:
    [ ] // Device.CloseApp()
    [ ] // Alternative for both WebBrowser.Close()and Device.CloseApp():
    [ ] // Agent.DetachAll()
    [ ]
    [ ] WebBrowser.Close()
    [ ] DefaultScriptExit(bException)
A mobile device is automatically released if one of the following conditions is met:
  • The Open Agent is closed.
  • The test process stops during unattended testing. The device is only released by this action when parallel testing is enabled.
  • Silk Test Classic is closed. The device is only released by this action when parallel testing is enabled.
Note: Releasing a mobile device will close the application under test (AUT) on the mobile device.
Parent topic: Releasing a Mobile Device


Troubleshooting when Testing Mobile Applications

Why does the Select Application dialog not display my mobile devices?

If Silk Test Classic does not recognize a mobile device or emulator, the Mobile tab in the Select Application dialog does not display the device or emulator. Additionally, the Web tab of the Select Application dialog does not display the mobile browsers that are installed on the device or emulator.

Silk Test Classic might not recognize a mobile device or emulator for one of the following reasons:
Reason | Solution
The emulator is not running. | Start the emulator.
The Android Debug Bridge (adb) does not recognize the mobile device. To check if the mobile device is recognized by adb:
  1. Navigate to the Android Debug Bridge (adb) in the Android SDK installation folder. If the Android SDK is not installed, navigate to C:\Program Files (x86)\Silk\SilkTest\ng\Mobile\windows\AndroidTools\platform-tools to use the adb that is installed with Silk Test Classic.
  2. Hold Shift and right-click into the File Explorer window.
  3. Select Open command window here.
  4. In the command window, type adb devices to get a list of all attached devices.
  5. If your device is not listed, check if USB-debugging is enabled on the device and if the appropriate USB driver is installed.
  6. If you get an error, for example adb server is out of date, ensure that the adb version in C:\Program Files (x86)\Silk\SilkTest\ng\Mobile\windows\AndroidTools\platform-tools is the same as the adb version of your local Android SDK. For additional information, see What can I do if the connection between the Open Agent and my device is unstable?.
The version of the operating system of the device is not supported by Silk Test Classic. | For information on the supported mobile operating system versions, refer to the Release Notes.
The USB driver for the device is not installed on the local machine. | Install the USB driver for the device on the local machine. For additional information, see Installing a USB Driver.
USB-debugging is not enabled on the device. | Enable USB-debugging on the device. For additional information, see Enabling USB-Debugging.
Note: If all previous solutions do not work, you could try to restart the device.

Why does Silk Test Classic search for a URL in Chrome for Android instead of navigating to the URL?

Chrome for Android might in some cases interpret typing an URL into the address bar as a search. As a workaround you can manually add a command to your script to navigate to the URL.

What do I do if the adb server does not start correctly?

When the Android Debug Bridge (adb) server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients. All adb clients use port 5037 to communicate with the adb server. The adb server locates emulator and device instances by scanning odd-numbered ports in the range 5555 to 5585, which is the range used by emulators and devices. Adb does not allow changing those ports. If you encounter a problem while starting adb, check if one of the ports in this range is already in use by another program.

For additional information, see http://developer.android.com/tools/help/adb.html.

What can I do if the connection between the Open Agent and my device is unstable?

If you have installed the Android SDK or another tool that uses the Android Debug Bridge (adb), an additional adb server might be running in addition to the one that is used by Silk Test Classic. If the running adb servers have different versions, the connection between the Open Agent and the device might become unstable or even break.

To avoid version mismatch errors, specify the path to the Android SDK directory by setting the environment variable SILK_ANDROID_HOME, for example to C:\Users\<user>\AppData\Local\Android\android-sdk. If the information service was running during this change, use the Windows Service Manager to restart the Silk Test information service with the updated environment variable. If the variable is not set, Silk Test Classic uses the adb version that is shipped with Silk Test Classic.

Why do I get the error: Failed to allocate memory: 8?

This error displays if you are trying to start up the emulator and the system cannot allocate enough memory. You can try the following:

  1. Lower the RAM size in the memory options of the emulator.
  2. Lower the RAM size of Intel HAXM. To lower the RAM size, run the IntelHaxm.exe again and choose change.
  3. Open the Task Manager and check if there is enough free memory available. If not, try to free up additional memory by closing a few programs.

Why do I get the error "Silk Test cannot start the app that you have specified" during testing on an iOS device?

This error might display for one or more of the following reasons:
Reason | Solution
The iOS device is not in developer mode. You can enable the developer mode in one of the following two ways:
  • Connect the device to a Mac on which Xcode is installed, and start the app that you want to test on the device.
  • Add your provisioning profiles to the device.
    1. Open Xcode.
    2. Select Window > Devices.
    3. Right-click on the iOS device.
    4. Select Show Provisioning Profiles.
    5. Add your provisioning profiles.
You have recently updated the iOS version of the device.
  1. Open Xcode.
  2. Select Window > Devices.
  3. Wait unitl Xcode has processed the symbol files.
UI automation is not enabled on the iOS device.
  1. Select Settings > Developer.
  2. Activate Enable UI Automation.
The Web Inspector is not activated on the iOS device, while you are trying to test a mobile web application.
  1. Click Settings > Safari > Advanced.
  2. Activate the Web Inspector.
The app that you want to test was not built for the iOS version of the iOS device on which you are testing. | Use Xcode to build the app for the iOS version of the device.
The Software Update dialog box is currently open on the iOS device. Close the dialog box and disable automatic software updates:
  1. Select Settings > App and iTunes Stores > AUTOMATIC DOWNLOADS.
  2. Deactivate Updates.

Why does my Android device display only the Back button in the dynamic hardware controls?

If the Android or the Android Emulator is screen-locked when you start testing, the device or Emulator might display only the button Back in the dynamic hardware controls.

To solve this issue, stop the Open Agent, restart the device, and change the device settings to no longer lock the screen.

Why does my Android device or emulator no longer display a keyboard?

To support unicode characters, Silk Test Classic replaces the standard keyboard with a custom keyboard. When testing is finished, the original keyboard is restored. If an error occurs during testing, the custom keyboard might still be active and cannot be replaced.

To solve this issue, manually reset the keyboard under Settings > Language & input > Current Keyboard.

Why does my device not respond during testing?

If the device, emulator, or Simulator is screen-locked when you start testing, and Silk Test Classic is unable to unlock the screen, the device, emulator, or Simulator might stop responding to any actions.

To solve this issue, stop the Open Agent and change the device settings to no longer lock the screen.

Why can I not install the Information Service on a Mac?

When the Allow apps downloaded from setting in the General tab of the Security & Privacy system preferences pane is set to Mac App Store and identified developers, which is the default value, the following error message appears when opening the Information Service setup:
"SilkTestInformationService<version>.pkg" can't be opened because it is from an unidentified developer.
To solve this issue, use one of the following:
  • Right-click the setup file and select Open. A warning message will appear, but you will still be able to open the file.
  • Set the Allow apps downloaded from setting to Anywhere.
  • After attempting to open the file, navigate to the General tab of the Security & Privacy system preferences pane and click Open Anyway.

Why is the Recording window black when recording an Android app?

Android apps that require a higher level of security, for example apps that handle financial transactions, might have the FLAG_SECURE flag set, which prevents Silk Test Classic from capturing the app. Silk Test Classic relies on screenshots or on a video of the Android device during recording and will display a black screen of the device in the Recording window, if the Android app that you are testing has this flag set. To test such an app with Silk Test, you have to contact the app development team, and ask them to un-set the FLAG_SECURE flag during testing.

Why does Silk Test Classic not show a video when testing on an Android emulator?

If the emulator is using the graphic card of your computer for better rendering, the video capturing of Silk Test Classic might not work. To solve this, emulate the graphics in software:
  1. Open the Android Virtual Device Manager.
  2. Click Edit in the Actions column of the emulator.
  3. Select Software from the list in the Emulated Performance area of the Virtual Device Configuration dialog.

What can I do if Silk Test Classic does not show a video when testing in a cloud environment?

When testing in a cloud environment, showing a video might not work when recording or replaying a test, for example because required ports are not open.

To solve this issue, you can specify a list of WebDriver host URLs in the infoservice.properties file. For information on how to access this properties file, see Editing the Properties of the Silk Test Information Service. Add the option infoservice.disableScreencastHosts to the file, by typing the following:
infoservice.disableScreencastHosts=<URL_1>,<URL_2>, ...
For example:
infoservice.disableScreencastHosts=http://my-webdriver-server-url.com:80/wd/hub
You can specify URL patterns like *my-webdriver-server-url.com by using asterisks (*) as wildcards.

Silk Test Classic will show a series of screenshots instead of a video when recording and replaying on the specified hosts.

How can I change the installed version of Xcode?

If the version of Xcode that you are using is not supported by Silk Test Classic, for example when you upgrade to the latest version of Xcode, an error message might appear when testing on iOS.

To replace the installed version of Xcode with a supported version, download a supported Xcode version from https://developer.apple.com/download/more/, and replace the unsupported version with the downloaded version. For information about the supported Xcode versions, refer to the Release Notes.

What can I do if my Mac runs out of disk space?

Silk Test Classic uses Instruments to automate iOS devices. This tool creates large log files in the /Library/Caches/com.apple.dt.instruments directory, which might fill up disk space on the Mac. To solve this issue, Micro Focus recommends regularly deleting these log files, either manually or by using a cronjob. For example, to delete the files each day at the same time, you could do the following:
  1. Type sudo crontab -e into a Terminal. This opens an editor in which you can edit the crontab for root.
  2. Add the following line to the crontab:
    0 2 1 * * find /Library/Caches/com.apple.dt.instruments -mtime +10 -delete
  3. Save the crontab.

In this example, all log files that are older than ten days will be deleted each day at 2 AM from the directory.

Why does my test fail with the error message "Xcode build failed with code 65"?

When testing on a physical iOS device, this error usually means that during the build process the WebDriverAgent app could not be signed or that there is a problem with the provisioning profile.

You can check the actual problem with the following commands, which have to be executed at the Mac machine to which the device is connected:
cd /Applications/Silk/Mobile/common/Appium/node_modules/appium-xcuitest-driver
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test
Verify that the folder Resources exists under /Applications/Silk/Mobile/common/Appium/node_modules/appium-xcuitest-driver and that the folder contains the file WebDriverAgent.bundle. If not, create this folder and an empty WebDriverAgent.bundle file, for example by using the following command:
mkdir -p Resources/WebDriverAgent.bundle

What can I do to prevent the Developer Tools Access from requesting to take control of another process?

When starting the execution of a test on iOS, a message box stating the following might appear:
Developer Tools Access needs to take control of another process for debugging to continue. Type your password to allow this.
To avoid getting this message, execute the following command in a Terminal:
sudo /usr/sbin/DevToolsSecurity --enable

Why are the rectangles wrong while testing a mobile web application on an iPad?

If the rectangles around controls are offset when testing a mobile web application on an iPad, you might have multiple browser tabs open and the Tab bar might be displayed. To fix this issue, close all tabs except one.

Why can I no longer record or replay tests on my device after updating Silk Test Classic?

When updating to a new version of Silk Test Classic, some Appium apps on any physical mobile devices that have already been used for mobile testing with the previous version of Silk Test Classic are updated automatically. If for any reason these apps are not automatically updated, you might experience difficulties when trying to record or replay tests on the device.

If you are experiencing such issues on a specific Android device after updating Silk Test Classic, manually uninstall the following apps from the device:
  • Appium Android Input Manager
  • Appium Settings
  • io.appium.uiautomator2.server
  • io.appium.uiautomator2.server.test
  • Unlock

If you are experiencing such issues on a specific iOS device after updating Silk Test Classic, manually uninstall the WebDriverAgentRunner from the device.

Parent topic: Testing Mobile Applications
Related tasks
Testing Mobile Applications on Android
Editing the Properties of the Silk Test Information Service
Related reference
Prerequisites for Testing Mobile Applications on Android


Limitations for Testing Mobile Web Applications

The support for playing back tests and recording locators on mobile browsers is not as complete as the support for the other supported browsers. The known limitations for playing back tests and recording locators for mobile web applications are:

  • The following classes, interfaces, methods, and properties are currently not supported for mobile web applications:
    • BrowserApplication class.
      • CloseOtherTabs method
      • CloseTab method
      • ExistsTab method
      • GetActiveTab method
      • GetSelectedTab method
      • GetSelectedTabIndex method
      • GetSelectedTabName method
      • GetTabCount method
      • ImageClick method
      • OpenTab method
      • SelectTab method
    • DomElement class.
      • DomDoubleClick method
      • DomMouseMove method
      • GetDomAttributeList method
    • IKeyable interface.
      • PressKeys method
      • ReleaseKeys method
  • Silk Test Classic does not support testing HTML frames and iFrames with Apple Safari on iOS.
  • Recording in landscape mode is not supported for emulators that include virtual buttons in the system bar. Such emulators do not correctly detect rotation and render the system bar in landscape mode to the right of the screen, instead of the lower part of the screen. However, you can record against such an emulator in portrait mode.
  • Only HTML attributes in the HTML DOM are supported in XPath expressions for mobile applications. Silk Test Classic does not support properties in XPath expressions.
  • If you are testing a mobile web application on Android, Silk Test Classic does not support zooming.
  • The following JavaScript alert-handling methods of the BrowserWindow class do not work when testing on the Original Android Stock (AOSP) Browser:
    • AcceptAlert method
    • DismissAlert method
    • GetAlertText method
    • IsAlertPresent method
  • At any given point in time, you can test on multiple physical iOS devices that are connected to the Mac, but only on one iOS Simulator that is running on the Mac.
  • Before starting to test a mobile web application, ensure that no browser tab is open.
    Tip: On iPads you can disable tabs in Apple Safari. Navigate to Settings > Safari and disable Show Tab Bar to do so.
  • While testing a mobile web application, you can only have one browser tab open.
  • Silk Test Classic does not support testing mobile web applications that are opened by a native mobile application.
Parent topic: Testing Mobile Applications
Related concepts
Limitations for Testing Native Mobile Applications


Limitations for Testing Native Mobile Applications

The known limitations for playing back tests and recording locators on native mobile applications (apps) are:

  • The following classes, interfaces, methods, and properties are currently not supported for native mobile applications:
    • IKeyable interface.
      • PressKeys method
      • ReleaseKeys method
    • MobileDevice class.
      • When testing a native mobile application on iOS, the SetLocation method is not supported.
      • When testing a native mobile application on an Android version prior to Android 6.0, you have to enable Allow mock locations to use the SetLocation method. To do so, open the settings of the Android device or emulator and tap Developer Options.
      • When testing a native mobile application on Android 6.0 or later, you have to set the app to Appium Settings to use the SetLocation method. To do so, open the settings of the Android device or emulator and tap Developer Options > Select mock location app. Then choose Appium Settings.
        Note: The Appium Settings entry is only available if you have already executed a test with Appium on the Android device or emulator.
      • When testing on iOS, the Find method does not work in the following cases:
        • If the path attribute is set.
        • If an attribute value is empty.
  • When testing on iOS, the getValue method of the XCUIElementTypeSwitch class returns the strings false or true depending on the checked state, instead of returning the strings 0 and 1.
  • Recording in landscape mode is not supported for Android emulators that include virtual buttons in the system bar. Such emulators do not correctly detect rotation and render the system bar in landscape mode to the right of the screen, instead of the lower part of the screen. However, you can record against such an emulator in portrait mode.
  • Only HTML attributes in the HTML DOM are supported in XPath expressions for mobile applications. Silk Test Classic does not support properties in XPath expressions.
  • At any given point in time, you can test on multiple physical iOS devices that are connected to the Mac, but only on one iOS Simulator that is running on the Mac. With Silk Test 17.5 Hotfix 1 or later, you are no longer required to use multiple user sessions on a Mac to test mobile applications on iOS.
  • Silk Test Classic does not support text recognition when testing native mobile applications on both Android and iOS.
    Text recognition includes the following methods:
    • TextCapture
    • TextClick
    • TextExists
    • TextRectangle
  • Silk Test Classic does not support testing native mobile applications with multiple web views.
  • When testing on iOS, the state of the isVisible property is always true, even if the element is not visible.
  • When testing on iOS, a swipe action with multiple steps swipes to a point, releases the mouse pointer and then swipes to the next point. On prior versions of iOS, the action does not release the mouse pointer between the swipes.
  • When testing on iOS, Silk Test Classic does not support any multi-touch actions except pinch.
  • When testing on iOS, Silk Test Classic does not support the PinchIn method.
  • When testing on iOS, you can only accept or dismiss alert dialog boxes. If no Cancel button is available and Silk Test Classic cannot dismiss the dialog, the default action is to accept the dialog.
  • When testing on Android, Silk Test Classic does not provide automated synchronization for controls of the Animation class.

  • When testing on iOS, Silk Test Classic does not provide automated synchronization for controls that call the UIView.animate function or the UIView.animateWithDuration function.

    You can workaround this issue by increasing the speed of the animation in the app delegate:
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
  //...
  if NSProcessInfo.processInfo().environment["automationName"] == "Silk Test" {
    // Speed animations up (recommended)
    window!.layer.speed = 100;
  }
}
    Micro Focus does not recommend disabling such animations completely, as this might change the applications behavior. However, if speeding up the animation does not resolve the synchronization issue, you could completely disable animations in the app delegate as follows:
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
  //...
  if NSProcessInfo.processInfo().environment["automationName"] == "Silk Test" {
    UIView.setAnimationsEnabled(false)
  }
}
  • When testing on iOS, the following additional limitations apply:
    • You might experience performance decreases while recording and replaying tests.
    • Due to internal changes in iOS, the locators of some controls might have changed, and some of your existing tests might break.
    • Text fields that are not in focus might not be recognized as text fields. To ensure that text fields are recognized correctly, set the focus on the text fields, for example by clicking on a text field before trying to interact with it.
Parent topic: Testing Mobile Applications
Related concepts
Limitations for Testing Mobile Web Applications


Clicking on Objects in a Mobile Website

When clicking on an object during the recording and replay of an automated test, a mobile website presents the following challenges in comparison to a desktop website:
  • Varying zoom factors and device pixel ratios.
  • Varying screen sizes for different mobile devices.
  • Varying font and graphic sizes between mobile devices, usually smaller in comparison to a website in a desktop browser.
  • Varying pixel size and resolution for different mobile devices.

Silk Test Classic enables you to surpass these challenges and to click the appropriate object on a mobile website.

When recording a test on a mobile device, Silk Test Classic does not record coordinates when recording a Click. However, for cross-browser testing, coordinates are allowed during replay. You can also manually add coordinates to a Click. Silk Test Classic interprets these coordinates as the HTML coordinates of the object. To click on the appropriate object inside the BrowserWindow, during the replay of a test on a mobile device, Silk Test Classic applies the current zoom factor to the HTML coordinates of the object. The device pixel coordinates are the HTML coordinates of the object, multiplied with the current zoom factor.

If the object is not visible in the currently displayed section of the mobile website, Silk Test Classic scrolls to the appropriate location in the website.

Example

The following code shows how you can test a DomButton with a fixed size of 100 x 20 px in your HTML page.

DomButton domButton = Desktop.Find("locator for the button")
domButton.Click(MouseButton.LEFT, new Point(50, 10))

During replay on a different mobile device or with a different zoom factor, the DomButton might for example have an actual width of 10px on the device screen. Silk Test Classic clicks in the middle of the element when using the code above, independent of the current zoom factor, because Silk Test Classic interprets the coordinates as HTML coordinates and applies the current zoom factor.

Parent topic: Testing Mobile Applications


Using Existing Mobile Web Tests

Silk Test 17.0 or later uses a different approach to mobile web testing than previous versions of Silk Test. This change might result in your old mobile web tests no longer working on Silk Test 17.0 or later. This topic describes some of the changes that were introduced with Silk Test 17.0 and provides guidance on changing existing mobile web tests with Silk Test 17.0 or later.

The following changes for mobile web testing were introduced with Silk Test 17.0:

  • With previous versions of Silk Test, you were able to test on iOS devices that were connected by USB to a Windows machine. With Silk Test 17.0 or later, you can only test on iOS devices that are connected to an OSX machine (Mac).
  • If you have tested mobile web applications on an Android device with a previous version of Silk Test, you have to manually remove the proxy from the Android device to test a web application with Silk Test 17.0 or later. Silk Test 17.0 or later no longer requires a proxy, and if the proxy is set, the message Unable to connect to the proxy server displays on the device.
Parent topic: Testing Mobile Applications


Testing Rumba Applications

Rumba is the world's premier Windows desktop terminal emulation solution. Silk Test provides built-in support for recording and replaying Rumba.

When testing with Rumba, please consider the following:

  • The Rumba version must be compatible to the Silk Test version. Versions of Rumba prior to version 8.1 are not supported.
  • All controls that surround the green screen in Rumba are using basic WPF functionality (or Win32).
  • The supported Rumba desktop types are:
    • Mainframe Display
    • AS400 Display
    • Unix Display

For a complete list of the record and replay controls available for Rumba testing, see the Rumba Class Reference.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

  • Enabling and Disabling Rumba
    Describes how to enable and disable Rumba.
  • Locator Attributes for Identifying Rumba Controls
    Describes the locator attributes that are supported for identifying Rumba controls.
  • Testing a Unix Display
    Describes how you can replay a test on a Unix display in Rumba.
  • Rumba Class Reference
    Lists the Visual Basic classes for Rumba support.
Parent topic: Testing in Your Environment with the Open Agent
Related reference
Rumba Class Reference


Enabling and Disabling Rumba

Rumba is the world's premier Windows desktop terminal emulation solution. Rumba provides connectivity solutions to mainframes, mid-range, UNIX, Linux, and HP servers.

Enabling Support

Before you can record and replay Rumba scripts, you need to enable support:

  1. Install Rumba desktop client software version 8.1 or later.
  2. Click (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Administration > Rumba plugin > Enable Silk Test Rumba plugin or (in Microsoft Windows 10) Start > Silk > Enable Silk Test Rumba plugin.

Disabling Support

Click (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Administration > Rumba plugin > Disable Silk Test Rumba plugin or (in Microsoft Windows 10) Start > Silk > Disable Silk Test Rumba plugin.

Parent topic: Testing Rumba Applications


Locator Attributes for Identifying Rumba Controls

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests. Supported attributes include:

caption
The text that the control displays.
priorlabel
Since input fields on a form normally have a label explaining the purpose of the input, the intention of priorlabel is to identify the text input field, RumbaTextField, by the text of its adjacent label field, RumbaLabel. If no preceding label is found in the same line of the text field, or if the label at the right side is closer to the text field than the left one, a label on the right side of the text field is used.
StartRow
This attribute is not recorded, but you can manually add it to the locator. Use StartRow to identify the text input field, RumbaTextField, that starts at this row.
StartColumn
This attribute is not recorded, but you can manually add it to the locator. Use StartColumn to identify the text input field, RumbaTextField, that starts at this column.
All dynamic locator attributes.

For additional information on dynamic locator attributes, see Dynamic Locator Attributes.

Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.
Parent topic: Testing Rumba Applications


Testing a Unix Display

Unix displays in Rumba are completely text-based, and provide no UI controls except the main RUMBA screen control. To replay a test on a Unix display, you can use the SendKeys method to send keys to the Unix display. Silk Test Classic does not support recording on a Unix display.

Parent topic: Testing Rumba Applications


Rumba Class Reference

When you configure a Rumba application, Silk Test Classic automatically provides built-in support for testing standard Rumba controls.

Parent topic: Testing Rumba Applications


Testing SAP Applications

Silk Test Classic provides built-in support for testing SAP client/server applications based on the Windows-based GUI module.

For information on the supported versions and any eventual known issues, refer to the Release Notes.

Note: If you use SAP NetWeaver with Internet Explorer or Mozilla Firefox, Silk Test Classic tests the application using the xBrowser technology domain.

Silk Test Agent Support

When you create a Silk Test Classic SAP project, the Open Agent is assigned as the default Agent.

Note: You must set Ctrl+Shift as the shortcut key combination to use to pause recording. To change the default setting, click Options > Recorder and then check the OPT_ALTERNATE_RECORD_BREAK check box.
  • Locator Attributes for SAP Controls
    Lists the attributes that the locator uses to identify objects inside your SAP tests.
  • Dynamically Invoking SAP Methods
    Explains how to call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose by using the dynamic invoke feature.
  • Configuring Automation Security Settings for SAP
    Configure the security warning settings to prevent SAP from warning you each time a test plays back an SAP application.
  • SAP Class Reference
    Lists the Visual Basic classes for SAP support.
Parent topic: Testing in Your Environment with the Open Agent
Related tasks
Setting Recording Options for the Open Agent


Locator Attributes for SAP Controls

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.

Silk Test Classic supports the following locator attributes for SAP controls:
  • automationId
  • caption
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.
Parent topic: Testing SAP Applications
Related concepts
Dynamic Object Recognition
Related tasks
Defining which Custom Locator Attributes to Use for Recognition


Dynamically Invoking SAP Methods

Dynamic invoke enables you to directly call methods, retrieve properties, or set properties, on an actual instance of a control in the application under test. You can also call methods and properties that are not available in the Silk Test Classic API for this control. Dynamic invoke is especially useful when you are working with custom controls, where the required functionality for interacting with the control is not exposed through the Silk Test Classic API.

Call dynamic methods on objects with the DynamicInvoke method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.

Call multiple dynamic methods on objects with the DynamicInvokeMethods method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.

Retrieve dynamic properties with the GetProperty method and set dynamic properties with the SetProperty method. To retrieve a list of supported dynamic properties for a control, use the GetPropertyList method.

For example, to call a method named SetTitle, which requires the title to be set as an input parameter of type string, on an actual instance of a control in the application under test, type the following:
control.DynamicInvoke("SetTitle", {"my new title"})
Note: Typically, most properties are read-only and cannot be set.
Note: Reflection is used in most technology domains to call methods and retrieve properties.

Supported Methods and Properties

The following methods and properties can be called:
  • Methods and properties that Silk Test Classic supports for the control.
  • All public methods that the SAP automation interface defines
  • If the control is a custom control that is derived from a standard control, all methods and properties from the standard control can be called.

Supported Parameter Types

The following parameter types are supported:
  • All built-in Silk Test Classic types

    Silk Test Classic types includes primitive types (such as boolean, int, string), lists, and other types (such as Point and Rect).

  • UI controls

    UI controls can be passed or returned as AnyWin.

Returned Values

The following values are returned for properties and methods that have a return value:
  • The correct value for all built-in Silk Test Classic types. These types are listed in the Supported Parameter Types section.
  • All methods that have no return value return NULL.

Example

A custom calculator control has a Reset method and an Add method, which performs an addition of two numbers. You can use the following code to call the methods directly from your tests:
customControl.Invoke("Reset")
REAL sum = customControl.DynamicInvoke("Add",{1,2})
Parent topic: Testing SAP Applications
Related concepts
Dynamic Invoke


Configuring Automation Security Settings for SAP

Before you launch an SAP application, you must configure the security warning settings. Otherwise, the security warning A script is trying to attach to the GUI displays each time a test plays back an SAP application.
  1. Click Start > Control Panel.
  2. Choose SAP Configuration. The SAP GUI Configuration dialog box opens.
  3. In the Design Selection tab, uncheck the Notify When a Script Attaches to a Running SAP GUI check box.
Parent topic: Testing SAP Applications


SAP Class Reference

When you configure a SAP application, Silk Test Classic automatically provides built-in support for testing standard SAP controls.

Note: To enable Silk Test Classic to recognize SAP controls, enable SAP GUI Scripting on the server. For information on enabling SAP GUI scripting, see Introduction to SAP Gui Scripting. If SAP GUI Scripting is not enabled, Silk Test Classic recognizes all controls as Win32 and custom controls.

The classes included in the SAP class reference, along with all included properties and methods, are part of the SAP Automation module that is directly accessible through Silk Test Classic.

Note: The interface, including the underlying algorithms and the behavior of the interface, is not under the control of Silk Test Classic.
Parent topic: Testing SAP Applications
Related reference
SAP Class Reference


Cross-Browser Testing with the Open Agent

This functionality is supported only if you are using the Open Agent.

With Silk Test Classic, you can easily verify the functionality of even the most advanced web application across a variety of browsers, with a single, portable test script. Silk Test Classic provides leading support for effective and maintainable cross-browser testing with modern web technologies.

One of the main challenges in test automation is to create and maintain test cost effectively. As different browsers behave differently, web application validation is hard to carry out productively. Silk Test Classic enables you to focus on writing tests, as it handles the following three areas of cross-browser testing:

Built-in synchronization
This enables you to create scripts that run on all supported browsers, without the need to manually synchronize against asynchronous events, which are typical of highly dynamic web applications such as AJAX, or HTML5. Silk Test Classic supports synchronization modes for HTML or AJAX as well as all major web environments including Apache Flex, Microsoft Silverlight, and HTML5/AJAX. For additional information, see Page Synchronization for xBrowser.
Unified object model
Silk Test Classic enables you to create and maintain a test which runs across a wide range of different browsers. A unified object model across all browsers gives you the ability to focus on a single browser when you create or maintain a test. Silk Test Classic ensures that the object you interact with is accessible in the same way on all the other browsers, which saves time and enables you to focus on testing rather than on finding workarounds for different browsers.
Out-of-the-box recording of a cross-browser script
Record a script once and replay it in all the other browsers, without any modifications. This significantly reduces the time and effort it takes to create and maintain test scripts. Nothing is simulated - testing is carried out across real browsers, which ensures that the test behaves exactly as it does for your end user.
With Silk Test Classic, you can test web applications that use:
  • Internet Explorer.
  • Mozilla Firefox.
  • Google Chrome.
  • Microsoft Edge.
  • Chrome for Android on an Android device.
  • Apple Safari, both on a Mac and on an iOS device.
  • Embedded browser controls.
Note: You can record tests for web applications using one of the following browsers:
  • Internet Explorer.
  • Microsoft Edge.
  • Mozilla Firefox.
  • Google Chrome 50 or later.
  • A mobile browser on a mobile device.
You can replay tests or record locators on any other supported browser.
Note: Before you record or playback web applications, disable all browser add-ons that are installed in your system. To disable add-ons in Internet Explorer, click Tools > Internet Options, click the Programs tab, click Manage add-ons, select an add-on and then click Disable.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Sample Applications

To access the Silk Test sample web applications, go to:

  • http://demo.borland.com/InsuranceWebExtJS/
  • http://demo.borland.com/gmopost
  • http://demo.borland.com/gmoajax
  • Test Objects for xBrowser
    Describes the classes that Silk Test Classic uses to model a web application.
  • Overview of Test Frames
    Provides an overview of test frames.
  • Testing Web Applications on Different Browsers
    Provides an overview of testing web applications on different browsers.
  • Changing the Browser Type When Replaying Tests from the UI
    Describes how to change the browser type for replay in the UI.
  • Setting the Browser when Running Automated Tests
    Modify your test case to replay tests in a specific browser, for example when running automated tests from a CI server or from Silk Central.
  • Testing Objects in a Web Page with the Open Agent
    Describes how you can test the objects that are included in a web application with Silk Test Classic.
  • Object Recognition for xBrowser Objects
    Describes how Silk Test Classic recognizes xBrowser objects.
  • xBrowser Default BaseState
    Describes the xBrowser default base state.
  • Locator Attributes for xBrowser controls
    Provides an overview of the locator attributes that are supported for xBrowser controls.
  • Page Synchronization for xBrowser
    Provides an overview of page synchronization modes and troubleshooting tips.
  • Configuring the Locator Generator for xBrowser
    Describes how to configure the locator generator for xBrowser.
  • Comparing API Playback and Native Playback for xBrowser
    Lists the differences between API playback and native playback.
  • Setting Recording Options for xBrowser
    Describes how to set recording options for xBrowser.
  • Browser Configuration Settings for xBrowser
    Describes the browser configuration settings for xBrowser.
  • Connection String for a Remote Desktop Browser
    Describes how you can specify a connection string to connect to a desktop browser on a remote machine.
  • Setting Capabilities for WebDriver-Based Browsers
    Set capabilities in the base state to customize and configure web-driver based browsers.
  • Testing with Apple Safari on a Mac
    Describes how you can test with Apple Safari on a Mac.
  • Testing with Google Chrome
    Describes how you can test with Google Chrome.
  • Testing with Mozilla Firefox
    Describes how you can test with Mozilla Firefox.
  • Testing with Microsoft Edge
    Describes how you can test with Microsoft Edge.
  • Responsive Web Design Testing
    Describes how you can specify the size of the browser window to perform responsive web design testing.
  • Detecting Visual Breakpoints
    Detect visual breakpoints in a responsive web application to test against the web application in a window with a specific size.
  • Manually Creating Tests for Dynamic Popup Menus
    Describes how you can create scripts that use dynamic object recognition with the Open Agent.
  • Finding Hidden Input Fields
    Describes how you can specify whether you want to find hidden input fields or not.
  • Cross-Browser Testing: Frequently Asked Questions
    Includes a collection of questions that you might encounter when testing your Web application on various browsers.
  • Testing the Insurance Company Sample Web Application
    Describes how to test the insurance company sample Web application.
  • xBrowser Classes
    Lists the classes that are used for xBrowser.
Parent topic: Testing in Your Environment with the Open Agent
Related concepts
Dynamic Object Recognition
Troubleshooting Web Applications
Related tasks
Creating a New Project
Configuring Web Applications
Recording Test Cases for Standard and Web Applications
Recording Test Cases for Mobile Applications
Running a Test Case


Test Objects for xBrowser

Silk Test Classic uses the following classes to model a web application:
Class | Description
BrowserApplication | Exposes the main window of a web browser and provides methods for tabbing.
BrowserObject | Represents the base class for all objects that are contained within a BrowserApplication.
BrowserWindow | Provides access to tabs and embedded browser controls and provides methods for navigating to different pages.
DomElement | Exposes the DOM tree of a web application, including frames, and provides access to all DOM attributes. Specialized classes are available for several DOM elements.
DomButton | Represents the top-level container for a web page. It exposes the DOM tree through DomElement.
DomCheckBox | Represents all DOM elements that were specified using the <input type='checkbox'> tag.
DomForm | Represents all DOM elements that are specified using the <form> tag.
DomLink | Represents all DOM elements that were specified using the <a> tag.
DomListBox | Represents all DOM elements that were specified using the <select> tag.
DomRadioButton | Represents all DOM elements that were specified using the <input type='radio'> tag.
DomTable | Represents all DOM elements that were specified using the <table> tag.
DomTableRow | Represents all DOM elements that were specified using the <tr> tag.
DomTextField Represents all DOM elements that were specified using one of the following tags:
  • <input type='text'>
  • <input type='password'>
  • <input type='file'>
  • <textarea>
Parent topic: Cross-Browser Testing with the Open Agent
Related reference
xBrowser Classes


Overview of Test Frames

A test frame is an include file (.inc) that serves as a central global repository of information about the application under test. It contains all the data structures that support your test cases and test scripts. Though you do not have to create a test frame, by declaring all the objects in your application, you will find it much easier to understand, modify, and interpret the results of your tests.

When you create a test frame, Silk Test Classic automatically adds the frame file to the Use files field of the Runtime Options dialog box. This allows Silk Test Classic to use the information in the declarations and recognize the objects in your application when you record and run test cases.

When you enable extensions, Silk Test Classic adds an include file based on the technology or browser type that you enable to the Use files location in the Runtime Options dialog box. For extensions that use the Open Agent, Silk Test Classic names the include file <technology_type>.inc. For instance, if you enable extensions for an Apache Flex application, a file named flex.inc is added. If you enable extensions for an Internet Explorer browser, Silk Test Classic adds the explorer.inc file to the Runtime Options dialog box.

A constant called wStartup is created when you record the test frame. By assigning the identifier of the login window to wStartup and by recording a new invoke method, your tests can start the application, enter any required information into the login window, then dismiss the login window.

See Marking 4Test Code as GUI-Specific to learn about the ways you modify the test frame when porting your test cases to other GUIs.

  • Recording the Test Frame for a Web Application (Open Agent)
    Record a test frame file for a web application to store information about the web application, for example the URL.
  • Modifying the Identifiers
    Describes how to modify identifiers.
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Marking 4Test Code as GUI Specific
Related reference
Runtime Options Dialog Box


Recording the Test Frame for a Web Application (Open Agent)

This functionality is supported only if you are using the Open Agent.

Record a test frame file for a web application to store information about the web application, for example the URL.

  1. Click File > New from the menu bar.
  2. Click Test Frame and then click OK. The Select Application dialog box displays.
  3. Select the Web tab.
  4. Select one of the installed browsers or mobile browsers from the list.
  5. Specify the web page to open in the Enter URL to navigate text box. If an instance of the selected browser is already running, you can click Use URL from running browser to record against the URL currently displayed in the running browser instance.
  6. Click OK.
Parent topic: Overview of Test Frames


Modifying the Identifiers

Identifiers are arbitrary strings. You use identifiers to identify objects in your scripts. Tags, on the other hand, are not arbitrary and should not be changed except in well-specified ways.

To make your tests easier to understand and maintain, you can change your objects’ identifiers to correspond to their meaning in your application. Then when Silk Test Classic records tests, it will use the identifiers that you specify.

Parent topic: Overview of Test Frames


Testing Web Applications on Different Browsers

Testing web applications can be challenging because of the large number of browsers and browser versions available. Your web applications must support the browsers that the users of these applications prefer to use. While developing tests for web applications, you might ask your self the following questions:

  • How will your test cases handle differences between browsers?
  • How can you specify which browser to use for the test case or test script?

Handling differences between browsers

In most cases, your include files (declarations) and scripts apply to any browser. You can run test cases against different browsers by simply changing the default browser and running the test case, even if the pages look a bit different, such as pushbuttons being in different places. Because Silk Test Classic is object-based, the layout is not relevant. All that matters are the objects on the page.

Declarations and scripts might have one or more lines that apply only to particular browsers. In such a case you can use browser specifiers to make lines specific to one or more browsers. Browser specifiers are of the built-in data type BROWSERTYPE.

Parent topic: Cross-Browser Testing with the Open Agent
Related tasks
Setting the Browser when Running Automated Tests


Changing the Browser Type When Replaying Tests from the UI

This topic describes how to change the browser type for replay in the UI. For information on how you to set the browser when executing automated tests from a command-line interface, for example from a CI server or from Silk Central, see Setting the Browser when Running Automated Tests.

To select a specific browser to replay a test, perform the following actions:

  1. Record the test case against the web application. For a list of the supported browsers for recording, see Cross-Browser Testing.
  2. Replay the test to ensure it works as expected.
  3. Click Configure Applications on the Basic Workflow bar. If you do not see Configure Applications on the Basic Workflow bar, ensure that the default Agent is set to the Open Agent. The Select Application dialog box opens.
  4. Select the Web tab.
  5. Select the browser on which you want to replay the test.
  6. Click OK. If you have selected an existing instance of Google Chrome, Silk Test Classic checks whether the automation support is included. If the automation support is not included, Silk Test Classic restarts Google Chrome. The Choose name and folder of the new frame file page opens. Silk Test Classic configures the recovery system and names the corresponding file frame1.inc by default.
  7. Navigate to the location in which you want to save the frame file.
  8. In the File name text box, type the name for the frame file that contains the default base state and recovery system. Then, click Save.
  9. Copy the window declaration for the additional browser into the original frame1.inc file. frame1.inc must not contain two window declarations of the same name, so rename the Internet Explorer declaration to InternetExplorer and the new declaration to another name, for example Firefox.
  10. To ensure that each of the window declarations works with the appropriate browser type, add the browsertype property to the locator. For example, "//BrowserApplication[@browsertype='Firefox']".
  11. Determine which browser you want to use and change the const wDynamicMainWindow = <browsertype> to use that browser and then replay the test. For example, you might type const wDynamicMainWindow = InternetExplorer.
Parent topic: Cross-Browser Testing with the Open Agent
Related tasks
Setting the Browser when Running Automated Tests
Related reference
Prerequisites for Replaying Tests with Google Chrome


Setting the Browser when Running Automated Tests

This functionality is supported only if you are using the Open Agent.

This topic describes how you can set the browser when executing automated tests from a command-line interface, for example from a CI server or from Silk Central. For information on how to set the browser for test replay from the UI, see Changing the Browser Type When Replaying Tests.

  1. Record the test case.
  2. Use the sBrowserType property to specify the browser.
    The following browsers are supported for the Open Agent:
    [ ] const BROWSER_TYPE_INTERNET_EXPLORER   = "InternetExplorer"
[ ] const BROWSER_TYPE_FIREFOX             = "Firefox"
[ ] const BROWSER_TYPE_CHROME              = "GoogleChrome"
[ ] const BROWSER_TYPE_ANDROID_BROWSER     = "AndroidBrowser"
[ ] const BROWSER_TYPE_SAFARI              = "Safari"
[ ] const BROWSER_TYPE_EDGE                = "Edge"
    Tip: For a complete list of the available browser types, see the file 4Test.inc file in the Silk Test installation directory, which is by default C:\Program Files (x86)\Silk\SilkTest.
  3. Call the default base state.
  4. Replay the test case.

Examples

The following code shows a sample frame file for the sample web application http://demo.borland.com/InsuranceWebExtJS/:
[-] window BrowserApplication WebBrowser
 [ ] locator "//BrowserApplication"
 [ ]
 [ ] // The start URL
 [ ] const sUrl = "http://demo.borland.com"
 [ ]
 [ ] STRING sBrowserType = NULL
 [ ] STRING sConnectionString = NULL
 [ ] STRING sCmdLine = NULL
 [ ]
 [ ] const bCloseOtherTabs = TRUE
To run a test against a specific browser, set the sBrowserType property and call the base state. The following code sample implements a simple test case that opens the application under test in Internet Explorer:
[-] testcase OpenGMOAjaxAppIE () appstate none
 [ ] WebBrowser.sBrowserType = BROWSER_TYPE_INTERNET_EXPLORER
 [ ] WebBrowser.sCmdLine = "C:\\Program Files\\Internet Explorer\\iexplore.exe" // Optional
 [ ] DefaultBaseState()
 [ ] WebBrowser.BrowserWindow.DemoApplication.Select()
The following code sample opens the same application in Mozilla Firefox:
[-] testcase OpenGMOAjaxAppFF () appstate none
 [ ] WebBrowser.sBrowserType = BROWSER_TYPE_FIREFOX
 [ ] DefaultBaseState()
 [ ] WebBrowser.BrowserWindow.DemoApplication.Select()
To run the test against a remote browser, for example Apple Safari on a Mac, you have to additionally specify the connection string:
[-] testcase OpenGMOAjaxAppSafari () appstate none
 [-] recording
  [ ] WebBrowser.sBrowserType = BROWSER_TYPE_SAFARI
  [ ] WebBrowser.sConnectionString = "host=macmini1702.microfocus.com"
  [ ] DefaultBaseState()
  [ ] WebBrowser.BrowserWindow.DemoApplication.Select()
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Testing Web Applications on Different Browsers
Connection String for a Mobile Device
Selecting the Mobile Device for Test Replay
Understanding the Recovery System for the Open Agent
Dynamic Object Recognition
Related tasks
Changing the Browser Type When Replaying Tests from the UI
Configuring Web Applications
Related reference
Prerequisites for Replaying Tests with Google Chrome


Testing Objects in a Web Page with the Open Agent

This functionality is supported only if you are using the Open Agent.

The Document Object Model (DOM) extension uses information in the HTML source to recognize and manipulate objects on a web page. Silk Test Classic uses the DOM extension to test the objects that are included in a web application.

Using the DOM extension provides several advantages:

  • During recording, Silk Test Classic displays a rectangle which highlights the active control in the web page.
  • The DOM extension is highly accurate, because it gets information directly from the browser. For example, the DOM extension recognizes text size and the actual name of an object.
  • The DOM extension is independent of the browser size and text size settings.
  • The DOM extension recognizes non-visible objects.
  • The DOM extension offers support for borderless tables.
  • The DOM extension is consistent with the standard being developed by the W3C.
  • Testing Columns and Tables
    Provides overview for testing columns and tables.
  • Definition of a Table (Open Agent)
    Describes how a table is defined for the Open Agent.
  • Testing Controls
    Describes how you can test controls for Web applications.
  • Testing Images
    Describes how you can test images in Web applications.
  • Testing Links
    Describes how to test links.
  • Testing Text in Web Applications
    Describes how to test text in Web applications.
Parent topic: Cross-Browser Testing with the Open Agent


Testing Columns and Tables

  • If you are using the Classic Agent, tables in Web applications are recognized as HtmlTable controls. An HtmlTable consists of two or more HtmlColumn controls.
  • If you are using the Open Agent, tables in Web applications are recognized as DomTable controls. Rows in a table are recognized as DomTableRow controls.
Parent topic: Testing Objects in a Web Page with the Open Agent
Related concepts
Overview of Test Frames
Related reference
DomTable Class
DomTableRow Class


Definition of a Table (Open Agent)

For the Open Agent, a table is a DomTable, which is a DOM element that is specified using the <table> tag.

Parent topic: Testing Objects in a Web Page with the Open Agent


Testing Controls

Web applications can contain the same controls as standard applications, including the following:
Control | Classic Agent Class | Open Agent Class
check box | HtmlCheckBox | DomCheckBox
combo box | HtmlComboBox | No corresponding class.
list boxes | HtmlListBox | DomListBox
popup lists | HtmlPopupList | DomListBox
pushbuttons | HtmlPushButton | DomButton
radio lists | HtmlCheckBox | DomCheckBox

All these classes are derived from their respective standard class. For example, HtmlCheckBox is derived from CheckBox. So all the testing you can do with these controls in standard applications you can also do in Web applications.

Classic Agent Example

The following code gets the list of items in the credit card list in the Billing Information page of the sample GMO application:

LIST OF STRING lsCards
lsCards = BillingPage.CreditCardList.GetContents ()
ListPrint (lsCards)

Result:
American Express
MasterCard
Visa

Open Agent Example

The following code gets the list of items in the credit card list in the Billing Information page of the sample GMO application:

LIST OF STRING lsCards
lsCards = WebBrowser.BrowserWindow.CardType.Items
ListPrint(lsCards)

Result:
American Express
MasterCard
Visa
Parent topic: Testing Objects in a Web Page with the Open Agent


Testing Images

Classic Agent

If you are using the Classic Agent, images in your Web application are objects of type HtmlImage. You can verify the appearance of the image by using the Bitmap tab in the Verify Window dialog box.

If an HtmlImage is an image map, which means that the image contains clickable regions, you can use the following methods to test the clickable regions:
  • GetRegionList
  • MoveToRegion
  • ClickRegion

Open Agent

If you are using the Open Agent, you can test images by using the IMG locator. For example, the following code sample finds an image and then prints some of the properties of the image:
Window img = FindBrowserApplication("/BrowserApplication").FindBrowserWindow("//BrowserWindow").Find("//IMG[@title='Image1.png']")
String src = img.GetProperty("src")
String altText = img.GetProperty("alt")
print(src)
print(altText)
Parent topic: Testing Objects in a Web Page with the Open Agent


Testing Links

  • If you are using the Classic Agent, links in your application are objects of type HtmlLink.
  • If you are using the Open Agent, links in your application are objects of type DomLink.

Silk Test Classic provides several methods that let you get their text properties as well as the location to which they jump.

Classic Agent Example

The following code returns the definition for the HtmlLink on a sample home page:
STRING sJump
sJump = Acme.LetUsKnowLink.GetLocation ()
Print (sJump)

Result:
mailto:support@acme.com

Open Agent Example

The following code returns the definition for the DomLink on the sample home page:
STRING sJump
sJump = WebBrowser.BrowserWindow.LetUsKnowLink.GetProperty("href")
Print(sJump)

Result:
mailto:support@acme.com
Parent topic: Testing Objects in a Web Page with the Open Agent


Testing Text in Web Applications

Classic Agent

Straight text in a Web application can be in the following classes:

  • HtmlHeading
  • HtmlText

Silk Test Classic provides methods for getting the text and all its properties, such as color, font, size, and style.

There are also classes for text in Java applets and applications.

Classic Agent Example

For example, the following code gets the copyright text on a sample Web page:
STRING sText
sText = Acme.Copyright.GetText ()
Print (sText)

Result:
Copyright © 2006 Acme Software, Inc. All rights reserved.

Open Agent

When you are using the Open Agent, use the GetText() method to get text out of every DomElement control.

Open Agent Example

For example, the following code gets the text of a DomLink control:
Window link = FindBrowserApplication("/BrowserApplication")
                                                                                .FindBrowserWindow("//BrowserWindow")
                     .FindDomLink("A[@id='story2128000']")
String linkText = link.GetText()
print(linkText)
Parent topic: Testing Objects in a Web Page with the Open Agent


Object Recognition for xBrowser Objects

This functionality is supported only if you are using the Open Agent.

The xBrowser technology domain supports dynamic object recognition.

When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations.

Existing test cases that use dynamic object recognition without locator keywords in an INC file will continue to be supported. You can replay these tests, but you cannot record new tests with dynamic object recognition without locator keywords in an INC file.

Test cases use locator strings to find and identify objects. A typical locator includes a locator name and at least one locator attribute, such as "//LocatorName[@locatorAttribute='value']".

Locator Names
With other technology types, such as Java SWT, locator names are created using the class name of the test object. With xBrowser, the tag name of the DOM element can also be used as locator name. The following locators describe the same element:
  1. Using the tag name: "//a[@href='http://www.microfocus.com']"
  2. Using the class name: "//DomLink[@href='http://www.microfocus.com']"

To optimize replay speed, use tag names rather than class names.

Locator Attributes
All DOM attributes can be used as locator string attributes. For example, the element <button automationid='123'>Click Me</button> can be identified using the locator "//button[@automationid='123']".
Recording Locators
Silk Test Classic uses a built-in locator generator when recording test cases and using the Locator Spy. You can configure the locator generator to improve the results for a specific application.
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Dynamic Object Recognition
Related tasks
Recording Locators Using the Locator Spy


xBrowser Default BaseState

This functionality is supported only if you are using the Open Agent.

By default, Silk Test Classic uses the dynamic base state for xBrowser projects. When you configure the application, the base state is generated to the frame.inc file.

  • The wDynamicMainWindow variable in the first line of the frame.inc file tells Silk Test Classic to use the dynamic base state rather than the classic base state.
  • The WebBrowser window declaration contains the necessary information to launch the browser and navigate to the Web application that you want to test.
  • If you do not want to close all other tabs during base state execution, change bCloseOtherTabs to false.
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Configuring Applications
DefaultBaseState Function


Locator Attributes for xBrowser controls

This functionality is supported only if you are using the Open Agent.

When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.

Silk Test Classic supports the following locator attributes for xBrowser controls:

caption
Supports wildcards ? and *.
all DOM attributes
Supports wildcards ? and *.
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.
Note: Whitespace, which includes spaces, carriage returns, line feeds, and tabs, is handled differently by each browser. As a result, the textContents and innerText attributes have been normalized. Whitespace is skipped or replaced by a single space if an empty space is followed by another empty space. The matching of such values is normalized also. In Silk Test 14.0 or later, whitespace in texts, which are retrieved through the textContents property of an element, is trimmed consistently across all supported browsers. For some browser versions, this whitespace handling differs to Silk Test versions prior to Silk Test 13.5. You can re-enable the old behavior by setting the OPT_COMPATIBILITY option to a version lower than 13.5.0.

Example

<a>abc abc</a>
Uses the following locator:
//A[@innerText='abc abc']
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Dynamic Object Recognition
Related tasks
Defining which Custom Locator Attributes to Use for Recognition
Related reference
Agent Options


Page Synchronization for xBrowser

This functionality is supported only if you are using the Open Agent.

Synchronization is performed automatically before and after every method call. A method call is not started and does not end until the synchronization criteria is met.

Note: Any property access is not synchronized.

Synchronization Modes

Silk Test Classic includes synchronization modes for HTML and AJAX.

Using the HTML mode ensures that all HTML documents are in an interactive state. With this mode, you can test simple Web pages. If more complex scenarios with Java script are used, it might be necessary to manually script synchronization functions, such as:
  • WaitForObject
  • WaitForProperty
  • WaitForDisappearance
  • WaitForChildDisappearance

The AJAX mode synchronization waits for the browser to be in a kind of idle state, which is especially useful for AJAX applications or pages that contain AJAX components. Using the AJAX mode eliminates the need to manually script synchronization functions (such as wait for objects to appear or disappear, wait for a specific property value, and so on), which eases the script creation process dramatically. This automatic synchronization is also the base for a successful record and playback approach without manual script adoptions.

Troubleshooting

Because of the true asynchronous nature of AJAX, generally there is no real idle state of the browser. Therefore, in rare situations, Silk Test Classic will not recognize an end of the invoked method call and throws a timeout error after the specified timeout period. In these situations, it is necessary to set the synchronization mode to HTML at least for the problematic call.

Note: Regardless of the page synchronization method that you use, in tests where a Flash object retrieves data from a server and then performs calculations to render the data, you must manually add a synchronization method to your test. Otherwise, Silk Test Classic does not wait for the Flash object to complete its calculations. For example, you might use Thread.sleep(millisecs).

Some AJAX frameworks or browser applications use special HTTP requests, which are permanently open in order to retrieve asynchronous data from the server. These requests may let the synchronization hang until the specified synchronization timeout expires. To prevent this situation, either use the HTML synchronization mode or specify the URL of the problematic request in the Synchronization exclude list setting.

Use a monitoring tool to determine if playback errors occur because of a synchronization issue. For instance, you can use FindBugs, http://findbugs.sourceforge.net/, to determine if an AJAX call is affecting playback. Then, add the problematic service to the Synchronization exclude list.

Note: If you exclude a URL, synchronization is turned off for each call that targets the URL that you specified. Any synchronization that is needed for that URL must be called manually. For example, you might need to manually add WaitForObject to a test. To avoid numerous manual calls, exclude URLs for a concrete target, rather than for a top-level URL, if possible.

Configuring Page Synchronization Settings

You can configure page synchronization settings for each individual test or you can set global options that apply to all tests in the Script Options dialog box.

To add the URL to the exclusion filter, specify the URL in the Synchronization exclude list in the Script Options dialog box.

To configure individual settings for tests,

To configure individual settings for tests, record the test and then insert an agent option to override the global replay value.

For example, you might set the Synchronization mode replay setting to HTML and then return the Synchronization mode to AJAX for the remaining portion of the test if necessary.

To configure individual settings within a test, call any of the following:

  • OPT_XBROWSER_SYNC_MODE
  • OPT_XBROWSER_SYNC_EXCLUDE_URLS
  • OPT_SYNC_TIMEOUT
  • Setting xBrowser Synchronization Options
    Describes how to set xBrowser synchronization options.
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
How Does Silk Test Classic Synchronize Tests?
Related tasks
Slowing Down Tests
Related reference
Agent Options
My Test Script Hangs After Navigating to a New Page
Limitations for Testing with Google Chrome


Setting xBrowser Synchronization Options

This functionality is supported only if you are using the Open Agent.

Specify the synchronization and timeout values for web applications. Synchronization is performed before and after every method call. A method call is not started and does not end until the synchronization criteria is met.

  1. Click Options > Agent and then click the Synchronization tab.
  2. From the Synchronization mode list box, select the synchronization algorithm for the ready state of a web application.

    The synchronization algorithm configures the waiting period for the ready state of an invoke call.

    Using the HTML mode ensures that all HTML documents are in an interactive state. With this mode, you can test simple Web pages. If more complex scenarios with Java script are used, it might be necessary to manually script synchronization functions.

    Using the AJAX mode eliminates the need to manually script synchronization functions (such as wait for objects to appear or disappear, wait for a specific property value, and so on), which eases the script creation process dramatically. This automatic synchronization is also the base for a successful record and replay approach without manual script adoptions.

  3. In the Synchronization timeout text box, enter the maximum time, in seconds, to wait for an object to be ready.
  4. In the Synchronization exclude list text box, type the entire URL or a fragment of the URL for any service or Web page that you want to exclude.

    Some AJAX frameworks or browser applications use special HTTP requests, which are permanently open in order to retrieve asynchronous data from the server. These requests may let the synchronization hang until the specified synchronization timeout expires. To prevent this situation, either use the HTML synchronization mode or specify the URL of the problematic request in the Synchronization exclude list setting.

    For example, if your web application uses a widget that displays the server time by polling data from the client, permanent traffic is sent to the server for this widget. To exclude this service from the synchronization, determine what the service URL is and enter it in the exclusion list.

    For example, you might type:

    http://example.com/syncsample/timeService
timeService
UICallBackServiceHandler

    Separate multiple entries with a comma.

    Note: If your application uses only one service, and you want to disable that service for testing, you must use the HTML synchronization mode rather than adding the service URL to the exclusion list.

  5. Click OK.

    You can now record or manually create a test that uses ignores browser attributes and uses the type of page input that you specified.

Parent topic: Page Synchronization for xBrowser
Related tasks
Setting Recording Options for the Open Agent
Setting Replay Options for the Open Agent


Configuring the Locator Generator for xBrowser

This functionality is supported only if you are using the Open Agent.

The Open Agent includes a sophisticated locator generator mechanism that guarantees locators are unique at the time of recording and are easy to maintain. Depending on your application and the frameworks that you use, you might want to modify the default settings to achieve the best results.

A well-defined locator relies on attributes that change infrequently and therefore requires less maintenance. Using a custom attribute is more reliable than other attributes like caption or index, since a caption will change when you translate the application into another language, and the index might change when another object is added.

To achieve optimal results, add a custom automation ID to the elements that you want to interact with in your test. In Web applications, you can add an attribute to the element that you want to interact with, such as <div myAutomationId=”my unique element name” />. This approach can eliminate the maintenance associated with locator changes.

  1. Click Options > Recorder and then click the Custom Attributes tab.
  2. If you use custom automation IDs, from the Select a TechDomain list box, select xBrowser and then add the IDs to the list. The custom attributes list contains attributes that are suitable for locators. If custom attributes are available, the locator generator uses these attributes before any other attribute. The order of the list also represents the priority in which the attributes are used by the locator generator. If the attributes that you specify are not available for the objects that you select, Silk Test Classic uses the default attributes for xBrowser.
  3. Click the Browser tab.
  4. In the Locator attribute name exclude list grid, type the attribute names to ignore while recording.

    For example, use this list to specify attributes that change frequently, such as size, width, height, and style. You can include the wildcards ‘*’ and ‘?’ in the Locator attribute name blacklist.

    Separate attribute names with a comma.

  5. In the Locator attribute value exclude list grid, type the attribute values to ignore while recording.

    Some AJAX frameworks generate attribute values that change every time the page is reloaded. Use this list to ignore such values. You can also use wildcards in this list.

    Separate attribute values with a comma.

  6. Click OK.

    You can now record or manually create a test case.

Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Custom Attributes
Related tasks
Recording Test Cases for Standard and Web Applications
Recording Locators Using the Locator Spy


Comparing API Playback and Native Playback for xBrowser

This functionality is supported only if you are using the Open Agent.

Silk Test Classic supports API playback and native playback for Web applications. If your application uses a plug-in or AJAX, use native user input. If your application does not use a plug-in or AJAX, we recommend using API playback.

Advantages of native playback include:
  • With native playback, the agent emulates user input by moving the mouse pointer over elements and pressing the corresponding elements. As a result, playback works with most applications without any modifications.
  • Native playback supports plug-ins, such as Flash and Java applets, and applications that use AJAX, while high-level API recordings do not.
Advantages of API playback include:
  • With API playback, the Web page is driven directly by DOM events, such as onmouseover or onclick.
  • Scripts that use API playback do not require that the browser be in the foreground.
  • Scripts that use API playback do not need to scroll an element into view before clicking it.
  • Generally API scripts are more reliable since high-level user input is insensitive to pop-up windows and user interaction during playback.
  • API playback is faster than native playback.

Differences Between API and Native Playback Functions

The DomElement class provides different functions for API playback and native playback.

The following table describes which functions use API playback and which use native playback.

 | API Playback | Native Playback
Mouse Actions | DomClick DomDoubleClick DomMouseMove | Click DoubleClick MoveMouse PressMouse ReleaseMouse
Keyboard Actions | not available | TypeKeys
Specialized Functions | Select SetText etc. | not available
Parent topic: Cross-Browser Testing with the Open Agent
Related reference
FileInputField.DomClick() Will Not Open the Dialog
DomClick(x, y) Is Not Working Like Click(x, y)


Setting Recording Options for xBrowser

This functionality is supported only if you are using the Open Agent.

There are several options that can be used to optimize the recording of Web applications.

  1. Click Options > Recorder.
  2. Check the Record mouse move actions box if you are testing a Web page that uses mouse move events. You cannot record mouse move events for child technology domains of the xBrowser technology domain, for example Apache Flex and Swing. Silk Test Classic will only record mouse move events that cause changes to the hovered element or its parent in order to keep scripts short.
  3. You can change the mouse move delay if required. Mouse move actions will only be recorded if the mouse stands still for this time. A shorter delay will result in more unexpected mouse move actions.
  4. Click the Browser tab.
  5. In the Locator attribute name exclude list grid, type the attribute names to ignore while recording. For example, if you do not want to record attributes named height, add the height attribute name to the grid. Separate attribute names with a comma.
  6. In the Locator attribute value exclude list grid, type the attribute values to ignore while recording. For example, if you do not want to record attributes assigned the value of x-auto, add x-auto to the grid. Separate attribute values with a comma.
  7. To record native user input instead of DOM functions, check the OPT_XBROWSER_RECORD_LOWLEVEL check box.

    For example, to record Click instead of DomClick and TypeKeys instead of SetText, check this check box.

    If your application uses a plug-in or AJAX, use native user input. If your application does not use a plug-in or AJAX, we recommend using high-level DOM functions, which do not require the browser to be focused or active during playback. As a result, tests that use DOM functions are faster and more reliable.

  8. Click the Custom Attributes tab.
  9. Select xBrowser in the Select a tech domain list box and add the DOM attributes that you want to use for locators to the text box. Using a custom attribute is more reliable than other attributes like caption or index, since a caption will change when you translate the application into another language, and the index might change when another object is added. If custom attributes are available, the locator generator uses these attributes before any other attribute. The order of the list also represents the priority in which the attributes are used by the locator generator. If the attributes that you specify are not available for the objects that you select, Silk Test Classic uses the default attributes for xBrowser.
  10. Click OK. You can now record or manually create a test that uses ignores browser attributes and uses the type of page input that you specified.
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Locator Attributes for xBrowser controls
Related tasks
Recording Test Cases for Standard and Web Applications
Recording Locators Using the Locator Spy
Configuring the Locator Generator for xBrowser
Setting Recording Options for the Open Agent


Browser Configuration Settings for xBrowser

Several browser settings help to sustain stable test executions. Although Silk Test Classic works without changing any settings, there are several reasons that you might want to change the browser settings.

Increase replay speed
Use about:blank as home page instead of a slowly loading Web page.
Avoid unexpected behavior of the browser
  • Disable pop up windows and warning dialog boxes.
  • Disable auto-complete features.
  • Disable password wizards.
Prevent malfunction of the browser
Disable unnecessary third-party plugins.

The following sections describe where these settings are located in the corresponding browser.

Internet Explorer

The browser settings are located at Tools > Internet Options. The following table lists options that you might want to adjust.

Tab | Option | Configuration | Comments
General | Home page | Set to about:blank. | Minimize start up time of new tabs.
General Tabs
  • Disable warning when closing multiple tabs.
  • Enable to switch to new tabs when they are created.
  • Avoid unexpected dialog boxes.
  • Links that open new tabs might not replay correctly otherwise.
Privacy | Pop-up blocker | Disable pop up blocker. | Make sure your Web site can open new windows.
Content AutoComplete Turn off completely
  • Avoid unexpected dialog boxes.
  • Avoid unexpected behavior when typing keys.
Programs Manage add-ons Only enable add-ons that are absolutely required.
  • Third-party add-ons might contain bugs.
  • Possibly not compatible to Silk Test Classic.
Advanced Settings
  • Disable Automatically check for Internet Explorer updates.
  • Enable Disable script debugging (Internet Explorer).
  • Enable Disable script debugging (Other).
  • Disable Enable automatic crash recovery.
  • Disable Display notification about every script error.
  • Disable all Warn ... settings
Avoid unexpected dialog boxes.
Note: Recording a Web application in Internet Explorer with a zoom level different to 100% might not work as expected. Before recording actions against a Web application in Internet Explorer, set the zoom level to 100%.

Mozilla Firefox

You do not have to change browser settings for Mozilla FirefoxSilk Test Classic automatically starts Mozilla Firefox with the appropriate command-line parameters.

Note: To avoid unexpected behavior when testing web applications, disable auto updates for Mozilla Firefox. For additional information, see Stop automatic updates.

Google Chrome

You do not have to change browser settings for Google Chrome. Silk Test Classic automatically starts Google Chrome with the appropriate command-line parameters.

Note: To avoid unexpected behavior when testing web applications, disable auto updates for Google Chrome. For additional information, see Turning Off Auto Updates in Google Chrome.
Parent topic: Cross-Browser Testing with the Open Agent
Related reference
Prerequisites for Replaying Tests with Google Chrome


Connection String for a Remote Desktop Browser

The connection string specifies the remote desktop browser that is used for testing. When testing a web application in a remote browser, Silk Test Classic uses the connection string to connect to the remote location. The connection string is typically part of the application configuration. You can set the connection string when you configure the web application that you want to test. To change the connection string, you can use the Edit Application Configuration dialog box.

When testing a web application in a remote browser, the connection string includes only the host, which means the IP address or the host name of the remote machine, for example 10.0.0.1. To select the correct browser, Silk Test Classic uses the connection string in combination with the browser type, which you can also specify in the Edit Application Configuration dialog box.

The host name is case-insensitive.

Note: Remote desktop browser testing is only supported for Microsoft Edge on a remote Microsoft Windows machine, and for Apple Safari on a remote Mac.

Connection string example

"host=10.0.0.1"
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Connection String for a Mobile Device
Select Application Dialog Box
Related tasks
Setting Capabilities for WebDriver-Based Browsers


Setting Capabilities for WebDriver-Based Browsers

If you are testing a web application on a WebDriver-based browser, you can customize and configure the browser session by setting the capabilities.

In Silk Test Classic, you can specify WebDriver capabilities in the connection string for the following browser types:
  • Google Chrome
  • Mozilla Firefox

For information on the available options and capabilities for Mozilla Firefox 48 or later, see https://github.com/mozilla/geckodriver. For information on the available options and capabilities for Google Chrome, see Capabilities & ChromeOptions.

To set the capabilities in Silk Test Classic:

  1. Select the project which corresponds to the web application for which you want to change the capabilities.
  2. Edit the connection string in the base state of the project. You can edit the connection string in the following ways:
    • By using the Edit Application Configurations dialog, for example if you want to record actions against a customized browser.
    • In a script, if you only want to execute the tests in the script against the customized browser.

    For additional information, see Modifying the Base State (Open Agent).

  3. Execute the script to start the browser with the specified options and capabilities.

Examples

You can add the following code to the base state in a script to automatically download executables from Mozilla Firefox:
STRING sConnectionString = "moz:firefoxOptions="""{""prefs"": "{ ""browser.download.folderList"": 2, ""browser.helperApps.neverAsk.saveToDisk"": ""application/octet-stream""}};"
You can add the following code to the base state in a script to specify the download folder for Mozilla Firefox:
STRING sConnectionString = "moz:firefoxOptions="""{""prefs"": "{ ""browser.download.dir"" : ""C:/Download""}};"
You can add the following code to the base state in a script to set a command line argument for Mozilla Firefox:
STRING sConnectionString = "moz:firefoxOptions="""{""args"": [""--devtools""]};"""
You can add the following code to the base state in a script to automatically download executables from Google Chrome to a specific folder:
STRING sConnectionString = "chromeOptions="""{""prefs"": "{""profile.default_content_setting_values.automatic_downloads"":1, ""download.default_directory"":""c:/Download"", ""download.prompt_for_download"":false}};"
You can add the following code to the base state in a script to disable the password manager from showing messages in Google Chrome:
STRING sConnectionString = "chromeOptions="""{""args"": [""--disable-save-password-bubble""], ""prefs"": "{""profile.password_manager_enabled"": false, ""credentials_enable_service"":false}};"
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Connection String for a Remote Desktop Browser
Base State


Testing with Apple Safari on a Mac

This functionality is supported only if you are using the Open Agent.

This section describes how you can enhance your cross-browser test set by testing Apple Safari on Mac machines that are connected to a Windows machine on which Silk Test Classic is installed.

  • Prerequisites for Testing with Apple Safari on a Mac
    Lists the prerequisites for testing with Apple Safari on a Mac.
  • Preparing Apple Safari for Testing
    Prepare Apple Safari to test web applications with Silk Test Classic.
  • Installing the Silk Test Information Service on a Mac
    Install the information service on a Mac to test Apple Safari or mobile applications on iOS with Silk Test Classic.
  • Limitations for Testing with Apple Safari
    Lists the known limitations for playing back tests and recording locators with Apple Safari.
  • Running Multiple Apple Safari Tests at the Same Time
    Describes how you can execute multiple Apple Safari tests on the same Mac simultaneously.
  • Uninstalling the Silk Test Information Service from a Mac
    Uninstall the information service from a Mac to no longer test Apple Safari or mobile applications on iOS with Silk Test Classic on this Mac.
Parent topic: Cross-Browser Testing with the Open Agent


Prerequisites for Testing with Apple Safari on a Mac

This functionality is supported only if you are using the Open Agent.

Before you can test with Apple Safari on a Mac, ensure that the following prerequisites are met:
  • The Mac is connected as a remote location to a Windows machine, on which Silk Test Classic is installed. For additional information, see Editing Remote Locations.
  • If you are testing with Apple Safari 9, the SafariDriver, which is the WebDriver extension for Apple Safari that inverts the traditional client/server relationship and communicates with the WebDriver client using WebSockets, needs to be installed on the Mac. With Apple Safari 10.1, Safari features a built-in driver implementation.
  • Java JDK is installed on the Mac.
  • The information service is installed on the Mac. To get the files that are required for the information service, use the Silk Test installer. For additional information, see Installing the Silk Test Information Service on a Mac.
  • To run tests on Apple Safari, the user that has installed the information service needs to be logged in on the Mac.
    Tip: Micro Focus recommends to set the Mac to automatically log in the correct user during startup. For additional information, see Set your Mac to automatically log in during startup.
  • To run unattended tests against Apple Safari on a Mac, adjust the following energy-related settings in the Energy Saver pane of the System Preferences:
    • Set Turn display off after to Never.
    • Check the Prevent computer from sleeping automatically when the display is off check box.
    Note: You can use the Silk Test Configuration Assistant to easily configure such settings.
  • To run unattended tests against Apple Safari on a Mac, disable the screen saver.
    1. Navigate to System Preferences > Desktop & Screen Saver.
    2. Click the Screen Saver tab.
    3. Set Start screen saver to Never.
    Note: You can use the Silk Test Configuration Assistant to easily configure such settings.
  • If you are testing with Apple Safari 10.1, enable the Safari developer menu. Choose Safari > Preferences , click Advanced, and check Show develop menu in menu bar.
  • If you are testing with Apple Safari 10.1, enable remote automation. In the Safari developer menu, check Allow Remote Automation.
  • When executing a test for the first time against Apple Safari 10.1, you need to provide a password.
Parent topic: Testing with Apple Safari on a Mac
Related tasks
Installing the Silk Test Information Service on a Mac
Preparing Apple Safari for Testing
Prerequisites for Testing Mobile Applications on iOS
Editing Remote Locations


Preparing Apple Safari for Testing

To test web applications on Apple Safari 10.1 or later, you can use the Silk Test Configuration Assistant to easily configure Apple Safari, or you can perform the following preparation steps in addition to fulfilling the requirements listed in Prerequisites for Testing with Apple Safari on a Mac:
  1. Enable remote automation in Apple Safari, by opening the Develop menu and checking Allow Remote Automation. The Develop menu is hidden by default. To open the menu:
    1. In the Safari menu, choose Preferences.
    2. In the Preferences window, select the Advanced tab.
    3. Check the Show Develop menu in menu bar check box.
    4. Close the Preferences window.
  2. When running a test for the first time on Apple Safari, a dialog box appears, stating that the browser window is remotely controlled by an automated test. Click Continue Session.
For additional information on Apple Safari and Selenium WebDriver, see https://webkit.org/blog/6900/webdriver-support-in-safari-10/.
Parent topic: Testing with Apple Safari on a Mac
Related tasks
Prerequisites for Testing Mobile Applications on iOS
Related reference
Prerequisites for Testing with Apple Safari on a Mac


Limitations for Testing with Apple Safari

This functionality is supported only if you are using the Open Agent.

The following are the known limitations for testing with Apple Safari on a Mac:
  • The following classes, interfaces, methods, and properties are currently not supported when testing web applications with Apple Safari on a Mac:
    • BrowserApplication class.
      • ClearCache method
      • CloseOtherTabs method
      • CloseTab method
      • ExistsTab method
      • GetHorizontalScrollbar method
      • GetNextCloseWindow method
      • GetSelectedTab method
      • GetSelectedTabIndex method
      • GetSelectedTabName method
      • GetTabCount method
      • GetVerticalScrollbar method
      • IsActive method
      • Minimize method
      • OpenContextMenu method
      • OpenTab method
      • Restore method
      • SelectTab method
      • SetActive method
      • WindowState property
    • BrowserWindow class.
      • AcceptAlert method
      • DismissAlert method
      • GetAlertText method
      • IsAlertPresent method
      • MouseMove method
      • PressKeys method
      • PressMouse method
      • ReleaseKeys method
      • ReleaseMouse method
    • MoveableWin class.
      • GetFocusfunction.
  • Silk Test Classic does not support testing Apache Flex.
  • Silk Test Classic does not support testing iframes with a JavaScript source on Apple Safari.
  • To test secure web applications over HTTPS on Apple Safari, ensure that any required server certificates are trusted.
  • Silk Test Classic does not provide native support for Apple Safari. You cannot test internal Apple Safari functionality. For example, in a test, you cannot change the currently displayed web page by adding text to the navigation bar. As a workaround, you can use API calls to navigate between web pages.
  • Silk Test Classic does not support JavaScript dialog API functions for Apple Safari. As a workaround, you could patch such functions so that they are ignored. For additional information, see https://groups.google.com/forum/#!topic/selenium-developer-activity/qsovJw93g9c.
  • Silk Test Classic does not support text recognition with Apple Safari.
    Text recognition includes the following methods:
    • TextCapture
    • TextClick
    • TextExists
    • TextRectangle
  • Silk Test Classic does not support tabbing on Apple Safari.
  • To test a multi window application, disable the Apple Safari pup-up blocker. To do so, start Apple Safari and navigate to Safari Preferences > Security > Block pop-up window.
  • Silk Test Classic does not support testing the dialog box for saving a password. To avoid this dialog box, start Apple Safari, navigate to Safari Preferences > AutoFill, and check the User names and passwords check box.
  • Silk Test Classic does not support properties in XPath expressions for Apple Safari. Only attributes are supported in XPath expressions.
  • Silk Test Classic does not support testing web applications which include a Content-Security-Policy HTTP header.
  • With Apple Safari 10.1, Silk Test Classic does not support navigating back in the browser.
  • With Apple Safari 10.1, Silk Test Classic does not support using control keys in the TypeKeys method.
  • With Apple Safari 10.1, Silk Test Classic only supports dom actions in Frames and IFrames.
  • With Apple Safari 10.1, Silk Test Classic does not support navigating with Frames and IFrames.
  • With Apple Safari 10.1, Silk Test Classic does not support direct scrolling during recording. As a workaround, you could use the executeJavaScript method.
Parent topic: Testing with Apple Safari on a Mac


Running Multiple Apple Safari Tests at the Same Time

To execute a test on Apple Safari, you require a Mac that is connected to the Windows machine on which Silk Testis installed. If multiple Apple Safari want to execute tests on Apple Safari, these tests can be executed simultaneously on the same Mac.

Note: Each test that is executed against Apple Safari on the Mac opens an individual instance of Apple Safari. Having too many instances of Apple Safari running simultaneously might reduce the performance of the Mac.
Parent topic: Testing with Apple Safari on a Mac


Testing with Google Chrome

This functionality is supported only if you are using the Open Agent.

This section describes how you can enhance your cross-browser test set by testing with Google Chrome.

Silk Test Classic supports recording actions and replaying tests on Google Chrome 50 or later, and supports replaying tests and recording locators on Google Chrome versions prior to version 50.

  • When starting to test on Google Chrome 50 or later, with no running instance of Google Chrome open, Silk Test Classic starts a new instance of Google Chrome. This new browser uses a temporary profile without add-ons and with an empty cache.
  • When starting to test on an instance of Google Chrome 50 or later, which is already running, Silk Test Classic restarts Google Chrome with the same command line arguments that were used when the instance was initially started. This restart is required to enable the Silk Test Classic automation support.
  • When testing with Google Chrome 50 or later, the Google Chrome instance is closed when shutting down the Open Agent or when starting to test another application outside Google Chrome.
Tip: If you want to execute an existing test script with Google Chrome 50 or later, Micro Focus recommends that you use a base state or that you add a command to the test script to navigate to the URL.

Example 1

If the running instance of Google Chrome 50 or later was initially started with the command C:/Program Files (x86)/Google/Chrome/Application/chrome.exe www.borland.com, Google Chrome opens to www.borland.com after the restart.

Example 2

If the running instance of Google Chrome 50 or later was initially started with the command C:/Program Files (x86)/Google/Chrome/Application/chrome.exe, Google Chrome opens to about:blank after the restart.

  • Prerequisites for Replaying Tests with Google Chrome
    Lists the prerequisites for replaying tests and recording locators with Google Chrome.
  • Testing Google Chrome Extensions
    Describes how you can test Google Chrome extensions.
  • Testing Google Chrome with User Data Directories
    Describes how you can test Google Chrome with user data directories.
  • Limitations for Testing with Google Chrome
    Lists the known limitations for playing back tests and recording locators with Google Chrome.
Parent topic: Cross-Browser Testing with the Open Agent


Prerequisites for Replaying Tests with Google Chrome

Command-line parameters

When you use Google Chrome to replay a test or to record locators, Google Chrome is started with the following command:
%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe
  --enable-logging
  --log-level=1
  --disable-web-security
  --disable-hang-monitor
  --disable-prompt-on-repost
  --dom-automation
  --full-memory-crash-report
  --no-default-browser-check
  --no-first-run
  --homepage=about:blank
  --disable-web-resources
  --disable-preconnect
  --enable-logging
  --log-level=1
  --safebrowsing-disable-auto-update
  --test-type=ui
  --noerrdialogs
  --metrics-recording-only
  --allow-file-access-from-files
  --disable-tab-closeable-state-watcher
  --allow-file-access
  --disable-sync
  --testing-channel=NamedTestingInterface:st_42

When you use the wizard to hook on to an application, these command-line parameters are automatically added to the base state. If an instance of Google Chrome is already running when you start testing, without the appropriate command-line parameters, Silk Test Classic closes Google Chrome and tries to restart the browser with the command-line parameters. If the browser cannot be restarted, an error message displays.

Note: The command-line parameter disable-web-security is required when you want to record or replay cross-domain documents.
Note: To test a web application that is stored in the local file system, navigate to the chrome://extensions in Google Chrome and check the Allow access to file URLs check box for the Silk Test Chrome Extension.
Parent topic: Testing with Google Chrome
Related concepts
Browser Configuration Settings for xBrowser
Application Configuration
Related tasks
Changing the Browser Type When Replaying Tests from the UI
Setting the Browser when Running Automated Tests


Testing Google Chrome Extensions

You can use one of the following two approaches to test a Google Chrome extension (add-on) with Silk Test Classic:
Install the extension as a .crx file when starting Google Chrome
To test a Google Chrome extension that is installed as a .crx file, add the following command line to the base state:
chrome.exe --load-extension=C:/myExtension/myExtension.crx
Note: You can only install a single extension in Google Chrome as a .crx file. To install multiple extensions in Google Chrome, use a comma separated list of .crx files. For example:
chrome.exe --load-extension=C:/myExtension/myExtension.crx,C:/myExtension2/myExtension2.crx

For information on adding command line arguments to a browser, see Modifying the Base State.

Add the extension to a profile
Add the extension to a Google Chrome user data directory and use that profile for testing. For additional information, see Testing Google Chrome with User Data Directories.
Parent topic: Testing with Google Chrome


Testing Google Chrome with User Data Directories

All changes that you make in Google Chrome, for example your home page, what toolbars you use, any saved passwords, and your bookmarks, are all stored in a special folder, which is called a user data directory.

With Silk Test Classic, you can test Google Chrome user data directories by specifying the path to the user data directory in the base state of the application under test. The following command line includes the path to the profile:
chrome.exe "--user-data-dir=C:/Users/MyUser/AppData/Local/Google/Chrome/User Data"
To set the profile directory for our sample web application, you can use the following code:
const sCmdLine = """C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"" --user-data-dir=D:/temp/SilkTest --profile-directory=Profile1"
Note: When Google Chrome is started by Silk Test Classic, an empty user data directory is used. This ensures that the test starts at a clean state.
Parent topic: Testing with Google Chrome


Limitations for Testing with Google Chrome

The support for playing back tests and recording locators with Google Chrome is not as complete as the support for the other supported browsers. The following list lists the known limitations for playing back tests and recording locators with Google Chrome:
  • Silk Test does not support testing child technology domains of the xBrowser domain with Google Chrome. For example Apache Flex or Microsoft Silverlight are not supported with Google Chrome.
  • Silk Test Classic does not support recording a test in an HTTP Basic Authentication dialog.
  • With Google Chrome 49 or prior, Silk Test does not provide native support for Google Chrome. You cannot test internal Google Chrome functionality. For example, in a test, you cannot change the currently displayed Web page by adding text to the navigation bar through Win32. As a workaround, you can use API calls to navigate between Web pages. Silk Test supports handling alerts and similar dialog boxes through the Alerts API.
  • Silk Test Classic does not support text recognition with Google Chrome.
    Text recognition includes the following methods:
    • TextCapture
    • TextClick
    • TextExists
    • TextRectangle
  • Silk Test Classic does not support the GetFocus method of the MoveableWin class.
  • Silk Test does not recognize opening the Print dialog box in Google Chrome by using the Google Chrome menu. To add opening this dialog box in Google Chrome to a test, you have to send Ctrl+Shift+P using the TypeKeys method. Internet Explorer does not recognize this shortcut, so you have to first record your test in Internet Explorer, and then manually add pressing Ctrl+Shift+P to your test.
  • Testing on multiple Google Chrome windows at the same time is only supported if the additional windows are opened from the initial Google Chrome window by the AUT itself. If the additional Google Chrome windows are opened manually, Silk Test Classic does not recognize the elements on these Google Chrome windows. For example, Silk Test Classic recognizes the elements in a Google Chrome window that is opened by clicking on a link or a button in the AUT during recording, but Silk Test Classic does not recognize the elements in a Google Chrome window that was opened by pressing CTRL+N during recording.
  • With Google Chrome 49 or prior and when you want to test a web application with Google Chrome and the Continue running background apps when Google Chrome is closed check box is checked, Silk Test cannot restart Google Chrome to load the automation support.
  • To replay a test with a Google Chrome version prior to 50, you need to perform one of the following:
    • Start Google Chrome and enable the Silk Test Chrome extension.
      Note: If by mistake you have disabled the Silk Test Chrome extension, you have to re-install the extension from the Chrome Web Store.
    • If enabling the Silk Test Chrome extension is not possible, because you have no access to the Chrome Web Store, remove the registry key HKEY_LOCAL_MACHINE\SOFTWARE\[Wow6432Node\]Google\Chrome\Extensions\cjkcicfagnoafgjpgnpcdfllcnneidjj:
      1. In the Start menu, type regedit into the search box and press Enter.
      2. In the Registry Editor, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\[Wow6432Node\]Google\Chrome\Extensions.
      3. Right click cjkcicfagnoafgjpgnpcdfllcnneidjj and select Delete.
  • With Google Chrome 49 or prior and when using Internet Explorer to replay a test, you can use the following code to test executeJavaScript:
    // Java code
desktop.<BrowserWindow> find("//BrowserWindow")
  .executeJavaScript("function foo() { alert('Silk Test'); }");
desktop.<BrowserWindow> find("//BrowserWindow")
  .executeJavaScript("foo();");

    When replaying tests on Google Chrome, the scripts are not executed in the global context (window), but in a closure. Everything is executed within a function. The first ExecuteJavaScript call in the previous code sample will not work with Google Chrome, because the function foo is only available as long as the ExecuteJavaScript call lasts.

    To replay the same test on Google Chrome, you can use the following function expression:
    // Java code
desktop.<BrowserWindow> find("//BrowserWindow")
  .executeJavaScript("window.foo = function() { alert('Silk Test'); }");
desktop.<BrowserWindow> find("//BrowserWindow")
  .executeJavaScript("window.foo();");

    The previous code samples will work in Silk4J. The code for the other Silk Test clients is similar. For additional information, refer to the documentation of the ExecuteJavaScript method in the Help of your Silk Test client.

Note: If the Silk Test Chrome extension symbol is marked red, this indicates an error with the Silk Test Chrome support.
Parent topic: Testing with Google Chrome
Related concepts
Page Synchronization for xBrowser
Related reference
Google Chrome


Testing with Mozilla Firefox

This functionality is supported only if you are using the Open Agent.

This section describes how you can enhance your cross-browser test set by testing with Mozilla Firefox.

Silk Test Classic supports recording actions and replaying tests on Mozilla Firefox.

  • When starting to test on Mozilla Firefox, with no running instance of Mozilla Firefox open, Silk Test Classic starts a new instance of Mozilla Firefox. This new browser uses a temporary profile without add-ons and with an empty cache.
  • When starting to test on an instance of Mozilla Firefox which is already running, Silk Test Classic restarts Mozilla Firefox with the same command line arguments that were used when the instance was initially started. This restart is required to enable the Silk Test Classic automation support.
  • The Mozilla Firefox instance is closed when shutting down the Open Agent or when starting to test another application outside Mozilla Firefox.
Tip: If you want to execute an existing test script with Mozilla Firefox, Micro Focus recommends that you use a base state or that you add a command to the test script to navigate to the URL.

While recording with Silk Test Classic on Mozilla Firefox 52 or later, Mozilla Firefox opens external links in a new tab, instead of a new window. Disable the OPT_FIREFOX_SINGLE_WINDOW_MODE option in the Browser options to open external links in a new window.

Example 1

If the running instance of Mozilla Firefox was initially started with the command C:/program files/Mozilla/firefox.exe www.borland.com, Mozilla Firefox opens to www.borland.com after the restart.

Example 2

If the running instance of Mozilla Firefox was initially started with the command C:/program files/Mozilla/firefox.exe, Mozilla Firefox opens to about:blank after the restart.

  • Testing Mozilla Firefox with Profiles
    Describes how you can test Mozilla Firefox with profiles.
  • Testing Mozilla Firefox Extensions
    Describes how you can test Mozilla Firefox extensions.
  • Limitations for Testing with Mozilla Firefox
    Lists the known limitations for testing web applications on Mozilla Firefox.
Parent topic: Cross-Browser Testing with the Open Agent


Testing Mozilla Firefox with Profiles

All changes that you make in Mozilla Firefox, for example your home page, what toolbars you use, any saved passwords, and your bookmarks, are all stored in a special folder, which is called a profile.

To test Mozilla Firefox profiles, you can specify either the name of the profile or the path to the profile as custom browser command line arguments in the INC file of the test:

Using the name of the profile
The following command specifies the name of the profile:
const sCmdLine = """C:\Program Files (x86)\Mozilla Firefox\firefox.exe"" -p myProfile"
You can configure the named profile in the Profile Manager. To start the Profile Manager, type firefox.exe -P into a command window.
Using the path to the profile
The following command specifies the path to the profile:
const sCmdLine = """C:\Program Files (x86)\Mozilla Firefox\firefox.exe"" -Profile ""C:/Temp"""
Note: If Mozilla Firefox is started by Silk Test Classic, an empty profile is used. This ensures that the test starts at a clean state. If the user manually starts Mozilla Firefox, the default profile is used.
Note: As profiles need to be deployed to the test machine are and have high memory consumption, you might face some issues when testing profiles. If you only want to change a few browser settings, you can use capabilities instead of profiles. For additional information, see Setting Capabilities for Web-Driver Based Browsers.
Parent topic: Testing with Mozilla Firefox
Related concepts
Testing Mozilla Firefox Extensions


Testing Mozilla Firefox Extensions

To test a Mozilla Firefox extension (add-on) with Silk Test Classic, add the extension to a Mozilla Firefox profile and use that profile for testing. For additional information, see Testing Mozilla Firefox with Profiles.

Parent topic: Testing with Mozilla Firefox
Related concepts
Testing Mozilla Firefox with Profiles


Limitations for Testing with Mozilla Firefox

The following limitations are known when testing web applications with Silk Test Classic on Mozilla Firefox:

  • Silk Test Classic does not support Mozilla Firefox 47, 48, 49, 50, and 51. However, Silk Test Classic supports Mozilla Firefox 47.0.1 and 47.0.2
  • Testing on multiple Mozilla Firefox windows at the same time is only supported if the additional windows are opened from the initial Mozilla Firefox window by the AUT itself. If the additional Mozilla Firefox windows are opened manually, Silk Test Classic does not recognize the elements on these Mozilla Firefox windows. For example, Silk Test Classic recognizes the elements in a Mozilla Firefox window that is opened by clicking on a link or a button in the AUT during recording, but Silk Test Classic does not recognize the elements in a Mozilla Firefox window that was opened by pressing CTRL+N during recording.
  • Silk Test Classic does not support testing modal browser windows, which are windows that can be displayed with the window.showmodaldialog command. These modal browser windows have been officially deprecated, and are disabled with Google Chrome 37 or later, while they are planned to no longer be supported in future versions of Mozilla Firefox. You can workaround this issue by using low-level actions, for example native clicks with coordinates to click on an object or typekeys to fill out text fields.
  • Silk Test Classic does not support testing Silverlight with Mozilla Firefox.
  • Silk Test Classic does not support testing some browser dialogs, for example the About dialog, with Mozilla Firefox.
  • Silk Test Classic does not support testing about:* pages with Mozilla Firefox.
  • Silk Test Classic does not support recording a click on the Print button in Mozilla Firefox. To click on this button during replay, you can manually add a desktop click with coordinates to your test script. For example:
    [ ] RECT rect = printButton.GetRect(true)
[ ] DesktopOA.Click(MB_LEFT, rect.xPos + (rect.xSize / 2), rect.yPos + (rect.ySize / 2))
  • Silk Test Classic does not support text recognition with Mozilla Firefox.
    Text recognition includes the following methods:
    • TextCapture
    • TextClick
    • TextExists
    • TextRectangle
  • Silk Test Classic does not support recording locators on JavaScript alert boxes with Mozilla Firefox. You can workaround this issue by manually scripting the locators. For example, to click on the button OK, which has the locator //PushButton[@caption='OK'], type the following into your script:
    WebBrowser.Dialog.FindPushButton("//PushButton[@caption='OK']").Click()
    You can also use the following methods to handle Javascript alert boxes:
    • AcceptAlert
    • DismissAlert
    • GetAlertText
    • IsAlertPresent
  • Silk Test Classic does not support Java applets for Mozilla Firefox 52 or later. Silk Test Classic supports Java applets for Mozilla Firefox 47.0.1 or prior with the following limitations:
    • Silk Test Classic does not support the locator //AppletContainer.
    • When the applet opens a modal dialog, a locator similar to //BrowserApplication//BrowserWindow/JDialog[@caption='Information']//JButton[@caption='OK'] might not work. You can use a locator like //JDialog[@caption='Information']//JButton[@caption='OK'] instead.
  • Silk Test Classic does not support properties in XPath expressions for Mozilla Firefox. Only attributes are supported in XPath expressions.
  • Silk Test Classic does not support the GetFocus method of the MoveableWin class.
  • Silk Test does not support testing child technology domains of the xBrowser domain with Mozilla Firefox. For example Apache Flex or Microsoft Silverlight are not supported with Mozilla Firefox.
  • With Mozilla Firefox 52 or later, the following methods are not supported:
    • PressKeys
    • ReleaseKeys
  • With Mozilla Firefox 52 or prior, the SetViewportSize method of the BrowserWindow class is not supported.
  • With Mozilla Firefox 52 or later, native playback for the following is not supported:
    • Double-click.
    • Right and middle mouse button click.
  • With Mozilla Firefox 52 or later, the DomClick method is not supported on controls that open an alert.
  • With Mozilla Firefox 55, uploading a file does not work. For additional information, see File upload no longer works with geckodriver 0.18.0 and Firefox 55.
Parent topic: Testing with Mozilla Firefox


Testing with Microsoft Edge

This functionality is supported only if you are using the Open Agent.

This section describes how you can enhance your cross-browser test set by testing with Microsoft Edge.

  • Limitations for Testing with Microsoft Edge
    Lists the known limitations for playing back tests and recording locators with Microsoft Edge.
  • Testing Microsoft Edge on a Remote Machine
    Start the information service on the remote machine with medium integrity to test Microsoft Edge.
Parent topic: Cross-Browser Testing with the Open Agent


Limitations for Testing with Microsoft Edge

This functionality is supported only if you are using the Open Agent.

The following are the known limitations for testing with Microsoft Edge:
  • The following classes, interfaces, methods, and properties are currently not supported when testing web applications on Microsoft Edge:
    • BrowserApplication class.
      • ClearCache method
      • CloseOtherTabs method
      • CloseTab method
      • ExistsTab method
      • GetHorizontalScrollbar method
      • GetNextCloseWindow method
      • GetSelectedTab method
      • GetSelectedTabIndex method
      • GetSelectedTabName method
      • GetTabCount method
      • GetVerticalScrollbar method
      • IsActive method
      • Minimize method
      • OpenContextMenu method
      • OpenTab method
      • Restore method
      • SelectTab method
      • SetActive method
      • WindowState method
    • The following methods of the BrowserWindow class are not supported for Microsoft Edge versions prior to build 38.14393, the Microsoft Edge version for Microsoft Windows 10 Anniversary Update.
      • PressKeys method
      • ReleaseKeys method
  • Silk Test Classic does not automatically bring the browser into the foreground when recording actions against Microsoft Edge.
  • When testing with Microsoft Edge, the rectangle for the BrowserApplication is not absolute.
  • Silk Test Classic does not support testing Apache Flex.
  • Silk Test Classic does not provide native support for Microsoft Edge. You cannot test internal Microsoft Edge functionality. For example, in a test, you cannot change the currently displayed web page by adding text to the navigation bar. As a workaround, you can use API calls to navigate between web pages.
  • Silk Test Classic does not support handling alerts and similar dialog boxes for Microsoft Edge.
  • Image clicks are only supported for Microsoft Edge Threshold 2 (build 25.10586) or later. If you are testing a web application on a prior version of Microsoft Edge, you can only use image verifications.
  • Silk Test Classic does not support text recognition with Microsoft Edge.
    Text recognition includes the following methods:
    • TextCapture
    • TextClick
    • TextExists
    • TextRectangle
  • Silk Test Classic does not support tabbing on Microsoft Edge. Tabs are recognized as windows.
  • When testing web applications on Microsoft Edge, Silk Test Classic cannot locate meta-tags which include the http-equiv attribute. For example, Silk Test Classic cannot locate the following meta-tag:
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  • With Microsoft Edge, Silk Test Classic does not support directly reading the currentStyle attribute of a DOM element. You can use the GetCssStyle method of the DomElement class to retrieve the computed CSS style with the specified style name.
  • When starting the interaction with a web application on Microsoft Edge, Silk Test Classic closes any open instance of Microsoft Edge and starts a new browser. This new browser uses a temporary profile without add-ons and with an empty cache. This instance of Microsoft Edge is closed when shutting down the Open Agent or when starting to test another application outside Microsoft Edge.
  • With Microsoft Edge, Silk Test Classic does not recognize the textContents attribute while recording actions or locators. However, you can use the textContents attribute in object maps and when replaying a test on Microsoft Edge.
  • Silk Test Classic does not support properties in XPath expressions for Microsoft Edge. Only attributes are supported in XPath expressions.
  • Silk Test Classic does not support the GetFocus method of the MoveableWin class.
  • Silk Test Classic does not support testing web applications which include a Content-Security-Policy HTTP header.
Parent topic: Testing with Microsoft Edge
Related tasks
Recording a Test on Microsoft Edge
Related reference
Microsoft Edge


Testing Microsoft Edge on a Remote Machine

To test Microsoft Edge on a remote Microsoft Windows 10 machine, Silk Test Classic needs to be installed on the remote machine.
  1. On the local machine, from which you want to test Microsoft Edge, add the remote Microsoft Windows 10 machine as a remote location. For additional information, see Editing Remote Locations.
  2. If the Silk Test information service is already running with administrator privileges on the remote Microsoft Windows 10 machine, disable the Silk Test information service.
    1. Sign in to the Microsoft Windows 10 machine as an administrator.
    2. Open the Control Panel (icons view).
    3. Click Administrative Tools.
    4. Double-click Services.
    5. Double click on the Silk Test information service.
    6. If the service shows a status of running, click Stop and wait until the service status shows as stopped.
    7. Change the Startup type to Disabled.
    8. Click OK.
  3. Start the Silk Test information service with medium integrity level, which means without administrator privileges.
    1. Open a file explorer and navigate to %OPEN_AGENT_HOME%/InfoService. For example, C:\Program Files (x86)\Silk\SilkTest\ng\InfoService.
    2. Double-click infoservice_start.bat.
  4. You can now select Microsoft Edge on the remote Microsoft Windows 10 machine in the Select Application dialog box.
Note: Ensure that the Silk Test information service is running in a user session, and not in the services session. The Silk Test information service requires UI interaction to be enabled. The services session, which is session 0, does not enable UI interaction.
Parent topic: Testing with Microsoft Edge


Responsive Web Design Testing

Desktop web applications which are built based upon responsive web design might change their appearance in response to the size of the screen or web browser in which these applications are displayed. Choosing the appropriate size of the replay window might have significant impact on the stability of such tests.

Silk Test Classic enables you to specify the exact size of the browser window in the following situations:
  • When you add an application configuration for a web application to a project.
You can use the following settings to specify the size of the browser window:
  • The Browser size list contains a mix of predefined and custom browser window sizes, enabling you to select the size on which you want to test.
  • The Orientation list enables you to select whether you want the browser window to use landscape or portrait orientation.
  • Click Edit Browser Sizes to add custom browser sizes to the Browser size list or to specify which browser sizes are displayed in the list.
    • To add a new custom browser size to the list, click Add Browser Size.
    • To exclude a size from the list, uncheck the corresponding check box.
    • To add the visual breakpoints of a specific web application to the Browser size list, click Detect Visual Breakpoints.

When replaying a test against a web application from the command line or from Silk Central, you can specify the size of the browser viewport by setting the silktest.browserViewportSize environment variable. You can either specify the name of a browser from the Browser Size list or a specific size.

Example: Setting the browser size for automated replay by using the name

The following code sample sets the browser size to SVGA (800, 600) by using the SVGA entry of the Browser size list:
SET silktest.browserViewportSize=name=SVGA;orientation=landscape

Example: Setting the browser size for automated replay by using the width and height

The following code sample sets the browser size to SVGA (800, 600) by using the width and height parameters:
SET silktest.browserViewportSize=width=800;height=600;orientation=landscape
Parent topic: Cross-Browser Testing with the Open Agent
Related tasks
Detecting Visual Breakpoints


Detecting Visual Breakpoints

Many web applications that are implemented with responsive web design techniques change their layout in response to the size of the browser or device in which they are displayed. The specific resolutions on which the layout changes are called visual breakpoints.

Silk Test Classic supports testing such applications by detecting the visual breakpoints, and by allowing you to resize the recording window to the specific size of such a visual breakpoint.

Silk Test Classic enables you to specify the exact size of the browser window in the following situations:
  • When you add an application configuration for a web application to a project.

To find the visual breakpoints in a web application, and to display the corresponding resolutions in the Browser size list, perform the following actions:

  1. Click Edit Browser Sizes. The Edit Browser Sizes dialog appears.
  2. Click Detect Visual Breakpoints. If no URL for the web application is specified in an application configuration or base state, the Visual Breakpoint Detection URL dialog appears.
  3. If no URL for the web application has been specified in an application configuration or base state, the Visual Breakpoint Detection URL dialog appears. Type the URL into the text field and click OK. Silk Test Classic detects all visual breakpoints for the web application and adds them to the Browser sizes list.
  4. Click OK to close the Edit Browser Sizes dialog.
You can now select any of the visual breakpoints as the size of the browser window or mobile device for testing.
Parent topic: Cross-Browser Testing with the Open Agent
Related concepts
Responsive Web Design Testing


Manually Creating Tests for Dynamic Popup Menus

You must enable xBrowser extensions and use the Open Agent to create scripts that use dynamic object recognition.

Although the xBrowser extension does not support recording, you can manually create scripts that test dynamic popup menus. When you manually create scripts use the Record Window Identifiers dialog box to identify the locator strings for dynamic object recognition. After you determine which event needs to be triggered in order to pop up the menu, trigger it either by using native user input, by moving the mouse over the element or clicking the element, or by triggering the event directly. For example, to trigger the event, type:
DomElement.ExecuteJavaScript("currentElement.onmouseover()"))
Parent topic: Cross-Browser Testing with the Open Agent


Finding Hidden Input Fields

Hidden input fields are HTML fields for which the tag includes type="hidden". To enable a Find to locate hidden input fields, you can use the OPT_XBROWSER_FIND_HIDDEN_INPUT_FIELDS option. The default value of the option is TRUE.
Agent.SetOption (OPT_XBROWSER_FIND_HIDDEN_INPUT_FIELDS, TRUE)
Parent topic: Cross-Browser Testing with the Open Agent


Cross-Browser Testing: Frequently Asked Questions

This section includes questions that you might encounter when testing your Web application on various browsers.

  • How do I Verify the Font Type Used for the Text of an Element?
    Describes how to verify the font type for a text element.
  • What is the Difference Between textContents, innerText, and innerHtml?
    Describes the differences between textContents, innerText, and innerHtml.
  • I Configured innerText as a Custom Class Attribute, but it Is Not Used in Locators
    Describes why innerText may not display in locator strings.
  • What Should I Take Care Of When Creating Cross-Browser Scripts?
    Describes issues that you might encounter when creating cross-browser scripts.
  • How Can I See Which Browser I Am Currently Using?
    Describes how you can see which browser you are using, or define which browser you want to use, in you scripts.
  • Which Locators are Best Suited for Stable Cross Browser Testing?
    Describes how you can create stable locators for cross browser testing.
  • Logging Output of My Application Contains Wrong Timestamps
    Describes how to work around incorrect timestamps in your logs.
  • My Test Script Hangs After Navigating to a New Page
    Describes how to work around a script problem that occurs after navigating to a new page.
  • Recorded an Incorrect Locator
    Describes how an incorrect locator might be recorded.
  • Rectangles Around Elements in Internet Explorer are Misplaced
    Describes how to resolve misplaced rectangles in Internet Explorer.
  • Link.Select Does Not Set the Focus for a Newly Opened Window in Internet Explorer
    Describes how to activate a newly opened window.
  • DomClick(x, y) Is Not Working Like Click(x, y)
    Describes how to resolve the issue that DomClick(x, y) is not working like Click(x, y).
  • FileInputField.DomClick() Will Not Open the Dialog
    Describes how to open a dialog if FileInputField.DomClick() does not.
  • How can I scroll in a browser?
    Describes how you can handle scrolling in browsers during replay.
  • The Move Mouse Setting Is Turned On but All Moves Are Not Recorded. Why Not?
    Describes when MoveMouse action are recorded.
  • I Need Some Functionality that Is Not Exposed by the xBrowser API. What Can I Do?
    Describes how to add functionality to your scripts.
  • Why Are the Class and the Style Attributes Not Used in the Locator?
    Describes when to use the class and style attributes in the locator.
  • Dialog is Not Recognized During Replay
    Describes how you can edit your script if the browser does not recognize Dialog during replay.
  • Why Do I Get an Invalidated-Handle Error?
    Describes what you can do when you get an invalidated-handle error.
  • Why Are Clicks Recorded Differently in Internet Explorer 10?
    Describes why a Click recorded in Internet Explorer 10 might behave different than a Click recorded in a previous Internet Explorer version.
Parent topic: Cross-Browser Testing with the Open Agent


How do I Verify the Font Type Used for the Text of an Element?

You can access all attributes of the currentStyle attribute of a DOM element by separating the attribute name with a ":".

Internet Explorer 8 or earlier
wDomElement.GetProperty("currentStyle:fontName")
All other browsers, for example Internet Explorer 9 or later and Mozilla Firefox
wDomElement.GetProperty("currentStyle:font-name")
Parent topic: Cross-Browser Testing: Frequently Asked Questions


What is the Difference Between textContents, innerText, and innerHtml?

  • textContents is all text contained by an element and all its children that are for formatting purposes only.
  • innerText returns all text contained by an element and all its child elements.
  • innerHtml returns all text, including html tags, that is contained by an element.

Consider the following html code.

<div id="mylinks">
  This is my <b>link collection</b>:
  <ul>
    <li><a href="www.borland.com">Bye bye <b>Borland</b> </a></li>
    <li><a href="www.microfocus.com">Welcome to <b>Micro Focus</b></a></li>
  </ul>
</div>

The following table details the different properties that return.

Code Returned Value
browser.DomElement("//div[@id='mylinks']").GetProperty("textContents")
This is my link collection:
browser.DomElement("//div[@id='mylinks']").GetProperty("innerText")
This is my link collection:Bye bye Borland Welcome to Micro Focus
browser.DomElement("//div[@id='mylinks']").GetProperty("innerHtml")
This is my <b>link collection</b>:
<ul>
  <li><a href="www.borland.com">Bye bye <b>Borland</b></a></li>
  <li><a href="www.microfocus.com">Welcome to <b>Micro Focus</b></a></li>
</ul>
Note: In Silk Test 13.5 or later, whitespace in texts, which are retrieved through the textContents property of an element, is trimmed consistently across all supported browsers. For some browser versions, this whitespace handling differs to Silk Test versions prior to Silk Test 13.5. You can re-enable the old behavior by setting the OPT_COMPATIBILITY option to a version lower than 13.5.0. For example, to set the option to Silk Test 13.0, type the following into your script:
Agent.SetOption(OPT_COMPATIBILITY, "13.0.0")
Parent topic: Cross-Browser Testing: Frequently Asked Questions
Related reference
Agent Options


I Configured innerText as a Custom Class Attribute, but it Is Not Used in Locators

A maximum length for attributes used in locator strings exists. InnerText tends to be lengthy, so it might not be used in the locator. If possible, use textContents instead.

Parent topic: Cross-Browser Testing: Frequently Asked Questions


What Should I Take Care Of When Creating Cross-Browser Scripts?

When you are creating cross-browser scripts, you might encounter one or more of the following issues:
  • Different attribute values. For example, colors in Internet Explorer are returned as "# FF0000" and in Mozilla Firefox as "rgb(255,0,0)".
  • Different attribute names. For example, the font size attribute is called "fontSize" in Internet Explorer 8 or earlier and is called "font-size" in all other browsers, for example Internet Explorer 9 or later and Mozilla Firefox.
  • Some frameworks may render different DOM trees.
Parent topic: Cross-Browser Testing: Frequently Asked Questions


How Can I See Which Browser I Am Currently Using?

The BrowserApplication class provides a property "browsertype" that returns the type of the browser. You can add this property to a locator in order to define which browser it matches.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Examples

To get the browser type, type the following into the locator:
browserApplication.GetProperty("browsertype")

Additionally, the BrowserWindow provides a method GetUserAgent that returns the user agent string of the current window.

Parent topic: Cross-Browser Testing: Frequently Asked Questions
Related reference
SetBrowserType Function


Which Locators are Best Suited for Stable Cross Browser Testing?

The built in locator generator attempts to create stable locators. However, it is difficult to generate quality locators if no information is available. In this case, the locator generator uses hierarchical information and indices, which results in fragile locators that are suitable for direct record and replay but ill-suited for stable, daily execution. Furthermore, with cross browser testing, several AJAX frameworks might render different DOM hierarchies for different browsers.

To avoid this issue, use custom IDs for the UI elements of your application.

Parent topic: Cross-Browser Testing: Frequently Asked Questions


Logging Output of My Application Contains Wrong Timestamps

This might be a side effect of the synchronization. To avoid this problem, specify the HTML synchronization mode.

Parent topic: Cross-Browser Testing: Frequently Asked Questions


My Test Script Hangs After Navigating to a New Page

This can happen if an AJAX application keeps the browser busy (open connections for Server Push / ActiveX components). Try to set the HTML synchronization mode. Check the Page Synchronization for xBrowser topic for other troubleshooting hints.

Parent topic: Cross-Browser Testing: Frequently Asked Questions
Related concepts
Page Synchronization for xBrowser


Recorded an Incorrect Locator

The attributes for the element might change if the mouse hovers over the element. Silk Test Classic tries to track this scenario, but it fails occasionally. Try to identify the affected attributes and configure Silk Test Classic to ignore them.

Parent topic: Cross-Browser Testing: Frequently Asked Questions


Rectangles Around Elements in Internet Explorer are Misplaced

  • Make sure the zoom factor is set to 100%. Otherwise, the rectangles are not placed correctly.
  • Ensure that there is no notification bar displayed above the browser window. Silk Test Classic cannot handle notification bars.
Parent topic: Cross-Browser Testing: Frequently Asked Questions


Link.Select Does Not Set the Focus for a Newly Opened Window in Internet Explorer

This is a limitation that can be fixed by changing the Browser Configuration Settings. Set the option to always activate a newly opened window.

Parent topic: Cross-Browser Testing: Frequently Asked Questions


DomClick(x, y) Is Not Working Like Click(x, y)

If your application uses the onclick event and requires coordinates, the DomClick method does not work. Try to use Click instead.

Parent topic: Cross-Browser Testing: Frequently Asked Questions
Related concepts
Comparing API Playback and Native Playback for xBrowser


FileInputField.DomClick() Will Not Open the Dialog

Try to use Click instead.

Parent topic: Cross-Browser Testing: Frequently Asked Questions
Related concepts
Comparing API Playback and Native Playback for xBrowser


How can I scroll in a browser?

This functionality is supported only if you are using the Open Agent.

Silk Test Classic provides the following ways to scroll controls in a browser into view during replay:
ExecuteJavaScript method (DomElement)
Use the ScrollIntoView method to scroll a specific DOM element into the visible area of the browser window.
ExecuteJavaScript method (BrowserWindow)
Use the ExecuteJavaScript method to scroll the entire page up or down by a specified range.

Examples

The following command scrolls one page down:
browserWindow.ExecuteJavaScript("window.scrollBy(0, window.innerHeight)")
The following command scrolls down 100 pixels:
browserWindow.ExecuteJavaScript("window.scrollBy(0, 100)")
The following command scrolls up 100 pixels:
browserWindow.ExecuteJavaScript("window.scrollBy(0, -100)")
Parent topic: Cross-Browser Testing: Frequently Asked Questions


The Move Mouse Setting Is Turned On but All Moves Are Not Recorded. Why Not?

In order to not pollute the script with a lot of useless MoveMouse actions, Silk Test Classic does the following:

  • Only records a MoveMouse action if the mouse stands still for a specific time.
  • Only records MoveMouse actions if it observes activity going on after an element was hovered over. In some situations, you might need to add some manual actions to your script.
  • Silk Test Classic supports recording mouse moves only for Web applications, Win32 applications, and Windows Forms applications. Silk Test Classic does not support recording mouse moves for child technology domains of the xBrowser technology domain, for example Apache Flex and Swing.
Parent topic: Cross-Browser Testing: Frequently Asked Questions


I Need Some Functionality that Is Not Exposed by the xBrowser API. What Can I Do?

You can use ExecuteJavaScript() to execute JavaScript code directly in your Web application. This way you can build a workaround for nearly everything.

Parent topic: Cross-Browser Testing: Frequently Asked Questions


Why Are the Class and the Style Attributes Not Used in the Locator?

These attributes are on the ignore list because they might change frequently in AJAX applications and therefore result in unstable locators. However, in many situations these attributes can be used to identify objects, so it might make sense to use them in your application.

Parent topic: Cross-Browser Testing: Frequently Asked Questions


Dialog is Not Recognized During Replay

When recording a script, Silk Test Classic recognizes some windows as Dialog. If you want to use such a script as a cross-browser script, you have to replace Dialog with Window, because some browsers do not recognize Dialog.
For example, the script might include the following line:
/BrowserApplication//Dialog//PushButton[@caption='OK']
Rewrite the line to enable cross-browser testing to:
/BrowserApplication//Window//PushButton[@caption='OK']
Parent topic: Cross-Browser Testing: Frequently Asked Questions


Why Do I Get an Invalidated-Handle Error?

This topic describes what you can do when Silk Test Classic displays the following error message: The handle for this object has been invalidated.

This message indicates that something caused the object on which you called a method, for example WaitForProperty, to disappear. For example, if something causes the browser to navigate to a new page, during a method call in a Web application, all objects on the previous page are automatically invalidated.

When testing a Web application, the reason for this problem might be the built-in synchronization. For example, suppose that the application under test includes a shopping cart, and you have added an item to this shopping cart. You are waiting for the next page to be loaded and for the shopping cart to change its status to contains items. If the action, which adds the item, returns too soon, the shopping cart on the first page will be waiting for the status to change while the new page is loaded, causing the shopping cart of the first page to be invalidated. This behavior will result in an invalidated-handle error.

As a workaround, you should wait for an object that is only available on the second page before you verify the status of the shopping cart. As soon as the object is available, you can verify the status of the shopping cart, which is then correctly verified on the second page.

Parent topic: Cross-Browser Testing: Frequently Asked Questions
Related reference
WaitForProperty Method


Why Are Clicks Recorded Differently in Internet Explorer 10?

When you record a Click on a DomElement in Internet Explorer 10 and the DomElement is dismissed after the Click, then the recording behavior might not be as expected. If another DomElement is located beneath the initial DomElement, Silk Test records a Click, a MouseMove, and a ReleaseMouse, instead of recording a single Click.

A possible workaround for this unexpected recording behavior depends on the application under test. Usually it is sufficient to delete the unnecessary MouseMove and ReleaseMouse events from the recorded script.

Parent topic: Cross-Browser Testing: Frequently Asked Questions


Testing the Insurance Company Sample Web Application

Silk Test Classic provides a sample insurance company Web application, http://demo.borland.com/InsuranceWebExtJS/.

To complete a tutorial for how to test the insurance company Web application using Silk Test Classic, complete each of the following steps. Or, in the Help, click the Contents tab and then expand Testing in Your Environment > Testing Web Applications > Using the xBrowser Tech Domain > Testing the Insurance Company Sample Web Application. Follow the topics sequentially in the Testing the Insurance Company Sample Web Application book to test the sample Web application using Silk Test Classic.

To test the sample Web application, follow these steps:

  • Create a New Project for the insurance company Web application.
  • Configure the insurance company Web application.
  • Record a test case for the insurance company Web site.
  • Replay the test case for the insurance company Web site.
  • Modify the insurance company test case to replay tests in a different browser than Internet Explorer.
  • Creating a New Project for the Insurance Company Web Application
    Create a new project to execute sample tests on the insurance company Web application.
  • Configuring the Insurance Company Web Application
    Configure the insurance company Web application to create useful sample tests.
  • Recording a Test Case for the Insurance Company Web Site
    Record a test case for the insurance company web site to create a sample test.
  • Replaying a Test Case for the Insurance Company Web Site
    Replay a test case for the insurance company Web site to ensure that the test case works as expected.
Parent topic: Cross-Browser Testing with the Open Agent


Creating a New Project for the Insurance Company Web Application

The type of project that you select determines the default Agent. For Web application projects, the Open Agent is automatically set as the default agent. Silk Test Classic uses the default agent when configuring an application and recording a test case.

  1. Click File > New Project, or click Open Project > New Project on the Basic workflow bar. The Create Project dialog box opens.
  2. Type a project name and a description in the appropriate fields.
  3. Click OK to save your project in the default location, C:\Users\<Current user>\Documents\Silk Test Classic Projects. Silk Test Classic creates a <Project name> folder within the specified directory, saves the projectname.vtp and projectname.ini to this location and copies the extension .ini files, which are appexpex.ini, axext.ini, domex.ini, and javaex.ini, to the extend subdirectory. If you do not want to save your project in the default location, click Browse and specify the folder in which you want to save your project.

    Silk Test Classic creates your project and displays nodes on the Files and Global tabs for the files and resources associated with this project.

Parent topic: Testing the Insurance Company Sample Web Application
Related tasks
Creating a New Project
Related reference
Basic Workflow for the Open Agent
Project Explorer


Configuring the Insurance Company Web Application

When you configure an application, Silk Test Classic automatically creates a base state for the application. An application’s base state is the known, stable state that you expect the application to be in before each test begins execution, and the state the application can be returned to after each test has ended execution.

  1. Click Configure Applications on the Basic Workflow bar. If you do not see Configure Applications on the Basic Workflow bar, ensure that the default Agent is set to the Open Agent. The Select Application dialog box opens.
  2. Select the Web tab.
  3. Select Internet Explorer.
  4. In the Enter URL to navigate text box, type the URL of the web application that you want to test. For example, type http://demo.borland.com/gmoajax.
  5. Click OK.

    The Choose name and folder of the new frame file page opens. Silk Test Classic configures the recovery system and names the corresponding file frame.inc by default.

  6. Navigate to the location in which you want to save the frame file.
  7. In the File name field, type the name for the frame file that contains the default base state and recovery system. Then, click Save. Silk Test Classic automatically creates a base state for the application. By default, Silk Test Classic lists the caption of the main window of the application as the locator for the base state. When you configure an application, Silk Test Classic adds an include file based on the technology or browser type that you enable to the Use files location in the Runtime Options dialog box. For instance, if you configure an application that uses one of the supported browsers, Silk Test Classic adds the xBrowser.inc file to the Runtime Options dialog box.
Silk Test Classic opens the Web page. Record the test case whenever you are ready.
Parent topic: Testing the Insurance Company Sample Web Application
Related concepts
Understanding the Recovery System for the Open Agent
Base State
Dynamic Object Recognition


Recording a Test Case for the Insurance Company Web Site

  1. Click Record Testcase on the Basic Workflow bar. The Record Testcase dialog box opens.
  2. Type the name of your test case in the Testcase name field.

    For example, type ZipTest.

    Test case names are not case sensitive; they can be any length and consist of any combination of alphabetic characters, numerals, and underscore characters.

  3. From the Application State list box, select DefaultBaseState to have the built-in recovery system restore the default base state before the test case begins executing. If you choose DefaultBaseState as the application state, the test case is recorded in the script file as: testcase testcase_name ().
  4. If you do not want Silk Test Classic to display the status window during playback when driving the application to the specified base state, uncheck the Show AppState status window check box.

    Typically, you check this check box. However, in some circumstances it is necessary to hide the status window. For instance, the status bar might obscure a critical control in the application you are testing.

  5. Click Start Recording. Silk Test Classic:
    • Closes the Record Testcase dialog box.
    • Starts your application, if it is not already running
    • Removes the editor window from the display.
    • Displays the Recording window.
    • Waits for you to take further action.
  6. In the insurance company web site, perform the following steps:
    1. From the Select a Service or login list box, select Auto Quote. The Automobile Instant Quote page opens.
    2. Type a zip code and email address in the appropriate fields, click an automobile type, and then click Next.
    3. Specify an age, click a gender and driving record type, and then click Next.
    4. Specify a year, make, and model, click the financial info type, and then click Next. A summary of the information you specified displays.
    5. Point to the Zip Code that you specified and press Ctrl+Alt to add a verification to the script. You can add a verification for any of the information that displays. The Verify Properties dialog box opens.
    6. Check the textContents check box and then click OK. A verification action is added to the script for the zip code text.
    An action that corresponds with each step is recorded.
  7. To review what you have recorded, click Stop in the Recording window.

    Silk Test Classic displays the Record Testcase dialog box, which contains the code that has been recorded for you.

  8. Click Paste to Editor.
  9. Click File > Save.

Replay the test to ensure that it works as expected. You can modify the test to make changes if necessary.

Parent topic: Testing the Insurance Company Sample Web Application
Related concepts
Dynamic Object Recognition
Configuring Applications
Understanding the Recovery System for the Open Agent
Related reference
Basic Workflow for the Open Agent


Replaying a Test Case for the Insurance Company Web Site

Replay a test to ensure that it works as expected.

  1. Make sure that the test case you want to run is in the active window.
  2. Click Run Testcase on the Basic Workflow bar.

    Silk Test Classic displays the Run Testcase dialog box, which lists all the test cases contained in the current script.

  3. Select the ZipTest test case.
  4. To wait one second after each interaction with the application under test is executed, check the Animated Run Mode (Slow-Motion) check box. Typically, you will only use this check box if you want to watch the test case run. For instance, if you want to demonstrate a test case to someone else, you might want to check this check box. Executions of the default base state and functions that include one of the following strings are not delayed:
    • BaseStateExecutionFinished
    • Connecting
    • Verify
    • Exists
    • Is
    • Get
    • Set
    • Print
    • ForceActiveXEnum
    • Wait
    • Sleep
  5. Click Run.

    Silk Test Classic runs the test case and generates a results file. The results file describes whether the test passed or failed, and provides summary information.

Parent topic: Testing the Insurance Company Sample Web Application
Related reference
Basic Workflow for the Open Agent
Run Testcase Dialog Box


xBrowser Classes

This section lists the classes that are used for the xBrowser technology domain.
  • BrowserApplication Class
    The class that represents the top-level window of a browser application.
  • BrowserObject Class
    The class that represents the base class for all objects that are contained within a BrowserApplication.
  • BrowserWindow Class
    The class that represents the top-level container for a web page.
  • DomButton Class
    The class that represents the top-level container for a web page.
  • DomCheckBox Class
    The class that represents all DOM elements that were specified using the <input type='checkbox'> tag.
  • DomElement Class
    The class that represents any element in the DOM tree.
  • DomForm Class
    The class that represents all DOM elements that are specified using the <form> tag.
  • DomLink Class
    The class that represents all DOM elements that were specified using the <a> tag.
  • DomListBox Class
    The class that represents all DOM elements that were specified using the <select> tag.
  • DomRadioButton Class
    The class that represents all DOM elements that were specified using the <input type='radio'> tag.
  • DomTable Class
    The class that represents all DOM elements that were specified using the <table> tag.
  • DomTableRow Class
    The class that represents all DOM elements that were specified using the <tr> tag.
  • DomTextField Class
    The class that represents all DOM elements that were specified using one of the following tags: <input type='text'>, <input type='password'>, <input type='file'> or <textarea>.
Parent topic: Cross-Browser Testing with the Open Agent
Parent topic: Classes


Testing Windows API-Based Applications

This section describes how Silk Test Classic provides built-in support for testing Microsoft Windows API-based applications.

  • Overview of Windows API-Based Application Support
    Provides an overview of Windows API-based application support.
  • Locator Attributes for Windows API-Based Applications
    Describes the supported attributes for Windows API-based client/server applications.
  • Suppressing Controls (Classic Agent)
    Suppress controls to ignore them during recording and playback.
  • Suppressing Controls (Open Agent)
    Suppress controls to ignore them during recording and playback.
  • Configuring Standard Applications
    Configure the application that you want to test to set up the environment that Silk Test Classic will create each time you record or replay a test case.
  • Determining the priorLabel in the Win32 Technology Domain
    Describes how the priorLabel is determined in the Win32 technology domain.
  • Testing Embedded Chrome Applications
    Describes how you can use Silk Test Classic to test embedded Chrome applications.
Parent topic: Testing in Your Environment with the Open Agent


Overview of Windows API-Based Application Support

Silk Test Classic provides built-in support for testing Microsoft Windows API-based applications. Several objects exist in Microsoft applications that Silk Test Classic can better recognize if you enable Accessibility. For example, without enabling Accessibility Silk Test Classic records only basic information about the menu bar in Microsoft Word and the tabs that display in Internet Explorer 7.0. However, with Accessibility enabled, Silk Test Classic fully recognizes those objects. You can also improve Silk Test Classic object recognition by defining a new window, if necessary.

You can test Windows API-based applications using the Classic or Open Agent.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Object Recognition

Windows API-based applications support hierarchical object recognition and dynamic object recognition. You can create tests for both dynamic and hierarchical object recognition in your test environment. Use the method best suited to meet your test requirements.

When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations.

Existing test cases that use dynamic object recognition without locator keywords in an INC file will continue to be supported. You can replay these tests, but you cannot record new tests with dynamic object recognition without locator keywords in an INC file.

To test Windows API-based applications using hierarchical object recognition, record a test for the application that you want to test. Then, replay the tests at your convenience.

Supported Controls

For a complete list of the record and replay controls available for Windows-based testing for each Agent type, view the WIN32.inc and winclass.inc file. To access the WIN32.inc file, which is used with the Open Agent, navigate to the <SilkTest directory>\extend\WIN32 directory. By default, this file is located in C:\Program Files\Silk\SilkTest\extend\WIN32\WIN32.inc. To access the winclass.inc file, which is used with the Classic Agent, navigate to the <SilkTest directory>\ directory. By default, this file is located in C:\Program Files\Silk\SilkTest\winclass.inc.

Parent topic: Testing Windows API-Based Applications
Related concepts
Differences in the Parameters Supported by the Silk Test Agents
Dynamic Object Recognition
Improving Silk Test Classic Window Declarations
Related tasks
Recording Test Cases for Standard and Web Applications
Recording Test Cases for Mobile Applications
Related reference
Differences in the Classes Supported by the Silk Test Agents


Locator Attributes for Windows API-Based Applications

Silk Test Classic supports the following locator attributes for the controls of Windows API-based client/server applications:

  • caption.
  • windowid.
  • priorlabel. For controls that do not have a caption, priorlabel is used as the caption automatically. For controls with a caption, it may be easier to use the caption.
Note: Attribute names are case sensitive. Attribute values are by default case insensitive, but you can change the default setting like any other option. The locator attributes support the wildcards ? and *.
Parent topic: Testing Windows API-Based Applications
Related concepts
Dynamic Object Recognition
Determining the priorLabel in the Win32 Technology Domain
Related tasks
Defining which Custom Locator Attributes to Use for Recognition


Suppressing Controls (Classic Agent)

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

You can suppress the controls for certain classes for .NET, Java SWT, and Windows API-based applications. For example, you might want to ignore container classes to streamline your test cases. Ignoring these unnecessary classes simplifies the object hierarchy and shortens the length of the lines of code in your test scripts and functions. Container classes or ‘frames’ are common in GUI development, but may not be necessary for testing.

The following classes are commonly suppressed during recording and playback:
Technology Domain | Class
.NET | Group
Java SWT | org.eclipse.swt.widgets.Composite org.eclipse.swt.widgets.Group
Windows API-based applications | Group

To suppress specific controls:

  1. Click Options > Class Map. The Class Map dialog box opens.
  2. In the Custom class field, type the name of the class that you want suppress. The class name depends on the technology and the extension that you are using. For Windows API-based applications, use the Windows API-based class names. For Java SWT applications, use the fully qualified Java class name. For example, to ignore the SWT_Group in a Windows API-based application, type SWT_Group, and to ignore to ignore the Group class in Java SWT applications, type org.eclipse.swt.widgets.Group.
  3. In the Standard class list, select Ignore.
  4. Click Add. The custom class and the standard class display at the top of the dialog box.
Parent topic: Testing Windows API-Based Applications
Related tasks
Suppressing Controls (Open Agent)


Determining the priorLabel in the Win32 Technology Domain

To determine the priorLabel in the Win32 technology domain, all labels and groups in the same window as the target control are considered. The decision is then made based upon the following criteria:
  • Only labels either above or to the left of the control, and groups surrounding the control, are considered as candidates for a priorLabel.
  • In the simplest case, the label closest to the control is used as the priorLabel.
  • If two labels have the same distance to the control, the priorLabel is determined based upon the following criteria:
    • If one label is to the left and the other above the control, the left one is preferred.
    • If both levels are to the left of the control, the upper one is preferred.
    • If both levels are above the control, the left one is preferred.
  • If the closest control is a group control, first all labels within the group are considered according to the rules specified above. If no labels within the group are eligible, then the caption of the group is used as the priorLabel.
Parent topic: Testing Windows API-Based Applications
Related concepts
Locator Attributes for Windows API-Based Applications


Testing Embedded Chrome Applications

An embedded Chrome application is a desktop application with an embedded web browser engine that is based on the Chromium core. Such applications enable you to add web browser capabilities to a desktop application. You can create such an app by using for example the Chromium Embedded Framework (CEF) or the Electron framework.

Silk Test Classic provides full support for testing embedded Chrome applications that allow remote debugging through the --remote-debugging-port command line argument. Silk Test Classic does not support testing embedded Chrome applications that are based on Java, for example Java AWT and Swing applications.

To test an embedded Chrome application with Silk Test Classic, you have to set the debugging ports for the executable of the application. Start the application from the command line and set the remote debugging port.

  • Silk Test Classic checks if the -remote-debugging-port argument is set in the command line arguments of the embedded Chrome application. If the argument is set, Silk Test Classic automatically sets the Enable embedded Chrome support field to the appropriate executable and debugging port.
  • If the -remote-debugging-port argument is not set in the command line arguments of the embedded Chrome application, you have to manually specify the executable and the port in the Enable embedded Chrome support field:
    1. In the Silk Test Classic UI, select Edit Options.
    2. In the Options dialog, select the Advanced tab.
    3. In the Enable embedded Chrome support option, specify the executable and the port as a comma-separated value pair:
      <application name>.exe=<port number>
Note: You cannot test embedded Chrome applications that do not allow remote debugging with Silk Test Classic.
Note: Silk Test Classic does not support testing non-browser menus of Electron apps.

Example

For example, you can start the application myApp from the command line as follows:
myApp.exe --remote-debugging-port=9222
You can then specify the executable and port in the Enable embedded Chrome support option as follows:
myApp.exe=9222
Parent topic: Testing Windows API-Based Applications


Limitations for Testing on Microsoft Windows 10

The following list lists the known limitations for testing on Microsoft Windows 10 (Windows 10):
  • Silk Test does not support testing Universal Windows Platform (UWP) apps on Windows 10.
Parent topic: Testing in Your Environment with the Open Agent


Keyword-Driven Tests

This functionality is supported only if you are using the Open Agent.

Keyword-driven testing is a software testing methodology that separates test design from test development and therefore allows the involvement of additional professional groups, for example business analysts, in the test automation process. Silk Central and Silk Test support the keyword-driven testing methodology and allow a very close collaboration between automation engineers and business analysts by having automation engineers develop a maintainable automation framework consisting of shared assets in the form of keywords in Silk Test. These keywords can then be used by business analysts either in Silk Test to create new keyword-driven tests or in Silk Central to convert their existing manual test assets to automated tests or to create new keyword-driven tests.

  • A keyword-driven test is an executable collection of keywords. A keyword-driven test can be played back just like any other test.
  • A keyword sequence is a keyword that is a combination of other keywords. Keyword sequences bundle often encountered combinations of keywords into a single keyword, enabling you to reduce maintenance effort and to keep your tests well-arranged.
  • A keyword is a defined combination of one or more actions on a test object. The implementation of a keyword can be done with various tools and programming languages, for example Java or .NET.

There are two phases required to create keyword-driven tests:
  1. Designing the test.
  2. Implementing the keywords.
  • Advantages of Keyword-Driven Testing
    Lists the advantages of using the keyword-driven testing methodology to perform functional and regression testing.
  • Keywords
    Describes keywords and how you can use them.
  • Creating a Keyword-Driven Test in Silk Test Classic
    Create a keyword-driven test to test the functionality of your application under test by using keywords.
  • Recording a Keyword-Driven Test in Silk Test Classic
    Record actions in the recorder and bundle these actions into keywords to create a new keyword-driven test.
  • Setting the Base State for a Keyword-Driven Test in Silk Test Classic
    Describes how Silk Test Classic creates a base state for the AUT during the recording of a keyword-driven test.
  • Implementing a Keyword in Silk Test Classic
    Implement a keyword from the Keyword-Driven Test Editor to reuse the keyword in keyword-driven tests.
  • Recording a Keyword in Silk Test Classic
    Record actions into a new keyword to use the keyword in keyword-driven tests.
  • Marking a Test Method in a Script as a Keyword
    Mark an existing test method in a script as a keyword to add it to a keyword-driven test.
  • Editing a Keyword-Driven Test
    Open a keyword-driven test in the Keyword-Driven Test Editor to edit the keyword driven test.
  • Managing Keywords in a Test in Silk Central
    Manage the keywords in your keyword-driven test to specify the sequence of actions.
  • Which Keywords Does Silk Test Classic Recommend?
    Describes the basic recommendation algorithm that Silk Test Classic uses to recommend keywords for keyword-driven testing.
  • Using Parameters with Keywords
    Describes how you can handle parameters of keywords and keyword sequences.
  • Example: Keywords with Parameters
    Describes how you can use keywords with parameters.
  • Combining Keywords into Keyword Sequences
    Combine keywords in the Keyword-Driven Test Editor to create keyword sequences.
  • Replaying a Keyword-Driven Test with Specific Variables
    Set variable values to execute a keyword-driven test based on the variables.
  • Integrating Silk Test Classic with Silk Central
    Integrate Silk Test Classic and Silk Central to enable collaboration between technical and less-technical users.
  • Implementing Silk Central Keywords in Silk Test Classic
    Implement Silk Central keywords in Silk Test Classic to create executable keyword-driven tests in Silk Central.
  • Uploading a Keyword Library to Silk Central
    Upload a keyword library from Silk Test Classic to Silk Central to use the implemented keywords when automating manual tests in Silk Central.
  • Uploading a Keyword Library to Silk Central from the Command Line
    Upload an external keyword library to Silk Central from a Java-based command line to integrate Silk Central and your keyword-driven tests into your continuous integration build system, for example Jenkins.
  • Searching for a Keyword
    Describes how you can search for a specific keyword in the Keywords window.
  • Filtering Keywords
    Use the Keywords window to find a keyword in the current project.


Advantages of Keyword-Driven Testing

This functionality is supported only if you are using the Open Agent.

The advantages of using the keyword-driven testing methodology are the following:
  • Keyword-driven testing separates test automation from test case design, which allows for better division of labor and collaboration between test engineers implementing keywords and subject matter experts designing test cases.
  • Tests can be developed early, without requiring access to the application under test, and the keywords can be implemented later.
  • Tests can be developed without programming knowledge.
  • Keyword-driven tests require less maintenance in the long run. You need to maintain the keywords, and all keyword-driven tests using these keywords are automatically updated.
  • Test cases are concise.
  • Test cases are easier to read and to understand for a non-technical audience.
  • Test cases are easy to modify.
  • New test cases can reuse existing keywords, which amongst else makes it easier to achieve a greater test coverage.
  • The internal complexity of the keyword implementation is not visible to a user that needs to create or execute a keyword-driven test.
Parent topic: Keyword-Driven Tests


Keywords

This functionality is supported only if you are using the Open Agent.

A keyword is a defined combination of one or more actions on a test object. The implementation of a keyword can be done with various tools and programming languages, for example Java or .NET. In Silk Test Classic, a keyword is a method with the keyword keyword before the method name. Keywords are saved as keyword assets.

You can define keywords and keyword sequences during the creation of a keyword-driven test and you can then implement them as test methods. You can also mark existing test methods as keywords by adding the keyword keyword before the method name..Keywords are defined as follows:
keyword method_name() alias "keyword_name" keyworddescription "description_text"

You can use the alias in the definition to give a name to the keyword that is different than the method name. The alias and the description are optional.

A keyword sequence is a keyword that is a combination of other keywords. Keyword sequences bundle often encountered combinations of keywords into a single keyword, enabling you to reduce maintenance effort and to keep your tests well-arranged.

A keyword can have input and output parameters. Any parameter of the test method that implements the keyword is a parameter of the keyword.

Note: You cannot use group keywords in Silk Test Classic.

Example

A test method that is marked as a keyword can look like the following:
keyword Login() alias "Login"
    ... // method implementation
or
keyword Login(string userName, string password) alias "Login" keyworddescription "Logs in with the given name and password."
    ... // method implementation
where the keyword logs into the application under test with a given user name and password.
Note: If you are viewing this help topic in PDF format, this code sample might include line-breaks which are not allowed in scripts. To use this code sample in a script, remove these line-breaks.
Parent topic: Keyword-Driven Tests


Creating a Keyword-Driven Test in Silk Test Classic

Before you can create a keyword-driven test in Silk Test Classic, you have to select a project.

This functionality is supported only if you are using the Open Agent.

Use the Keyword-Driven Test Editor to combine new keywords and existing keywords into new keyword-driven tests. New keywords need to be implemented as methods in a later step.

  1. Click File > New. The New File dialog box opens.
  2. Select Keyword-driven test from the file type list.
  3. Click OK.
    The Keyword-Driven Test Editor opens.
  4. Perform one of the following actions:
    • To add a new keyword, type a name for the keyword into the New Keyword field.
    • To add an existing keyword, expand the list and select the keyword that you want to add.
  5. Press Enter.
  6. Repeat the previous two steps until the test includes all the keywords that you want to execute.
  7. Click File > Save. The Save As dialog box opens.
  8. Type a name for the new test into the File name field.
  9. Click Save.
  10. Click Yes to add the keyword-driven test to the active project.

Continue with implementing the keywords or with executing the test, if all keywords are already implemented.

Parent topic: Keyword-Driven Tests


Recording a Keyword-Driven Test in Silk Test Classic

This functionality is supported only if you are using the Open Agent.

To record a single keyword, see Recording a Keyword.

To record a new keyword-driven test:

  1. In the workflow bar, click Record Testcase. The Start Recording dialog box opens.
  2. Select Keyword-Driven Test.
  3. Click Yes to start recording the keyword-driven test.
  4. Select the application state. During the recording of a keyword-driven test, Silk Test Classic generates a base state keyword with the same name as the application state that you have selected in the Record Keyword-Driven Test dialog box. By default, the application state is the DefaultBaseState. Silk Test Classic inserts this base state keyword as the first keyword of the keyword-driven test.
  5. Click Start Recording.
  6. If you have not set an application configuration for the current project, select the tab that corresponds to the type of application that you are testing:
    • If you are testing a standard application that does not run in a browser, select the Windows tab.
    • If you are testing a web application or a mobile web application, select the Web tab.
    • If you are testing a native mobile application, select the Mobile tab.
  7. To test a standard application, select the application from the list.
  8. To test a web application or a mobile web application, select one of the installed browsers or mobile browsers from the list.
    1. Specify the web page to open in the Enter URL to navigate text box. If an instance of the selected browser is already running, you can click Use URL from running browser to record against the URL currently displayed in the running browser instance.
    2. Optional: If you want to test a web application on a desktop browser with a predefined browser size, select the browser size from the Browser size list.
      For example, to test a web application on Apple Safari and in a browser window which is as big as the screen of the Apple iPhone 7, select Apple iPhone 7 from the list.
    3. Optional: Select an Orientation for the browser window.
    4. Optional: Click Edit Browser Sizes to specify a new browser size and to select which browser sizes should be shown in the Browser size list.
  9. To test a native mobile application (app):
    1. Select the mobile device, on which you want to test the app, from the list.
    2. Click Browse to select the app file or enter the full path to the app file into the Mobile app file text field. Silk Test Classic supports HTTP and UNC formats for the path. Silk Test Classic installs the app on the mobile device or emulator.
  10. If you have set an application configuration for the current project and you are testing a web application, the Select Browser dialog box opens:
    1. Select the browser.
  11. Depending on the dialog that is open, perform one of the following:
    • In the Select Application dialog box, click OK.
    • In the Select Browser dialog box, click Record.
  12. If you have defined a new application configuration, specify a name and location for the new frame file.
  13. In the application under test, perform the actions that you want to include in the first keyword.
    For information about the actions available during recording, see Actions Available During Recording.
  14. To specify a name for the keyword, hover the mouse cursor over the keyword name in the Recording window and click Edit.
    Note: Silk Test Classic automatically adds the keyword Start application to the start of the keyword-driven test. In this keyword, the applications base state is executed to enable the test to replay correctly. For additional information on the base state, see Base State.
  15. Type a name for the keyword into the Keyword name field.
  16. Click OK.
  17. To record the actions for the next keyword, type a name for the new keyword into the New keyword name field and click Add. Silk Test Classic records any new actions into the new keyword.
  18. Create new keywords and record the actions for the keywords until you have recorded the entire keyword-driven test.
  19. Click Stop. The Record Keyword-Driven Test dialog box opens.
  20. Click Paste to Editor. The Update Files dialog box opens.
  21. Click Paste testcase and update window declaration(s). The Save Keyword Implementation dialog box opens.
  22. Select a file name and a location to save the implementation of the recorded keywords.
  23. Click Save.
Silk Test Classic creates the new keyword-driven test with all recorded keywords.
Parent topic: Keyword-Driven Tests


Setting the Base State for a Keyword-Driven Test in Silk Test Classic

This functionality is supported only if you are using the Open Agent.

When you execute a keyword-driven test with Silk Test Classic and the keyword-driven test calls a base state keyword, Silk Test Classic starts your AUT from the base state.

During the recording of a keyword-driven test, Silk Test Classic generates a base state keyword with the same name as the application state that you have selected in the Record Keyword-Driven Test dialog box. By default, the application state is the DefaultBaseState. Silk Test Classic inserts this base state keyword as the first keyword of the keyword-driven test.

Parent topic: Keyword-Driven Tests
Related concepts
Base State


Implementing a Keyword in Silk Test Classic

Before implementing a keyword, define the keyword as part of a keyword-driven test.

This functionality is supported only if you are using the Open Agent.

To implement a keyword for reuse in keyword-driven tests:

  1. Open a keyword-driven test that includes the keyword that you want to implement.
  2. In the Keyword-Driven Test Editor, click Implement Keyword to the left of the keyword that you want to implement. The Start Recording dialog box opens.
  3. Perform one of the following actions:
    • To record the keyword, click Yes.
    • To create an empty keyword method, click No.
  4. Click Record.
    For additional information on recording, see Recording a Keyword.
You can now record or manually script actions for the keyword.
Parent topic: Keyword-Driven Tests


Recording a Keyword in Silk Test Classic

You can only record actions for a keyword that already exists in a keyword-driven test, not for a keyword that is completely new. To record a new keyword-driven test, see Recording a Keyword-Driven Test.

This functionality is supported only if you are using the Open Agent.

To record the actions for a new keyword:
  1. Open a keyword-driven test that includes the keyword that you want to record.
  2. In the Keyword-Driven Test Editor, click Implement Keyword to the left of the keyword that you want to implement. The Start Recording dialog box opens.
  3. Click Yes.
    The Recording window opens and Silk Test Classic starts recording the actions for the keyword.
  4. In the application under test, perform the actions that you want to test.
    For information about the actions available during recording, see Actions Available During Recording.
  5. Click Stop. The Record Actions on Open Agent dialog box opens.
  6. Click Paste to Editor. The Update Files dialog box opens.
  7. Click Paste script and update window declaration(s).
  8. Click OK. The Record Actions on Open Agent dialog box opens.
  9. Click Close.

The recorded actions are displayed in the defined 4Test script.

Parent topic: Keyword-Driven Tests
Related concepts
Actions Available During Recording


Marking a Test Method in a Script as a Keyword

This functionality is supported only if you are using the Open Agent.

Mark an existing test method in a script as a keyword to reuse the method in keyword-driven tests.

  1. Open the script which includes the test method that you want to mark as a keyword.
  2. Add keyword to the start of the test method. By default, the keyword name is the name of the test method.
  3. Optional: You can set a different name for the keyword by adding alias "KeywordName" to the start of the test method.
You can now use the test method as a keyword in a keyword-driven test.

Examples

To mark the test method TestLogin as a new keyword with the name Login, type the following before the start of the test method:
keyword TestLogin() alias "Login"
To mark the test method TestLogin as a new keyword with the name Login and with the two input parameters UserName and PassWord, type the following:
keyword TestLogin(string UserName, string PassWord) alias "Login" keyworddescription "Logs in with the given name and password."
    ...    // method implementation
Note: If you are viewing this help topic in PDF format, this code sample might include line-breaks which are not allowed in scripts. To use this code sample in a script, remove these line-breaks.
Parent topic: Keyword-Driven Tests


Editing a Keyword-Driven Test

This functionality is supported only if you are using the Open Agent.

Note: In Silk Test Classic, you can edit and execute keyword-driven tests that are located in Silk Test Classic, and you can execute keyword-driven tests that are stored in Silk Central. To edit a keyword-driven test, which is stored in Silk Central, open the keyword-driven test in the Keyword-Driven Test Editor and click Edit.

To edit a keyword-driven test:

  1. Open the keyword-driven test in the Keyword-Driven Test Editor.
    1. Click File > Open and browse for the keyword-driven test. If the test is included in a project, you can also expand the Keyword Tests node and double-click on the keyword-driven test that you want to edit.
    2. Click Keyword-Driven Test.
  2. To add a new keyword to the keyword-driven test:
    1. Click into the New Keyword field.
    2. Type a name for the new keyword.
    3. Press Enter.
  3. To edit an existing keyword, click Open Keyword to the left of the keyword.
    Note: Silk Central has the ownership of any keyword that has been created in Silk Central, which means any changes that you make to such keywords are saved in Silk Central, not in Silk Test Classic.
  4. To copy a keyword into the keyword-driven test:
    1. Select the keyword.
      Tip: Use Ctrl+Click or Shift+Click on the row number column to select multiple keywords.
    2. Press Ctrl+C.
    3. Select the row above which you want to insert the keyword.
    4. Press Ctrl+V.
  5. To move a keyword to another location in the keyword-driven test, click on the keyword and drag it to the new location, or:
    1. Select the keyword.
      Tip: Use Ctrl+Click or Shift+Click on the row number column to select multiple keywords.
    2. Press Ctrl+X.
    3. Select the row above which you want to insert the keyword.
    4. Press Ctrl+V.
  6. To remove the keyword from the keyword-driven test, click Delete Keyword to the left of the keyword. The keyword is still available in the Keywords window and you can re-add it to the keyword-driven test at any time.
  7. To save your changes, click File > Save.
Parent topic: Keyword-Driven Tests


Managing Keywords in a Test in Silk Central

This functionality is supported only if you are using the Open Agent.

The Keywords page enables you to manage the keywords of the selected keyword-driven test. The following actions are possible:
Task | Steps
Opening a test or keyword sequence in Silk Test | Click Open with Silk Test to open the selected test or keyword sequence in Silk Test.
Adding a keyword
  1. Click New Keyword at the bottom of the keywords list, or right-click a keyword and select Insert Keyword Above from the context menu.
    Note: You can let Silk Test recommend keywords based on their usage. Toggle the recommendations on or off with Enable Recommendations or Disable Recommendations in the context menu. For additional information, see Which Keywords Does Silk Test Classic Recommend?.
  2. Select a keyword from the list of available keywords or type a new name to create a new keyword.
  3. Click Save.
Alternatively, double click an existing keyword in the All Keywords pane on the right or drag and drop it.
Tip: You can select multiple keywords with Ctrl+Click. When dropping them, they will be sorted in the order that you selected them in.
Deleting a keyword | Click Delete in the Actions column of the keyword that you want to delete. Click Save.
Changing the order of keywords | Drag and drop a keyword to the desired position. Click Save.
Creating a keyword sequence (a keyword consisting of other keywords)
  1. Select the keywords that you want to combine in the keywords list. Use Ctrl+Click or Shift+Click on the row number column to select multiple keywords.
  2. Right-click your selection and click Combine.
  3. Specify a Name and Description for the new keyword sequence.
Extracting keywords from a keyword sequence | Right-click a keyword sequence and click Extract keywords. The original keyword sequence is then replaced by the keywords that it contained, but it is not removed from the library. Click Save.
Copying and pasting keywords into tests or keyword sequences
  1. Select the keywords that you want to copy in the keywords list. Use Ctrl+Click or Shift+Click on the row number column to select multiple keywords.
  2. Press Ctrl+C to copy your selection, or Ctrl+X if you want to move the keywords.
  3. Open the test or keyword sequence that you want to copy the keywords to and select the row above which the keywords will be inserted.
  4. Press Ctrl+V.
Tip: You can also paste your selected keywords into Excel, and copy and paste them from there into your tests or keyword sequences.
Defining parameters for a keyword sequence
  1. Click Parameters above the keywords list. The Parameters dialog box appears.
  2. Click Add Parameter.
  3. Specify a Name for the new parameter. If the parameter is an outgoing parameter (delivers a value, instead of requiring an input value), check the Output checkbox.
  4. Click OK.
  5. Click Save.
Editing a draft keyword
  1. Click Edit in the Actions column of the draft keyword that you want to edit.
  2. Select a Group or specify a new group for the keyword.
  3. Type a Description for the keyword. This information is valuable for the engineer who will implement the keyword.
  4. Click OK.
  5. Optional: Click into a parameter field to add parameters for the keyword. If the keyword is implemented with Silk Test, these parameters will appear in the generated code stub.
  6. Click Save.
Searching for a keyword
Use the search field in the Keywords window to find a specific keyword. When you enter alphanumeric characters, the list is dynamically updated with all existing matches. Tips for searching:
  • The search is case-insensitive: doAction will find doaction and DOAction.
  • Enter only capital letters to perform a so-called CamelCase search: ECD will find Enter Car Details, Enter Contact Details and EnterContactDetails.
  • Keyword and group names are considered: test will find all keywords that contain test and all keywords in groups where the group name contains test.
  • ? replaces 0-1 characters: user?test will find userTest and usersTest.
  • * replaces 0-n characters: my*keyword will find myKeyword, myNewKeyword and my_other_keyword.
  • .<string> only searches in keyword names: .keyword will find all keywords that contain keyword.
  • Use quotes to search for an exact match: 'Keyword' will find Keyword and MyKeyword, but not keyword.
Parent topic: Keyword-Driven Tests


Which Keywords Does Silk Test Classic Recommend?

When you add keywords to a keyword-driven test or a keyword sequence in the Keyword-Driven Test Editor, Silk Test Classic recommends existing keywords which you might want to use as the next keyword in your test. The recommended keywords are listed on top of the keywords list, and are indicated by a bar graph, with the filled-out portion of the graph corresponding to how much Silk Test Classic recommends the keyword.

Silk Test Classic recommends the keywords based on the following:

  • When you add the first keyword to a keyword-driven test or a keyword sequence, Silk Test Classic searches for similar keywords that are used as the first keyword in other keyword-driven tests or keyword sequences. The keywords that are used most frequently are recommended higher.
  • When you add additional keywords to a keyword-driven test or a keyword sequence, which already includes other keywords, Silk Test Classic recommends keywords as follows:
    • If there are keywords before the position in the keyword-driven test or the keyword sequence, to which you add a new keyword, Silk Test Classic compares the preceding keywords with keyword combinations in all other keyword-driven tests and keyword sequences and recommends the keywords that most frequently follow the preceding combination of keywords.
    • If there are no keywords before the position in the keyword-driven test or the keyword sequence, but there are keywords after the current position, then Silk Test Classic compares the succeeding keywords with keyword combinations in all other keyword-driven tests and keyword sequences and recommends the keywords that most frequently precede the succeeding combination of keywords.
  • Additionally, Silk Test Classic takes into account how similar the found keywords are. For example, if both the name and group of two keywords match, then Silk Test Classic recommends these keywords higher in comparison to two keywords for which only the name matches.
  • If you have established a connection with Silk Central, any keywords included in keyword-driven tests, which belong to the keyword library that corresponds to the current project, are also considered.
Parent topic: Keyword-Driven Tests


Using Parameters with Keywords

A keyword or a keyword sequence can have input and output parameters. This topic describes how you can handle these parameters with Silk Test Classic.

In the Keyword-Driven Test Editor, you can view any defined parameters for a keyword or a keyword sequence and you can edit the parameter values.

In the Keywords window, you can see which parameters are assigned to a keyword or a keyword sequence when you hover the mouse cursor over the keyword or keyword sequence.

Input parameters for simple keywords

You can define and use input parameters for keywords in the same way as for any other test method.

The following code sample shows how you can define the keyword SetUserDetails with the two input parameters userName and password:
keyword SetUserDetails(STRING userName, STRING password)
  ...

Output parameters for simple keywords

You can define a return value or one or more output parameters for a keyword. You can also use a combination of a return value and one ore more output parameters.

The following code sample shows how you can define the keyword GetText that returns a string:
keyword GetText()
  return "text"
The following code sample shows how you can define the keyword GetUserDetails with the two output parameters userName and password:
keyword GetUserDetails(out STRING userName null, out STRING password)
  userName="name"
  password="password"

Parameters for keyword sequences

You can define or edit the parameters for a keyword sequence in the Parameters dialog box, which you can open if you click Parameters in the Keyword Sequence Editor.

Parent topic: Keyword-Driven Tests


Example: Keywords with Parameters

This topic provides an example of how you can use keywords with parameters.

As a first step, create a keyword-driven test which contains the keywords that you want to use. You can do this by recording an entire keyword-driven test, or by creating a new keyword-driven test and by adding the keywords in the keyword-driven test editor.

In this example, the keyword-driven test includes the following keywords:
Start application
This is the standard keyword that starts the AUT and sets the base state.
Login
This keyword logs into the AUT with a specific user, identified by a user name and a password.
GetCurrentUser
This keyword returns the name of the user that is currently logged in to the AUT.
AssertEquals
This keyword compares two values.
Logout
This keyword logs the user out from the AUT.

The next step is to add the parameters to the keywords. To do this, open the test scripts of the keywords and add the parameters to the methods.

To add the input parameters UserName and Password to the keyword Login, change
keyword Login()
  ...
to
keyword Login(STRING UserName, STRING Password)
  ...
To add the output parameter UserName to the keyword GetCurrentUser, change
keyword GetCurrentUser()
  ...
to
keyword GetCurrentUser(out STRING CurrentUser)
  ...

The keyword-driven test in the Keyword-Driven Test Editor should look similar to the following:

Now you can specify actual values for the input parameters in the Keyword-Driven Test Editor. To retrieve the value of the output parameter UserName of the keyword GetCurrentUser, provide a variable, for example ${current user}. You can then pass the value that is stored in the variable to subsequent keywords.

Parent topic: Keyword-Driven Tests


Combining Keywords into Keyword Sequences

This functionality is supported only if you are using the Open Agent.

Use the Keyword-Driven Test Editor to combine keywords, which you want to execute sequentially in multiple keyword-driven tests, into a keyword sequence.
  1. Open the keyword-driven test that includes the keywords that you want to combine.
  2. In the Keyword-Driven Test Editor, press and hold down the Ctrl key and then click the keywords that you want to combine.
  3. Right-click on the selection and click Combine. The Combine Keywords dialog box opens.
  4. Type a name for the new keyword sequence into the Name field.
  5. Optional: Type a description for the new keyword sequence into the Description field.
  6. Click Combine.
The new keyword sequence opens and is also displayed in the Keywords window. You can use the keyword sequence in keyword-driven tests.
Note: Like any other keyword, you cannot execute a keyword sequence on its own, but only as part of a keyword-driven test.
Parent topic: Keyword-Driven Tests


Replaying a Keyword-Driven Test with Specific Variables

Before you can set the values of variables for the execution of a keyword-driven test, you have to create the project.

When executing keyword-driven tests that are part of an automation framework and that are managed in a test management tool, for example Silk Central, you can set the values of any variables that are used for the execution of the keyword-driven test in Silk Test Classic. To set the values of global variables for the entire project, which means that these values are used whenever a Silk Test Classic user executes the keyword-driven test assets in this project, perform the following actions:

  1. Open the project that includes the keyword-driven test.
  2. Right-click the folder Data of the project and select New File. A new untitled file is opened in the editor.
  3. Add new lines to the file to specify the variables.
    The format for a new variable is:
    name=value
    For example, to specify the two variables user and password, type the following:
    user=John
password=john5673
  4. In the menu, click File > Save.
  5. Type globalvariables.properties into the File name field.
  6. Click Save.

Whenever the keyword-driven test is executed from Silk Test Classic, the variables are used.

Note: When you replay a keyword-driven test, which is located in Silk Central, from Silk Test Classic, the result file (.xlg) is saved into the folder of the current Silk Test Classic project.
Parent topic: Keyword-Driven Tests


Integrating Silk Test Classic with Silk Central

Integrate Silk Test Classic and Silk Central to enable collaboration between technical and less-technical users.

This functionality is supported only if you are using the Open Agent.

When Silk Test Classic and Silk Central are integrated and a library with the same name as the active Silk Test Classic project exists in Silk Central, the Keywords view under Window > Keywords displays all keywords from the Silk Central library in addition to any keywords defined in the active Silk Test Classic project.
Note: The Silk Central connection information is separately stored for every Silk Test Classic user, which means every Silk Test Classic user that wants to work with keywords and keyword sequences from Silk Central must integrate Silk Test Classic with Silk Central.
Integrating Silk Test Classic with Silk Central provides you with the following advantages:
  • Test management and execution is handled by Silk Central.
  • Keywords are stored in the Silk Central database (upload library) and are available to all projects in Silk Central.
  • Manual tests can be directly automated in Silk Central and the created keyword-driven tests can be executed in Silk Test Classic from Silk Central.
Note: In Silk Test Classic, you can edit and execute keyword-driven tests that are located in Silk Test Classic, and you can execute keyword-driven tests that are stored in Silk Central. To edit a keyword-driven test, which is stored in Silk Central, open the keyword-driven test in the Keyword-Driven Test Editor and click Edit.
  1. From the menu, select Options > Silk Central Configuration. The Silk Central Connection dialog box opens.
  2. Type the URL of your Silk Central server into the URL field. For example, if the Silk Central server name is sctm-server, and the port for Silk Central is 13450, type http://sctm-server:13450.
  3. Type a valid user name and password into the corresponding fields.
  4. Click Verify to verify if Silk Test Classic can access the Silk Central server with the specified user.
  5. Click OK.
Parent topic: Keyword-Driven Tests
Related tasks
Using SauceLabs Devices
Using Devices from Mobile Center


Implementing Silk Central Keywords in Silk Test Classic

Before implementing Silk Central keywords, define the keywords as part of a keyword-driven test in Silk Central.

This functionality is supported only if you are using the Open Agent.

To implement a Silk Central keyword in Silk Test Classic:

  1. Create a project in Silk Test Classic with the same name as the keyword library in Silk Central, which includes the keyword-driven test.
  2. If the keyword library in Silk Central has no type assigned, click Upload Keyword Library in the toolbar to set the library type.
  3. Optional: To implement a specific keyword in Silk Test Classic from Silk Central, open the Keywords tab of the library in Silk Central and click Implement with Silk Test in the Actions column of the keyword.
  4. In Silk Test Classic, open the project and select the Keywords tab.
  5. In the Keywords tab, double-click the keyword-driven test. To update the Keywords tab with any changes from Silk Central, click Refresh.
  6. In the toolbar, click Record Testcase.
  7. Click Record.
    For additional information on recording, see Recording a Keyword.
  8. Record the actions for the first unimplemented keyword.
  9. When you have recorded all the actions for the current keyword, click Next Keyword.
  10. To switch between keywords in the Recording window, click Previous Keyword and Next Keyword.
  11. Click Stop. The Record Keyword-Driven Test dialog box opens.
Note: You cannot delete keywords or change the sequence of the keywords in a keyword-driven test from Silk Central, as these tests are read only in Silk Test Classic.
Parent topic: Keyword-Driven Tests


Uploading a Keyword Library to Silk Central

This functionality is supported only if you are using the Open Agent.

To work with Silk Central, ensure that you have configured a valid Silk Central location. For additional information, see Integrating Silk Test Classic with Silk Central.

To automate manual tests in Silk Central, upload keywords that you have implemented in a Silk Test Classic project as a keyword library to Silk Central, where you can then use the keywords to automate manual tests.
Note: Ensure that the project does not reference files that are located outside of the project directory.
  1. In Silk Test Classic, select the project in which the keyword-driven tests reside.
  2. Ensure that a library with the same name exists in Silk Central (Tests > Libraries).
  3. Optional: Provide a description of the changes to the keyword library.
  4. Optional: Click Configure to configure the connection to Silk Central.
  5. Optional: To see which libraries are available in the connected Silk Central instance, click on the link.
  6. Click Upload.
    CAUTION:
    If the keyword library in Silk Central is already assigned to a different automation tool or another Silk Test client, you are asked if you really want to change the type of the keyword library. Upload the library only if you are sure that you want to change the type.
Silk Test Classic creates a keyword library out of all the keywords that are implemented in the project. Then Silk Test Classic saves the keyword library with the name library.zip into the output folder of the project. The library is validated for consistency, and any changes which might break existing tests in Silk Central are listed in the Upload Keyword Library to Silk Central dialog box. Finally, Silk Test Classic uploads the library to Silk Central. You can now use the keywords in Silk Central. Any keyword-driven tests in Silk Central, which use the keywords that are included in the keyword library, automatically use the current implementation of the keywords.
Parent topic: Keyword-Driven Tests


Uploading a Keyword Library to Silk Central from the Command Line

Upload an external keyword library to Silk Central from a Java-based command line to integrate Silk Central and your keyword-driven tests into your continuous integration build system, for example Jenkins.
To upload your keyword library to Silk Central from a Java-based command line:
  1. Select Help > Tools in Silk Central and download the Java Keyword Library Tool.
  2. Call the command line tool that is contained in the downloaded jar file with the following arguments:
    • java
    • -jar com.borland.silk.keyworddriven.jar
    • -upload
    • Library name of the library in Silk Central to be updated, or created if it does not yet exist.
    • Package name of the library package (zip archive) to be uploaded.
    • Hostname:port of the Silk Central front-end server.
    • Username of the Silk Central user.
    • Password of the Silk Central user.
    • Update information, describing the changes that were applied to the library, in quotes.
    • [-allowUsedKeywordDeletion], an optional flag to allow the deletion of keywords that are used in a test or keyword sequence. By default, an error is raised if used keywords are attempted to be deleted.
    The following example outlines the command line to upload a library to Silk Central:
    java -jar com.borland.silk.keyworddriven.jar -upload
"My library" "./output/library.zip" silkcentral:19120 scLogin
scPassword "Build xy: Implemented missing keywords"
Parent topic: Keyword-Driven Tests


Searching for a Keyword

This functionality is supported only if you are using the Open Agent.

Use the search field in the Keywords window to find a specific keyword. When you enter alphanumeric characters, the list is dynamically updated with all existing matches. Tips for searching:
  • The search is case-insensitive: doAction will find doaction and DOAction.
  • Enter only capital letters to perform a so-called CamelCase search: ECD will find Enter Car Details, Enter Contact Details and EnterContactDetails.
  • Keyword and group names are considered: test will find all keywords that contain test and all keywords in groups where the group name contains test.
  • ? replaces 0-1 characters: user?test will find userTest and usersTest.
  • * replaces 0-n characters: my*keyword will find myKeyword, myNewKeyword and my_other_keyword.
  • .<string> only searches in keyword names: .keyword will find all keywords that contain keyword.
  • Use quotes to search for an exact match: 'Keyword' will find Keyword and MyKeyword, but not keyword.
Parent topic: Keyword-Driven Tests


Filtering Keywords

To find a specific keyword in the current project, you can filter the keywords that are displayed in the Keywords window. If an integration with Silk Central is configured, the result includes the relevant keywords from Silk Central.
  1. In the menu, click Keywords. The Keywords window opens.
  2. In the Keywords window, type the name of the keyword that you are searching for into the search field. The Keywords window lists all keywords in the current project with the given name.
  3. Optional: To edit a keyword, hover the mouse cursor over the keyword in the Keywords window and click Go to implementation.
Parent topic: Keyword-Driven Tests


Using Advanced Techniques with the Open Agent

This section describes advanced techniques for testing you applications with Silk Test Classic and the Open Agent.

  • Starting from the Command Line
    Describes how you can start Silk Test Classic from the command line.
  • Recording a Test Frame
    Describes how you can record a test frame.
  • Improving Object Recognition with Microsoft Accessibility
    Describes how you can use Microsoft Accessibility to ease the recognition of objects at the class level.
  • Calling Windows DLLs from 4Test
    Describes how you can call Windows DLLs from 4Test by using the stdcall calling convention.
  • Extending the Class Hierarchy
    Describes how you can extend the class hierarchy.
  • Porting Tests to Other GUIs
    Describes how you can port tests to other GUIs.
  • Supporting Custom Controls
    Describes how Silk Test Classic supports custom controls.
  • Supporting Internationalized Objects
    Describes how you can work with internationalized objects.
  • Using Autocomplete
    Describes how you can automatically complete functions, members, application states, and data types.
  • Overview of the Library Browser
    Describes how the Library Browser provides online documentation for built-in and user-defined methods and properties.
  • Text Recognition Support
    Describes how you can use text recognition to conveniently interact with test applications that contain highly customized controls.
  • Slowing Down Tests
    Slow down a test to enable the UI of the AUT to finish loading.
  • Testing Applications in Multiple UI Sessions on a Single Machine
    Connect to multiple Open Agent instances on a single machine to test applications in multiple UI sessions on the machine or to test on multiple agents.


Starting from the Command Line

This section describes how you can start Silk Test Classic from the command line.

  • Starting Silk Test Classic from the Command Line
    Describes how to start Silk Test Classic from the command line.
Parent topic: Using Advanced Techniques with the Open Agent


Starting Silk Test Classic from the Command Line

You can start the Silk Test Classic executable program from the command line by:

  • Clicking Run in the Start menu.
  • Using the command-line prompt in a DOS window or batch file.
The syntax is:
partner [-complog filename] [-m mach] [-opt optionset.opt] [-p mess] [-proj filename [-base filename]]
[[-q] [-query query name] [-quiet] [-r filename] [-resexport] [-resextract] [-r] scr.t/suite.s/plan.pln/link.lnk
[args]]

The filename specified for various options expects the file to be located in the working directory. The default location is the Silk Test Classic installation directory, C:\Program Files (x86)\Silk\SilkTest. If you want to use a file that is located in another directory, you must specify the full path in addition to the filename.

Options

The partner command can be called with the following options:

args

Optional arguments to a script file. You can access the arguments using the GetArgs function and use them with your scripts.

If you pass arguments in the command line, the arguments provided in the command line are used and any arguments specified in the currently loaded options set are not used. To use the arguments in the currently loaded options set, do not specify arguments in the command line.

For additional information, see Passing arguments to a script.

-complog
Tells Silk Test Classic to log compilation errors to a file you specify. Enter the argument as -complog filename. For example:
partner [-complog c:\testing\logtest1.txt]

If you include this argument, Silk Test Classic checks that the specified file exists each time that you compile. If the file does not exist, Silk Test Classic creates and opens the file. If the file exists, Silk Test Classic opens it and adds the information. The number of errors is written in the format n error(s), for example 0 errors, 1 error, or 50 errors. Compilation errors are written to the error log file as they are displayed in the Errors window. The error log file is automatically saved and closed when Silk Test Classic finishes writing errors to it.

-m

Specifies the target machine. The default is the current machine. Call the 4Test built-in function Connect to connect to a different machine at runtime.

In order to use the -m switch, you need to have the Network setting of the Runtime Options dialog box set to TCP/IP or NetBIOS. If this is set to '(disabled)', the target machine is ignored. To set the Network setting, either set it interactively in the Runtime Options dialog box before running from the command line, or save the setting in an option set and add the '-opt <option set>' argument to the command line.

-opt
Specifies an options set. Must be followed by the path of the .opt file that you want to use.
-p

Provided for use with a Windows shell program that is running Silk Test Classic as a batch task. This option enables another Windows program to receive a message containing the number of errors that resulted from the run. Silk Test Classic broadcasts this message using the Windows PostMessage function, with the following arguments:

  • hWnd = HWND_BROADCAST
  • uiMsg = RegisterWindowMessage (mess)
  • wParam = 0
  • lParam = number of errors

To take advantage of the -p option, the shell program that runs Silk Test Classic should first register the message (mess), and should look for the message while Silk Test Classic is running.

-proj
Optional argument specifying the project file or archived project to load when starting Silk Test Classic or Silk Test Classic Runtime. For example:
partner –proj d:\temp\testapp.vtp –r agent.pln

-base is an optional argument to –proj. You use the base argument to specify the location where you want to unpack the package contents. For example, partner –proj d:\temp\testapp.stp –base c:\rel30\testapp unpacks the contents of the package to the c:\rel30\testapp directory.

-q
Quits Silk Test Classic after the script, suite, or test plan completes.
-query
Specifies a query. Must be followed by the name of a saved query. Tells Silk Test Classic to perform an Include > Open All, then Testplan > Mark By Named Query, then Run > Marked Tests.
-quiet

Starts Silk Test Classic in quiet mode, which prevents any pop-up dialog boxes from displaying when Silk Test Classic starts up.

The quiet option is particularly useful if you are doing unattended testing where a user is not available to respond to any pop-up dialog boxes that may display.

-r
Must be the last option specified, followed only by the name of a Silk Test Classic file to open. This includes files such as script (and, optionally, arguments that the script takes), a suite, test plan, or link file. If you specify a link file, tells Silk Test Classic to resolve the link and attempt to open the link target. Otherwise, tells Silk Test Classic to run the specified script, suite, or test plan, optionally passing args as arguments to a script file. For example, partner –proj d:\temp\testapp.stp –base c:\rel30\testapp –r Agent.pln unpacks the archive from the temp subdirectory into the c:\rel30\testapp subdirectory and then loads and executes the Agent.pln file.
-resexport
Tells Silk Test Classic to export a one line summary of the most recent results sets to .rex files automatically. Specifying -resexport has the same effect as if each script run invokes the ResExportOnClose function during its execution.
-resextract
Tells Silk Test Classic to extract all information from the most recent results sets to a .txt file. Both the Silk Test Classic Extract menu command and the -resextract option create UTF-8 files.
script.t/ suite.s/ plan.pln/ link.lnk
The name of the Silk Test Classic script, suite, test plan, or link file to load, run, or open.

Examples

  • To load Silk Test Classic, type the following:
    partner
  • To run the test.s suite, type the following:
    partner -r test.s on system "sys1"
  • To run the test.t script, type the following:
    partner -m sys1 -r test.t
  • To run the test.t script with arguments, type the following:
    partner -r test.t arg1 arg2
  • To run the tests marked by the query named query3 in tests.pln, type the following:
    partner -query query3 -r tests.pln
  • To run tests.pln and to export the most recent results set from tests.res to tests.rex, type the following:
    partner -q -resexport -r tests.pln
  • To edit the test.inc include file, type the following:
    partner test.inc
Parent topic: Starting from the Command Line
Related concepts
Passing Arguments to a Script
Specifying Options Sets
Related reference
Starting the Runtime Version
Runtime Options Dialog Box


Recording a Test Frame

This section describes how you can record a test frame.

  • Overview of Object Files
    Provides an overview of object files.
  • Declarations
    Describes declarations.
  • Window Declarations
    Describes how you can specify an identifier for a GUI object and map the identifier to the locator.
  • Overview of Identifiers
    Provides an overview of identifiers.
  • Save the Test Frame
    Describes how to save the test frame.
  • Specifying How a Dialog Box is Invoked
    Describes how to invoke a dialog box.
Parent topic: Using Advanced Techniques with the Open Agent


Overview of Object Files

Object files are the compiled versions of include (.inc) or script (.t) files. Object files are saved with an "o" at the end of the extension, for example, .ino, or .to. Object files cannot be edited; the only way to change compiled objects is to recompile the include or script file. When you save a script or include file, a source file and an object file are saved. Object files are not platform-specific; you can use them on all platforms that Silk Test Classic supports.

In order for Silk Test Classic to run a script or include file that is in source form, it must compile it, which can be time-consuming. Object files, on the other hand, are ready to run.

Note: You cannot call objects that exist in the object file (.to) from a test plan; you must have the script file (.t).

To disable saving object files during compilation, the AutoComplete options on the General Options dialog box as well as the Save object files during compilation option on the Runtime Options dialog box need to be unchecked.

Silk Test Classic always uses object files if they are available. When you open a script file or an include file, Silk Test Classic loads the corresponding object file as well, if there is one. If the object file is not older than the source file, Silk Test Classic does not recompile the source file. The script is ready to run. If the source file is more recent, Silk Test Classic recompiles the source file before the script is run. If you then later save the source file, Silk Test Classic automatically saves a new object file.

If a file is loaded during compilation, that is, if you include a file in another file that is being compiled, Silk Test Classic loads only the object file, if it exists and is newer than the corresponding source file.

Object files may not be backward-compatible, although sometimes they will be. Specifically, object files will not work with versions of Silk Test Classic for which the list of GUI/browser types is different than for the version used to compile the object file. The list is in 4Test.inc. For example, object files created before 'mswxp' was added as the GUI type for Windows XP cannot be used with ST5.5 SP3, which includes the 'mswxp' GUI type.

If you are using a .ino file, but during compilation Silk Test Classic displays a message that the corresponding .inc file is missing, then you may be experiencing the object file version incompatibility explained in the preceding paragraph.

  • Advantages of Object Files
    Describes the advantages of object files.
  • Object File Locations
    Describes the directories in which object files can be read from and written to.
  • Specifying where Object Files Should be Written To and Read From
    Enter a short description of your task here (optional).
Parent topic: Recording a Test Frame


Advantages of Object Files

Advantages of object files include:

  • Because object files are ready to run, they do not need to be recompiled if the source file has not changed. This can save you a lot of time. If your object file is more recent than your source file, the source file does not need to be recompiled each time the file is first opened in a session; the object file is used as is.
  • You can distribute object files without having to distribute the source equivalents. So if you have built some tests and include files that you want to distribute but don’t want others to see the sources, you can distribute only the object files.

Since an object file cannot be run directly:

  • Define the code you want to "hide" in an include file, which will be compiled into an .ino object file.
  • Call those functions from an ordinary script file.
  • Distribute the .t script file and the compiled .ino include file. Users can open and run the script file as usual, through File > Run.

Here’s a simple example of how you might distribute object files so that others cannot see the code.

In file test.inc, place the definition of a function called TestFunction. When you save the file, the entire include file is compiled into test.ino.

TestFunction ()
           ListPrint (Desktop.GetActive ())

In the file test.t use the test.inc include file. Silk Test Classic will load the .ino equivalent. Call TestFunction, which was defined in the include file.

use "test.inc"

        main ()
        TestFunction () // call the function

Distribute test.t and test.ino. Users can open test.t and run it but do not have access to the actual routine, which resides only in compiled form in test.ino.

Parent topic: Overview of Object Files


Object File Locations

By default, an object file is read from and written to the same directory as its corresponding source file. But you can specify different directories for object files.

Specifying d:\obj in the Objfile Path text box of the Runtime Options dialog box tells Silk Test Classic to read and write all object files in the d:\obj directory, regardless of where the source files are located.

Specifying obj in the Objfile Path text box tells Silk Test Classic to read and write an object file in the directory obj that is a subdirectory of the directory containing the source file. In this scenario, each directory of source files will have a different directory of object files. For example, if a source file is in d:\src, its corresponding object file would be read from and written to d:\src\obj.

You can specify several directories in the Objfile Path text box. New files are written to the first directory specified. Silk Test Classic searches the directories in the order in which you have specified them to find existing files and will subsequently re-save existing files in the same directory where it found them.

Parent topic: Overview of Object Files


Specifying where Object Files Should be Written To and Read From

By default, an object file is read from and written to the same directory as its corresponding source file. But you can specify different directories for object files. To specify where object files are written to and read from:
  1. Click Options > Runtime.
  2. Specify a directory in the Objfile Path text box.
    • Leave the text box empty if you want to store object files in the same directory as their corresponding source files.
    • Specify an absolute path if you want to store all object files in the same directory.
    • Specify a relative path if you want object files to be stored in a directory relative to the directory containing the source files.
  3. Click OK.
Object files are saved in the location you specify here. In addition, Silk Test Classic will try to find object files in these locations. If it fails to find an object file, it will look in the directory containing the source file.
Parent topic: Overview of Object Files


Declarations

This section describes declarations.

  • GUI Specifiers
    Describes GUI specifiers.
  • Overview of Dialog Box Declarations
    Provides an overview of dialog box declarations.
  • Main Window and Menu Declarations
    Describes the main window and menu declarations.
Parent topic: Recording a Test Frame


GUI Specifiers

Where Silk Test Classic can detect a difference from one platform to the next, it automatically inserts a GUI-specifier in a window declaration to indicate the platform, for example msw.

For a complete list of the valid GUI specifiers, see GUITYPE data type.

Parent topic: Declarations
Related reference
GUITYPE Data Type


Overview of Dialog Box Declarations

The declarations for the controls contained by a dialog box are nested within the declaration of the dialog box to show the GUI hierarchy.

The declarations for menus are nested (indented) within the declaration for the main window, and the declarations for the menu items are nested within their respective menus. This nesting denotes the hierarchical structure of the GUI, that is, the parent-child relationships between GUI objects. Although a dialog box is not physically contained by the main window, as is true for menus, the dialog box nevertheless logically belongs to the main window. Therefore, a parent statement within each dialog box declaration is used to indicate that it belongs to the main window of the application.

In the sample Text Editor application, MainWin is the parent of the File menu. The File menu is considered a child of the MainWin. Similarly, all the menu items are child objects of their parent, the File menu. A child object belongs to its parent object, which means that it is either logically associated with the parent or physically contained by the parent.

Because child objects are nested within the declaration of their parent object, the declarations for the child objects do not need to begin with the reserved word window.

Classic Agent Example

The following example from the Text Editor application shows the declarations for the Find dialog box and its contained controls:

window DialogBox Find
   tag "Find"
   parent TextEditor
   StaticText FindWhatText
     multitag "Find What:"
       "$65535"
   TextField FindWhat
     multitag "Find What:"
       "$1152"
   CheckBox CaseSensitive
     multitag "Case sensitive"
       "$1041"
   StaticText DirectionText
     multitag "Direction"
       "$1072"
   RadioList Direction
     multitag "Direction"
       "$1056"
   PushButton FindNext
     multitag "Find Next"
       "$1"
   PushButton Cancel
     multitag "Cancel"
       "$2"

Open Agent Example

The following example from the Text Editor application shows the declarations for the Find dialog box and its contained controls:
window DialogBox Find
  locator "Find"
  parent TextEditor
  TextField FindWhat
    locator "@caption='Find What:' or @windowId='65535'"
  StaticText FindWhatText
    locator "@caption='Find What:' or @windowId='1152'"
  CheckBox CaseSensitive
    locator "@caption='Case sensitive' or @windowId='1041'"
  StaticText DirectionText
    locator "@caption='Direction' or @windowId='1072'"
  RadioList Direction
    locator "@caption='Direction' or @windowId='1056'"
  PushButton FindNext
    locator "@caption='Find Next' or @windowId='1'"
  PushButton Cancel
    locator "@caption='Cancel' or @windowId='2'"
Parent topic: Declarations
Related concepts
Window Declarations


Main Window and Menu Declarations

The main window declaration

The main window declaration begins with the 4Test reserved word window. The term window is historical, borrowed from operating systems and window manager software, where every GUI object, for example main windows, dialogs, menu items, and controls, is implemented as a window.

As is true for all window declarations, the declaration for the main window is composed of a class, identifier, and tag or locator.

Classic Agent Example

The following example shows the beginning of the default declaration for the main window of the Text Editor application:
window MainWin TextEditor
  multitag "Text Editor"
        "$C:\PROGRAMFILES\<SilkTest install directory>\SILKTEST\TEXTEDIT.EXE"
Part of Declaration | Value for TextEditor's main window.
Class | MainWin
Identifier | TextEditor
Tag Two components in the multiple tag:
  • " Text Editor "—The application’s caption
  • " executable path "—The full path of the executable file that invoked the application

Open Agent Example

The following example shows the beginning of the default declaration for the main window of the Text Editor application:
window MainWin TextEditor
  locator "Text Editor"
Part of Declaration | Value for TextEditor's main window.
Class | MainWin
Identifier | TextEditor
Locator | " Text Editor "—The application’s caption

sCmdLine and wMainWindow constants

When you record the declaration for your application’s main window and menus, the sCmdLine and wMainWindow constants are created. These constants allow your application to be started automatically when you run your test cases.

The sCmdLine constant specifies the path to your application’s executable. The following example shows an sCmdLine constant for a Windows environment:
mswnt const sCmdLine = "c:\program files\<SilkTest install directory>\silktest\textedit.exe"
The wMainWindow constant specifies the 4Test identifier for the main window of your application. For example, here is the definition for the wMainWindow constant of the Text Editor application on all platforms:
const wMainWindow = TextEditor

Menu declarations

When you are working with the Classic Agent, the following example from the Text Editor application shows the default main window declaration and a portion of the declarations for the File menu:
window MainWin TextEditor
  multitag "Text Editor"
    "$C:\PROGRAM FILES\<SilkTest install directory>\SILKTEST\TEXTEDIT.EXE"
    .
    .
    .
    Menu File
      tag "File"
      MenuItem New
        multitag "New"
          "$100"
Menus do not have window IDs, but menu items do, so by default menus are declared with the tag statement while menu items are declared with the multitag statement.
When you are working with the Open Agent, the following example from the Text Editor application shows the default main window declaration and a portion of the declarations for the File menu:
window MainWin TextEditor
  locator "Text Editor"
    .
    .
    .
    Menu File
      locator "File"
      MenuItem New
        locator "@caption='New' or windowId='100'"
Parent topic: Declarations
Related concepts
Improving Silk Test Classic Window Declarations
Differences in Object Recognition Between the Silk Test Agents


Window Declarations

A window declaration specifies a cross-platform, logical name for a GUI object, called the identifier, and maps the identifier to the actual name of the object, which is called the tag or locator. Because your test cases use logical names, if the actual name of the object changes on the current GUI, on another GUI, or in a localized version of the application, you only need to change the tag in the window declarations. You do not need to change any of your scripts.

You can add variables, functions, methods, and properties to the basic window declarations recorded by Silk Test Classic. For example, you can add variables to a dialog box declaration that specify what the tab sequence is, what the initial values are, and so on. You access the values of variables at runtime as you would a field in a record.

After you record window declarations for the GUI objects in your application and insert them into a declarations file, called an include file (*.inc), Silk Test Classic references the declarations in the include file to identify the objects named in your test scripts. You tell Silk Test Classic which include files to reference through the Use Files field in the Runtime Options dialog box.

  • Improving Silk Test Classic Window Declarations
    Describes how to improve Silk Test Classic window declarations.
  • Improving Object Recognition by Defining a New Window
    Describes how you can define a new window to improve the recognition of objects.
  • Recording Window Declarations for the Main Window and Menu Hierarchy
    Describes how to record window declarations for the main window and menu hierarchy.
  • Use the member-of Operator to Access Data
    Describes how to use the member-of operator to access data.
Parent topic: Recording a Test Frame
Related concepts
Overview of the Locator Keyword
Related tasks
Recording Window Declarations that Include Locator Keywords
Related reference
Runtime Options Dialog Box


Improving Silk Test Classic Window Declarations

The current methodology for identifying window declarations in Microsoft Windows-based applications during a recording session is usually successful. However, some applications may require an alternate approach of obtaining their declarations because their window objects are invisible to the Silk Test Recorder. You can try any of the following:

  • Turning on Accessibility - use this if during a session started with the Recorder, Silk Test Classic is unable to recognize objects within a Microsoft Windows-based application. This functionality is available only for projects or scripts that use the Classic Agent.
  • Defining a new window - use this if turning on Accessibility does not help Silk Test Classic to recognize the objects. This functionality is available only for projects or scripts that use the Classic Agent.
  • Creating a test case that uses dynamic object recognition - use this to create test cases that use XPath queries to find and identify objects. Dynamic object recognition uses a Find or FindAll method to identify an object in a test case. This functionality is available only for projects or scripts that use the Open Agent.
Parent topic: Window Declarations
Related concepts
Dynamic Object Recognition
Related tasks
Recording Locators Using the Locator Spy


Improving Object Recognition by Defining a New Window

If Silk Test Classic is having difficulty recognizing objects in Internet Explorer or Microsoft Office applications, try enabling Accessibility. If that does not help improve recognition, try defining a new window.

How defined windows works

When you use Defined Window, you use the mouse pointer to draw a rectangle around the object that Silk Test Classic cannot record and then assign a name to the object. When you save your work, Silk Test Classic stores the name and the object’s coordinates in a test script. When you replay the script, Silk Test Classic uses a Click() method on the center of the area you have specified.

Notes

  • Defining a new window is only available for projects or scripts that use the Classic Agent.
  • Defining a new window is not available for Java applications or applets.
  • Defined Window does not support nesting of defined objects.
  • Defined Window is location-based and uses pixel coordinates to locate the object in the parent window. Thus, if the layout of your parent window changes and/or the object’s coordinates change frequently, you may need to re-define the window in order for Silk Test Classic to correctly declare the object.
  • If you draw a rectangle around an unrecognized object, but also include an object that Silk Test Classic easily recognizes, Silk Test Classic records both and lists the easily recognized object first.
Parent topic: Window Declarations


Recording Window Declarations for the Main Window and Menu Hierarchy

  1. Start your application.
  2. Click File > New in Silk Test Classic.
  3. Click Test Frame and then click OK. Silk Test Classic displays the New Test Frame dialog box.
  4. If you are using the Open Agent, follow the appropriate wizard to select your application, depending on whether you want to test an application that uses a Web browser or not. When you have stepped through the wizard, the Choose name and folder of the new frame file dialog box opens.
  5. In the Frame filename (Classic Agent) or the File name (Open Agent) text box, accept the default test frame name (frame.inc), or type a new name. By default, Silk Test Classic names the new test frame file frame.inc, denoting it is an include file that contains declarations. If you change the default name of the file, make sure to include the file extension .inc in the new file name. If you do not, the file is not identified to Silk Test Classic as an include file and Silk Test Classic will give it a .txt extension and report a compilation error when you click OK to create the file.
  6. If you are using the Classic Agent, select your application from the Application list box. The Application list box displays all applications that are open and not minimized. If your test application is not listed, click Cancel, open your application, and click File > New again.
  7. Click OK (Classic Agent) or Save (Open Agent). Silk Test Classic creates the new test frame file. Window declarations display in the test plan editor, which means that the declarations for individual GUI objects can be expanded to show detail, collapsed to hide detail, and edited if necessary.
Parent topic: Window Declarations


Use the member-of Operator to Access Data

Use the member-of operator (.) to reference the data defined in a window declaration. For example, if a script needs to know which control should have focus when the Find dialog box is first displayed, it can access this data from the window declaration with this expression:

Find.lwTabOrder[1]

Similarly, to set focus to the third control in the list:

Find.lwTabOrder[3].SetFocus ()
Parent topic: Window Declarations


Overview of Identifiers

When you record test cases, Silk Test Classic uses the window declarations in the test frame file to construct a unique identifier, called a fully qualified identifier, for each GUI object. The fully-qualified identifier consists of the identifier of the object, combined with the identifiers of the object’s ancestors. In this way, the 4Test commands that are recorded can manipulate the correct object when you run your test cases.

If all identifiers were unique, this would not be necessary. However, because it is possible to have many GUI objects with the same identifier, for example the OK button, a method call must specify as many of the object’s ancestors as are required to uniquely identify it.

The following table shows how fully qualified identifiers are constructed:

GUI Object | Fully-Qualified Identifier | Example
Main Window | The main window’s identifier | TextEdit.SetActive ()
Dialog | The dialog’s identifier | Find.SetActive ()
Control | The identifiers of the dialog and the control | Find.Cancel.Click ()
Menu item | The identifiers of the main window, the menu, and the menu item | TextEditor.File.Open.Pick ()

The fully qualified identifier for main windows and dialog boxes does not need to include ancestors because the declarations begin with the keyword window.

An identifier is the GUI object’s logical name. By default, Silk Test Classic derives the identifier from the object’s actual label or caption, removing any embedded spaces or special characters (such as accelerators). So, for example, the Save As label becomes the identifier SaveAs. Identifiers can contain single-byte international characters, such as é and ñ.

If the object does not have a label or caption, Silk Test Classic constructs an identifier by combining the class of the object with the object’s index. When you are using the Classic Agent, the index is the object’s order of appearance, from top left to bottom right, in relation to its sibling objects of the same class. For example, if a text box does not have a label or caption, and it is the first text box within its parent object, the default identifier is TextField1. When you are using the Open Agent, the index depends on the underlying technology of the application under test.

Note: The identifier is arbitrary, and you can change the generated one to the unique name of your choice.
Parent topic: Recording a Test Frame


Save the Test Frame

To save a test frame, click File > Save when the test frame is the active window. If it is a new file, it is automatically named frame.inc. If you already have a frame.inc file, a number is appended to the file name. You can click File > Save to select another name.

If you are working within a project, Silk Test Classic automatically adds the new test frame (.inc) to the project.

When saving a file, Silk Test Classic does the following:

  • Saves a source file, giving it the .inc extension. The source file is an ASCII text file, which you can edit. For example: myframe.inc.
  • Saves an object file, giving it the .ino extension. The object file is a binary file that is executable, but not readable by you. For example: myframe.ino.
Parent topic: Recording a Test Frame
Related concepts
Overview of Test Cases
Related tasks
Adding Existing Files to a Project


Specifying How a Dialog Box is Invoked

4Test provides two equivalent ways to invoke a dialog box:

  • Use the Pick method to pick the menu item that invokes the dialog box. For example: TextEditor.File.Open.Pick ()
  • Use the Invoke method: Open.Invoke ()

While both are equivalent, using the Invoke method makes your test cases more maintainable. For example, if the menu pick changes, you only have to change it in your window declarations, not in any of your test cases.

The Invoke method

To use the Invoke method, you should specify the wInvoke variable of the dialog box. The variable contains the identifier of the menu item or button that invokes the dialog box. For example:

window DialogBox Open
   tag "Open"
   parent TextEditor
WINDOW wInvoke = TextEditor.File.Open
Parent topic: Recording a Test Frame


Improving Object Recognition with Microsoft Accessibility

You can use Microsoft Accessibility (Accessibility) to ease the recognition of objects at the class level. There are several objects in Internet Explorer and in Microsoft applications that Silk Test Classic can better recognize if you enable Accessibility. For example, without enabling Accessibility Silk Test Classic records only basic information about the menu bar in Microsoft Word and the tabs that appear. However, with Accessibility enabled, Silk Test Classic fully recognizes those objects.

Example

Without using Accessibility, Silk Test Classic cannot fully recognize a DirectUIHwnd control, because there is no public information about this control. Internet Explorer uses two DirectUIHwnd controls, one of which is a popup at the bottom of the browser window. This popup usually shows the following:
  • The dialog box asking if you want to make Internet Explorer your default browser.
  • The download options Open, Save, and Cancel.

When you start a project in Silk Test Classic and record locators against the DirectUIHwnd popup, with accessibility disabled, you will see only a single control. If you enable Accessibility you will get full recognition of the DirectUIHwnd control.

  • Using Accessibility with the Open Agent
    Describes how you can use Accessibility with the Open Agent.
  • Enabling Accessibility for the Open Agent
    Describes how to enable Accessibility for the Open Agent.
Parent topic: Using Advanced Techniques with the Open Agent


Using Accessibility with the Open Agent

Win32 uses the Accessibility support for controls that are recognized as generic controls. When Win32 locates a control, it tries to get the accessible object along with all accessible children of the control.

Objects returned by Accessibility are either of the class AccessibleControl, Button or CheckBox. Button and Checkbox are treated specifically because they support the normal set of methods and properties defined for those classes. For all generic objects returned by Accessibility the class is AccessibleControl.

Example

If an application has the following control hierarchy before Accessibility is enabled:
  • Control
    • Control
  • Button
When Accessibility is enabled, the hierarchy changes to the following:
  • Control
    • Control
      • Accessible Control
      • Accessible Control
        • Button
  • Button
Parent topic: Improving Object Recognition with Microsoft Accessibility
Related reference
AccessibleControl Class


Enabling Accessibility for the Open Agent

If you are testing a Win32 application and Silk Test Classic cannot recognize objects, you should first enable Accessibility. Accessibility is designed to enhance object recognition at the class level.

To enable Accessibility for the Open Agent:

  1. Click Options > Agent. The Agent Options dialog box opens.
  2. Click Advanced.
  3. Select the Use Microsoft Accessibility option. Accessibility is turned on.
Parent topic: Improving Object Recognition with Microsoft Accessibility


Calling Windows DLLs from 4Test

This section describes how you can call Windows DLLs from 4Test.
Note: The Open Agent supports DLL calling for both 32-bit and 64-bit DLL calls, while the Classic Agent supports DLL calling only for 32-bit calls.
Silk Test Classic supports only the _stdcall calling convention.
Note: In some versions of Silk Test Classic, you can also use the _cdecl calling convention, although it is not officially supported. The _cdecl calling convention does not work with Silk Test 14.0 or later. Using the _cdecl calling convention might lead to unexpected failures of previously functioning DLL calls when migrating from the Classic Agent to the Open Agent or when upgrading Silk Test Classic to a newer version in which _cdecl does not work. If you are facing such failing DLL calls, ensure that you are using the _stdcall calling convention with the _stdcall naming decoration rules applied. For additional information on the DLL calling conventions, see /Gd, /Gr, /Gv, /Gz (Calling Convention).
  • Aliasing a DLL Name
    Describes how to provide an alias for a DLL name.
  • Calling a DLL from within a 4Test Script
    Describes how to call a DLL from within a 4Test script.
  • Passing Arguments to DLL Functions
    Describes how you can pass arguments to DLL functions.
  • Using DLL Support Files Installed with Silk Test Classic
    Describes how to use the installed DLL support files.
Parent topic: Using Advanced Techniques with the Open Agent


Aliasing a DLL Name

If a DLL function has the same name as a 4Test reserved word, or the function does not have a name but an ordinal number, you need to rename the function within your 4Test declaration and use the 4Test alias statement to map the declared name to the actual name.

For example, the exit statement is reserved by the 4Test compiler. Therefore, to call a function named exit, you need to declare it with another name, and add an alias statement, as shown here:

dll "mydll.dll"
my_exit ()
alias "exit"
Parent topic: Calling Windows DLLs from 4Test


Calling a DLL from within a 4Test Script

A declaration for a DLL begins with the keyword dll. The general format is:

dll dllname.dll
prototype
[prototype]...

where dllname is the name of the dll file that contains the functions you want to call from your 4Test scripts and prototype is a function prototype of a DLL function you want to call.

Environment variables in the DLL path are automatically resolved. You do not have to use double backslashes (\\) in the code, single backslashes (\) are sufficient.

The Open Agent supports calling both 32bit and 64bit DLLs. You can specify which type of DLL the Open Agent should call by using the SetDllCallPrecedence method of the AgentClass class. If you do not know if the DLL is a 32bit DLL or a 64bit DLL, use the GetDllCallPrecedence function of the AgentClass Class. The Classic Agent provides support for calling 32bit DLLs only.

Silk Test Classic supports only the _stdcall calling convention.
Note: In some versions of Silk Test Classic, you can also use the _cdecl calling convention, although it is not officially supported. The _cdecl calling convention does not work with Silk Test 14.0 or later. Using the _cdecl calling convention might lead to unexpected failures of previously functioning DLL calls when migrating from the Classic Agent to the Open Agent or when upgrading Silk Test Classic to a newer version in which _cdecl does not work. If you are facing such failing DLL calls, ensure that you are using the _stdcall calling convention with the _stdcall naming decoration rules applied. For additional information on the DLL calling conventions, see /Gd, /Gr, /Gv, /Gz (Calling Convention).

Prototype syntax

A function prototype has the following form:
return-type func-name ( [arg-list] )
where:
return-type
The data type of the return value, if there is one.
func-name
An identifier that specifies the name of the function.
arg-list
A list of the arguments passed to the function, specified as follows:
[pass-mode] data-type identifier
where:
pass-mode
Specifies whether the argument is passed into the function (in), passed out of the function (out), or both (inout). If omitted, in is the default.

To pass by value, make a function parameter an in parameter.

To pass by reference, use an out parameter if you only want to set the parameter’s value; use an inout parameter if you want to get the parameter’s value and have the function change the value and pass the new value out.

data-type
The data type of the argument.
identifier
The name of the argument.

You can call DLL functions from 4Test scripts, but you cannot call member functions in a DLL.

Example

The following example writes the text hello world! into a field by calling the SendMessage DLL function from the DLL user32.dll.

use "mswtype.inc"
use "mswmsg32.inc"

dll "user32.dll"
  inprocess ansicall INT SendMessage (HWND hWndParent, UINT  msg, WPARAM  wParam, LPARAM lParam) alias "SendMessageA"

testcase SetTextViaDllCall()
  SendMessage(UntitledNotepad.TextField.GetHandle(), WM_SETTEXT, 0, "hello world! ")
Parent topic: Calling Windows DLLs from 4Test
Related reference
GetDllCallPrecedence Function (AgentClass)
SetDllCallPrecedence Method (AgentClass)


Passing Arguments to DLL Functions

Valid data types for arguments passed to DLL functions

Since DLL functions are written in C, the arguments you pass to these functions must have the appropriate C data types. In addition to the standard 4Test data types, Silk Test Classic also supports the following C data types:

  • char, int, short, and long
  • unsigned char, unsigned int, unsigned short, and unsigned long
  • float and double
Note: Any argument you pass must have one of these data types (or be a record that contains fields of these types).

Passing string arguments

The char* data type in C is represented by the 4Test STRING data type. The default string size is 256 bytes.

The following code fragments show how a char array declared in a C struct is declared as a STRING variable in a 4Test record:

// C declaration
typedef struct
{
...
char szName[32];
...
}

// 4Test declaration
type REC is record
...
STRING sName, size=32
...
To pass a NULL pointer to a STRING, use the NULL keyword in 4Test. If a DLL sets an out parameter of type char* to a value larger than 256 bytes, you need to initialize it in your 4Test script before you pass it to the DLL function. This will guarantee that the DLL does not corrupt memory when it writes to the parameter. For example, to initialize an out parameter named my_parameter, include the following line of 4Test code before you pass my_parameter to a DLL:
my_parameter = space(1000)

If the user calls a DLL function with an output string buffer that is less then the minimum size of 256 characters, the original string buffer is resized to 256 characters and a warning is printed. This warning, String buffer size was increased from x to 256 characters (where x is the length of the given string plus one) alerts the user to a potential problem where the buffer used might be shorter than necessary.

Passing arguments to functions that expect pointers

When passing pointers to C functions, use these conventions:

  • Pass a 4Test string variable to a DLL that requires a pointer to a character (null terminated).
  • Pass a 4Test array or list of the appropriate type to a DLL that requires a pointer to a numerical array.
  • Pass a 4Test record to a DLL that requires a pointer to a record. 4Test records are always passed by reference to a DLL.
  • You cannot pass a pointer to a function to a DLL function.

Passing arguments that can be modified by the DLL function

An argument whose value will be modified by a DLL function needs to be declared using the out keyword. If an argument is sometimes modified and sometimes not modified, then declare the argument as in and then, in the actual call to the DLL, preface the argument with the out keyword, enclosed in brackets.

For example, the third argument (lParam) to the SendMessage DLL function can be either in or out. Therefore, it is declared as follows:

// the lParam argument is by default an in argument
dll "user.dll"
LRESULT
SendMessage (HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Then, to call the DLL with an out argument, you use the keyword out, enclosed within brackets:
SendMessage (Open.hWnd, WM_GETTEXT, 256, [out] sText)

Passing window handles to a DLL function

If a parameter takes a window handle, use the hwnd property or the GetHandle method of the AnyWin class to get the window handle you need.

Parent topic: Calling Windows DLLs from 4Test
Related reference
DLL Declaration


Using DLL Support Files Installed with Silk Test Classic

Silk Test Classic is installed with the following include files that contain all the declarations, data types, and constants necessary for you to call hundreds of functions within the Windows API from your scripts.

msw32.inc

Contains use statements for the include files that apply to 32-bit Windows: mswconst.inc, mswtype.inc, mswfun32.inc, mswmsg32.inc, and mswutil.inc.

By including msw32.inc in your 4Test scripts, you have access to all the information in the other include files.

Note: The DLL functions declared in the files included in msw32.inc are aliased to the W (wide-character) functions.
mswconst.inc
Declares constants you pass to DLL functions. These constants contain style bits, message box flags, codes used by the GetSystemMetrics function, flags used by the GetWindow function, window field offsets for the GetWindowLong and the GetWindowWord functions, class field offsets for the GetClassLong and GetClassWord functions, and menu function flags.
mswfun32.inc
Contains 4Test declarations for 32-bit functions in the user32.dll and kernel32.dll files. The mswfun32.inc file provides wide character support. This means that you no longer have to edit mswfun32.inc in order to call Windows DLL functions. See the description of mswfun32.inc in the Dll declaration section.
mswmsg32.inc
Declares 32-bit Microsoft Window messages, control messages, and notification codes.
mswtype.inc
Declares many data types commonly used in the Windows API.
mswutil.inc
Contains the following utility functions:
  • PrintWindowDetail
  • GetStyleBitList
  • PrintStyleBits
Parent topic: Calling Windows DLLs from 4Test


Extending the Class Hierarchy

This section describes how you can extend the class hierarchy.

  • Classes
    Describes the 4Test classes.
  • Verifying Attributes and Properties
    Describes how you can use attributes and properties to verify test cases.
  • Defining Methods and Custom Properties
    Describes how you can define methods and custom verification properties.
  • Examples
    Provides examples for defining methods and custom verification properties.
Parent topic: Using Advanced Techniques with the Open Agent


Classes

This section describes the 4Test classes.

  • Overview of Classes
    Provides an overview of classes.
  • Polymorphism
    Describes the concept of polymorphism.
  • CursorClass, ClipboardClass, and AgentClass
    Describes CursorClass, ClipboardClass, and AgentClass.
  • Defining New Classes with the Open Agent
    Describes how you can define a new class when you are using the Open Agent.
  • Defining New Class Properties
    Describes how to define new class properties.
  • DesktopWin
    Describes how you can use the DesktopWin class.
  • Logical Classes
    Describes logical classes.
  • Class Hierarchy (Open Agent)
    Describes the class hierarchy for the Open Agent.
Parent topic: Extending the Class Hierarchy


Overview of Classes

The class indicates the type, or kind, of GUI object being declared.

Note: This is the 4Test class, not the class that the GUI itself uses internally. For example, although the class might be Label on one GUI and Text on another, 4Test uses the class name StaticText to refer to text strings that cannot be edited.

A class defines data and behavior

The class also defines methods (actions) and properties (data) that are inherited by the GUI object. For example, if you record a declaration for a pushbutton named OK, a test case can legally use a method like Click on the pushbutton because the Click method is defined at the class level. In other words, the definition of what it means to click on a pushbutton is included within the definition of the 4Test class itself, and this definition is inherited by each pushbutton in the GUI. If this were not true, you would have to define within each GUI object’s window declaration all the methods you wanted to use on that object.

The class as recorded cannot be changed

The one exception is that if the recorded class is CustomWin, meaning that Silk Test Classic does not recognize the object. You can, when appropriate, map the class to one that is recognized.

Custom classes

Enable an application to perform functions specific to the application and to enhance standard class functionality. Custom classes are also easy to maintain and can be extended easily by developers. All custom objects default to the built-in class, CustomWin.

Custom objects fall into two general categories:

Visible objects
Objects that Silk Test Classic knows about, but cannot identify, for example, the icon in an About dialog box. Two further categories of visible objects include:
  • Common objects are those that look and behave like standard objects, for example, a third-party object that looks and acts like a PushButton, but is recorded as a CustomWin.
  • Uncommon objects, on the other hand, have no relation to the existing standard objects. For example, an Icon. there is no corresponding Icon class.
Invisible objects
Objects that Silk Test Classic cannot recognize at all.
Parent topic: Classes


Polymorphism

If a class defines its own version of a method or property, that method or property overrides the one inherited from an ancestor. This is referred to as polymorphism. For example, the ListBox class has its own GetContents method, which overrides the GetContents method inherited from the AnyWin class.

Parent topic: Classes
Related concepts
Defining Methods and Custom Properties
Examples


CursorClass, ClipboardClass, and AgentClass

The following three classes are not part of the AnyWin class hierarchy, because they define methods for objects that are not windows:
CursorClass
Defines the three methods you can use on the cursor: GetPosition, GetType, and Wait.
ClipboardClass
Defines the two methods you can use on the system clipboard: GetText and SetText.
AgentClass
Defines the methods you can use to set options in the 4Test Agent. The 4Test Agent is the component of Silk Test Classic that translates the method calls in your test cases into the appropriate GUI- specific event streams.

Predefined identifiers for Cursor, Clipboard, and Agent

You do not record declarations for the cursor, the clipboard, or the Agent. Instead, you use predefined identifiers for each of these objects when you want to use a method to act against the object. The predefined methods for each are:

  • 4Test Agent: Agent
  • clipboard: Clipboard
  • cursor (mouse pointer): Cursor
For example, to set a 4Test Agent option, you use a call such as the following:
Agent.SetOption (OPT_VERIFY_COORD, TRUE)
Parent topic: Classes


Defining New Classes with the Open Agent

This functionality is supported only if you are using the Open Agent.

Consider the declarations for the Open and the Save As dialog boxes of the Text Editor application, which each contain exactly the same child windows:

window DialogBox Open

   locator "Open"
   parent TextEditor
   StaticText FileNameText
      locator "File Name:"
   TextField FileName1
      locator "File Name:"
   ListBox FileName2
      locator "File Name:"
   StaticText DirectoriesText
      locator "Directories:"
   StaticText PathText
      locator "#3"
   ListBox Path
      locator "#2"
   StaticText ListFilesOfTypeText
      locator "List Files of Type:"
   PopupList ListFilesOfType
      locator "List Files of Type:"
   StaticText DrivesText
      locator "Drives:"
   PopupList Drives
      locator "Drives:"
   PushButton OK
      locator "OK"
   PushButton Cancel
      locator "Cancel"
   PushButton Network
      locator "Network"

window DialogBox SaveAs

   locator "Save As"
   parent TextEditor
   StaticText FileNameText
      locator "File Name:"
   TextField FileName1
      locator "File Name:"
   ListBox FileName2
      locator "File Name:"
   StaticText DirectoriesText
      locator "Directories:"
   StaticText PathText
      locator "#3"
   ListBox Path
      locator "#2"
   StaticText ListFilesOfTypeText
      locator "List Files of Type:"
   PopupList ListFilesOfType
      locator "List Files of Type:"
   StaticText DrivesText
      locator "Drives:"
   PopupList Drives
      locator "Drives:"
   PushButton OK
      locator "OK"
   PushButton Cancel
      locator "Cancel"
   PushButton Network
      locator "Network"

It is not uncommon for an application to have multiple dialogs whose only difference is the caption: The child windows are all identical or nearly identical. Rather than recording declarations that repeat the same child objects, it is cleaner to create a new class that groups the common child objects.

For example, here is the class declaration for a new class called FileDialog, which is derived from the DialogBox class and declares each of the children that will be inherited by the SaveAs and Open dialog boxes:

winclass FileDialog : DialogBox
   parent TextEditor
   StaticText FileNameText
      locator "File Name:"
   TextField FileName1
      locator "File Name:"
   ListBox FileName2
      locator "File Name:"
   StaticText DirectoriesText
      locator "Directories:"
   StaticText PathText
      locator "#3"
   ListBox Path
      locator "#2"
   StaticText ListFilesOfTypeText
      locator "List Files of Type:"
   PopupList ListFilesOfType
      locator "List Files of Type:"
   StaticText DrivesText
      locator "Drives:"
   PopupList Drives
      locator "Drives:"
   PushButton OK
      locator "OK"
   PushButton Cancel
      locator "Cancel"
   PushButton Network
      locator "Network"

To make use of this new class, you must do the following:

  1. Rewrite the declarations for the Open and Save As dialog boxes, changing the class to FileDialog.
  2. Remove the declarations for the child objects inherited from the new class.

Here are the rewritten declarations for the Open and Save As dialog boxes:

window FileDialog SaveAs
   locator "Save As"
window FileDialog Open
   locator "Open"

For more information on the syntax used in declaring new classes, see the winclass declaration.

The default behavior of Silk Test Classic is to tag all instances of the parent class as the new class. So, if you record a window declaration against a standard object from which you have defined a new class, Silk Test Classic records that standard object’s class as the new class. To have all instances declared by default as the original class, add the following statement to the declaration of your new class: setting DontInheritClassTag = TRUE. For example, let’s say you define a new class called FileDialog and derive it from the DialogBox class. Then you record a window declaration against a dialog box. Silk Test Classic records the dialog box to be of the new FileDialog class, instead of the DialogBox class. To have Silk Test Classic declare the class of the dialog box as DialogBox, in the FileDialog definition, set DontInheritClassTag to TRUE. For example:

winclass FileDialog : DialogBox
  setting DontInheritClassTag = TRUE
Parent topic: Classes


Defining New Class Properties

You can define new properties for existing classes using the property declaration. You use these class properties to hold data about an object; you can use class properties anywhere in a script.

Parent topic: Classes
Related reference
Property Declaration


DesktopWin

Because the desktop is a GUI object, it derives from the AnyWin class. However, unlike other GUI objects, you do not have to record a declaration for the desktop. Instead, you use the predefined identifier Desktop when you want to use a method on the desktop.

For example, to call the GetActive method on the desktop, you use a call like the following:
wActive = Desktop.GetActive ()
Parent topic: Classes


Logical Classes

The AnyWin, Control, and MoveableWin classes are logical (virtual) classes that do not correspond to any actual GUI objects, but instead define methods common to the classes that derive from them. This means that Silk Test Classic never records a declaration that has one of these classes.

Furthermore, you cannot extend or override logical classes. If you try to extend a logical class, by adding a method, property or data member to it, that method, property, or data member is not inherited by classes derived from the class. You will get a compilation error saying that the method/property/data member is not defined for the window that tries to call it. Nor can you override the class, by rewriting existing methods, properties, or data members. Your modifications are not inherited by classes derived from the class.

Parent topic: Classes


Class Hierarchy (Open Agent)

You can define your own methods and properties, as well as define your own classes. You can also define your own attributes, which are used in the verification stage in test cases.

The 4Test class hierarchy defines the methods and properties that enable you to query, manipulate, and verify the data or state of any GUI object in your application. You can define your own methods and properties, as well as define your own classes. You can also define your own attributes, which are used in the verification stage in test cases. The following schema shows a listing of the built-in class hierarchy for the core classes and the Open Agent:
  • AgentClass
  • AnyWin
    • Control
      • CheckBox
      • ComboBox
      • Group
      • Link
      • ListBox
      • ListViewEx
      • PageList
      • PushButton
      • RadioList
      • Scale
      • StaticText
      • StatusBar
      • TableEx
      • TextField
      • ToggleButton
      • ToolBar
      • TreeView
    • DesktopWinOA
    • Item
      • SeparatorItem
      • ToolItem
        • CheckBoxToolItem
        • DropDownToolItem
        • RadioListToolItem
        • PushToolItem
        • ScrollBar
          • HorizontalScrollBar
          • VerticalScrollBar
      • TableColumn
      • TableRow
    • Menu
      • MenuItem
    • MoveableWin
      • DialogBox
      • MainWin
    • WinPart
  • ClipboardClass
  • ConsoleClass
  • CursorClass
Parent topic: Classes


Verifying Attributes and Properties

This section describes how you can use attributes and properties to verify test cases.

  • Attribute Definition and Verification
    Describes attribute definition and verification.
  • Defining a New Attribute for an Existing Class
    Define a new attribute to add it to an existing class.
  • Defining New Verification Properties
    Describes how to define new verification properties.
  • Syntax for Attributes
    Describes the syntax for attributes.
  • Hidecalls Keyword
    Describes the hidecalls keyword.
  • An Alternative to NumChildren as a Class Property
    Describes an alternative to NumChildren as a class property.
Parent topic: Extending the Class Hierarchy


Attribute Definition and Verification

When you record a test case, you can verify the test case using attributes.

You can choose to verify using either attributes or properties. Generally you will verify using properties, because property verification is more flexible.

For example, the attributes for the DialogBox class are Caption, Contents, Default button, Enabled, and Focus. The following 4Test code implements the Default Button attribute in the winclass.inc file:
attribute "Default button", VerifyDefaultButton, QueryDefaultButton
As this 4Test code shows, each attribute definition begins with the statement, followed by the following three comma-delimited values:
  1. The text that you want to display in the Attribute panel of the Verify Window dialog box. This text must be a string.
  2. The method Silk Test Classic should use to verify the value of the attribute at runtime.
  3. The method Silk Test Classic should use to get the actual value of the attribute at runtime.
Parent topic: Verifying Attributes and Properties
Related concepts
Verification


Defining a New Attribute for an Existing Class

To add one or more attributes to an existing class, use the following syntax:
winclass ExistingClass : ExistingClass...
attribute_definitions
Each attribute definition begins with the attribute statement, followed by the following three comma-delimited values:
  1. The text that you want to display in the Attribute panel of the Verify Window dialog box. This text must be a string.
  2. The method Silk Test Classic should use to verify the value of the attribute at runtime.

  3. The method Silk Test Classic should use to get the actual value of the attribute at runtime.

Each attribute definition must begin and end on its own line. When you define a new attribute, you usually need to define two new methods (steps 2 and 3 above) if none of the built-in methods suffice.

Silk Test Classic allows you to add, delete, or edit the existing functionality of a class; this applies to both functions and variables of a class. However, we recommend that you do not override a function or a variable by declaring a function or variable of that same name. Furthermore, you should never override a variable that has a tag associated with it. You cannot have two variables with the same name in the same level of an object. If you do so, Silk Test Classic will display a compile error.

Parent topic: Verifying Attributes and Properties


Defining New Verification Properties

You can perform verifications in your test cases using properties. These verification properties are different from class properties, which are defined using the property declaration. Verification properties are used only when verifying the state of your application in a test case. Silk Test Classic comes with built-in verification properties for all classes of GUI objects.

You can define your own verification properties, which will be added to the built-in properties listed in the Verify Window dialog box when you record a test case.

Parent topic: Verifying Attributes and Properties
Related concepts
Verifying Object Properties
Confirming the Property List
Related tasks
Defining Custom Verification Properties


Syntax for Attributes

To add one or more attributes to an existing class, use the following syntax:

winclass ExistingClass : ExistingClass...
attribute_definitions

Each attribute definition must begin and end on its own line.

When you define a new attribute, you usually need to define two new methods if none of the built-in methods suffices.

For example, to add a new attribute to the DialogBox class that verifies the number of children in the dialog box, you add code like this to your test frame (or other include file):

winclass DialogBox:DialogBox

  attribute "Number of children", VerifyNumChild, GetNumChild

  integer GetNumChild()
     return ListCount (GetChildren ()) // return count of children of dialog

  hidecalls VerifyNumChild (integer iExpectedNum)
     Verify (GetNumChild (), iExpectedNum, "Child number test")

As this example shows, you use the hidecalls keyword when defining the verification method for the new attribute.

Parent topic: Verifying Attributes and Properties


Hidecalls Keyword

The keyword hidecalls hides the method from the call stack listed in the results. Using hidecalls allows you to update the expected value of the verification method from the results. If you do not use hidecalls in a verification method, the results file will point to the frame file, where the method is defined, instead of to the script. We recommend that you use hidecalls in all verification methods so that you can update the expected values.

Parent topic: Verifying Attributes and Properties


An Alternative to NumChildren as a Class Property

Instead of defining NumChildren as a class property, you could also define it as a variable, then initialize the variable in a script. For example, in your include file, you would have:

winclass DialogBox : DialogBox
INTEGER NumChild2
 // list of custom verification properties
LIST OF STRING lsPropertyNames = {"NumChild2"}
And in your script, before you do the verification, you would initialize the value for the dialog box under test, such as:
Find.NumChild2 = ListCount(Find.GetChildren ())
Parent topic: Verifying Attributes and Properties


Defining Methods and Custom Properties

This section describes how you can define methods and custom verification properties.

  • Defining a New Method
    Describes how to define a new method.
  • Defining a New Method for a Single GUI Object
    Describes how to define a new method for a single GUI object.
  • Recording a Method for a GUI Object
    Record a method for a GUI object to perform an action, which is not supported by a built-in method, on the object.
  • Deriving a New Method from an Existing One
    Describes how to derive a new method from an existing one.
  • Defining Custom Verification Properties
    Define custom verification properties in a class declaration or a declaration for an individual object.
  • Redefining a Method
    Describes how to redefine a method.
  • Confirming the Property List
    Describes how to confirm the property list.
Parent topic: Extending the Class Hierarchy


Defining a New Method

To add a method to an existing class, you use the following syntax to begin the method definition:
winclass ExistingClass : ExistingClass

The syntax ExistingClass : ExistingClass means that the declaration that follows extends the existing class definition, instead of replacing it.

Note: Adding a method to an existing class adds the method to all instances of the class.

Example

To add a SelectAll() method to the TextField class, add the following code to your frame.inc file:
 winclass TextField : TextField
  SelectAll()
    TypeKeys("<Ctrl+a>")
In your test cases, you can then use the SelectAll method like any other method in the TextField class.
UntitledNotepad.TextField.SelectAll()
Parent topic: Defining Methods and Custom Properties
Related concepts
Polymorphism
Examples
Defining a New Method for a Single GUI Object
Related reference
winclass Declaration


Defining a New Method for a Single GUI Object

To define a new method to use on a single GUI object, not for an entire class of objects, you add the method definition to the window declaration for the individual object, not to the class. The syntax is exactly the same as when you define a method for a class.

To add a method to a single GUI object, for example to add the SelectAll() method to a specific TextField object, locate the GUI object in your frame.inc file, like described in the following code sample:
window MainWin UntitledNotepad

  ...

  TextField TextField
    locator "//TextField"
In your test cases, you can then use the SelectAll method like any other method of the TextField object:
window MainWin UntitledNotepad

  ...

  TextField TextField
    locator "//TextField"
    SelectAll()
      TypeKeys("<Ctrl+a>")
Note: Adding a method to a single GUI object adds the method only to the specific GUI object and not to other instances of the class.

Classic Agent Example

For example, suppose you want to create a method named SetLineNum for a dialog box named GotoLine, which performs the following actions:

  • Invokes the dialog box.
  • Enters a line number.
  • Clicks OK.

The following 4Test code shows how to add the definition for the SetLineNum method to the declaration of the GotoLine dialog box.

window DialogBox GotoLine
   tag "Goto Line"
   parent TextEditor
   const wInvoke = TextEditor.Search.GotoLine

   void SetLineNum (STRING sLine)
     Invoke ()            // open dialog
     Line.SetText (sLine) // populate text field
                          // whose identifier is Line
     Accept ()            // close dialog, accept values

     //Then, to go to line 7 in the dialog, you use this method call in your testcases:
     GotoLine.SetLineNum (7)
Parent topic: Defining Methods and Custom Properties
Related concepts
Defining a New Method
Polymorphism
Examples
Related tasks
Recording a Method for a GUI Object


Recording a Method for a GUI Object

If you need to perform an action on an object, which is not supported by the class of the object, you can record or manually script a new method that performs the action. Add the new method to the class or to the window declaration of the object to use the method in the same way as the built-in methods of the class.

You can use the Record Method dialog box to record a method for a class or window declaration.

Note: Before you can record a method, you must have recorded window declarations.
  1. Open an include file or script file.
  2. Move the mouse cursor into the declaration of the GUI object to which you want to add a method.
  3. Click Record > Method.
    Note: This is only available when an include file or script file is the active window and the mouse cursor is within a class or object declaration because methods are necessarily part of a class or object definition.
    The Record Method dialog box appears.
  4. Type a name for the method into the Method name field. You can also select one of the predefined methods:
    • BaseState
    • Close
    • Invoke
    • Dismiss
  5. Click Start Recording. Silk Test Classic is minimized and displays the application under test.
    • If you are using the Open Agent, the Recording window appears.
    • If you are using the Classic Agent, the Record Status on Classic Agent dialog box appears.
  6. Perform and record the actions that you require.
  7. Stop recording.
    • If you are using the Open Agent, click Stop Recording.
    • If you are using the Classic Agent, click Done.
    The Method code field in the Record Method dialog box displays the actions that you have recorded translated into 4Test statements.
  8. On the Record Method dialog box, click OK to paste the code into the file in the editor.
  9. Edit the 4Test statements that were recorded, if necessary.
Note: To add a method to a class which is using the Open Agent, you can also copy the method into the script from a recorded test case.
Parent topic: Defining Methods and Custom Properties
Related concepts
Defining a New Method
Defining a New Method for a Single GUI Object


Deriving a New Method from an Existing One

To derive a new method from an existing method, you can use the derived keyword followed by the scope resolution operator (::).

Use the following syntax:
new method : existing method

The following example defines a GetCaption method for WPFNewTextBox that prints the string Caption as is before calling the built-in GetCaption method (defined in the AnyWin class) and printing its return value:

winclass WPFNewTextBox : WPFTextBox
GetCaption ()
Print ("Caption as is: ")
Print (derived::GetCaption ())
Parent topic: Defining Methods and Custom Properties
Related concepts
Polymorphism
Examples


Defining Custom Verification Properties

  1. In a class declaration or in the declaration for an individual object, define the variable lsPropertyNames as follows:
    LIST OF STRING lsPropertyNames
  2. Specify each of your custom verification properties as elements of the list lsPropertyNames. Custom verification properties can be either:
    • Class properties, defined using the property statement.
    • Variables of the class or individual object.

Any properties you define in lsPropertyNames will override built-in properties with the same name. With your custom verification properties listed as elements in lsPropertyNames, when you record and run a test case, those additional properties will be available during verification.

Parent topic: Defining Methods and Custom Properties
Related concepts
Example: Defining a Custom Verification Property


Redefining a Method

There may be some instances in which you want to redefine an existing method. For example, to redefine the GetCaption method of the Anywin class, you use this 4Test code:

winclass AnyWin : AnyWin
   GetCaption ()
      // insert method definition here
Parent topic: Defining Methods and Custom Properties
Related Topics
A Polymorphism
Defining a new method
Defining a new method for a single GUI object
Deriving a new method from an existing one
Example: adding method to TextField class
Example: adding Tab method to DialogBox class


Confirming the Property List

You can use the GetPropertyList method to confirm the list of verification properties for an object. For example, the following simple test case prints the list of all the verification properties of the Find dialog to the results file:

testcase FindDialogPropertyConfirm ()
TextEditor.Search.Find.Pick ()
ListPrint (Find.GetPropertyList ())
Find.Cancel.Click ()
Parent topic: Defining Methods and Custom Properties
Related concepts
Example: Defining a Custom Verification Property
Related tasks
Defining Custom Verification Properties


Examples

This section provides examples for defining methods and custom verification properties.

  • Example: Adding a Method to TextField Class
    Describes how to add a method to the TextField class.
  • Example: Adding Tab Method to DialogBox Class
    Describes how to add a Tab method to the DialogBox class.
  • Example: Defining a Custom Verification Property
    Provides an example for defining a custom verification property.
Parent topic: Extending the Class Hierarchy


Example: Adding a Method to TextField Class

This example adds to the TextField class a method that selects all of the text in the text box.

winclass TextField : TextField
   SelectAll ()
      STRING sKey1, sKey2
      switch (GetGUIType ())
         case mswnt, msw2003
            sKey1 = "<Ctrl-Home>"
            sKey2 = "<Shift-Ctrl-End>"
         case mswvista
            sKey1 = "<Ctrl-Up>"
            sKey2 = "<Shift-Cmd-Down>"
      // return cursor to 1,1
      this.TypeKeys (sKey1)
      // highlight all text
      this.TypeKeys (sKey2)

The keyword this refers to the object the method is being called on.

The preceding method first decides which keys to press, based on the GUI. It then presses the key that brings the cursor to the beginning of the field. It next presses the key that highlights (selects) all the text in the field.

Parent topic: Examples
Related reference
Method Declaration


Example: Adding Tab Method to DialogBox Class

To add a Tab method to the DialogBox class, you could add the following 4Test code to your frame.inc file (or other include file):

winclass DialogBox : DialogBox
Tab (INTEGER iTimes optional)
if (iTimes == NULL)
 iTimes = 1
this.TypeKeys ("<tab {iTimes}>")
Parent topic: Examples


Example: Defining a Custom Verification Property

Let's look at an example of defining a custom verification property. Say you want to test a dialog box. Dialog boxes come with the following built-in verification properties:
  • Caption
  • Children
  • DefaultButton
  • Enabled
  • Focus
  • Rect
  • State

And let's say that you have defined a class property, NumChildren, that you want to make available to the verification system.

Here is the class property definition:
property NumChildren
INTEGER Get ()
return ListCount (GetChildren ())

That property returns the number of children in the object, as follows:

  • The built-in method GetChildren returns the children in the dialog box in a list.
  • The built-in function ListCount returns the number of elements in the list returned by GetChildren.
To make the NumChildren class property available to the verification system (that is, to also make it a verification property) you list it as an element in the variable lsPropertyNames. So here is part of the extended DialogBox declaration that you would define in an include file:
winclass DialogBox : DialogBox
  // user-defined property
  property NumChildren
    INTEGER Get ()
      return ListCount (GetChildren ())
  // list of custom verification properties
  LIST OF STRING lsPropertyNames = {"NumChildren"}

Now when you verify a dialog box in a test case, you can verify your custom property since it will display in the list of DialogBox properties to verify.

Note: As an alternative, instead of defining NumChildren as a class property, you could also define it as a variable, then initialize the variable in a script. For example, in your include file, you would have:
winclass DialogBox : DialogBox
  INTEGER NumChild2
  // list of custom verification properties
  LIST OF STRING lsPropertyNames = {"NumChild2"}
And in your script-before you do the verification-you would initialize the value for the dialog box under test, such as:
Find.NumChild2 = ListCount (Find.GetChildren ())
Parent topic: Examples


Porting Tests to Other GUIs

This section describes how you can port tests to other GUIs.

  • Handling Differences Among GUIs
    Describes how you can handle differences between GUIs when porting tests to other GUIs.
  • About GUI Specifiers
    Describes GUI specifiers.
  • Supporting GUI-Specific Objects
    Describes how Silk Test Classic supports testing GUI-specific objects.
Parent topic: Using Advanced Techniques with the Open Agent


Handling Differences Among GUIs

This section describes how you can handle differences between GUIs when porting tests to other GUIs.

  • Conditionally Loading Include Files
    Describes how to conditionally load include files.
  • Load Different Include Files for Different Versions of the Test Application
    Describes how to load different include files for different versions of the test application.
  • Different Error Messages
    Describes why error messages are different among platforms.
  • One Logical Control can Have Two Implementations
    Describes how one logical control can have two implementations.
  • Options Sets and Porting
    Describes options sets and porting.
  • Specifying Options Sets
    Describes how to specify options sets.
  • Supporting Differences in Application Behavior
    Describes how to support differences in application behavior.
  • Text Box Requires Return Keystroke
    Describes why a text box requires a Return keystroke.
  • Using Cross-Platform Methods in Your Scripts
    Describes how to use cross-platform methods in your scripts.
Parent topic: Porting Tests to Other GUIs


Conditionally Loading Include Files

If you are testing different versions of an application, such as versions that run on different platforms or versions in different languages, you probably have different include files for the different versions. For example, if your applications run under different languages, you might have text strings that display in windows defined in different include files, one per language. You want Silk Test Classic to load the proper include file for the version of the application you are currently testing.

Parent topic: Handling Differences Among GUIs
Related concepts
Include File Size
What Happens when the Code is Compiled
Marking 4Test Code as GUI Specific
Where You Use GUI Specifiers
Related tasks
Conditionally Compile Code


Load Different Include Files for Different Versions of the Test Application

  1. Define a compiler constant. For example, you might define a constant named MyIncludeFile.
  2. Insert the following statement into your 4Test file: use constant. For example, if you defined a constant MyIncludeFile, insert the following statement: use MyIncludeFile. In this example, constant can also be an expression that evaluates to a constant at compile time.
  3. When you are ready to compile your 4Test files, specify the file name of the include file you want loaded as the value of the constant in the Compiler Constants dialog box. Be sure to enclose the value in quotation marks if it is a string.
  4. Compile your code.

Silk Test Classic evaluates all compiler constants and substitutes their values for the constants in your code. In this case, the constant MyIncludeFile will be evaluated to a file, which will be loaded through the use statement.

Parent topic: Handling Differences Among GUIs
Related concepts
Marking 4Test Code as GUI Specific
Where You Use GUI Specifiers
Related tasks
Conditionally Compile Code


Different Error Messages

The VerifyErrorBox function, shown below, illustrates how to solve the problem of different error messages on each GUI platform. For example, if a GUI platform always adds the prefix "Error:" to its message, while the other platforms do not, you might use or create a GUI Specifier for that platform and then use the VerifyErrorBox function as follows:

VerifyErrorBox (STRING sMsg)
   // verifies that the error box has the correct error
   // message, then dismisses the error box

   const ERROR_PREFIX = "ERROR: "
   const ERROR_PREFIX_LEN = Len (ERROR_PREFIX)
   STRING sActMsg = MessageBox.Message.GetText ()

   // strip prefix "ERROR: " from GUI Specifier for that platform error messages
   if (GetGUIType () == GUI Specifier for that platform)
      sActMsg = SubStr (sActMsg, ERROR_PREFIX_LEN + 1)

   Verify (sActMsg, sMsg)
   MessageBox.Accept ()
Parent topic: Handling Differences Among GUIs
Related concepts
Syntax of a GUI Specifier
Marking 4Test Code as GUI Specific
Where You Use GUI Specifiers


One Logical Control can Have Two Implementations

Consider the case where the same logical control in your application is implemented using different classes on different GUIs.

If the kinds of actions you can perform against the object classes are similar, and if Silk Test Classic uses the same method names for the actions, then you do not have a portability problem to address.

For example, the methods for the RadioList and PopupList classes have identical names, because the actions being performed by the methods are similar. Therefore, if a control in your application is a popup list on one GUI and a radio list on another, your scripts are already portable.

If the two object classes do not have similar methods, or if the methods have different names, then you need to port your scripts.

Parent topic: Handling Differences Among GUIs
Related concepts
Marking 4Test Code as GUI Specific
Where You Use GUI Specifiers


Options Sets and Porting

Options sets save all current options except General Options. Options sets can be very useful when trying to use the same scripts on different operating systems. The primary differences between the two may be compiler constants.

For example, you might use the compiler constant sCmdLine. Usually, the command line to invoke an application differs between the PC operating systems. You could create a compiler constant (note that there is a string limit on compiler constants) for use in the sCmdLine constant to differentiate between the platforms' command lines. You might also use a compiler constant for methods that work slightly differently on the two operating systems, such as the Pick() methods.

Parent topic: Handling Differences Among GUIs


Specifying Options Sets

In a test plan, you can specify options sets to be used with the test plan or parts of it. You use options sets to automatically run different tests that require different options without having to manually open options sets.

To ensure that everyone working on a project has the same options settings (such as class mapping), do one of the following:
  • Open an Options Set.
  • Set these option values at runtime.
  • Specify the following statement in the test plan: optionset: filename.opt.

Dependent test cases will run with the specified options set opened. The options set will be closed when it passes out of scope. If you don't specify a full path name, the file is considered to be in a directory relative to the directory containing the current test plan or sub-plan.

Remember:
  • Options can also be set at runtime in a test script by using the Agent method, SetOption, and passing in the name of the option and its value.
  • Many Agent options and their values are found in the Agent Options dialog box.
  • Agent options can be set in a testcase/ function.
  • Class map settings, set at runtime, are best set before any tests are executed (for example, in ScriptEnter) and after each test case (for example TestcaseExit) in case any have been changed in the course of a test case.
  • Class mappings set at runtime using the Agent method SetOption are only in effect during test execution; these settings are not available to the recorders.
Parent topic: Handling Differences Among GUIs
Related concepts
Starting Silk Test Classic from the Command Line
Related reference
Agent Options
Agent Options Dialog Box


Supporting Differences in Application Behavior

Although you can account for differences in the appearance of your application in the window declarations, if the application’s behavior is fundamentally different when ported, you need to modify your test cases themselves. To modify your test cases, you write sections of 4Test code that are platform-specific, and then branch to the correct section of code using the return value from the GetGUIType built-in function.

This topic shows how to use the GetGUIType function in conjunction with if statements and the switch statements.

Switch statements

You can use GUI specifiers before an entire switch statement and before individual statements within a case clause, but you cannot use GUI specifiers before entire case clauses.

testcase GUISwitchExample()
INTEGER i
FOR i=1 to 5
mswxp, mswnt switch(i)

// legal:
mswxp, mswnt switch (i)
   case 1
      mswxp Print ("hello")
      mswnt Print ("goodbye")
   case 2
      mswxp raise 1, "error"
      mswnt Print ("continue")
   default
      mswxp Print ("ok")

// NOT legal:
switch (i)
   mswxp case 1
      Print ("hello")
   mswnt case 1
      Print ("goodbye")

If statements

You can use GUI specifiers in if statements, as long as GUI specifiers used within the statement are subsets of any GUI specifiers that enclose the entire if statement.

// legal because no GUI specifier
// enclosing entire if statement:
if (i==j)
   msw32, mswnt Print ("hi")
   msw2000 Print ("bye")

// legal because msw is a subset of enclosing specifier:
msw32, msw2000 if (i==j)
   mswnt Print("hi")

// legal for the same reason as preceding example:
msw32, msw2000 if (i==j)
   Print ("hi")
mswnt else
   Print ("Not the same")

// NOT legal because msw2000 is not a subset
// of the enclosing GUI specifier msw:
msw32 if (i==j)
   msw2000 Print ("bye")  // Invalid GUI type

If you are trying to test multiple conditions, then you should use a select or switch block. You could use nested if.else statements, but if you have more than two or three conditions, the levels of indentation will become cumbersome.

You should not use an if..else if..else block. Although if..else if..else will work, it will be difficult to troubleshoot exceptions that occur because the results file will always point to the first if statement even if it was actually a subsequent if statement that raised the exception.

For example, in the following test case, the third string, Not a date, will raise the exception:

*** Error: Incompatible types -- 'Not a date' is not a valid date

The exception actually occurs in the lines containing:

GetDateTimePart ([DATETIME]sVal, DTP_YEAR) == 2006

For the nested if..else and the select blocks, the results file points to those lines as the sources of the exceptions. However, for the if..else if..else block, the results file points to the first if statement, in other words to the line:

[-] if IsNull (sVal)

even though that line clearly is not the source of the exception because it does not concern DATETIME values.

[+] testcase IfElseIfElse ()
[-] LIST OF STRING lsVals = {...}
[ ] "2006-05-20"
[ ] "2006-11-07"
[ ] "Not a date"
[ ] STRING sVal
[ ]
[-] for each sVal in lsVals
[-] do
[-] if IsNull (sVal)
[ ] Print ("No date given")
[-] else if sVal == FormatDateTime (GetDateTime (), "yyyy-mm-dd")
[ ] Print ("The date is today")
[-] else if GetDateTimePart ([DATETIME]sVal, DTP_YEAR) == 2006
[ ] Print ("The year is this year")
[-] else
[ ] Print ("Some other year")
[-] except
[ ] ExceptLog ()
[ ]
[-] do
[-] if IsNull (sVal)
[ ] Print ("No date given")
[-] else
[-] if sVal == FormatDateTime (GetDateTime (), "yyyy-mm-dd")
[ ] Print ("The date is today")
[-] else
[-] if GetDateTimePart ([DATETIME]sVal, DTP_YEAR) == 2006
[ ] Print ("The year is this year")
[-] else
[ ] Print ("Some other year")
[-] except
[ ] ExceptLog ()
[ ]
[-] do
[-] select
[-] case IsNull (sVal)
[ ] Print ("No date given")
[-] case sVal == FormatDateTime (GetDateTime (), "yyyy-mm-dd")
[ ] Print ("The date is today")
[-] case GetDateTimePart ([DATETIME]sVal, DTP_YEAR) == 2006
[ ] Print ("The year is this year")
[-] default
[ ] Print ("Some other year")
[-] except
[ ] ExceptLog ()
[ ]
Parent topic: Handling Differences Among GUIs
Related concepts
Marking 4Test Code as GUI Specific
Where You Use GUI Specifiers


Text Box Requires Return Keystroke

On some GUIs, the Enter/Return key must be pressed after data is entered into a text box. Suppose you want to create a test case that enters invalid data into the text box, and then checks if the application detects the error. After the test case enters the invalid data, it needs to use the GetGUIType function to determine the GUI, and then press the Return key if the GUI requires it.

For example:

// code to enter an invalid string into field
if (GetGUIType () == mswnt)
   MyTextField.TypeKeys ("<Return>")
// code to verify that application detected error
Parent topic: Handling Differences Among GUIs
Related concepts
Marking 4Test Code as GUI Specific
Where You Use GUI Specifiers


Using Cross-Platform Methods in Your Scripts

In scripts, you can use your cross-platform method names. The window declarations map the cross-platform method names you use in your scripts to the actual methods required to carry out the actions you want on each of the GUIs.

Continuing the example from Creating a Class that Maps to Several Silk Test Classic Classes, you use the Select method in your code to select the control named Direction.

testcase SearchBackward ()

   LISTITEM Item
   Item = "Up"
   Find.Invoke ()
   Find.Direction.Select (Item)
   .
   .
   .
   Find.Dismiss ()
Note: The script does not indicate that anything unusual is happening. All of the steps necessary to make the Select method work properly, regardless of the class of the object, are encapsulated in the class and window declarations.
Parent topic: Handling Differences Among GUIs
Related concepts
Marking 4Test Code as GUI Specific
Where You Use GUI Specifiers


About GUI Specifiers

This section describes GUI specifiers.

  • Class Declarations
    Describes class declarations.
  • Conditional Compilation
    Describes conditional compilation.
  • Conditionally Compile Code
    Conditionally compile code to make the compilation faster and the resulting code smaller.
  • GUI with Inheritance
    Describes inheritance with GUI specifiers.
  • GUI with Global Variables
    Describes how to use GUI specifiers with global variables.
  • Marking 4Test Code as GUI Specific
    Describes how to mark 4Test code as GUI specific.
  • Syntax of a GUI Specifier
    Describes the syntax of a GUI specifier.
  • What Happens when the Code is Compiled
    Describes what happens when the code is compiled.
  • Where You Use GUI Specifiers
    Describes where you use GUI specifiers.
  • do...except Statements
    Describes the do...except statement.
  • Type Statements
    Describes type statements.
Parent topic: Porting Tests to Other GUIs


Class Declarations

Be careful using GUI specifiers before class declarations; they can be ambiguous. Any ambiguities must be resolvable at compile-time.

// bad style:
msw winclass myclass
mswnt winclass myclass
window myclass inst // Ambiguous. Is it an instance of
                    // the msw class or the mswnt class?

The preceding example’s ambiguity can be resolved by specifying a GUI target with conditional compilation (so that, for example, only code for msw gets compiled, in which case inst would be an instance of the msw class or by explicitly using a GUI specifier for the window, as follows:

// good style:
msw winclass myclass
mswnt winclass myclass
msw window myclass inst
Parent topic: About GUI Specifiers


Conditional Compilation

If you have GUI-specific code in your scripts and declarations, you can have Silk Test Classic conditionally compile your code based on the values of the GUI specifiers - only code specific to a particular GUI is compiled (as well, of course, as all code that is not GUI-specific). This has the following two advantages:

  • The compilation is faster.
  • The resulting code is smaller and requires less memory to run.

You can also cause conditional compilation by using constants, which are evaluated at compile time.

Constants are not restricted to conditional compilation. You can use constants for any value that you want resolved at compile time.

Parent topic: About GUI Specifiers
Related concepts
One Logical Control can Have Two Implementations
Supporting GUI-Specific Objects
Supporting Differences in Application Behavior
Text Box Requires Return Keystroke
Using Cross-Platform Methods in Your Scripts


Conditionally Compile Code

  1. Prefix any 4Test statements that are GUI-specific with the appropriate GUI specifier.
  2. Specify the platforms that you want to compile for by entering the appropriate GUI specifiers in the GUI Targets field in the Runtime Options dialog box. You can specify as many GUI targets as you want; separate each GUI specifier by a comma. Setting a GUI target affects which classes are listed in the Library Browser.
  3. To conditionalize code based on the value of constants you define, do the following:
    1. Click Compiler Constants in the Runtime Options dialog box.
    2. The Compiler Constants dialog box is displayed.
    3. Define a constant and specify its value.
    4. Use the constant in your code anywhere you can specify an expression.
  4. Click OK to close the Runtime Options dialog box.
Parent topic: About GUI Specifiers
Related concepts
Conditionally Loading Include Files


GUI with Inheritance

When using GUI specifiers for parent classes, you must explicitly use the GUI specifiers with the descendants:

mswxp winclass newclass
mswxp winclass subclass : newclass
mswxp window subclass inst
Parent topic: About GUI Specifiers


GUI with Global Variables

Be careful when using GUI specifiers with global variables, because Silk Test Classic initializes global variables before connecting to an Agent. This might not give you the results you want if you are doing distributed testing.

Let’s say that you are running tests on a remote machine that is listed in the Runtime Options dialog box. Because Silk Test Classic initializes all global variables before connecting to an Agent, any GUI specifier at the global level will initialize to the host machine, not the target machine you want to test against.

For example, say the host machine is running a different operating system than the target machine. Consider the following script:

mswxp STRING sVar1 = SYS_GetEnv("UserName")

mswxp STRING sVar1 = SYS_GetRegistryValue
   (HKEY_LOCAL_MACHINE,     "System\CurrentControlSet\Control", "Current User")

main()
   print(sVar1)

This script fails, with the error message:

*** Error: Registry entry 'Current User' not found

because sVar1 is initialized to the value for the host system, not the target system.

Constants behave similarly to global variables if you use a GUI specifier to initialize the variable (or constant). It is a good idea to use GUI specifiers in the main function, under Options > Runtime or another function that is called after the Agent is contacted.

Parent topic: About GUI Specifiers


Marking 4Test Code as GUI Specific

Using Silk Test Classic, you can create portable test cases that will test your application on any of the supported GUIs. The reason for this is that your test cases use logical names, called identifiers, to refer to the GUI objects, and not actual names, called tags. Therefore, if there are differences in the ported application’s appearance, you need only change the window declarations, not the test cases themselves.

The porting scenarios described section use 4Test keywords called GUI specifiers to indicate that portions of include files or script files are specific to a particular GUI. Before studying these scenarios, you should understand which GUI specifiers are available and how to use them in your include files and script files.

4Test includes a long list of GUI specifiers.

Parent topic: About GUI Specifiers
Related concepts
Conditionally Loading Include Files
Handling Differences Among GUIs
Supporting GUI-Specific Objects


Syntax of a GUI Specifier

A GUI specifier has this syntax:

[[gui-type [,gui-type]] | [!gui-type]]

gui-type is the GUI. You can express this in one of two mutually exclusive ways. For example, you can specify one or more GUIs separated by commas, as in:

mswxp, mswin7

Or you can specify all but one GUI, as in the following, which indicates that what follows applies to all environments except Windows NT-based operating systems:

! mswnt
Parent topic: About GUI Specifiers
Related concepts
Supporting GUI-Specific Objects
Handling Differences Among GUIs


What Happens when the Code is Compiled

Only code relevant to the GUI environments specified in the GUI Targets field (plus all common code) will be compiled. If you do not list any GUI specifiers in the GUI Targets field, all code will be compiled; at runtime, code not relevant to the platform the application is running on will be skipped.

The constants you have defined are evaluated and used to compile the code. You can use this feature to conditionally load include files.

Parent topic: About GUI Specifiers
Related concepts
Conditionally Loading Include Files


Where You Use GUI Specifiers

A GUI specifier can be located before any 4Test declaration or statement except the use statement, which must be evaluated at compile time, with the following exceptions:

  • Switch statements
  • If statements
  • Type statements
  • Do… except statements
  • Class declarations
  • GUI with inheritance
  • GUI with global variables

If you try to use a browser specifier instead of a GUI specifier to specify a window, Silk Test Classic 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.

Parent topic: About GUI Specifiers
Related concepts
Supporting Differences in Application Behavior


do...except Statements

You can use GUI specifiers to enclose an entire do...except statement before individual statements, but you cannot use GUI specifiers before the except clause.

// legal:
do
   mswxp Verify (expr1,expr2)
   mswin7 Verify (expr3,expr4)
except
   mswin7 reraise
   mswxp if (ExceptNum () == 1)
       Print ("err, etc.")
// NOT legal:
mswin7 do
   Verify (expr,expr)
mswxp except
   reraise
Parent topic: About GUI Specifiers


Type Statements

You can use a GUI specifier before a type type ... is enum or type ... is set statement, but not before an individual value within the type declaration.

Parent topic: About GUI Specifiers


Supporting GUI-Specific Objects

This section describes how Silk Test Classic supports testing GUI-specific objects.

  • Supporting GUI-Specific Captions
    Describes how to support GUI-specific captions.
  • Supporting GUI-Specific Executables
    Describes how to support GUI-specific executables.
  • Supporting GUI-Specific Menu Hierarchies
    Describes how to support GUI-specific menu hierarchies.
Parent topic: Porting Tests to Other GUIs


Supporting GUI-Specific Captions

Classic Agent

When you are using the Classic Agent, by default Silk Test Classic bases the tag for an object on the actual caption or label of the object. If the captions or labels change when the application is ported to a different GUI, you have two options:

  • You can have multiple tags, each based on the platform-specific caption or label.
  • You can have a single tag, using the index form of the tag, as long the relative position of the object is the same in the ported versions of the application.

Then, in your test cases, you can use the same identifier to refer to the object regardless of what the object’s actual label or caption is.

Open Agent

When you are using the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations. The locator is the actual name of the object, as opposed to the identifier, which is the logical name. Silk Test Classic uses the locator to identify objects in the application when executing test cases. Test cases never use the locator to refer to an object; they always use the identifier.

The advantages of using locators with an INC file include:
  • You combine the advantages of INC files with the advantages of dynamic object recognition. For example, scripts can use window names in the same manner as traditional, Silk Test Classic tag-based scripts and leverage the power of XPath queries.
  • Enhancing legacy INC files with locators facilitates a smooth transition from using hierarchical object recognition to new scripts that use dynamic object recognition. You use dynamic object recognition but your scripts look and feel like traditional, Silk Test Classic tag-based scripts that use hierarchical object recognition.
  • You can use AutoComplete to assist in script creation. AutoComplete requires an INC file.
Parent topic: Supporting GUI-Specific Objects
Related concepts
Marking 4Test Code as GUI Specific
Where You Use GUI Specifiers


Supporting GUI-Specific Executables

The command to start the application will almost always be different on each GUI. The Invoke method of Silk Test Classic expects to find the command in the constant sCmdLine, which is defined in the main window declaration of your application. You should declare as many sCmdLine variables as there are GUIs on which your application runs, beginning each declaration with the appropriate GUI specifier.

For example, the following constants specify how Silk Test Classic should start the Text Editor application on Windows and Windows Vista:

msw32 const sCmdLine = "c:\program files\<SilkTest install directory>\silktest\textedit.exe"
mswvista const sCmdLine = "{SYS_GetEnv(‘SEGUE_APPS’)}/SilkTest/demo/textedit"
Parent topic: Supporting GUI-Specific Objects
Related concepts
Marking 4Test Code as GUI Specific
Handling Differences Among GUIs
What Happens when the Code is Compiled
Where You Use GUI Specifiers


Supporting GUI-Specific Menu Hierarchies

When an application is ported, there are two common structural differences in the menu hierarchy:

  • The menu bar contains a platform-specific menu.
  • A menu contains different menu items.

To illustrate the case of the platform-specific menu, consider the Microsoft Windows system menu or a Vista menu (for example). Silk Test Classic recognizes these kinds of standard GUI- specific menus and includes the appropriate GUI specifier for them when you record declarations.

For menus that Silk Test Classic does not recognize as platform-specific, you should preface the window declaration with the appropriate GUI specifier.

Different menu items - example

To illustrate the case of different menu items, suppose that the Edit menu for the Text Editor application has a menu item named Clear which displays on the Windows version only. The declaration for the Edit menu should look like the following:
Classic Agent Open Agent
Menu Edit
   tag "Edit"
   msw32 MenuItem Clear
      tag "Clear"
   MenuItem Undo
      tag "Undo"

Menu Edit
   locator "Edit"
   msw32 MenuItem Clear
      locator "Clear"
   MenuItem Undo
      locator "Undo"
Parent topic: Supporting GUI-Specific Objects
Related concepts
Marking 4Test Code as GUI Specific
Where You Use GUI Specifiers


Supporting Custom Controls

This sections describes how Silk Test Classic supports custom controls.

  • Why Silk Test Classic Sees Controls as Custom Controls
    Describes why Silk Test Classic sees controls as custom controls.
  • Reasons Why Silk Test Classic Sees the Control as a Custom Control
    Describes why Silk Test Classic sees a control as a custom control.
  • Supporting Graphical Controls
    Describes issues with supporting graphical controls.
  • Custom Controls (Open Agent)
    Describes how Silk Test Classic supports custom controls.
  • Using Clipboard Methods
    Describes how you can use the 4Test Clipboard methods.
  • Filtering Custom Classes
    Describes how you can filter custom classes.
Parent topic: Using Advanced Techniques with the Open Agent


Why Silk Test Classic Sees Controls as Custom Controls

A control is defined by the following:

  • The actual class name of the control.
  • The underlying software code that creates and manipulates the control.

Whenever the definition of a control varies from the standard, Silk Test Classic defines the control as a custom control. During recording, Silk Test Classic attempts to identify the class of each control in your GUI and to assign the appropriate class from the built-in class hierarchy. If a control does not correspond to one of the built-in classes, Silk Test Classic designates the control as a custom control.

  • When you are using the Classic Agent, Silk Test Classic assigns custom controls to the CustomWin class.
  • When you are using the Open Agent, Silk Test Classic assigns custom controls to the Control class or another class.

Classic Agent Example

For example, Silk Test Classic supports the standard MFC library, which is a library of functions that allow for the creation of controls and the mechanism of interaction with them. In supporting these libraries, Silk Test Classic contains algorithms to interrogate the controls based upon the standard libraries. When these algorithms do not work, Silk Test Classic reports the control as a CustomWin.

Suppose that you see a text box in a window in your application under test. It looks like a normal text field, but Silk Test Classic calls it a control of the class CustomWin.

Parent topic: Supporting Custom Controls
Related concepts
Reasons Why Silk Test Classic Sees the Control as a Custom Control


Reasons Why Silk Test Classic Sees the Control as a Custom Control

For the following reasons Silk Test Classic might recognize a control as a custom control:

  • The control is not named with the standard name upon the definition of the control in the application under test. For example, when a TextField is named EnterTextRegion. If this is the only reason why Silk Test Classic recognizes the control as a custom control, then you can class map the control to the standard name.

    The class mapping might not work. The class mapping will work if the control is not really a custom control, but rather a standard control with a non-standard name. Try this as your first attempt at dealing with a custom control.

  • If the class mapping does not work the control truly is a custom control. The software in the application under test that creates and manipulates the control is not from the standard library. That means that the Silk Test Classic algorithms written to interrogate this kind of control will not work, and other approaches will have to be used to manipulate the control.

When you are using the Classic Agent, the support for custom controls depends on whether the control is a graphical control, such as a tool bar, or a non-graphical control, such as a text box.

Parent topic: Supporting Custom Controls
Related concepts
Why Silk Test Classic Sees Controls as Custom Controls
Custom Controls (Open Agent)


Supporting Graphical Controls

If an application contains a graphical area, for example a tool bar, which is actually composed of a discrete number of graphical controls, Silk Test Classic records a single declaration for the entire graphical area; it does not understand that the area contains individual controls.

Parent topic: Supporting Custom Controls
Related concepts
Using the Modified Declaration
Reasons Why Silk Test Classic Sees the Control as a Custom Control
Why Silk Test Classic Sees Controls as Custom Controls
Custom Controls (Open Agent)


Custom Controls (Open Agent)

This functionality is supported only if you are using the Open Agent.

Silk Test Classic provides the following features to support you when you are working with custom controls:
  • The dynamic invoke functionality of Silk Test Classic enables you to directly call methods, retrieve properties, or set properties on an actual instance of a control in the application under test (AUT).
  • The class mapping functionality enables you to map the name of a custom control class to the name of a standard Silk Test class. You can then use the functionality that is supported for the standard Silk Test class in your test.
    Silk Test Classic supports managing custom controls over the UI for the following technology domains:
    • Win32
    • Windows Presentation Foundation (WPF)
    • Windows Forms
    • Java AWT/Swing
    • Java SWT
  • The Manage Custom Controls dialog box enables you to specify a name for a custom control that can be used in a locator and also enables you to write reusable code for the interaction with the custom control.
Note: For custom controls, you can only record methods like Click,TextClick, and TypeKeys with Silk Test Classic. You cannot record custom methods for custom controls except when you are testing Apache Flex applications.
  • Dynamic Invoke
    Describes how you can call methods, retrieve properties, or set properties, on an actual instance of a control in the application under test.
  • Testing Apache Flex Custom Controls
    Describes the basic and advanced support available for testing custom controls.
  • Managing Custom Controls (Open Agent)
    Describes how Silk Test Classic supports custom controls.
Parent topic: Supporting Custom Controls
Related concepts
Reasons Why Silk Test Classic Sees the Control as a Custom Control
Related reference
Custom Controls Dialog Box


Dynamic Invoke

Dynamic invoke enables you to directly call methods, retrieve properties, or set properties, on an actual instance of a control in the application under test. You can also call methods and properties that are not available in the Silk Test Classic API for this control. Dynamic invoke is especially useful when you are working with custom controls, where the required functionality for interacting with the control is not exposed through the Silk Test Classic API.

Call dynamic methods on objects with the DynamicInvoke method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.

Call multiple dynamic methods on objects with the DynamicInvokeMethods method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList method.

Retrieve dynamic properties with the GetProperty method and set dynamic properties with the SetProperty method. To retrieve a list of supported dynamic properties for a control, use the GetPropertyList method.

For example, to call a method named SetTitle, which requires the title to be set as an input parameter of type string, on an actual instance of a control in the application under test, type the following:
control.DynamicInvoke("SetTitle", {"my new title"})
Note: Typically, most properties are read-only and cannot be set.
Note: Reflection is used in most technology domains to call methods and retrieve properties.
Note: You cannot dynamically invoke methods for DOM elements.
  • Frequently Asked Questions About Dynamic Invoke
    Includes a collection of questions that you might encounter when you are dynamically invoking methods to test custom controls.
Parent topic: Custom Controls (Open Agent)
Related concepts
Dynamically Invoking Apache Flex Methods
Dynamically Invoking Java Methods
Dynamically Invoking SAP Methods
Dynamically Invoking Silverlight Methods
Dynamically Invoking Windows Forms Methods
Dynamically Invoking WPF Methods
Related reference
DynamicInvoke Method (AnyWin)
DynamicInvokeMethods Method (AnyWin)


Frequently Asked Questions About Dynamic Invoke

This functionality is supported only if you are using the Open Agent.

This section includes a collection of questions that you might encounter when you are dynamically invoking methods to test custom controls.

  • Which Methods Can I Call With the DynamicInvoke Method?
    Describes how you can get a list of the instance methods that you can call with the DynamicInvoke method.
  • Why Does an Invoke Call Return a Simple String when the Expected Return is a Complex Object?
    Describes why an DynamicInvoke call, that is expected to return a complex object, returns a simple string.
  • How Can I Simplify My Scripts When I Use Many Calls To DynamicInvokeMethods?
    Describes how you can simplify your scripts, when you use many calls to DynamicInvokeMethods in the scripts.
Parent topic: Dynamic Invoke


Which Methods Can I Call With the DynamicInvoke Method?

This functionality is supported only if you are using the Open Agent.

To get a list of all the methods that you can call with the DynamicInvoke method for a specific test object, you can use the GetDynamicMethodList. To view the list, you can for example print it to the console or view it in the debugger.

Parent topic: Frequently Asked Questions About Dynamic Invoke


Why Does an Invoke Call Return a Simple String when the Expected Return is a Complex Object?

This functionality is supported only if you are using the Open Agent.

The DynamicInvoke method can only return simple data types. Complex types are returned as string. Silk Test Classic uses the ToString method to retrieve the string representation of the return value. To call the individual methods and read properties of the complex object that is returned by the first method invocation, use DynamicInvokeMethods instead of DynamicInvoke.

Parent topic: Frequently Asked Questions About Dynamic Invoke


How Can I Simplify My Scripts When I Use Many Calls To DynamicInvokeMethods?

This functionality is supported only if you are using the Open Agent.

When you extensively use DynamicInvokeMethods in your scripts, the scripts might become complex because you have to pass all method names as strings and all parameters as lists. To simplify such complex scripts, create a static method that interacts with the actual control in the AUT instead of interacting with the control through DynamicInvokeMethods.

Parent topic: Frequently Asked Questions About Dynamic Invoke


Testing Apache Flex Custom Controls

Silk Test Classic supports testing Apache Flex custom controls. However, by default, Silk Test Classic cannot record and playback the individual sub-controls of the custom control.

For testing custom controls, the following options exist:
  • Basic support

    With basic support, you use dynamic invoke to interact with the custom control during replay. Use this low-effort approach when you want to access properties and methods of the custom control in the test application that Silk Test Classic does not expose. The developer of the custom control can also add methods and properties to the custom control specifically for making the control easier to test. A user can then call those methods or properties using the dynamic invoke feature.

    The advantages of basic support include:
    • Dynamic invoke requires no code changes in the test application.
    • Using dynamic invoke is sufficient for most testing needs.
    The disadvantages of basic support include:
    • No specific class name is included in the locator, for example Silk Test Classic records //FlexBox rather than //FlexSpinner.
    • Only limited recording support.
    • Silk Test Classic cannot replay events.

    For more details about dynamic invoke, including an example, see Dynamically Invoking Apache Flex Methods.

  • Advanced support
    With advanced support, you create specific automation support for the custom control. This additional automation support provides recording support and more powerful play-back support. The advantages of advanced support include:
    • High-level recording and playback support, including the recording and replaying of events.
    • Silk Test Classic treats the custom control exactly the same as any other built-in Apache Flex control.
    • Seamless integration into Silk Test Classic API
    • Silk Test Classic uses the specific class name in the locator, for example Silk Test Classic records //FlexSpinner.
    The disadvantages of advanced support include:
    • Implementation effort is required. The test application must be modified and the Open Agent must be extended.
Parent topic: Custom Controls (Open Agent)


Managing Custom Controls (Open Agent)

This functionality is supported only if you are using the Open Agent.

You can create custom classes for custom controls for which Silk Test Classic does not offer any dedicated support. Creating custom classes offers the following advantages:
  • Better locators for scripts.
  • An easy way to write reusable code for the interaction with the custom control.

Example: Testing the tabControl Infragistics control

Suppose that a custom tab control is recognized by Silk Test Classic as the generic class Control. Using the custom control support of Silk Test Classic has the following advantages:
Better object recognition because the custom control class name can be used in a locator.
Many objects might be recognized as Control. The locator requires an index to identify the specific object. For example, the object might be identified by the locator //Control[13]. When you create a custom class for this control, for example the class UltraTabControl, you can use the locator //UltraTabControl. By creating the custom class, you do not require the high index, which would be a fragile object identifier if the application under test changed.
You can implement reusable playback actions for the control in scripts.

When you are using custom classes, you can encapsulate the behavior for getting the contents of a grid into a method by adding the following code to your custom class, which is the class that gets generated when you specify the custom control in the user interface.

Typically, you can implement the methods in a custom control class in one of the following ways:
  • You can use methods like Click, TypeKeys, TextClick, and TextCapture. In this example the TextClick method is used.
  • You can dynamically invoke methods on the object in the AUT.
Without using the custom classes, when you want to select a tab in your custom tab controls, you can write code like the following:
UltraTabControl.TextClick("<TabName>")
When you are using custom classes, you can encapsulate the behavior for selecting a tab into a method by adding the following code to your custom class, which is the class that gets generated when you specify the custom control in the user interface:
void SelectTab(string tabText)
  TextClick(tabText)
The custom class looks like the following:
winclass UltraTabControl : Control
  tag "[UltraTabControl]"

  void SelectTab(string tabText)
    TextClick(tabText)
You can now use the newly created method SelectTab in a script like the following:
UltraTabControl.SelectTab("<TabName>")

When you define a class as a custom control, you can use the class in the same way in which you can use any built-in class, for example the Dialog class.

  • Supporting a Custom Control
    Create a new custom class to support a custom control in Silk Test Classic.
  • Custom Controls Dialog Box
    Describes how you can set options to support custom controls.
Parent topic: Custom Controls (Open Agent)


Supporting a Custom Control

This functionality is supported only if you are using the Open Agent.

Silk Test Classic supports managing custom controls over the UI for the following technology domains:
  • Win32
  • Windows Presentation Foundation (WPF)
  • Windows Forms
  • Java AWT/Swing
  • Java SWT

To create a custom class for a custom control for which Silk Test Classic does not offer any dedicated support.

  1. Click Options > Manage Custom Controls. The Manage Custom Controls dialog box opens.
  2. In the Frame file for custom class declarations field, type in a name or click Browse to select the frame file that will contain the custom control.
  3. Click on the tab of the technology domain for which you want to create a new custom class.
  4. Click Add.
  5. Click one of the following:
    • Click Identify new custom control to directly select a custom control in your application with the Identify Object dialog box.
    • Click Add new custom control to manually add a custom control to the list.
    A new row is added to the list of custom controls.
  6. If you have chosen to manually add a custom control to the list:
    1. In the Silk Test base class column, select an existing base class from which your class will derive. This class should be the closest match to your type of custom control.
    2. In the Silk Test class column, enter the name to use to refer to the class. This is what will be seen in locators. For example: //UltraGrid instead of //Control[13].
      Note: After you add a valid class, it will become available in the Silk Test base class list. You can then reuse it as a base class.
    3. In the Custom control class name column, enter the fully qualified class name of the class that is being mapped. For example: Infragistics.Win.UltraWinGrid.UltraGrid. For Win32 applications, you can use the wildcards ? and * in the class name.
  7. Only for Win32 applications: In the Use class declaration column, set the value to False to simply map the name of a custom control class to the name of a standard Silk Test class. When you map the custom control class to the standard Silk Test class, you can use the functionality supported for the standard Silk Test class in your test. Set the value to True to additionally use the class declaration of the custom control class.
  8. Click OK.
  9. Only for scripts:
    1. Add custom methods and properties to your class for the custom control.
    2. Use the custom methods and properties of your new class in your script.
      Note: The custom methods and properties are not recorded.
Note: Do not rename the custom class or the base class in the script file. Changing the generated classes in the script might result in unexpected behavior. Use the script only to add properties and methods to your custom classes. Use the Manage Custom Controls dialog box to make any other changes to the custom classes.
Parent topic: Managing Custom Controls (Open Agent)
Related reference
Custom Controls Dialog Box


Custom Controls Dialog Box

This functionality is supported only if you are using the Open Agent.

Options > Manage Custom Controls.

Silk Test Classic supports managing custom controls over the UI for the following technology domains:
  • Win32
  • Windows Presentation Foundation (WPF)
  • Windows Forms
  • Java AWT/Swing
  • Java SWT

In the Frame file for custom class declarations, define the frame file into which the new custom classes should be generated.

When you map a custom control class to a standard Silk Test class, you can use the functionality supported for the standard Silk Test class in your test. The following Custom Controls options are available:
Option
Description
Silk Test base class
Select an existing base class to use that your class will derive from. This class should be the closest match to your type of custom control.
Silk Test class
Enter the name to use to refer to the class. This is what will be seen in locators.
Custom control class name
Enter the fully qualified class name of the class that is being mapped. You can use the wildcards ? and * in the class name.
Use class declaration
This option is available only for Win32 applications. By default False, which means the name of the custom control class is mapped to the name of the standard Silk Test class. Set this setting to True to additionally use the class declaration of the custom control class.
Note: After you add a valid class, it will become available in the Silk Test base class list. You can then reuse it as a base class.

Example: Setting the options for the UltraGrid Infragistics control

To support the UltraGrid Infragistics control, use the following values:
Option | Value
Silk Test base class | Control
Silk Test class | UltraGrid
Custom control class name | Infragistics.Win.UltraWinGrid.UltraGrid
Parent topic: Managing Custom Controls (Open Agent)
Parent topic: Setting Silk Test Classic Options
Related concepts
Custom Controls (Open Agent)
Related tasks
Supporting a Custom Control


Using Clipboard Methods

If you are having trouble getting or setting information with a custom object that contains text, you might want to try the 4Test Clipboard methods. For example, assume you have a class, CustomTextBuffer, which is similar to a TextField, but using the GetText and SetText methods of the TextField does not work with the CustomTextBuffer. In such a case, you can use the GetText and SetText methods of the ClipboardClass.

  • Get and Set Text Sample Code
    Provides sample code on how to get and set text.
  • Using the Modified Declaration
    Describes how to use the modified declaration.
Parent topic: Supporting Custom Controls
Related concepts
Reasons Why Silk Test Classic Sees the Control as a Custom Control
Why Silk Test Classic Sees Controls as Custom Controls


Get and Set Text Sample Code

The following sample code retrieves the contents of the CustomTextBuffer by placing it on the Clipboard, then printing the Clipboard contents:

// Go to beginning of text field
CustomTextBuffer.TypeKeys ("<Ctrl-Home>")
// Highlight it
CustomTextBuffer.TypeKeys ("<Ctrl-Shift-End>")
// Copy it to the Clipboard
CustomTextBuffer.TypeKeys ("<Ctrl-Insert>")
// Print the contents of the Clipboard
Print (Clipboard.GetText())

Setting text

Similarly, the following sample code inserts text into the custom object by pasting it from the Clipboard:

// Go to beginning of text field
CustomTextBuffer.TypeKeys ("<Ctrl-Home>")
// Highlight it
CustomTextBuffer.TypeKeys ("<Ctrl-Shift-End>")
// Paste the Clipboard contents into the text field
CustomTextBuffer.TypeKeys ("<Shift-Insert>")

You can wrap this functionality in GetText and SetText methods you define for your custom class, similar to what was shown in supporting custom text boxes.

Parent topic: Using Clipboard Methods
Related concepts
Reasons Why Silk Test Classic Sees the Control as a Custom Control
Why Silk Test Classic Sees Controls as Custom Controls


Using the Modified Declaration

Once you create window declarations like these for the graphical objects in your application, you can manipulate them as you would any other object. For example, if the tool bar was contained in an application named MyApp, to click on the FileOpen icon in the tool bar, you use the following command:
MyApp.FileOpen.Click()

You need to write this statement, and others that access the objects declared above, such as Save and Printer, by hand. Record > Testcase and Record > Actions will not use these identifiers.

Parent topic: Using Clipboard Methods
Related concepts
Reasons Why Silk Test Classic Sees the Control as a Custom Control
Why Silk Test Classic Sees Controls as Custom Controls


Filtering Custom Classes

This section describes how you can filter custom classes.

  • Invisible Containers
    Describes invisible containers.
Parent topic: Supporting Custom Controls


Invisible Containers

Sometimes a window contains an invisible dialog box that contains controls. You can set these "dialog box containers" to Ignore using class mapping and style-bits in order to avoid making all of the dialog boxes disappear.

See the following examples for details.

Example: WordPad with No Class Mappings

[-] window MainWin WordPad
[+] multitag "*WordPad"
[+] Menu File
[+] Menu Edit
[+] Menu View
[+] Menu Insert
[+] Menu Format
[+] Menu Help
// toolbars seen, but are nested
[+] CustomWin BottomStatusBar
[-] CustomWin Frame
[+] CustomWin FormatBar
[+] ComboBox ComboBox1
[+] ComboBox ComboBox2
[+] CustomWin StandardBar
[+] CustomWin Ruler
[-] main ()
WordPad.Frame.FormatBar.ComboBox1.Select ("Arial")

Example: WordPad with AfxControlBar Ignored

[-] window MainWin WordPad
[+] multitag "*WordPad"
[+] Menu File
[+] Menu Edit
[+] Menu View
[+] Menu Insert
[+] Menu Format
[+] Menu Help
// toolbars, ruler, and statusbar not seen
[+] ComboBox ComboBox1
[+] ComboBox ComboBox2
[+] TextField Document
[-] main ()
WordPad.ComboBox1.Select ("Arial")
Parent topic: Filtering Custom Classes
Related tasks
Suppressing Controls (Open Agent)


Supporting Internationalized Objects

This section describes how you can work with internationalized objects.

  • Overview of Silk Test Classic Support of Unicode Content
    Describes how Silk Test Classic supports Unicode content.
  • Using DB Tester with Unicode Content
    Describes how to use DB Tester with unicode content.
  • Issues Displaying Double-Byte Characters
    Describes potential issues while displaying double byte characters.
  • Learning More About Internationalization
    Describes topics to research on internationalization.
  • Silk Test Classic File Formats
    Describes the Silk Test Classic file formats.
  • Working with Bi-Directional Languages
    Describes how to work with bi-directional languages.
  • Configuring Your Environment
    Describes how you can configure your environment for internationalized objects.
  • Troubleshooting Unicode Content
    Contains topics to help troubleshoot unicode content.
Parent topic: Using Advanced Techniques with the Open Agent


Overview of Silk Test Classic Support of Unicode Content

Silk Test Classic is Unicode-enabled, which means that Silk Test Classic is able to recognize double-byte (wide) languages. We have enabled components within the application to deal with Unicode content. The Silk Test Classic GUI supports the display and input of wide text. The 4Test language processor has been enhanced to support wide text. All 4Test library functions have been widened. The extensions have been enhanced to support the input and output of wide text.

We have added and modified 4Test functions to deal with internationalization issues. With Silk Test Classic you can test applications that contain content in double-byte languages such as Chinese, Korean, or Japanese (Kanji) characters, or any combination of these. You can also name Silk Test Classic files using internationalized characters. Silk Test Classic supports three text file formats: ANSI, Unicode and UTF-8.

Silk Test Classic supports the following:

  • Localized versions of Windows.
  • International keyboards and native language Input Method Editors (IME).
  • Passing international strings as parameters to test cases, methods, and so on, and comparing strings.
  • Accessing databases through direct ODBC standard access.
  • Reading and writing text files in multiple formats: ANSI, Unicode, and UTF-8.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Before testing double-byte characters with Silk Test Classic

Testing an internationalized application, particularly one that contains double-byte characters, is more complicated than testing an application that contains strictly English single-byte characters. Testing an internationalized application requires that you understand a variety of issues, from operating system support, to language packs, to fonts, to working with IMEs and complex languages.

Before you begin testing your application using Silk Test Classic, you must do the following:

  • Meet the needs of your application under test (AUT) for any necessary localized OS, regional settings, and required language packs.
  • Install the fonts necessary to display your AUT.
  • If you are testing an application that requires an IME for data input, install the appropriate IME.
Parent topic: Supporting Internationalized Objects
Related concepts
Configuring Your Microsoft Windows XP PC for Unicode Content


Using DB Tester with Unicode Content

To use DB Tester with Unicode characters:

  • You must have a Unicode-capable driver (ODBC version 3.5 or higher) associated with the data source name you are using in your test plan.
  • The database must be Unicode capable (SQL Server 7 and 2000, Oracle 8 and higher).
Parent topic: Supporting Internationalized Objects


Issues Displaying Double-Byte Characters

When you are dealing with internationalized content, being able to display the content of your application is critical. Carefully consider the following:
Operating system
Your operating system needs to be capable of displaying double-byte characters in the system dialog boxes and menus used by your application.
Silk Test Classic
You need to be concerned about displaying your content in the Silk Test Editor and the Silk Test Classic dialog boxes.
Application under test
You need to have a font installed that is capable of displaying the content of your application. If you have multiple languages represented in your application, you will need a font that spans these languages.
Browser
If your application is web-based, make sure that you are using a browser that supports your content, that the browser is configured to display your content, and that you have the necessary fonts installed to display your application.
Complex scripts (languages)
Silk Test Classic does not support complex scripts such as the bi-directional languages Hebrew and Arabic. These are languages that require special processing to display and edit because the characters are not laid out in a simple linear progression from left to right, as are most western European characters.
Parent topic: Supporting Internationalized Objects
Related concepts
Working with Bi-Directional Languages
Configuring Your Microsoft Windows XP PC for Unicode Content
Displaying Double-Byte Characters


Learning More About Internationalization

There are a variety of online sites that provide general information about internationalization issues. You may find the following Web sites useful if you are learning about internationalization, localization or Unicode. They include:

  • Microsoft’s Professional Developer’s Site for Software Globalization Information (http://www.microsoft.com/globaldev/default.asp)
  • The definitive word on the W3C’s Web site (http://www.w3.org/international)
  • The Unicode Consortium, a non-profit organization founded to develop, extend and promote use of the Unicode Standard (http://www.unicode.org)
  • IBM’s International Components for Unicode (http://oss.software.ibm.com/icu/userguide/index.html)
  • A tutorial from Sun on how to internationalize Java applications (http://java.sun.com/docs/books/tutorial/i18n)
Parent topic: Supporting Internationalized Objects


Silk Test Classic File Formats

Silk Test Classic gives you the ability to specify the file format of text files and .ini files. Before Silk Test Classic 5.5, all files were in the ANSI file format. You can create the following formats:
ANSI
For Silk Test Classic purposes, ANSI is defined as the Microsoft Windows ANSI character set from Code Page 1252 Windows Latin 1.
Unicode
Is an extended form of ASCII that provides the ability to represent data in a uniform plaintext format that can be sorted and processed efficiently. Unicode encompasses nearly all characters used in computers today.
UTF-8
Unicode Transformation Format (UTF) Is a multi-byte encoding that can handle all Unicode characters. It is used to compress Unicode, minimize storage consumption and maximize transmission.

You have the ability to save text files in any of three file formats: ANSI, UTF-8, and Unicode. By default all files are saved in UTF-8 format. The Save As dialog boxes throughout include a list box from which you can select the file format in which you want to save your file.

  • ANSI files cannot contain non ANSI characters
  • The file formats available will depend on the content of your text file. If your file contains characters not available on code page 1252, ANSI will not display in the list box. If you are working with an existing ANSI file and add non-ANSI characters, the Save As dialog box will open when you attempt to save the file. In order to save the changes you will need to change the file format and click Save.
  • The title bar indicates the file format: When you have a file open, the format of that file is indicated on the title bar.
  • Silk Test Classic uses the Microsoft standard Byte Order Marked (BOM) to determine the file type for UTF-8 and Unicode files. If a Unicode file does not have the BOM marker then Silk Test Classic sees the file as an ANSI file, and the Unicode characters cannot be displayed.
  • Reusing Silk Test Classic Single-Byte Files as Double-Byte
    Describes how to reuse Silk Test Classic single-byte files as double-byte.
  • Specifying File Formats for Existing Files with Unicode Content
    Describes how to properly specify file formats for existing files with unicode content.
  • Specifying File Formats for New Files with Unicode content
    Describes how to specify file formats for new files with unicode content.
Parent topic: Supporting Internationalized Objects


Reusing Silk Test Classic Single-Byte Files as Double-Byte

If you have existing single-byte Silk Test Classic text files, such as *.pln, *.inc or *.t, that you want to use in double-byte testing, the files must:

  • Be compatible with Silk Test Classic, such as files created using the IE 5.x DOM extension for testing a Web application.
  • Be recompiled in Silk Test Classic because the object files, *.ino and *.to, are not compatible.

Opening an existing Silk Test Classic file as a double-byte file

Choose one of the following:

  • Copy the file you want to re-use to a new directory. Do not copy the associated object (*.ino or *.to) files. In Silk Test Classic, open this new file.
  • In the existing directory, delete the object files associated with the file you want to re-use. In Silk Test Classic, open the desired file.

When the Silk Test Classic file is compiled, new objects files are created. If you enter double-byte content into the file, when you try to close the file you will be prompted to save the file in a compatible file format, Unicode or UTF-8.

Parent topic: Silk Test Classic File Formats


Specifying File Formats for Existing Files with Unicode Content

If you want to save an existing file in a different file format, choose one of the following:

Overwriting the file

If the file is already referenced from other files, you may want to change the format without changing the name or its location. As you cannot have two files with the same name saved in the same directory, even in different formats, the only option is to overwrite the file.

  1. Make sure the file is the active window. Click File > Save As and select the file from the list.
  2. From the Save as format list box, select the file format. ANSI is not available if the file contains characters outside of the ANSI character set.
  3. Click Save. A dialog box displays asking if you want to overwrite the file.
  4. Click Yes.

Saving in the same directory

If you want to have versions of a file in various formats within the same directory, you must save each file with a different name.

  1. Make sure the file is the active window. Click File > Save As.
  2. In the File name text box, enter the new name of the file.
  3. From the Save as format list box, select the file format. ANSI is not available if the file contains characters outside of the ANSI character set.
  4. Click Save.

Saving in a different directory

If you would like to keep the name of the file but change the format, you must save the file in a different directory.

  1. Make sure the file is the active window. Click File > Save As and select the file from the list.
  2. Navigate to the directory in which you want to save the file.
  3. From the Save as format list box, select the file format. ANSI is not available if the file contains characters outside of the ANSI character set.
  4. Click Save.

If you modify an ANSI text file and the modifications include characters outside of the ANSI characters set, when you try to save your changes, the Save As dialog box will open and you need to either overwrite the ANSI file with a file of the same name but in a different format, or rename the file and save in Unicode or UTF-8 format .

Parent topic: Silk Test Classic File Formats
Related concepts
Specifying File Formats for New Files with Unicode content


Specifying File Formats for New Files with Unicode content

This topic contains instructions on specifying the file format for:

With the exception of test frames, to specify the file format of a new file:

  1. Click File > New.
  2. On the New dialog box, select the file type.
  3. Click OK. The untitled file opens.
  4. Click File > Save As. The Save As dialog box opens.
  5. Navigate to where you want to store the file and enter the name of the file in the File name text box.
  6. Select a file format (UTF-8 is the default) from the Save as format list box. ANSI is not available if the file contains characters outside of the ANSI character set.
  7. Click Save.

To specify the file format for a new test frame:

  1. Click File > New.
  2. On the New dialog box, select the file type Test Frame and click OK. The New Test Frame dialog box opens.
  3. To select a file format, click Browse. The Save As dialog box opens. The default file format for test frames is UTF-8. If you simply type the path and file name in the File name text box of the New Test Frame dialog box and click OK, the file is saved in UTF-8.
  4. Navigate to where you want to store the file and enter the name the file in the File name text box.
  5. Select the file format from the Save as format list box. If you select ANSI and if the file contains characters outside of the ANSI character set, when you try to save the file you will need to change the file format to a compatible format, Unicode or UTF-8.
  6. Click Save. The New Test Frame dialog box regains focus.
  7. On the New Test Frame dialog box, select the application and proceed as normal.

If you modify an ANSI text file and the modifications include characters outside of the ANSI characters set, when you try to save your changes, the Save As dialog box will open and you need to either overwrite the ANSI file with a file of the same name but in a different format, or rename the file and save in Unicode or UTF-8 format .

Parent topic: Silk Test Classic File Formats
Related concepts
Specifying File Formats for Existing Files with Unicode Content


Working with Bi-Directional Languages

Silk Test Classic supports bi-directional languages to the extent that the operating system does. Silk Test Classic captures static text in all Unicode languages. However, scripting, playback and many string functions are not fully supported for complex languages, the most common of these being the bi-directional languages Hebrew and Arabic. The problems you may encounter are discussed below.

Silk Test Classic with bi-directional languages on Windows XP

Windows XP is a multi-lingual operating system and is capable of handling bi-directional languages when configured properly.

On Windows XP if you input characters from RIGHT to LEFT (CBA ) provided that the default system locale is set for a bi-directional language, Silk Test Classic will correctly record and playback the characters as they were entered and display, from RIGHT to LEFT. When you use a 4Test string function such as StrPos (string position) to return the third element, 4Test correctly counts from right to left and returns "C"

Once you have set a default system locale, the operating system continues to be able to read and write that language properly, even after another locale has been set as the default. This works only if the language is not unchecked from the Language Settings area after another default is set. Once a language is unchecked, the ability to read and write in that language will be gone when you reboot your system. You would need to reset it as the default to restore the capability.

Parent topic: Supporting Internationalized Objects
Related concepts
Configuring Your Microsoft Windows XP PC for Unicode Content


Configuring Your Environment

This section describes how you can configure your environment for internationalized objects.

  • Configuring Your Microsoft Windows XP PC for Unicode Content
    Describes how to configure your Microsoft Windows XP PC for Unicode content.
  • Displaying Double-Byte Characters
    Describes how to display double-byte characters.
  • Using an IME with Silk Test Classic
    Describes how to use an IME with Silk Test Classic.
Parent topic: Supporting Internationalized Objects


Configuring Your Microsoft Windows XP PC for Unicode Content

If you have already configured your Windows XP PC to run your internationalized application, you may be able to disregard this topic and see Recording Identifiers for International Applications.

On Microsoft Windows XP you may need to do all or some of the following:

  • Install language support required by your application through modifications in the Regional and Language Options dialog box.
  • If your application contains content that is in a large-character-set language, such as simplified Chinese, you may need to install an Input Method Editor (IME) if you want to input data in this language. For additional information about IMEs, refer to the Microsoft support site.

Fonts

To display the content of your application in Silk Test Classic you will need to have an appropriate font installed and specify this font in the system registry and in the Silk Test Classic Options/Editor Font.

  • Installing Language Support
    Install language support to configure your Microsoft Windows XP PC for Unicode content.
  • Setting Up Your Input Method Editor
    Set up your IME to configure your Microsoft Windows XP PC for Unicode content.
Parent topic: Configuring Your Environment
Related concepts
Displaying Double-Byte Characters


Installing Language Support

You must have administrator privileges to install language packs or set the system default locale.

Microsoft Windows XP provides built-in support for many double-byte languages. Enabling this support can be done at the time of install or after setup through the Regional and Language Options dialog box. If you enable language support after setup, you may need files from the Microsoft Windows XP installation CD. Configurations will vary depending on your needs and how your system has been configured previously. The following instructions are intended only to be general information to get you started:

  1. Click Start > Settings > Control Panel > Regional and Language Options.
  2. If you are testing East Asian languages, select the Languages tab, and then check the Install files for East Asian languages check box. You may be prompted to insert the Microsoft Windows XP CD for the necessary files.
  3. Click the Advanced tab on the Regional and Language Options dialog box.
  4. Select the language that matches the language of the non-Unicode programs you want to use. For example Chinese (PRC).
  5. Click OK.
  6. Reboot your computer for the changes to take effect. After you restart your computer, if you want to input data in a language other than the default language, you must click the Language bar icon in your system tray and select the language from the multi-lingual indicator.
Parent topic: Configuring Your Microsoft Windows XP PC for Unicode Content


Setting Up Your Input Method Editor

If you want to use an Input Method Editor (IME) to input data in the language you selected, you may need to set up your IME.

  1. Click Start > Settings > Control Panel > Regional and Language Options.
  2. Click the Languages tab.
  3. Click Details in the Text Services and Input Language area.
  4. In the Settings tab on the Text Services and Input Language dialog box, select the language you want to use as your default input language.
  5. In the Preferences section of the Settings tab, click Language Bar, make sure the Show the Language Bar on the desktop check box is checked, and then click OK on the Settings tab. This default will enable your system to display this language in dialog boxes and menus. We recommend setting the default to the language of the AUT.
Parent topic: Configuring Your Microsoft Windows XP PC for Unicode Content


Displaying Double-Byte Characters

While Silk Test Classic can process Unicode, displaying double-byte characters is not automatic. Keep the following in mind:

  • Is your operating system configured to display your content?
  • Is Silk Test Classic configured to display double-byte content in its dialog boxes?
  • Do you have the right font set to display your content in the Editor?
  • Displaying Double-Byte Characters in Dialog Boxes
    Configure Silk Test Classic to display double-byte characters in dialog boxes.
  • Displaying Double-Byte Characters in the Editor
    Select an appropriate font to display double-byte characters in the Editor.
Parent topic: Configuring Your Environment


Displaying Double-Byte Characters in Dialog Boxes

If Silk Test Classic is rendering squares or pipes in dialog boxes where you expect double-byte characters, you may need to make a simple modification to Silk Test Classic using a script we have provided. This script is located in <SilkTest Installation directory>\Tools.

  1. In Silk Test Classic, click File > Open.
  2. In the Tools directory, open font.t.
  3. Click Run > Testcase. The Run Testcase dialog box opens.
  4. In the arguments area, type the name of the font in quotes. For example, Arial Unicode MS. It is not necessary to include the type of font, for example Arial Unicode MS (True Type).
  5. Click Run.
  6. Reboot your computer for the changes to take effect.
Parent topic: Displaying Double-Byte Characters


Displaying Double-Byte Characters in the Editor

In order for the Editor to display double-byte characters, such as those captured in your test frame, you must select a font that is able to display these characters.

  1. In Silk Test Classic, click Options > Editor Font.
  2. From the available fonts, select one that is able to display the language of your application.
If your application contains multiple languages, make sure that you have a font installed that is capable of rendering all the languages, as the Editor does not display multiple fonts. Licensed Microsoft Office 2000 users can freely download the Arial Unicode MS font from Microsoft.
Parent topic: Displaying Double-Byte Characters
Related tasks
Setting the Editor Font


Using an IME with Silk Test Classic

Silk Test Classic supports IMEs. The IME is enabled only after you have installed an Asian language package. The IME will work once you have installed it, enabled it, and are in an application with IME support. In Silk Test Classic, the IME is only available when a file, such as an include or script, is active.

For additional information about IMEs and for downloads, see the Microsoft support site.

Parent topic: Configuring Your Environment


Troubleshooting Unicode Content

This section contains topics to help troubleshoot unicode content.

  • Display Issues
    Describes how you can troubleshoot display issues in Unicode contents.
  • File Formats
    Describes how you can troubleshoot issues with file formats in Unicode contents.
  • Working with Input Method Editors
    Describes how you can troubleshoot issues when working with Input Method Editors.
Parent topic: Supporting Internationalized Objects


Display Issues

This section describes how you can troubleshoot display issues in Unicode contents.

  • Why Are My Window Declarations Recording Only Pipes?
    Describes why window declarations may only record pipes.
  • What Are Pipes and Squares Anyway?
    Describes pipes and squares.
  • Why Can I Only Enter Pipes Into a Silk Test Classic File?
    Describes why only pipes can be entered into frame files, include files, or files of another type.
  • Why Do I See Pipes and Squares in the Project Tab?
    Describes why you may see pipes and squares in the project tab.
  • Why Cannot My System Dialog Boxes Display Multiple Languages?
    Describes why system dialog boxes may not be able to display multiple languages.
  • Why Do I See Pipes and Squares in My Win32 AUT?
    Describes why you may see pipes and squares in a Win32 AUT.
  • Why Do the Fonts on My System Look so Different?
    Describes why system fonts may look different.
  • Why Do Unicode Characters Not Display in the Silk Test Project Explorer
    Describes why unicode characters may not display in the Project Explorer.
  • Why Is My Web Application Not Displaying Characters Properly?
    Describes why Web applications may not display characters properly.
Parent topic: Troubleshooting Unicode Content


Why Are My Window Declarations Recording Only Pipes?

If your window declarations record only pipes (|), You’ve probably forgotten to set the Options > Font Editor to a font that can display the language of your AUT.

Parent topic: Display Issues
Related concepts
Displaying Double-Byte Characters


What Are Pipes and Squares Anyway?

The pipes and squares, or even question marks (?), display in place of characters which the system has not yet been configured to display. A font that does not support the language is being used in the dialog boxes and menus. Whether or not you see pipes or squares depends on what font is used and what language you are trying to display.

Parent topic: Display Issues


Why Can I Only Enter Pipes Into a Silk Test Classic File?

If you can only enter pipes into a file, for example a frame file or an include file, the Silk Test Classic Editor font is not set to display the language of your AUT.

Parent topic: Display Issues
Related tasks
Displaying Double-Byte Characters in Dialog Boxes


Why Do I See Pipes and Squares in the Project Tab?

Pipes, squares, and questions marks (?) display in place of characters which the system has not yet been configured to display. A font that does not support the language is being used in the dialog boxes and menus. Whether or not you see pipes or squares depends on what font is used and what language you are trying to display.

You must configure your system and make sure that you have set the regional settings.

Parent topic: Display Issues
Related concepts
Configuring Your Microsoft Windows XP PC for Unicode Content


Why Cannot My System Dialog Boxes Display Multiple Languages?

If you are testing an application whose content contains multiple languages, meaning that it has several character sets represented, you may need to:

  • Make sure that you have a font installed on your machine that can display all the languages.
  • Configure Silk Test Classic to use a font that can display your content.
Parent topic: Display Issues
Related tasks
Displaying Double-Byte Characters in Dialog Boxes


Why Do I See Pipes and Squares in My Win32 AUT?

If you start up your application under test and see pipes and squares in the title bar, menus, or dialog boxes, it may mean that the operating system cannot support your application or that your system is not properly configured to display your content.

Parent topic: Display Issues
Related concepts
Configuring Your Microsoft Windows XP PC for Unicode Content


Why Do the Fonts on My System Look so Different?

Fonts that display in your menus, title bars and so on, are controlled by the registry settings and the Display Properties > Appearance settings of your computer.

If your fonts display too large or too small, you may have incorrectly set the appearance for an item:

  1. Navigate to Start > Settings > Control Panel > Display.
  2. Navigate to the Appearance tab and select Windows standard in the Scheme field.
  3. Click OK.

Your desktop should now display normal.

Parent topic: Display Issues


Why Do Unicode Characters Not Display in the Silk Test Project Explorer

To view Unicode characters in the Silk Test Project Explorer, you must have installed a language pack with Unicode characters.

Parent topic: Display Issues
Related concepts
Why Do I See Pipes and Squares in the Project Tab?


Why Is My Web Application Not Displaying Characters Properly?

If your Web application is not displaying the characters properly, or strange symbols or character are mixed in with your content, you may need to change a setting in your browser.

Internet Explorer Users

Check the settings for Encoding:

  1. In Internet Explorer, click View > Encoding.
  2. Select one of the following:
    • From the listed encodings, select one that meets the requirements of your application.
    • Click More, then select an encoding that meets the requirements of your application.
    • Click Auto-Select.

Mozilla Firefox Users

Check the settings for Character Coding:

  1. In Mozilla Firefox, click Settings > Content.
  2. In the Fonts & Colors section, click Advanced.
  3. Select a character coding that meets the requirements of your application.

If you still have problems, ensure that your system locale is set for the language of your application under test.

Parent topic: Display Issues


File Formats

This section describes how you can troubleshoot issues with file formats in Unicode contents.

  • Why Am I Getting Compile Errors?
    Describes why you may be getting compile errors.
  • Why Does Silk Test Classic Open Up the Save As Dialog Box when I Try to Save an Existing File?
    Describes why Silk Test Classic may open up the Save as dialog box when saving an existing file.
Parent topic: Troubleshooting Unicode Content


Why Am I Getting Compile Errors?

You may be trying to compile a file with an incompatible file format. Silk Test Classic supports three file formats: ANSI, UTF-8, and Unicode. If you try to compile files in Silk Test Classic that are in other formats, such as DBCS, you will get compile errors.

Workaround: In a Unicode-enabled text editor, save the file in one of the Silk Test Classic supported file formats: ANSI, UTF-8 or Unicode.

Parent topic: File Formats


Why Does Silk Test Classic Open Up the Save As Dialog Box when I Try to Save an Existing File?

You have likely added content to the file that is incompatible with the file’s existing file format. For example, you could have added Japanese characters to a frame file that was previously saved in ANSI format.

You must save the existing file in a compatible format.

Parent topic: File Formats
Related concepts
Specifying File Formats for Existing Files with Unicode Content


Working with Input Method Editors

This section describes how you can troubleshoot issues when working with Input Method Editors (IMEs).

  • Why is English the Only Language Listed when I Click the Language Bar Icon?
    Describes why English is the only language listed when clicking the language bar icon.
  • Why Does This IME Look so Different from Other IMEs I Have Used
    Describes the difference in appearance for IMEs.
Parent topic: Troubleshooting Unicode Content


Why is English the Only Language Listed when I Click the Language Bar Icon?

You must be running an application, or area within the application, that supports an IME for a language other than English to be displayed in the Language bar icon. Applications that support IME include elements of Silk Test Classic such as include files and script files, Outlook, and Internet Explorer.

Parent topic: Working with Input Method Editors


Why Does This IME Look so Different from Other IMEs I Have Used

IMEs can look different, depending on the operating system you are using and the particular IME you have accessed. For more information about IMEs, see Microsoft’s support site.

Parent topic: Working with Input Method Editors


Using Autocomplete

This section describes how you can automatically complete functions, members, application states, and data types.

  • Overview of AutoComplete
    Describes how you can ease working with 4Test by automatically completing functions, members, application states, and data types.
  • Customizing your MemberList
    Customize the MemberList to define the level of details that is displayed in the MemberList.
  • Frequently Asked Questions about AutoComplete
    Provides answers to frequently asked questions about AutoComplete.
  • Turning AutoComplete Options Off
    Uncheck the AutoComplete options to disable AppStateList, DataTypeList, FunctionTip, and MemberList.
  • Using AppStateList
    Edit your script or the include file to display a list of the currently defined application states.
  • Using DataTypeList
    Edit your script or the include file to display a list of built-in and user-defined data types.
  • Using FunctionTip
    Edit your script or the include file to display the function signature for a function, test case, or method.
  • Using MemberList
    Use MemberList to view and select a list of members.
Parent topic: Using Advanced Techniques with the Open Agent


Overview of AutoComplete

AutoComplete makes it easier to work with 4Test, significantly reducing scripting errors and decreasing the need to type text into your 4Test files by automatically completing functions, members, application states, and data types. There are four AutoComplete options:
Option
Description
Function Tip
Provides the function signature in a tooltip.
MemberList
Displays window children, properties, methods, and variables available to your 4Test file.
AppStateList
Displays a list of the currently defined application states.
DataTypeList
Displays a list of built-in and user-defined data types.

AutoComplete works with both Silk Test Classic-defined and user-defined 4Test files.

If you create a new 4Test file, you must name and save it as either a .t , .g.t, or .inc file in order for AutoComplete to work. After a 4Test file is saved, AutoComplete recognizes any changes you make to this file in the 4Test Editor and includes files that you reference through a 4Test use statement or the Use Files text box on the Runtime Options dialog box. When working with an existing 4Test file, you do not need to save or compile in order to access newly defined functions, methods, or members.

AutoComplete only works with 4Test files, which are .t, .g.t, and .inc files, that use hierarchical object recognition or dynamic object recognition with locator keywords.

AutoComplete does not work on comment lines or within plan, suite, or text files. AutoComplete does not support global variables of type window. However, AutoComplete supports Unicode content.

AutoComplete does not distinguish between Silk Test Classic Agents. As a result, AutoComplete displays all methods, properties, variables, and data types regardless of the Silk Test Classic Agent that you are using. For example, if you are using the Open Agent, functions and data types that work only with the Classic Agent are also displayed when you use AutoComplete. For details about which methods are supported for each Silk Test Classic Agent, review the corresponding .inc file, such as the winclass.inc file.

Parent topic: Using Autocomplete
Related concepts
Overview of the Methods Supported by the Silk Test Agents
Related reference
Runtime Options Dialog Box


Customizing your MemberList

The members that you see in the MemberList depend on the MemberList options that you select. You can specify which members display in your MemberList. The members are window children, methods, properties, and variables. You can also determine how much detail is displayed in the MemberList by specifying the inheritance level and deciding whether you want to view class, data type, and function return type for methods in your MemberList.

All member options are enabled by default and the default inheritance level is below AnyWin class, meaning that methods for any class derived from the AnyWin class display in the MemberList. For additional information about the inheritance level, see the General Options Dialog Box.

Note: Methods that are defined in and above the AnyWin class, such as Click and Exist, which are defined in the Winclass, will not display in the MemberList. You can type these methods into your script, but they will not display in the MemberList unless you change the inheritance level to All.

To customize your MemberList:

  1. Open Silk Test Classic and choose Options > General.
  2. In the AutoComplete area of the General Options dialog box, make sure MemberList is selected.
  3. In the MemberList Options area, select the members that you want to display in your MemberList. For example, if you want to view only properties and variables, uncheck the Methods and Window Children check boxes.
  4. Select the appropriate Inheritance Level for the selected methods. You can choose one of the following:
    Below AnyWin Class
    Displays methods for any class derived from the AnyWin class. Below AnyWin Class is the default.
    All
    Displays the complete inheritance for members all the way up through AnyWin and the control classes, including the Winclass.
    None
    Displays only those members defined in the class of the current object and window declaration.
  5. If you want to view attributes for the selected members, such as the class for window children, the data type for properties and variables, and the return type for method functions in your MemberList, check the Member Type check box. Member Type is not checked by default. The following is a sample MemberList with and without Member Type checked.
    Default MemberList MemberList with Member Type Selected
  6. Click OK on the General Options dialog box to save your changes.
Parent topic: Using Autocomplete
Related tasks
Setting General Options


Frequently Asked Questions about AutoComplete

Why isn’t AutoComplete working?

AutoComplete only works with 4Test files with extension .t, .g.t, and .inc. If (untitled) is displayed in the title bar of your 4Test file, the file has not been saved yet. Save the file as .t, .g.t, or .inc.

After a 4Test file is saved, AutoComplete recognizes any changes you make to this file in the 4Test Editor and include files that you reference through a 4Test use statement or the Use Files text box on the SilkTest Runtime Options dialog box. Once you save a new file as a .t, .g.t, or .inc, you do not need to save or compile in order to access newly defined functions, methods, or members.

AutoComplete does not work on comment lines or within plan, suite, or text files.

Why doesn't a member display in my MemberList?

There a few reasons you may not see a member in your MemberList. Here's what you should do:

  1. On the General Options dialog box, make sure that you chose to show members of this type in the MemberList Options section. For additional information, see Customizing your MemberList.
  2. Make sure the member you want to see is included in the inheritance level you selected. Below AnyWin class is the default; you might need to change your inheritance level to All. For additional information, see Customizing your MemberList.
  3. Name and save your file with a .t, .g.t, or .inc extension.
  4. Compile your file and fix any scripting errors. Anything following a compile error is not displayed in the MemberList or FunctionTip.

What happens if there is a syntax error in the current file?

Everything, based on the AutoComplete options you have selected, prior to the syntax error will display in your MemberList and/or FunctionTip. Anything following the syntax error will not display in your MemberList and/or FunctionTip. For additional information, see Customizing your MemberList.

What if I type something and AutoComplete does not find a match?

AutoComplete might not find a match for a number of reasons, for example because of the AutoComplete options you have specified or because of a compile error in your file. For information about fixing some of these issues, see Customizing your MemberList and Turning AutoComplete Options Off.

When AutoComplete does not find a match in the MemberList, focus remains on the first item in the list.

Note: If you perform any of the selection methods, which means if you press Return, Tab, or click, the item will be pasted to the Editor.

You can simply type any function, method, or member in your 4Test files; AutoComplete does not restrict you in any way from typing in 4Test files.

Note: You must dismiss the MemberList or FunctionTip before you can type in the Editor.

If you plan to use AutoComplete extensively, we recommend that you rename your identifiers in your window declarations. Knowing your identifier names helps, especially when working with long lists.

Why doesn’t list of record type display in the FunctionTip?

This is a known limitation. FunctionTip does not support list of record types.

Why does AutoComplete show methods that are not valid for a 4Test class?

When using AutoComplete, the member list occasionally may reveal methods that are not valid for the 4Test class. The compiler will not catch these usage problems, but at Runtime the following exception is raised when the script is played back: Error: Function <invalid method> is not defined for <window class>.

Why does AutoComplete show methods, properties, variables, and data types that are not supported for the Silk Test Agent that I am using?

AutoComplete does not distinguish between Silk Test Agents. As a result, AutoComplete displays all methods, properties, variables, and data types regardless of the Silk Test Agent that you are using. For example, if you are using the Open Agent, functions and data types that work only with the Classic Agent are also displayed when you use AutoComplete. For detailed information about which methods are supported for each Silk Test Agent, review the corresponding .inc file, such as the winclass.inc file.

Parent topic: Using Autocomplete
Related concepts
Overview of the Methods Supported by the Silk Test Agents
Related tasks
Setting General Options
Turning AutoComplete Options Off


Turning AutoComplete Options Off

This topic contains instructions on how to disable AppStateList, DataTypeList, FunctionTip, and MemberList.

To turn off AutoComplete options:

  1. Open Silk Test Classic and click Options > General.
  2. In the AutoComplete area of the General Options dialog box, uncheck the check box for each of the AutoComplete options that you want to disable, and then click OK.
Parent topic: Using Autocomplete
Related tasks
Setting General Options


Using AppStateList

To display a list of currently defined application states:

  1. Within your script, .t or .g.t, or within the include file, type your test case declaration, followed by the keyword appstate and then press space.

    For example testcase foo ( ) appstate .

    A list of currently defined application states displays. You can also type the keyword basedon followed by a space. For example appstate MyAppState () basedon .

  2. Use one of the following methods to select the appropriate member and paste it to the Editor.
    • Type the first letter or the first few letters of the member and then press Enter or Tab.
    • Use your arrow keys to locate the member and then press Enter or Tab.
    • Scroll through the list and click on a member to select it.
Parent topic: Using Autocomplete


Using DataTypeList

To display a list of built-in and user-defined data types:
  1. Within your script, .t or .g.t, or include file, type array or varargs, as appropriate, followed by the of keyword and a space. For example, list of. The current list of built-in and user-defined data types appears. You can also view the list of data types by pressing F11.
  2. Use one of the following methods to select the appropriate member and paste it to the Editor:
    • Type the first letter or the first few letters of the member and then press Enter or Tab.
    • Use your arrow keys to locate the member and then press Enter or Tab.
    • Scroll through the list and click on a member to select it.
Parent topic: Using Autocomplete


Using FunctionTip

To display the function signature for a function, test case, or method.
  1. Within your script, .t or .g.t, or include file, type the function, test case, or method name, followed by an open parenthesis " ( ". For example SetUpMachine(. The function signature displays in a tooltip with the first argument, if any, in bold text. The function signature includes the return argument type, pass-mode, data type, name of the argument, and null and optional attributes, as they are defined.
  2. Type the argument. The FunctionTip containing the function signature remains on top and highlights the argument you are expected to enter in bold text. As you enter each argument and then type a comma, the next argument that you are expected to type is highlighted. The expected argument is always indicated with bold text; if you backspace or delete an argument within your function, the expected argument is updated accordingly in the FunctionTip. The FunctionTip disappears when you type the close parenthesis " ) " to complete the function call.

If you want to dismiss the FunctionTip, press Escape. FunctionTip is enabled by default. See Turning AutoComplete Options Off if you want to disable FunctionTip.

Parent topic: Using Autocomplete
Related tasks
Turning AutoComplete Options Off


Using MemberList

This topic contains instructions on how to use MemberList to view and select a list of members.

To view a list of members:

  1. Customize the member list so that it displays the information you require.
    You can choose to display any or all of the following members:
    Member
    Description
    Window children
    Displays all window objects of type WINDOW that are defined in window declarations in the referenced .t, .g.t, and .inc files. Indicated in the MemberList with a yellow icon.
    Methods
    Displays all methods defined in the referenced .t, .g.t, and .inc files. Indicated in the MemberList with a blue icon.
    Properties
    Displays all properties defined in the referenced .t, .g.t, and .inc files. Indicated in the MemberList with a red icon.
    Variables
    Displays all defined variables in the referenced .t, .g.t, and .inc files, including native data types, data, and records. Fields defined for records and nested records also display in the list. Indicated in the MemberList with a red icon.
  2. Within your script or include file, type the member name and then type a period ( . ). For example Find..

    The MemberList displays. Depending on the MemberList Options and the Inheritance Level you select, the types of members that display in the MemberList will vary.

  3. Use one of the following methods to select the appropriate member and paste it to the Editor:
    • Type the first letter or the first few letters of the member and then press Enter or Tab.
    • Use your arrow keys to locate the member and then press Enter or Tab.
    • Scroll through the list and click on a member to select it.
The MemberList is case sensitive. If you type the correct case of the member, it is automatically highlighted in the MemberList; press Enter or Tab once to paste it to the Editor. If you do not type the correct case, the member has focus, but is not highlighted; press Enter or Tab twice to select the member and paste it to the Editor. To dismiss the MemberList, press Escape.
Parent topic: Using Autocomplete


Overview of the Library Browser

Click Help > Library Browser to access the Library Browser. It provides online documentation for:

  • Built-in 4Test methods, properties, and functions: the Library Browser shows the name and class of the method, one line of descriptive text, syntax, and a list of parameters, including a description.
  • User-defined methods: the Library Browser shows the name and class of the method, syntax, and a list of parameters. It displays User defined as the method description and displays the data type for each parameter.
  • User-defined Properties: As with user-defined methods, the description for user-defined properties by default is User defined.

The Library Browser does not, by default, provide documentation for your user-defined functions. You can add to the contents of the Library Browser to provide descriptive text for your user-defined methods, properties, and functions.

  • Library Browser Source File
    Describes the Library Browser source file.
  • Adding Information to the Library Browser
    Add information to the Library Browser to display the information online.
  • Add User-Defined Files to the Library Browser with Silk Test Classic
    Use Silk Test Classic to add user-defined files to the Library Browser.
  • Viewing Functions in the Library Browser
    Use the Library Browser to view information about built-in 4Test functions.
  • Viewing Methods for a Class in the Library Browser
    Use the Library Browser to view 4Testclass methods.
  • Examples of Documenting User-Defined Methods
    Provides examples of documenting user-defined methods.
  • Web Classes Not Displayed in Library Browser
    Describes why web classes may not display in the library browser.
  • Library Browser
    Describes the Library Browser.
Parent topic: Using Advanced Techniques with the Open Agent


Library Browser Source File

The core contents of the Library Browser are based on a standard Silk Test Classic text file, 4test.txt, which contains information for the built-in methods, properties, and functions.

You can edit 4test.txt to include your user-defined information, or define your site-specific information in one or more separate files, and then have Silk Test Classic compile the file (creating 4test.hlp) to make it available to the Library Browser. Information about methods in 4test.hlp is also used in the Verify Window dialog box for methods.

Silk Test Classic does not update 4test.txt with user-defined information; instead it populates the Library Browser from information it receives when include files are compiled in memory. You modify 4test.txt to override the default information displayed for user-defined objects.

Simply looking through 4test.txt should give you all the help you need about how to structure the information in the file. The following table lists all the keywords and describes how they are used in 4test.txt. You should edit a copy of 4test.txt to add the information you want.

Keywords

Keywords are followed by a colon and one or more spaces.

class
Name of the class.
function

Name of the function.

Specify the full syntax. If the function returns a value, specify: return_value = function_name (parameters)

Otherwise, specify: function_name (parameters)

group
Name of the function category.
method

Description of the method.

Specify the full syntax. If the method returns a value, specify: return_value = method_name (parameters)

Otherwise, specify: method_name (parameters)

notes
Description of the method, property, or function, up to 240 characters. Do not split the description into multiple notes fields, since only the first one is displayed.
parameter

Name and description of a method or function parameter. Each parameter is listed on its own line.

Specify the name, followed by a colon, followed by the description of the parameter.

property
Name of the property.
returns

Type and description of the return value of the method or function.

Specify the name, followed by a colon, followed by the description of the return value.

#
Comment.
Parent topic: Overview of the Library Browser


Adding Information to the Library Browser

  1. Make a backup copy of the default 4test.txt file, which is in the directory where you installed Silk Test Classic, and store your backup copy in a different directory.
  2. In an ASCII text editor, open 4test.txt in your Silk Test Classic installation directory and edit the file. See examples for methods, properties, and functions, if necessary.
  3. Quit Silk Test Classic.
  4. Place your modified 4test.txt file in the Silk Test Classic installation directory.
  5. Restart Silk Test Classic. Silk Test Classic sees that your source file is more recent than 4test.hlp and automatically compiles 4test.txt, creating an updated 4test.hlp. If there are errors, Silk Test Classic opens a window listing them and continues to use the previous 4test.hlp file for the Library Browser. If there were errors, fix them in 4test.txt and restart Silk Test Classic. Your new definitions are displayed in the Library Browser (assuming that the files containing the declarations for your custom classes, methods, properties, and functions are loaded in memory).

There is another approach to updating the Library Browser: maintain information in different source files.

If the Library Browser isn’t displaying your user-defined objects, close the Library Browser, recompile the include files that contain your user-defined objects, then reopen the Library Browser.

Parent topic: Overview of the Library Browser


Add User-Defined Files to the Library Browser with Silk Test Classic

  1. Create a text file that includes information for all your custom classes and functions, using the formats described in the Library Browser source file. If you have added methods or properties to built-in classes, you should add that information in the appropriate places in 4test.txt, as described above. Only document your custom classes and functions in your own help file.
  2. Click Options > General and add your help file to the list in the Help Files For Library Browser field. Separate the files in this list with commas.
  3. Click OK. Silk Test Classic recompiles 4test.hlp to include the information in all the files listed in the Help Files For Library Browser field. If there are errors, Silk Test Classic opens a window listing them and continues to use the previous 4test.hlp file for the Library Browser. If you had errors, fix them in your source file, then quit and restart Silk Test Classic. Silk Test Classic recompiles 4test.hlp using your modified source file.
Parent topic: Overview of the Library Browser
Related concepts
Library Browser Source File


Viewing Functions in the Library Browser

To view information about built-in 4Test functions in the Library Browser:

  1. Click Help > Library Browser, and then click the Functions tab.
  2. Select the category of functions you want in the Groups list box. To see all built-in 4Test functions, check the Include all check box. Functions are listed in the Functions list box.
  3. Select the function for which you want information.
Parent topic: Overview of the Library Browser


Viewing Methods for a Class in the Library Browser

4Test classes have methods and properties. When you select the Methods or Properties tabs in the Library Browser, you see a list of all the built-in and user-defined classes in hierarchical form.

To see the methods or properties for a class:

  1. Click Help > Library Browser, and then click the Methods or Properties tab.
  2. Select the class in the Classes list box. Double-click a + box to expand the hierarchy. Double-click a – box to collapse the hierarchy. The methods or properties for the selected class are displayed. By default, only those methods or properties that are defined by the class are displayed. To see all methods or properties that are available to the class (that is, methods or properties also defined by an ancestor of the class), select the Include inherited check box. To see all methods or properties (even those not available to the selected class), select the Include all check box.
  3. Select a method or property. Information about the selected method or property is displayed.

If the Library Browser is not displaying your user-defined objects, close the Library Browser, recompile the include files that contain your user-defined objects (Run > Compile), and then re-open the Library Browser.

Parent topic: Overview of the Library Browser


Examples of Documenting User-Defined Methods

This topic contains examples of adding user-defined methods, properties, and functions to the Library Browser.

#******************************************************
class:     DialogBox
...
#** custom method
method:    VerifyNumChild (iExpectedNum)
parameter: iExpectedNum: The expected number of child objects (INTEGER).
notes:     Verifies the number of child objects in a dialog box.

Documenting user-defined properties: Add the property descriptions to the appropriate class section in 4test.txt, such as:
#***********************************************
class:    DialogBox
...

#** custom property
property: iNumChild
notes:    The number of child objects in the dialog box.

Documenting user-defined functions: Create a group called User-defined functions and document your functions, such as:
group:     User-defined functions

function:  FileOpen (sFileName)
parameter: sFileName = "myFile": The name of the file to open.
notes:     Opens a file from the application.

function:  FileSave (sFileName)
parameter: sFileName = "myFile": The name of the file to save.
notes:     Saves a file from the application.
Parent topic: Overview of the Library Browser
Related tasks
Adding Information to the Library Browser
Add User-Defined Files to the Library Browser with Silk Test Classic


Web Classes Not Displayed in Library Browser

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Problem

The class hierarchy in the Library Browser does not include the Web classes, which are BrowserChild, HtmlText, and so on.

Possible Causes and Solutions

No browser extension is enabled.
Make sure that at least one browser extension is enabled.
Enhanced support for Visual Basic is enabled.
Disable Visual Basic by un-checking the ActiveX check box for the Visual Basic application in the Extension Enabler and Extensions dialog boxes.
Parent topic: Overview of the Library Browser
Related concepts
Troubleshooting Projects


Library Browser

Use Library Browser to quickly look up documentation for built-in and user-defined 4Test methods, properties, and functions.

Click Help > Library Browser.

Methods tab

Click the Methods tab to display information about the built in and user-defined 4test methods.

Classes list
Click the class to display. A list of methods for the class is displayed.
Include all
Check to view all the 4Test methods available for the selected class.
Methods list
Click the method to display. Detailed information is displayed about the selected method and class.
Include inherited
Check to view the inherited 4Test methods available for the selected class.

Properties tab

Click the Properties tab to display information about the built-in and user-defined properties.

Classes list
Click the class to display. A list of properties for the class is displayed.
Include all
Check to view all of the 4Test properties available.
Properties list
Click the property to display. Detailed information is displayed about the selected property and class.
Include inherited
Check to view the inherited 4Test properties available for the selected class.

Functions tab

Click the Functions tab to display information about the built-in and user-defined functions.

Groups list
Click the group to display. A list of functions for the selected group is displayed.
Include all
Check to view all of the 4Test methods available.
Functions list
Click the function to display. Detailed information is displayed about the selected group and function.
Parent topic: Overview of the Library Browser


Text Recognition Support

Text recognition methods enable you to conveniently interact with test applications that contain highly customized controls, which cannot be identified using object recognition. You can use text clicks instead of coordinate-based clicks to click on a specified text string within a control.

For example, you can simulate selecting the first cell in the second row of the following table:

Specifying the text of the cell results in the following code:
table.TextClick("Brian Miller")
Text recognition methods are supported for the following technology domains:
  • Win32.
  • WPF.
  • Windows Forms.
  • Java SWT and Eclipse.
  • Java AWT/Swing.
    Note: For Java Applets, and for Swing applications with Java versions prior to version 1.6.10, text recognition is supported out-of-the-box. For Swing applications with Java version 1.6.10 or later, which do not support Direct3D, you have to add the following command-line element when starting the application:
    -Dsun.java2d.d3d=false
    For example:
    javaw.exe -Dsun.java2d.d3d=false -jar mySwingApplication.jar
    Text recognition is not supported for Java Applets and Swing applications that support Direct3D.
  • Internet Explorer.
Note: Text recognition does not work with controls that are not visible on the screen. For example, you cannot use text recognition for a text that is scrolled out of view.
Note: Text recognition might not work if the font that is used in the target text is not installed on the machine on which the test is executed.

Text recognition methods

The following methods enable you to interact with the text of a control:
TextCapture
Returns the text that is within a control. Also returns text from child controls.
TextClick
Clicks on a specified text within a control. Waits until the text is found or the Object resolve timeout, which you can define in the synchronization options, is over.
TextRectangle
Returns the rectangle of a certain text within a control or a region of a control.
TextExists
Determines whether a given text exists within a control or a region of a control.

Text click recording

Text click recording is enabled by default. To disable text click recording, click Options > Recorder > Recording and uncheck the OPT_RECORD_TEXT_CLICK check box.

When text click recording is enabled, Silk Test Classic records TextClick methods instead of clicks with relative coordinates. Use this approach for controls where TextClick recording produces better results than normal coordinate-based clicks. You can insert text clicks in your script for any control, even if the text clicks are not recorded.

If you do not whish to record a TextClick action, you can turn off text click recording and record normal clicks.

The text recognition methods prefer whole word matches over partially matched words. Silk Test Classic recognizes occurrences of whole words previously than partially matched words, even if the partially matched words are displayed before the whole word matches on the screen. If there is no whole word found, the partly matched words will be used in the order in which they are displayed on the screen.

Example

The user interface displays the text the hostname is the name of the host. The following code clicks on host instead of hostname, although hostname is displayed before host on the screen:
control.TextClick("host")
The following code clicks on the substring host in the word hostname by specifying the second occurrence:
control.TextClick("host", 2)
Parent topic: Using Advanced Techniques with the Open Agent
Related reference
TextCapture Method (AnyWin)
TextClick Method (AnyWin)
TextExists Method (AnyWin)
TextRectangle Method (AnyWin)


Slowing Down Tests

This functionality is supported only if you are using the Open Agent.

Some applications under test might require extensive loading of application data in the UI, and might not be finished on time with loading objects that are required for replaying a test. To successfully replay tests on such an AUT, you can check for the existence of an object before performing an action on it, or you can add sleeps before performing an action.

Note: Micro Focus does not recommend generally adding sleeps to tests, because in most cases Silk Test Classic will automatically detect if an object is available, and sleeps might severely reduce the performance of tests.
  1. To check if an object is available in the AUT, use the Exists method. For example, to wait for six seconds for the button INPUT to become available, add the following line to your test script:
    WebBrowser.BrowserWindow.Input.Exists(6)
  2. To add a sleep before performing an action on a control, use the method. For example, to sleep for six seconds, add the following line to your test script:
    Sleep(6)
Parent topic: Using Advanced Techniques with the Open Agent
Related concepts
Page Synchronization for xBrowser


Testing Applications in Multiple UI Sessions on a Single Machine

This functionality is supported only if you are using the Open Agent.

To test applications in multiple UI sessions on a single machine or to test multiple agents on a single machine, connect to multiple Open Agent instances on the machine. Every agent runs in its own UI-session. A UI session can be a Remote Desktop Protocol (RDP) connection or a Citrix-based connection.

  1. Create the UI sessions.
  2. Open a command line window.
  3. Navigate to the folder /ng/MultiSessionLauncher in the Silk Test installation directory. For example, the default folder path might look like the following: C:\Program Files (x86)\Silk\SilkTest\ng\MultiSessionLauncher.
  4. In each UI session, execute the following command: MicroFocus.SilkTest.MultiSessionLauncher.exe <port>.
    Note: Use a unique port number, because this port will be used in your Silk Test Classic script to identify the Open Agent and the UI session in which the agent is running.
  5. Change your Silk Test Classic scripts to connect to the Open Agent instances. To connect to an Open Agent instance, add the following line to the script:
    HMACHINE hAgent = Connect("hostname:port")
    Where hostname is the name of the machine on which the agent is running, and port is the unique port that you have used to execute the launcher.
The resulting objects are independent of each other and can be used either in one thread or in multiple threads.
Note: If you want to launch an application in multiple UI sessions, you have to execute the base state for each UI session.
Note: To use TrueLog when testing applications in multiple UI sessions on a remote machine, you need to manually copy any generated TrueLog files from the remote machine to your local machine.

Example

Assume that the server machine that is hosting the UI sessions is named ui-srv. You can create three UI sessions by using the ports 22902, 22903, and 22904.

In the first session, open the command line window, navigate to the MultiSessionLauncher directory, and type the following:
 MicroFocus.SilkTest.MultiSessionLauncher.exe 22902

Do the same for the other two sessions with the respective ports 22903 and 22904.

To connect to the Open Agent instances, add the following code to your script:
HMACHINE hAgent1 = Connect("ui-srv:22902")
HMACHINE hAgent2 = Connect("ui-srv:22903")
HMACHINE hAgent3 = Connect("ui-srv:22904")
The following sample script prints a simple text to each of the three UI sessions:
[-] main()
    [ ] HMACHINE hAgent1 = Connect("ui-srv:22902")
    [ ] HMACHINE hAgent2 = Connect("ui-srv:22903")
    [ ] HMACHINE hAgent3 = Connect("ui-srv:22904")

    [ ] hAgent1->FindWindow("//Window").TypeKeys("Hello to session 1!")
    [ ] hAgent2->FindWindow("//Window").TypeKeys("Hello to session 2!")
    [ ] hAgent3->FindWindow("//Window").TypeKeys("Hello to session 3!")
Parent topic: Using Advanced Techniques with the Open Agent
Related reference
Rendezvous Statement
Machine Handle Operator


Running Tests and Interpreting Results

This section describes how you can run your tests and interpret the generated results.

  • Running Tests
    Describes how you can run your tests with Silk Test Classic.
  • Interpreting Results
    Describes how you can use the Difference Viewer, the results file, and the reports to interpret the results of your tests.
  • Analyzing Results with the Silk TrueLog Explorer
    Describes how you can analyze results with the Silk TrueLog Explorer.
  • Analyzing Bitmaps
    Describes how to analyze bitmaps with the Bitmap Tool.
  • Working with Result Files
    Describes how you can use result files to interpret the results of your tests.


Running Tests

This section describes how you can run your tests with Silk Test Classic.

  • Creating a Suite
    Describes how to create a suite.
  • Passing Arguments to a Script
    Describes how to pass arguments to a script.
  • Running a Test Case
    Describes how to run a test case.
  • Running a Test Plan
    Describes how to run a test plan.
  • Running the Currently Active Script or Suite
    Describes how to run the currently active script or suite.
  • Running Tests in Parallel
    Describes how you can execute tests in parallel on multiple browsers, mobile devices, or emulators.
  • Setting Replay Options for the Open Agent
    Set the replay options to optimize replaying tests with the Open Agent.
  • Stopping a Running Test Case Before it Completes
    Describes how to stop a running test case before it completes.
  • Setting a Test Case to Use Animation Mode
    Run a test case in animation mode to execute the test in slow motion for presentation purposes.
  • Run Application State Dialog Box
    Describes the Run Application State dialog box.
  • Run Testcase Dialog Box
    Describes the Run Testcase dialog box.
  • Runtime Status Dialog Box
    Describes the Runtime Status dialog box.
Parent topic: Running Tests and Interpreting Results


Creating a Suite

After you have created a number of script files, you might want to collect them into a test suite. A suite is a file that names any number of scripts. Instead of running each script individually, you run the suite, which executes in turn each of your scripts and all the test cases they contain. Suite files have a .s extension.

  1. Click File > New.
  2. Select the Suite radio button and click OK. An untitled suite file is displayed.
  3. Enter the names of the script files in the order you want them executed. For example, the following suite file executes the find.t script first, the goto.t script second, and the open.t script third:
    find.t
goto.t
open.t
  4. Click File > Save to save the file.
  5. If you are working within a project, you are prompted to add the file to the project. Click Yes if you want to add the file to the open project, or No if you do not want to add this file to the project.
Parent topic: Running Tests


Passing Arguments to a Script

You can pass arguments to a script. For example, you might want to pass in the number of iterations to perform or the name of a data file.

Arguments in 4Test are declared in the following two ways:
  • Explicitly, as a list of arguments for a test case. Only the test case has access to an explicit argument, not the entire script. For example:
    testcase MyTest1(STRING arg1, STRING arg2)
  Print("{arg1} {arg2}")
  • Implicitly, by using the GetArgs method inside a function or test case. GetArgs returns a list of strings with each string being one of the passed arguments. All functions and test cases in the script have access to these implicit arguments by calling GetArgs. For example:
    testcase MyTest2()
  LIST OF STRING args = GetArgs()
  ListPrint(args)

All arguments are passed in as strings, separated by spaces, such as: Bob Emily Craig

If an argument is more than one word, enclose it with quotation marks. For example, the following passes in three arguments: "Bob H" "Emily M" "Craig J"

You can specify arguments explicitly in one of the following ways:
  • In the Arguments field in the Run Test Case dialog box.
  • In Silk Central. Select the Properties tab of a Silk Test Classic test and specify the arguments by adding the Test data property with the arguments to the Test Properties section.
  • When you invoke Silk Test Classic from the command line.
You can specify arguments implicitly in one of the following ways:
  • In the Arguments field in the Runtime Options dialog box. To open the dialog box, click Options > Runtime in the menu bar.
  • After a script name in a suite file, for example find.t arg1 arg2.
  • When you invoke Silk Test Classic from the command line.
Note: If you pass arguments in the command line, the arguments provided in the command line are used and any arguments specified in the currently loaded options set are not used. To use the arguments in the currently loaded options set, do not specify arguments in the command line.

Example: Implicitly passed arguments

The following test case prints a list of all the implicitly passed arguments:

testcase ProcessArgs ( )
LIST OF STRING lsArgs
lsArgs = GetArgs ( )
ListPrint (lsArgs)

//You can also process the arguments individually. The following test case prints the second argument passed:
testcase ProcessSecondArg ( )
LIST OF STRING lsArgs
lsArgs = GetArgs ( )
Print (lsArgs[2])

//The following testcase adds the first two arguments:
testcase AddArgs ()
LIST OF STRING lsArgs
lsArgs = GetArgs ( )
NUMBER nArgSum

nArgSum = Val (lsArgs[1]) + Val (lsArgs[2])
Print (nArgSum)

You can use the Val function to convert the arguments, which are always passed as strings, into numbers.

When the arguments script 10 20 30 are passed to the scr_args.t script, the test result is:

Script scr_args.t (10, 20, 30) - Passed
Passed:  1 test (100%)
Failed:  0 tests (0%)
Totals:  1 test, 0 errors, 0 warnings

Testcase AddArgs - Passed

30
Parent topic: Running Tests
Related concepts
Starting Silk Test Classic from the Command Line
Related reference
Runtime Options Dialog Box


Running a Test Plan

Before running a test plan, make sure that the window declarations file for the test plan is correctly specified in the Runtime Options dialog box and that the test plan is in the active window.

  • To run the entire test plan, click Run > Run All Tests. Silk Test Classic runs each test case in the plan and generates a results file.

  • To run only tests that are marked, click Run > Run Marked Tests. Silk Test Classic runs each marked test and generates a results file.

You can also run a single test case without marking it.

If your test plan is structured as a master plan and associated sub-plans, Silk Test Classic automatically opens any closed sub-plans before running. Silk Test Classic always saves the suite, script, or test plan before running it if you made any changes to it since the last time you saved it. By default, Silk Test Classic also saves all other open modified files whenever you run a script, suite, or test plan. To prevent this automatic saving of other open modified files, uncheck the Save Files Before Running check box in the General Options dialog box.

To stop the execution of a test plan, press both Shift keys at the same time.

Parent topic: Running Tests
Related tasks
Setting General Options
Related reference
Runtime Options Dialog Box


Running the Currently Active Script or Suite

  1. Make sure the script or suite you want to run is in the active window.
  2. Choose Run > Run.
Silk Test Classic runs all the test cases in the script or suite and generates a results file.
Parent topic: Running Tests


Running Tests in Parallel

This functionality is supported only if you are using the Open Agent.

You can use multiple Partner processes to execute tests in parallel against multiple browsers or mobile devices. For example, you can use this functionality when executing test from a continuous integration server, or from Silk Central.

Silk Test supports parallel testing for the following browsers and platforms:
  • Google Chrome.
  • Mozilla Firefox.
  • Web, native, and hybrid apps on the following platforms:
    • Physical Android devices.
    • Android Emulators.
    • Physical iOS devices.

To enable parallel test replay, set the environment variable SILKTEST_ENABLE_PARALLEL_TESTING to true.

Note: Enabling parallel testing causes the Open Agent to handle each test-executing process separately. Applications which have been tested in one Silk Test client cannot be tested from another client, while the initial client is running. For example, you cannot test the same application alternating between Silk4J and JUnit.
Note: You cannot execute multiple test runs on the same mobile device at the same time. Before running tests in parallel, ensure that enough devices or emulators are available. Any test runs that get no mobile device or emulator assigned will fail.

Each parallel test run starts as a separate partner.exe or runtime.exe, which corresponds to one browser or mobile device. You can specify the browser or mobile device that you want to associate with a specific partner.exe or runtime.exe through the connection string. For additional information, see Connection String for a Mobile Device or Connection String for a Remote Desktop Browser .

The following image shows testing multiple browsers in parallel:

The following image shows testing multiple devices in parallel:

Multiple processes starting simultaneously might each try to start the Open Agent on the machine on which Silk Test Classic is running. Running the Open Agent multiple times on the same machine is not possible and will cause Silk Test Classic to throw an exception. To avoid this, ensure that the Open Agent is running before starting the parallel test runs.

The test results are stored in multiple TrueLog files, one for each test run. To ensure that the TrueLog files are not overwritten, you can add placeholders to the TrueLog file name. For additional information, see Setting TrueLog Options.
Note: If you are experiencing high memory consumption during testing, ensure that test results are saved in the compressed TLZ file format, and not in the XLG format.
Parent topic: Running Tests
Related reference
TrueLog Options - Open Agent Dialog Box


Setting Replay Options for the Open Agent

This functionality is supported only if you are using the Open Agent.

You can set the replay options to optimize replaying tests with the Open Agent.

  1. Click Options > Agent. The Agent Options dialog box appears.
  2. Click the Replay tab.
  3. Select a Replay mode from the list.
    • Default: Use this mode for the most reliable results. Each control uses the best method for the control type, by using either the mouse and keyboard (low level) mode or the API (high level) mode.
    • High level: Use this mode to replay each control using the API.
    • Low level: Use this mode to replay each control using the mouse and keyboard.
  4. To ensure that the window is active before a call is executed, check the Ensure window is active check box.
  5. Click OK.
Parent topic: Running Tests
Parent topic: Setting Silk Test Classic Options
Related concepts
Cross-Browser Testing with the Open Agent
Related tasks
Recording Test Cases for Standard and Web Applications
Recording Locators Using the Locator Spy
Configuring the Locator Generator for xBrowser
Setting WPF Classes to Expose During Recording and Playback
Setting Pre-Fill During Recording and Replaying


Stopping a Running Test Case Before it Completes

To stop running a test case before it completes:

  • If your test application is on a target machine other than the host machine, click Run > Abort.

  • If your test application is running on your host machine, press Shift+Shift.

Parent topic: Running Tests


Setting a Test Case to Use Animation Mode

To slow down a test case during playback so that it can be observed, set the test case to use animation mode. For instance, if you want to demonstrate a test case to someone else, you might want to use animation mode.

You can specify the animation mode when you run a test case, or you can specify the animation mode in the Runtime Options dialog.

To specify the animation mode using the Runtime Options dialog:

  1. From the main menu, click Options > Runtime.
  2. In the Runtime Options dialog, check the Animated Run Mode (Slow-Motion) check box.
  3. Click OK.
Parent topic: Running Tests
Related reference
Runtime Options Dialog Box


Run Application State Dialog Box

Use the Run Application State dialog box to run or debug an application state defined in your test frame file or active script file.

Click Run > Application State.

Application state
Displays the application states defined in the active frame or script file.
Run
Runs the selected application state.
Debug
Opens the file in which the application state resides and enters debugging mode. Debugging mode makes all the debugging commands available on the Breakpoint, Debug, and View menus.
Cancel
Closes the dialog box.
Parent topic: Running Tests
Related tasks
Testing the Ability of the Recovery System to Close the Dialog Boxes of Your Application


Run Testcase Dialog Box

Use the Run Testcase dialog box to run or debug a test case accessible from the active script file. This dialog box is only available when the active window contains either a test case or a results file in which the current line is a test case or a data-driven test case. Data-driven test cases begin with "DD_". You cannot run a test case with both arguments and rows.

Click Run > Testcase or Testplan > Detail > Specify Rows.

Testcase
Displays all the test cases accessible from the current script.
Arguments
Allows you to enter arguments to pass to the selected test case.
Animated Run Mode (Slow-Motion)
Check to wait one second after each interaction with the application under test is executed. Typically, you will only use this check box if you want to watch the test case run. For instance, if you want to demonstrate a test case to someone else, you might want to check this check box. Executions of the default base state and functions that include one of the following strings are not delayed:
  • BaseStateExecutionFinished
  • Connecting
  • Verify
  • Exists
  • Is
  • Get
  • Set
  • Print
  • ForceActiveXEnum
  • Wait
  • Sleep
Use Sample Data from Script
Check to run the test case once using the sample record for each table used by the test case. This is available only if the selected test case is a data-driven test case.
Enable TrueLog
To view results using the TrueLog Explorer, check the Enable TrueLog check box. This check box enables you to enable or disable TrueLog Explorer each time you run a test case. You can also check this check box in the TrueLog Options dialog box. When you enable or disable TrueLog Explorer in the Run Test Case dialog box, the same changes are made in the TrueLog Options dialog box. Likewise, when you enable or disable TrueLog Explorer in the TrueLog Options dialog box, the same changes are made in the Run Testcase dialog box.
TrueLog Options
Click to set the TrueLog options you want to record. By default, Silk Test Classic uses the options that were most recently specified in the TrueLog Options dialog box. Check the Enable TrueLog check box to enable this button.
Run
Runs the selected test case. For data-driven test cases, the argument must be in the test case record format. If the Arguments text box is empty, Run causes the test case to run all combinations of all rows in all tables used by the test case.
Debug
Opens the file in which the test case resides, enters debugging mode, and places a breakpoint at the first line of the test case. Debugging mode makes available all the debugging commands on the Breakpoint, Debug and View menus. If the Arguments list is empty, Debug runs the data-driven test case using all rows, but in debug mode. Since the default breakpoint is the testcase statement, by default the debugger skips DefaultRunDataDrivenTestCase() and stops at the test case with the first set of rows as input. The debugger acts as described for Debug in Run > Testcase, but with data-driven test cases only sets of selected rows are passed to the test case.
Cancel
Closes this dialog box.
Specify Rows
Opens the Specify Rows dialog box where you can select the rows you want to run from the tables for this data-driven test case. This is available only if you have selected Use Sample Data from Script for a data-driven test case.
Parent topic: Running Tests
Related concepts
Code Automatically Generated by Silk Test Classic
Running a Data-Driven Test Case
Related reference
Specify Rows Dialog Box


Runtime Status Dialog Box

By default, this dialog box automatically appears on the partner machine while executing a test case, script or test plan. To keep this status dialog box automatically hidden at runtime, click Options > Runtime and in the Execution area clear the Show Detailed Status Window check box. This dialog box is for status purposes only.

If you are running a script, test case or test plan on a target machine other than the host machine, you can safely close the Runtime Status dialog box once execution begins. To reopen this dialog box after closing it, or if it is hidden by default, click Run > Show Status. This menu option is available only if running a script, test case, or test plan.

This dialog box is display only.

Program
Lists the recent tasks the agent executed as defined in the script. As Silk Test Classic executes the plan the list will change. Only the first item listed will remain constant. That is, if a test plan is executed the name of that file will always appear at the top of the Program list. If you are running a test plan that is a masterplan, which means it includes other test plans, the masterplan name will always be the first item listed, not the sub-plans.
Elapsed
Lists how long it took to execute the corresponding task listed under Program. The first item in the list is the current cumulative time elapsed for the entire execution.
Errors
Lists how many errors occurred while executing the corresponding task listed in Program. The first item in the list is the current cumulative number of errors for the entire execution.
Current agent call
Displays the current function the agent is executing against the AUT.
Last error
Displays the last error encountered.
Parent topic: Running Tests


Interpreting Results

This section describes how you can use the Difference Viewer, the results file, and the reports to interpret the results of your tests.

  • Overview of the Results File
    Provides an overview of the results file.
  • Viewing Test Results
    View test results to see how many tests passed, how many failed, why tests failed, and summary information.
  • Errors And the Results File
    Provides an overview of errors and results file.
  • Viewing Differences
    If a verification fails, use the Difference Viewer to compare the expected value with the actual value.
  • Merging Test Plan Results
    Use the Merge Results dialog box to merge another result into the active test-plan results file.
  • How Does Silk Test Classic Synchronize Tests?
    Describes how Silk Test Classic performs test synchronization during replay.
  • Selecting which Results to Display
    Use the Select Results dialog box to select which result of a test to display.
  • Export Results Dialog Box
    Describes the Export Results dialog box.
  • View Options Dialog Box
    Describes the View Options dialog box.
  • Compare Two Results Dialog Box
    Describes the Compare Two Results dialog box.
Parent topic: Running Tests and Interpreting Results


Overview of the Results File

A results file provides information about the execution of the test case, script, suite, test plan, or keyword-driven test. By default, the results file has the same name as the executed script, suite, test plan, or keyword-driven test, but with a .res extension. For example, find.res.

Whenever you run tests, Silk Test Classic generates a results file, which indicates how many tests passed and how many failed, describes why tests failed, and provides summary information. You can invoke comparison tools from within the results file that pinpoint exactly how the runtime results differ from your known baselines. Test-plan results files offer additional features, such as the ability to compare different runs of the test plan. When Silk Test Classic displays a results file, on the menu bar it includes the Results menu, which allows you to manipulate the results file and locate errors. The Results menu appears only when the active window displays a results file.

TrueLog Explorer

Silk Test Classic also provides the TrueLog Explorer to help you analyze test results files. You must configure Silk Test Classic to use the TrueLog Explorer and specify what you want to capture.

Multiple User Environments

A .res file can be opened by multiple users, as long as no test is in process. This means you cannot have two users run tests at the same time and write to the same results file. You can run a test on the machine while the file is open on the other machine. However, you must not add comments to the file on the other machine, or you will corrupt the .res file and will not be able to report the results of the test. If you add comments to the file on both machines, the comments will be saved only for the file that is closed (and therefore saved) first.

Default Settings

By default, the results file displays an overall summary at the top of the file, including the following:
  • The name of the script, suite, test plan, or keyword-driven test.
  • The machine on which the tests were executed.
  • The amount of tests that were executed.
  • The amount of errors and warnings that were generated during the execution.
  • The actual errors that were generated.
  • Timing information.

To hide the overall summary, click the summary and click Results > Hide Summary. For a script or suite results file, the individual test summaries contain timing information and errors or warnings. For a test plan results file, the individual test summaries contain the same information as in the overall summary plus the name of the test case and script file.

While Silk Test Classic displays the most current version of the script, suite, or test plan, by default Silk Test Classic saves the last five sets of results for each script, suite, or test plan executed. To change the default number, use the Runtime Options dialog. As results files grow after repeated testing, a lot of unused space can accumulate in the files. You can reduce the size of a results file with the Compact menu option.

The format for the rest of a test plan results file follows the hierarchy of test descriptions that were present in the test plan. Test statements in the test plan that are preceded by a pound sign (#) as well as comments, which are using the comment statement, are also printed in the results file, in context with the test descriptions.

comment

To change the default name and directory of the results file, edit the Runtime Options dialog.

Note: If you provide a local or remote path when you specify the name of a results file in the Directory/Field field on the Runtime Options dialog, the path cannot be validated until script execution time.
Parent topic: Interpreting Results
Related concepts
TrueLog Explorer
Related reference
Runtime Options Dialog Box


Errors And the Results File

You can expand the text of an error message or have Silk Test Classic find the error messages for you. To navigate from a test plan test description in a results file to the actual test in the test plan, click the test description and select Results > Goto Source.

Navigating to errors in the script

There are several ways to move from the results file to the actual error in the script:

  • Double-click in the margin next to an error line to go to the script file that contains the 4Test statement that failed.
  • Click an error message and select Results > Goto Source.
  • Click an error message and press Enter.

What the box icon means

Some expanded error messages are preceded by a box icon and three asterisks.

If the error message relates to an application’s behavior, as in Verify selected text failed, Silk Test Classic opens the Difference Viewer. The Difference Viewer compares actual and expected values for a given test case.

Application appearance errors

When you click a box icon followed by a bitmap-related error message, the bitmap tool starts, reads in the baseline and result bitmaps, and opens a Differences window and Zoom window.

Bitmap tool

In the Bitmap Tool:

  • The baseline bitmap is the bitmap that is expected, which means the baseline for comparison.
  • The results bitmap is the actual bitmap that is captured.
  • The Differences window shows the differences between the baseline and result bitmap.

The Bitmap Tool supports several comparison commands, which let you closely inspect the differences between the baseline and results bitmaps.

Finding application logic errors

To evaluate application logic errors, use the Difference Viewer, which you can open by clicking the box icon following an error message relating to an application’s behavior.

The Difference viewer

Clicking the box icon opens the Difference Viewer’s double-pane display-only window. It lists every expected (baseline) value in the left pane and the corresponding actual value in the right pane.

All occurrences are highlighted where expected and actual values differ. On color monitors, differences are marked with red, blue, or green lines, which denote different types of differences, for example, deleted, changed, and added items.

When you have more than one screen of values or are using a black-and-white monitor, use Results > Next Result Difference to find the next difference. Use Update Expected Values, described next, to resolve the differences.

Updating expected values

You might notice upon inspecting the Difference Viewer or an error message in a results file that the expected values are not correct. For example, when the caption of a dialog changes and you forget to update a script that verifies that caption, errors are logged when you run the test case. To have your test case run cleanly the next time, you can modify the expected values with the Update Expected Value command.

Note: The Update Expected Value command updates data within a test case, not data passed in from the test plan.

Debugging tools

You might need to use the debugger to explore and fix errors in your script. In the debugger, you can use the special commands available on the Breakpoint, Debug, and View menus.

Marking failed test cases

When a test plan results file shows test case failures, you might choose to fix and then rerun them one at a time. You might also choose to rerun the failed test cases at a slower pace, without debugging them, simply to watch their execution more carefully.

To identify the failed test cases, make the results file active and select Results > Mark Failures in Plan. All failed test cases are marked and test plan file is made the active file.

Parent topic: Interpreting Results
Related concepts
Data-Driven Test Cases
Debugging Test Scripts
How Does Silk Test Classic Synchronize Tests?
Related tasks
Viewing Differences


Viewing Differences

If a verification fails, because the actual value is different to the expected value, you can use the Difference Viewer from the results file to compare the expected value with the actual value.

You can use Results > Next Result Difference to find the next difference and update the values using Results > Update Expected Value.

Note: The Difference Viewer does not work for remote agent tests, because the compared values must be available on the local machine.
  1. Move the mouse cursor over the error in the results file.
  2. Click Results > View Differences. You can also click on the red square that precedes the error message in the results file. The Difference Viewer appears, listing every expected (baseline) value in the left pane and the corresponding actual value in the right pane. Differences are marked with red, blue, or green lines, which denote different types of differences, for example deleted, changed, and added items.
  3. Compare the values in the Expected value and Actual value fields.
  4. If the error was caused by a wrong expected value, click Results > Update Expected Value to modify the expected value in the test case.
  5. Click Results > Next Result Difference in the menu to find the next difference.
Note: If the error message on which you click relates to the appearance of the application under test, for example when bitmaps have different sizes, Silk Test Classic opens the Bitmap Tool to compare the baseline and results bitmaps.
Parent topic: Interpreting Results
Related concepts
Errors And the Results File


Merging Test Plan Results

You can use the Merge Results dialog box to merge another result into the active test-plan result file.

A results file consists of a series of results sets, one set for each test plan run. Merging such results sets is useful when:

  • Sections of the test plan are run separately, either by one person or by several people, and you need to create a single report on the testing process. For example, let’s say that yesterday you ran a section of the test plan consisting of 20 tests and today you ran a different section of the test plan consisting of 10 tests. The merged results set would have today's date and would consist of the results of 30 tests.
  • A newer version of a test plan is updated with new tests or sub-plans and you want a single results set to reflect the execution of the original test plan along with the additional tests or sub-plans. For example, if yesterday you ran a test plan consisting of 20 tests and another test plan with 10 tests, and today you added the second test plan to the first test plan as a sub-plan, the merged results set of yesterdays runs would have yesterday's date and would consist of the results of 30 tests.
  1. Click Results > Merge.
    Note: This command is only available in the menu when a results file produced by running a test-plan is active in the editor.
    The Merge Results dialog box appears.
  2. Select the test plan result that you want to merge into the test plan results file. The selected result is merged into the active test plan results file. The date and time of the altered results set reflect the more recent test run.
Parent topic: Interpreting Results
Parent topic: Working with Result Files


How Does Silk Test Classic Synchronize Tests?

This functionality is supported only if you are using the Open Agent.

Many unexpected test failures are related to synchronization issues. Weak synchronization during test replay might generate false negative results, making it difficult to detect actual application problems. Synchronization errors are timing issues that heavily depend on the test environment, making these errors difficult to reproduce and solve. For example, a synchronization error that occurs in a specific test environment might never be reproduced in the development environment. Weak synchronization is one of the most common reasons for an automation project to get unmanageable with a growing set of automated tests.

Silk Test Classic provides automated test synchronization for all supported technologies, enabling you to build robust and manageable test sets. During the replay of a test, Silk Test Classic ensures that the test always waits until the AUT is ready to perform the next action. For a verification step in a test, Silk Test Classic ensures that any preceding actions in the test are completed before performing the verification.

To adapt your tests to the specific behavior of your AUT, you can change the values of the following synchronization timeouts:
Synchronization timeout (OPT_SYNC_TIMEOUT)
The maximum time in seconds that Silk Test Classic waits for the AUT to become ready during playback. The default value is 300 seconds.
Window timeout (OPT_WINDOW_TIMEOUT)
The maximum time in seconds that the Find method searches for a window. The default value is 5 seconds.
Window retry interval (OPT_WINDOW_RETRY)
If Silk Test Classic cannot immediately find a window, Silk Test Classic will retry to find the window until the window timeout expires. The window retry interval specifies the time in seconds that Silk Test Classic waits before retrying to find the window. The default value is 0.5 seconds.
Timeout to wait for an enabled window (OPT_OBJECT_ENABLED_TIMEOUT)
The maximum time in seconds that Silk Test Classic waits for a window to become enabled during playback. The default value is 1 second.
Note: The timeouts do not overlap.

For detailed information about the automated synchronization that Silk Test Classic provides specifically for Web applications, see Page Synchronization for xBrowser. For detailed information about the synchronization that Silk Test Classic provides specifically for Ajax applications, see How to Synchronize Test Automation Scripts for Ajax Applications.

In addition to the automated synchronization, Silk Test Classic also enables you to manually add wait functions to your scripts. Silk Test Classic provides the following wait functions for manual synchronization:
WaitForObject
Waits for an object that matches the specified locator. Works with an xPath locator or an object map identifier.
WaitForProperty
Waits until the property specified by the propertyName parameter gets the value specified by the expectedValue parameter or until the timeout is reached.
WaitForDisappearance
Waits until the object does not exist or until the timeout is reached.
WaitForChildDisappearance
Waits until the child object specified by the locator parameter does not exist or until the timeout is reached.

If a test randomly fails with an ObjectNotFoundException, increase the Window timeout, for example to 30 seconds. For very specific long running operations, for example a click on an object that displays after a long calculation with a progress dialog, manually add the WaitForObject method to the test script, to wait until the object is found, or add the WaitForDisappearance method to the test script, to wait until the progress dialog is no longer displayed.

Automated synchronization example

Consider the following code sample, where Silk Test Classic tries to click on a button with the caption Ok:

WINDOW button = Desktop.Find("//PushButton[@caption='ok'")
button.Click()
To replay the actions in this code sample, Silk Test Classic performs the following synchronization actions:
  1. Silk Test Classic tries to find the button. If the Window timeout runs out, Silk Test Classic stops the replay and throws an exception.
  2. Silk Test Classic waits until the application under test (AUT) is ready. If the Synchronization timeout runs out before the AUT is ready, Silk Test Classic stops the replay and throws an exception.
  3. Silk Test Classic waits until the button is enabled. If the Timeout to wait for an enabled window runs out before the button is enabled, Silk Test Classic stops the replay and throws an exception.
  4. Silk Test Classic clicks the button.
  5. Silk Test Classic waits until the application under test (AUT) is ready again.
Parent topic: Interpreting Results
Related concepts
Page Synchronization for xBrowser
Errors And the Results File
Related reference
Timing Tab
Synchronization Tab


Selecting which Results to Display

By default, Silk Test Classic saves the results of the last five executions of a script, suite, or test plan. You can use the Select Results dialog box to select which of these results to display.

Click Results > Select.
Note: To change the default number of results that are saved, click Options > Runtime to open the Runtime Options dialog box and edit the History Size option.
  1. Click Results > Select.
    Note: The Results menu is only available when the active window is a results window.
  2. Select the result that you want to display from the Results to view list.
  3. Optional: Add a comment to the selected result by typing the comment into the Comment field.
  4. Click OK.
Parent topic: Interpreting Results


Export Results Dialog Box

Use the Export Results dialog box to export your results to a structured file that is suitable for further processing by an application, such as a spreadsheet. This is only available when the active window is a results window.

Click Results > Export.

Filename area

Displays the path and name of the file to be created. The default path is based on the current directory and the default file name is based on the name of the .res file. Click Browse to open the Export Results File Name dialog box if you need help choosing a new path or name.

Fields to export area

Specifies all the fields available for export. Select the fields you want to export.

Export format area

Specifies how the fields are delimited in the file. Select a built-in delimited style in the Export Format list or select Custom and specify your own delimiters. If you select custom specify your delimiters in the appropriate boxes: Delimiter, Quote, Escape delimiter, and Escape quote. Default is Comma Delimited, Quoted Strings.

Write header

If checked, the following header information is included in the file: name of the results file, which fields were exported, and how the fields were delimited. Default is checked.

Write paths relative to results file

If checked, the name of the directory and file that stores the results file is included in the file. Silk Test Classic always assigns the extension .res to all results files.

Results to export area

Specifies which results to export. Click to select the results you want exported. To select more than one set, press the Ctrl key, then click each file you want to export. Default is the set currently displayed in the results window.

Parent topic: Interpreting Results


View Options Dialog Box

Use the View Options dialog box to specify which information you want displayed in the results window.

Click Results > View Options.

You must check the Log elapsed time, thread, and machine for each output line check box in the Runtime dialog box in order to use these options. Click Options > Runtime to set the option.

Display options area
select the information you want to display in the results window. You can select Elapsed time, Thread number, or Current machine.
Sort lines by area
Select how you want the results sorted. You can specify Elapsed time, Thread number, or Current machine.

When you click OK, the current results file displays the options that you specified.

Parent topic: Interpreting Results


Compare Two Results Dialog Box

Use to see results that have changed from a previous run of the testplan. Available only when a results file produced by running a testplan is the active window.

Click Results > Compare Two Results.

Parent topic: Interpreting Results


Analyzing Results with the Silk TrueLog Explorer

This section describes how you can analyze results with the Silk TrueLog Explorer (TrueLog Explorer).

For additional information about TrueLog Explorer, refer to the Silk TrueLog Explorer User Guide, located in (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Documentation or (in Microsoft Windows 10) Start > Silk.

  • TrueLog Explorer
    Describes the TrueLog Explorer.
  • TrueLog Limitations and Prerequisites
    Lists the limitations of using TrueLogs with Silk Test Classic.
  • Opening the TrueLog Options Dialog Box
    Describes how to open the TrueLog Options dialog box.
  • Setting TrueLog Options
    Set TrueLog options to customize the test result information that the TrueLog collects.
  • Toggle TrueLog at Runtime Using a Script
    Describes how to toggle TrueLog Explorer at runtime using a script.
  • Viewing Results Using the TrueLog Explorer
    Use the TrueLog Explorer to analyze test results files, capture screenshots before and after each action, and capture screenshots upon error.
Parent topic: Running Tests and Interpreting Results


TrueLog Explorer

The TrueLog Explorer helps you analyze test results files and can capture screenshots before and after each action, and when an error occurs. TrueLog Explorer writes the test result files and screenshots into a TrueLog file.

You can additionally use the Difference Viewer to analyze results for test cases that use the Open Agent.

You can enable or disable TrueLog Explorer:

  • For all test cases using the TrueLog Options dialog box.
  • Each time you run a specific test case using the Run Testcase dialog box.
  • At runtime using the test script.

When you enable or disable TrueLog Explorer in the Run Testcase dialog box, Silk Test Classic makes the same change in the TrueLog Options dialog box. Likewise, when you enable or disable TrueLog Explorer in the TrueLog Options dialog box, Silk Test Classic makes the same change in the Run Testcase dialog box.

Note: By default, TrueLog Explorer is enabled when you are using the Open Agent, and disabled when you are using the Classic Agent. When TrueLog Explorer is enabled, the default setting is that screenshots are only created when an error occurs in the script and only test cases with errors are logged.

For additional information about TrueLog Explorer, refer to the Silk TrueLog Explorer User Guide, located in (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Documentation or (in Microsoft Windows 10) Start > Silk.

Parent topic: Analyzing Results with the Silk TrueLog Explorer
Related reference
Agent Options
TrueLog Options - Open Agent Dialog Box


TrueLog Limitations and Prerequisites

When you are using TrueLog with Silk Test Classic, the following limitations and prerequisites apply:
Remote agents
When you are using a remote agent, the TrueLog file is also written on the remote machine.
Suites
TrueLog is not supported when you are executing suites.
Mixed-agent scripts
TrueLog is not supported when you are executing mixed-agent scripts, which are scripts that are using both agents.
Multiple-agent scripts
TrueLog is supported only for one local or remote agent in a script. When you are using a remote agent, the TrueLog file is also written on the remote machine.
Open Agent scripts
To use TrueLog Explorer with Open Agent scripts, set the default agent in the toolbar to the Open Agent.
Classic Agent scripts
To use TrueLog Explorer with Classic Agent scripts, set the default agent in the toolbar to the Classic Agent.
  • Why is TrueLog Not Displaying Non-ASCII Characters Correctly?
    Describes what you can do when non-ASCII characters are not correctly displayed in your TrueLog files.
Parent topic: Analyzing Results with the Silk TrueLog Explorer


Why is TrueLog Not Displaying Non-ASCII Characters Correctly?

TrueLog Explorer is a MBCS-based application, meaning that to be displayed correctly, every string must be encoded in MBCS format. When TrueLog Explorer visualizes and customizes data, many string conversion operations may be involved before the data is displayed.

Sometimes when testing UTF-8 encoded Web sites, data containing characters cannot be converted to the active Windows system code page. In such cases, TrueLog Explorer will replace the non-convertible characters, which are the non-ASCII characters, with a configurable replacement character, which usually is '?'.

To enable TrueLog Explorer to accurately display non-ASCII characters, set the system code page to the appropriate language, for example Japanese.

Parent topic: TrueLog Limitations and Prerequisites


Opening the TrueLog Options Dialog Box

Use the TrueLog options to enable the TrueLog Explorer and to customize the test result information that TrueLog collects.

  • To open the TrueLog Options dialog box from the main menu, click Options > TrueLog.
  • To open the TrueLog Options dialog box from a test case, click Run Testcase on the Basic Workflow bar. If the workflow bar is not visible, click Workflows > Basic to enable it. In the Run Testcase dialog box, check the Enable TrueLog check box and then click TrueLog Options.
Parent topic: Analyzing Results with the Silk TrueLog Explorer
Related reference
Basic Workflow for the Open Agent
TrueLog Options - Open Agent Dialog Box


Setting TrueLog Options

Use the TrueLog options to enable TrueLog and to customize the test result information that the TrueLog collects.

Logging bitmaps and controls in a TrueLog may adversely affect performance. Because capturing bitmaps and logging information can result in large TrueLog files, you may want to log test cases with errors only and then adjust the TrueLog options for test cases where more information is needed.

Note: To reduce the size of TrueLog files with Silk Test 17.5 or later, the file format for TrueLog files with the Open Agent has changed from .xlg to the compressed .tlz file format. Files with a .xlg suffix are automatically appended with a .tlz suffix. To parse result data from a .tlz file, you can unzip the .tlz file and parse the data from the included .xlg file. For the Classic Agent, the .xlg file format is used.
  1. Click Options > TrueLog to open the TrueLog Options dialog box.
  2. To capture TrueLog data and activate logging settings, check the Enable TrueLog check box and then choose to capture data for:
    All testcases
    Logs activity for all test cases, both successful and failed. This setting may result in large TrueLog files.
    Testcases with errors
    Logs activity only for test cases with errors. This is the default setting.
  3. In the TrueLog location field, type the name of and optionally the path to the TrueLog file, or click Browse and select the file. The path is relative to the machine on which the agent is running. The default path is the path of the Silk Test Classic project folder, and the default name is the name of the suite class, with a .tlz suffix. To ensure that TrueLog files are not overwritten, for example when you perform parallel testing, you can add placeholders to the TrueLog file name. These placeholders are replaced with the appropriate data at execution time.
    Note: The path is validated at execution time. Tests that are executed by Silk Central set this value to the Silk Central results directory to enable the screenshots to be shown in the result view.
  4. Only when you are using the Classic Agent, choose one of the following to set pre-determined logging levels in the TrueLog Presets section:
    Minimal
    Enables bitmap capture of desktop on error; does not log any actions.
    Default
    Enables bitmap capture of window on error; logs data for Select and SetText actions; enables bitmap capture for Select and SetText actions.
    Full
    Logs all control information; logs all events for browsers except for MouseMove events; enables bitmap capture of the window on error; captures bitmaps for all actions.

    If you enable Full logs and encounter a Window Not Found error, you may need to manually edit your script.

  5. Only when you are using the Classic Agent, in the Log the following for controls section, specify the types of information about the controls on the active window or page to log.
  6. Only when you are using the Classic Agent, in the Log the following for browsers section, specify the browser events that you want to capture.
  7. Specify the amount of time you want to allow Windows to draw the application window before a bitmap is taken.
    • When you are using the Classic Agent, specify the delay in the TrueLog Delay field.
    • When you are using the Open Agent, specify the delay in the Delay field in the Screenshot mode section.
    The delay can be used for browser testing. You can insert a Browser.WaitForReady call in your script to ensure that the DocumentComplete events are seen and processed. If WindowActive nodes are missing from the TrueLog, you need to add a Browser.WaitForReady call. You can also use the delay to optimize script performance. Set the delay as small as possible to get the correct behavior and have the smallest impact on script execution time. The default setting is 0.
  8. To capture screenshots of the application under test:
    • When you are using the Classic Agent, check the Enable Bitmap Capture check box and then choose to capture bitmaps.
    • When you are using the Open Agent, determine how Silk Test Classic captures screenshots in the Screenshot mode section.
  9. Only when you are using the Classic Agent, click the Action Settings tab to select the scripted actions you want to include in the TrueLog. When enabled, these actions appear as nodes in the Tree List view of the TrueLog.
  10. Only when you are using the Classic Agent, in the Select Actions to Log section, check the Enable check box to include the corresponding 4Test action in the log. Each action corresponds to a 4Test method, except for Click and Select.
  11. Only when you are using the Classic Agent, in the Select Actions to Log section, from the Bitmap list box, select the point in time that you want bitmaps to be captured.
  12. Click OK.
Parent topic: Analyzing Results with the Silk TrueLog Explorer
Related reference
Agent Options
TrueLog Options - Open Agent Dialog Box


Toggle TrueLog at Runtime Using a Script

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Toggle the TrueLog Explorer at runtime to analyze test results, capture screen-shots before and after each action, and capture screen-shots when an error occurs.

Use the test script to toggle TrueLog Explorer multiple times during the execution of a test case. For example, if you run a single test case to test multiple user interface menus, you can turn TrueLog on and off several times during the script to capture bitmaps for only a portion of the menus.

  1. Set the TrueLog Explorer options to define what you want the TrueLog Explorer to capture.
  2. Create or open the script that you want to modify.
  3. Navigate to the portion of the script that you want to turn on or off.
  4. To turn TrueLog off, type: SetOption(OPT_PAUSE_TRUELOG, TRUE).
  5. To turn TrueLog on, type: SetOption(OPT_PAUSE_TRUELOG, FALSE).
  6. Click File > Save to save the script.
Parent topic: Analyzing Results with the Silk TrueLog Explorer


Viewing Results Using the TrueLog Explorer

Use the TrueLog Explorer to analyze test results files, capture screenshots before and after each action, and capture screenshots upon error.

  1. Set the TrueLog Explorer options.
  2. Run a test case.
  3. Choose one of the following:
    • Click Results > Launch TrueLog Explorer.
    • Click the Explore Results button on the Basic Workflow or the Data Driven Workflow bars.
  4. On the Results Files dialog box navigate to the file name that you want to review and click Open.

By default, the results file has the same name as the executed script, suite, or test plan. To review a file in the TrueLog Explorer, open a .tlz file. To review a Silk Test Classic results file in Silk Test Classic, open a .res file.

Parent topic: Analyzing Results with the Silk TrueLog Explorer
Related tasks
Comparing Result Files
Related reference
Basic Workflow for the Open Agent
Data-Driven Workflow


Analyzing Bitmaps

This section describes how you can analyze bitmaps with the Bitmap Tool.

  • Overview of the Bitmap Tool
    Provides an overview of the Bitmap tool.
  • When to use the Bitmap Tool
    Describes when to use the Bitmap Tool.
  • Capturing Bitmaps with the Bitmap Tool
    Provides an overview of capturing bitmaps with the Bitmap Tool.
  • Comparing Bitmaps
    Provides an overview of comparing bitmaps with the Bitmap Tool.
  • Rules for Using Comparison Commands
    Contains rules for using comparison commands.
  • Bitmap Functions
    Provides an overview of bitmap functions.
  • Baseline and Result Bitmaps
    Describes how to compare bitmaps by designating a baseline and a result bitmap.
  • Zooming the Baseline Bitmap, Result Bitmap, and Differences Window
    Describes how to zoom the Baseline Bitmap, Result Bitmap, and Differences windows.
  • Looking at Statistics
    Describes how to look at statistics.
  • Exiting from Scan Mode
    Exit from the scan mode to return to the zoom mode.
  • Starting the Bitmap Tool
    Describes how to start the Bitmap Tool.
  • Using Masks
    Describes how you can use masks to exclude any part of a bitmap from comparison by the Bitmap Tool.
  • Analyzing Bitmaps for Differences
    Describes how you can analyze bitmaps for differences.
Parent topic: Running Tests and Interpreting Results


Overview of the Bitmap Tool

This topic contains a brief overview of the Bitmap Tool. To access more information about the Bitmap Tool, launch it and press F1 or choose Help > Help Topics.

The Bitmap Tool is an application that allows you to test and correct your Windows application’s appearance by comparing two or more bitmaps and identifying the differences between them. It is especially useful for testing inherently graphical applications, like drawing programs, but you can also check the graphical elements of other applications. For example, you might want to compare the fonts you expect to see in a dialog with the fonts actually displayed, or you might want to verify that the pictures in toolbar buttons have not changed.

It can be used as a stand-alone product, in which you create and compare bitmaps of entire windows, client areas, the desktop, or selected areas of the screen. More commonly, however, you use the tool in conjunction with Silk Test Classic. Bitmaps captured can be opened in the Bitmap Tool where you can compare them using the tool’s comparison features. Conversely, bitmaps captured by the bitmap tool can be compared by Silk Test Classic bitmap functions.

You can compare a baseline bitmap captured in the Bitmap Tool with one captured in a Silk Test Classic test case of your application.

  • If you write test cases by hand, you can use Silk Test Classic built-in bitmap functions.
  • If you prefer to record test cases through Record > Testcase, the Verify Window dialog box allows you to record a bitmap-related verification statement.

The Bitmap Tool can only recognize an operating system's native windows. In the case of the Abstract Windowing Toolkit (AWT), included with Sun Microsystems Java Development Kit (JDK), each control has its own window, since AWT controls are native Microsoft windows. As a result, the Bitmap Tool will only see the top level dialog box.

Parent topic: Analyzing Bitmaps
Related concepts
Starting the Bitmap Tool
Related reference
Bitmap Tool Menus


When to use the Bitmap Tool

You might want to use the Bitmap Tool in these situations:

  • To compare a baseline bitmap against a bitmap generated during testing.
  • To compare two bitmaps from a failed test.

For example, suppose during your first round of testing you create a bitmap using one of Silk Test Classic’s built-in bitmap functions, CaptureBItmap. Assume that a second round of testing generates another bitmap, which your test script compares to the first. If the testcase fails, Silk Test Classic raises an exception but cannot specifically identify the ways in which the two images differ. At this point, you can open the Bitmap Tool from the results file to inspect both bitmaps.

Parent topic: Analyzing Bitmaps
Parent topic: Tips
Related reference
CaptureBitmap Method


Capturing Bitmaps with the Bitmap Tool

You can capture bitmaps by embedding bitmap functions and methods in a test case or by using the Bitmap Tool. This section explains how to capture bitmaps in the Bitmap Tool.

Use the Capture menu to capture a bitmap for any of the following in your application:

  • A window.
  • The client area of a window, which means the working area, without borders or controls.
  • A selected rectangular area of the screen. This is especially useful for capturing controls within a window.
  • The desktop.
  • Capturing a Bitmap with the Bitmap Tool
    Describes how to capture a bitmap with the Bitmap Tool.
  • Capturing a Bitmap During Recording
    Describes how to capture a bitmap during recording.
  • Capturing All or Part of the Zoom Window in Scan Mode
    Describes how to capture the Zoom window in scan mode.
  • Saving Captured Bitmaps
    Describes how to save captured bitmaps.
Parent topic: Analyzing Bitmaps


Capturing a Bitmap with the Bitmap Tool

  1. Start the application in which you want to capture bitmaps and set up the window or area to capture.
  2. Start the Bitmap Tool.
  3. If you want to change the current behavior of the tool window, click Capture > Hide Window on Capture. By default, the tool window is hidden during capture.
  4. Choose a window or screen area to capture:
    Window
    Choose Capture > Window. Click the window you want to capture.
    Client area
    Choose Capture > Client Area. Click the client area you want to capture.
    Selected rectangular area
    Choose Capture > Rectangle.

    1. Move the mouse cursor to desired location to begin capture.

    2. While pressing and holding the left mouse button, drag the mouse to outline a rectangle, and then release the mouse button to capture it. During outlining, the size of the rectangle is shown in pixels.

    Desktop
    Click Capture > Desktop.

    The Bitmap Tool creates a new MDI child window containing the newly captured bitmap. The title bar reads Bitmap - (Untitled) and the status line at the bottom right of the window gives the dimensions of the bitmap (height by width), and the number of colors.

  5. Repeat steps 3 and 4 to capture another bitmap. Alternatively, open an existing bitmap file.
  6. Save the bitmap.

    Now you are ready to compare the two bitmaps or create a mask for the baseline bitmap.

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap tool, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

Parent topic: Capturing Bitmaps with the Bitmap Tool
Related tasks
Creating and Applying a Mask that Excludes All Differences
Related reference
Comparing Bitmaps


Capturing a Bitmap During Recording

  1. Open the dialog box by pointing at the object you want to capture and pressing Ctrl+Alt.
  2. Click the Bitmap tab.
  3. Enter a file name in the Bitmap File Name field. Use the Browse button to select a directory name. The default path is based on the current directory. The default file name for the first bitmap is bitmap.bmp. Click Browse if you need help choosing a new path or name.
  4. Choose whether to copy the Entire Window, Client Area of Window, or Portion of Window, and click OK. To capture a portion of the window, move the mouse cursor to the location where you want to begin. While pressing the left mouse button, drag the mouse to outline a rectangle, and then release the mouse button to capture the bitmap.

Silk Test Classic always adds a bitmap footer to the bitmap file. This means that the physical size of the bitmap will be slightly bigger than if you capture the bitmap in the Bitmap Tool. The bitmap footer always contains the window tag for a given bitmap.

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap tool, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

Parent topic: Capturing Bitmaps with the Bitmap Tool


Capturing All or Part of the Zoom Window in Scan Mode

  1. Make sure the Capture > Hide Window is unchecked. If necessary, select the item to uncheck the check mark.
  2. Click Next or Previous until the Zoom window contains the difference you want to capture.
  3. Perform one of the following actions to capture the desired part of the Zoom window:
    Entire Zoom window
    Press Ctrl+W and select the Zoom window.
    Client area of Zoom window
    Press Ctrl+A and select the Zoom window.
    Selected area of Zoom window
    Press Ctrl+R. Move the mouse cursor to desired location to begin capture. While pressing and holding the left mouse button, drag the mouse to the screen location to end capture, and release the mouse button.
  4. Optionally, you can fit the bitmap in its window, resize it, and save it.
Parent topic: Capturing Bitmaps with the Bitmap Tool


Saving Captured Bitmaps

You can, if you want, save the bitmaps you have captured in the Bitmap Tool. You should adopt a naming convention that helps you distinguish between the first bitmap in the comparison, called the baseline bitmap, and the second bitmap, called the result bitmap. You can make the distinction in the file name itself, for example, by appending or prefixing a b or r to the name and using the same file extension for all bitmap files. Or you might use the same file name for both baseline and result bitmaps and add a unique file extension.

Example

You save baseline and result bitmaps of the Open dialog box as open.bmp and open.rmp. Alternatively, you might name them openbase.bmp and openres.bmp, respectively.

The following table lists the file extensions supported by the Bitmap Tool. We recommend that you use .bmp for baseline bitmaps and .rmp for result bitmaps.

If you are saving | And you want the file name to be | Then use this extension
Baseline bitmap | Identical to the result bitmap’s | .bmp
Result bitmap | Identical to the baseline bitmap’s | .rmp
Either baseline or result bitmap | Unique | .bmp or .dib (Device Independent Bitmap)
Note: Silk Test Classic uses .rmp for bitmaps that are captured within a test case and fail verification.
Parent topic: Capturing Bitmaps with the Bitmap Tool


Comparing Bitmaps

The Bitmap Tool can create and graphically locate the differences between two bitmaps. You can use all Windows functionality to resize, save, and otherwise manipulate bitmaps, in addition to the special comparison features included in the tool.

Using the Bitmap Tool, you can:

  • Show the areas of difference.
  • Zoom in on the differences.
  • Jump from one zoomed difference to the next.
  • View on-line statistics about the bitmaps.
  • Edit (copy and paste), print, and save bitmaps.
  • Create masks.
The Bitmap Tool has the following major comparison commands:
Command
Description
Show
Creates a Differences window, which is a child window containing a black-and-white bitmap. Black represents areas with no differences and white represents areas with differences.
Zoom

Creates a special, not sizable, Zoom window with three panes and resizes and stacks the Baseline, Differences, and Result windows.

  • The top pane of the Zoom window contains a zoomed portion of the Baseline window.
  • The middle pane shows a zoomed portion of the Differences window.
  • The bottom pane shows a zoomed portion of the Result window.

All three zoomed portions show the same part of the bitmap. When you move the mouse within any of the three windows, the Bitmap Tool generates a simultaneous and synchronized real-time display in all three panes of the Zoom window.

While in scan mode, you can capture the Zoom window to examine a specific bitmap difference.

Scan
The tool indicates the location of the first difference it finds by placing a square in the same relative location of the Baseline, Result, and Differences windows. The three panes of the Zoom window also show the difference.
Comparison Statistics
Provides statistics about the bitmaps.
You can also compare bitmaps by creating and applying masks.
Parent topic: Analyzing Bitmaps
Related tasks
Creating and Applying a Mask that Excludes All Differences


Rules for Using Comparison Commands

You should be familiar with the following rules before using the commands:

  • If you are comparing two new bitmaps captured in the tool, designate one bitmap as the baseline, the other as the result bitmap.
  • If you are comparing two existing, saved bitmaps, open first the bitmap that you consider the baseline. The tool automatically designates the first bitmap you open as the baseline, and the second as the result.
  • The commands must be used in this order: Show, Zoom, and Scan.
Parent topic: Analyzing Bitmaps


Bitmap Functions

CaptureBitmap, SYS_CompareBitmap, WaitBitmap, and VerifyBitmap are built-in bitmap-related 4Test functions. In particular, VerifyBitmap is useful for comparing a screen image during the execution of a test case to a baseline bitmap created in the Bitmap Tool. If the comparison fails, Silk Test Classic saves the actual bitmap in a file. In the following example, the code compares the test case bitmap (the baseline) against the bitmap of TestApp captured by VerifyBitmap:

TestApp.VerifyBitmap ("c:\sample\testbase.bmp")
Parent topic: Analyzing Bitmaps
Related reference
CaptureBitmap Method
SYS_CompareBitmap Function
WaitBitmap Method
VerifyBitmap Method


Baseline and Result Bitmaps

To compare two bitmaps, you must designate one bitmap in the comparison as the baseline and the second bitmap as the result. While you may have many bitmap files open in the Bitmap Tool, at any one time only one bitmap can be set as the baseline and one as the result. If you want to set new baseline and result bitmaps, you must first un-set the current assignments.

These designations are temporary and at any time you can set and reset a bitmap as a baseline, result, or neither.

  • Designating a Bitmap as a Baseline
    Designate a bitmap as a baseline to compare it with a result bitmap.
  • Designating a Bitmap as a Results File
    Designate a bitmap as a results file to compare it with a baseline.
  • Un-Setting a Designated Bitmap
    Un-set a designated bitmap to set a new designated bitmap.
Parent topic: Analyzing Bitmaps


Designating a Bitmap as a Baseline

To designate a bitmap as a baseline:
In the Bitmap Tool, click Bitmap > Set Baseline. The Set Baseline menu item is checked. The title bar of the child window changes to Baseline Bitmap -- filename.bmp.
Parent topic: Baseline and Result Bitmaps


Designating a Bitmap as a Results File

To designate a bitmap as a results file:
In the Bitmap Tool, click Bitmap > Set Result. The Set Result menu item is checked. The title bar of the child window changes to Result Bitmap -- filename.rmp.
Parent topic: Baseline and Result Bitmaps


Un-Setting a Designated Bitmap

Uncheck the menu item. For example, to un-set a baseline bitmap, uncheck Bitmap > Set Baseline. The check mark is removed.

Uncheck the menu item. For example, to un-set a baseline bitmap, uncheck Bitmap > Set Baseline. The check mark is removed.
Parent topic: Baseline and Result Bitmaps


Zooming the Baseline Bitmap, Result Bitmap, and Differences Window

Choose Differences > Show and then Differences > Zoom.

The tool arranges the Baseline Bitmap on top, the Result Bitmap on the bottom, and the Differences window in the middle. To the right of these, the tool creates a Zoom window with three panes, arranged like the bitmap windows

Parent topic: Analyzing Bitmaps
Related concepts
Zooming in on the Differences


Looking at Statistics

The Differences > Comparison Statistics command displays information about the baseline and result bitmaps, with respect to width, height, colors, bits per pixel, number of pixels, and the number and percentage of differences (in pixels).

  • Viewing Statistics by Comparing the Baseline Bitmap and the Result Bitmap
    Compare the baseline bitmap and the result bitmap to view statistics.
Parent topic: Analyzing Bitmaps


Viewing Statistics by Comparing the Baseline Bitmap and the Result Bitmap

To view statistics by comparing the baseline bitmap and the result bitmap:

Click Differences > Comparison Statistics. The Bitmap Comparison Statistics window opens.
Note: The number of colors is derived from the following formula: number of colors = 2 ^ (bits per pixel).
Parent topic: Looking at Statistics


Exiting from Scan Mode

To exit from the scan mode:
Click Differences > Scan. Exiting scan leaves the tool in zoom mode.
Parent topic: Analyzing Bitmaps


Starting the Bitmap Tool

This section lists the locations from which you can start the Bitmap Tool.

  • Starting the Bitmap Tool from its Icon and Opening Bitmap Files
    Start the Bitmap Tool from its icon to open bitmap files or to capture new bitmaps.
  • Starting the Bitmap Tool from the Results File
    Describes how to start the Bitmap Tool from the results file.
  • Starting the Bitmap Tool from the Run Dialog Box
    Describes how to start the Bitmap Tool from the Run dialog box.
Parent topic: Analyzing Bitmaps


Starting the Bitmap Tool from its Icon and Opening Bitmap Files

  1. Click (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Tools > Silk Test Bitmap Tool or (in Microsoft Windows 10) Start > Silk > Silk Test Bitmap Tool. The Bitmap Tool window displays.
  2. Do one of the following:
    Open an existing bitmap file
    Click File > Open and specify a file in the Open dialog box. See Overview of Comparing Bitmaps.
    Capture a new bitmap
    See Capturing a Bitmap in the Bitmap Tool.
Parent topic: Starting the Bitmap Tool
Related concepts
Comparing Bitmaps
Related tasks
Capturing a Bitmap with the Bitmap Tool


Starting the Bitmap Tool from the Results File

When the verification of a bitmap fails in a test case, Silk Test Classic saves the actual result in a bitmap file with the same name as the baseline bitmap but with the extension .rmp. So, if the bitmap file testbase.bmp fails the comparison, Silk Test Classic names the result bitmap file testbase.rmp. It also logs an error message in the results file.

Note: In some cases this error message does not reflect an actual error. In particular, when Silk Test Classic compares a bitmap it captured with one captured in the Bitmap Tool, the comparison fails because Silk Test Classic stores footer information in its bitmap. The bitmaps might in fact be identical in all ways except for this information.

To compare the actual bitmap generated by the test case against the baseline bitmap generated by the bitmap tool or one of Silk Test Classic’s built-in functions, click the box icon preceding the error message.

Silk Test Classic opens the bitmap tool, opens both the baseline bitmap, which is the expected bitmap as a .bmp file, and the result bitmap, which is the actual bitmap as a .rmp file, creates a Results/View Differences and places it in between the baseline bitmap and the result bitmap. The right portion of the tool displays a three-paned Zoom window.

Parent topic: Starting the Bitmap Tool


Starting the Bitmap Tool from the Run Dialog Box

  1. Click Start > Run. The Run dialog box displays.
  2. Type the pathname of the tool’s executable file and any parameters in the Command Line field and click OK. The Bitmap Tool starts. Any bitmaps you specified on the command line are opened.
  3. See Overview of Comparing bitmaps.
  4. If you did not specify any files in the command line, go to the next step. You can now open existing bitmaps created in Silk Test Classic or in the tool, or you can capture new bitmaps.
  5. Do one of the following:
    Open an existing bitmap file
    Click File > Open and specify a file in the Open dialog box. See Overview of Comparing Bitmaps.
    Capture a new bitmap
    See Capturing a Bitmap in the Bitmap Tool.
Parent topic: Starting the Bitmap Tool
Related concepts
Comparing Bitmaps
Related tasks
Capturing a Bitmap with the Bitmap Tool


Using Masks

A mask is a bitmap that you apply to the baseline and result bitmaps in order to exclude any part of a bitmap from comparison by the Bitmap Tool. For example, if you are testing a custom object that is painted on the screen and one part of the object is variable, you might want to create a mask to filter out the variable part from the bitmap comparison.

You might consider masking any differences that you decide are insignificant or that you know will vary in an effort to avoid test case failure. For example, suppose a test case fails because one bitmap includes a flashing area of a dialog box. In the Bitmap Tool you can block the flashing area from the two bitmaps by creating and applying a mask to them. Once a mask is applied and the masked bitmaps are saved, the mask becomes a permanent part of the baseline bitmaps you are comparing. Masks can also be saved in separate files and used in test cases.

You can create a mask in two ways:
  • By converting the Differences window to a mask. A mask created this way filters out all differences.
  • By opening a new mask window and specifying rectangular areas to mask.

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap tool, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

  • Prerequisites for the Masking Feature
    Lists the prerequisites for the masking feature.
  • Applying a Mask
    Describes how to apply a mask.
  • Editing an Applied Mask
    Describes how to edit an applied mask.
  • Creating and Applying a Mask that Excludes Some Differences or Just Selected Areas
    Create and apply a mask to exclude some differences or selected areas.
  • Creating and Applying a Mask that Excludes All Differences
    Create and apply a mask to exclude all differences.
  • Saving a Mask
    Describes how to save a mask.
Parent topic: Analyzing Bitmaps


Prerequisites for the Masking Feature

Before using the masking feature, you must:

  • Capture or open two bitmaps to compare. Set baselinesetbaseline and resultsetresult bitmaps, if currently un-set.
  • Determine which sections you need to mask. Use one or more comparison featurescomparisoncmds, if necessary, to locate bitmap differences.
Parent topic: Using Masks


Applying a Mask

  1. Open the mask bitmap file and click Bitmap > Set Mask.
  2. Click Edit > Apply Mask.

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap tool, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

Parent topic: Using Masks


Editing an Applied Mask

You can edit a mask after it has been applied:

  • To add to the mask, place the mouse cursor in the baseline bitmap window at the position where you want to begin adding to the mask. Click and drag the mouse cursor to outline a rectangle. Then release the left mouse button.
  • To delete part of the mask, place the mouse cursor in the baseline bitmap window at the position where you want to begin deleting part of the mask. While pressing and holding the Shift key, drag the mouse cursor over the area of the existing map that you want to delete, and then release the Shift key and the left mouse button.
Parent topic: Using Masks


Creating and Applying a Mask that Excludes Some Differences or Just Selected Areas

  1. Click Edit > New Mask. The bitmap tool creates an empty Mask Bitmap child window that is the same size as the baseline bitmap.
  2. Using the Differences window to help you locate differences, place the mouse cursor in the baseline bitmap window at the position where you want to begin creating the mask. As you press and hold the left mouse button, drag the mouse cursor to outline a rectangle. Then release the left mouse button. The rectangular outline in the baseline map changes to a filled-in rectangle. The mask bitmap window also contains a like-sized rectangle in the same relative location.
  3. Repeat step the previous step until you have completed the mask.
  4. If you want to delete a portion of the mask, place the mouse cursor in the baseline bitmap window at the position where you want to begin editing. While pressing the Shift key and then the left mouse button, drag the mouse cursor over the area of the existing map that you want to delete, and then release the Shift key and the left mouse button.

    The area of the mask overlapped by the rectangle outline disappears in both the baseline and mask bitmap window.

  5. Choose Edit > Apply Mask. The bitmap tool applies the mask to the result bitmap and closes the Differences window.
  6. Choose one of the following actions:
    Keep the baseline and result bitmaps with the mask applied
    Save the bitmap files. The mask is now a permanent part of the bitmap files.
    Unapply the mask
    Close the mask bitmap window. Saving is optional.
    Keep the mask as it is
    Save the mask file.
    Edit the mask
    Choose File > Save and close the mask bitmap window. This un-applies the mask.

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap tool, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

Parent topic: Using Masks


Creating and Applying a Mask that Excludes All Differences

  1. Click Differences > Show to open a Differences window, if one is not already open.
  2. Click Differences > Convert to Mask. A message is displayed: Bitmaps are now identical on screen.
  3. Click OK. The bitmap tool creates an untitled mask bitmap from the Differences window, swapping black and white, and applies the mask to the baseline and result bitmaps.
  4. Choose one of the following actions:
    Keep the baseline and result bitmaps with the mask applied
    Save the bitmap files. The mask is now a permanent part of the bitmap files.
    Unapply the mask
    Close the mask bitmap window. Saving is optional.
    Keep the mask as it is
    Save the mask file.
    Edit the mask
    Choose File > Save and close the mask bitmap window. This un-applies the mask.

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap tool, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

Parent topic: Using Masks


Saving a Mask

Masks can be saved in a file, applied to the baseline and result bitmaps for you to examine on screen only, or applied to and saved in the baseline and result bitmap files. Once masks are applied and saved, they become a permanent part of the baseline and result bitmaps. The advantage of saving the mask alone is that later you can read in the mask file and apply it to the bitmap on screen, thus allowing you to keep the bitmap in its original state.

You can supply the name of a mask bitmap file (as well as its associated baseline bitmap file) as an argument to bitmap functions.

The Bitmap Tool supports the .msk file extension for mask files. Alternatively, you can designate a mask in the file name and use the generic .bmp extension. We recommend, however, that you use the .msk extension.

The following bitmap-related functions accept mask files as arguments:

  • GetBitmapCRC
  • SYS_CompareBitmap
  • VerifyBitmap
  • WaitBitmap

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap tool, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

Parent topic: Using Masks
Related concepts
Bitmap Functions
Related reference
CaptureBitmap Method
WaitBitmap Method
VerifyBitmap Method
Comparing Bitmaps


Analyzing Bitmaps for Differences

This section describes how you can analyze bitmaps for differences.

  • Scanning Bitmap Differences
    Scan bitmap differences.
  • Showing Areas of Difference
    Describes how to show areas of difference.
  • Graphically Show Areas of Difference Between a Baseline and a Result Bitmap
    Use the Bitmap Tool to graphically show differences between a baseline and a result bitmap.
  • Moving to the Next or Previous Difference
    Use the scan mode to move to the next or previous difference.
  • Zooming in on the Differences
    Describes how to zoom in on differences between bitmaps.
Parent topic: Analyzing Bitmaps


Scanning Bitmap Differences

To scan the differences between the baseline and result bitmaps:

Click Differences > Scan or Differences > Next. The tool indicates the location of the first difference it finds by placing a square in the same relative location of the Baseline, Result, and Differences windows. The three panes of the Zoom window also show the difference.
Parent topic: Analyzing Bitmaps for Differences


Showing Areas of Difference

The Show command creates a Differences window which is a child window containing a black-and-white bitmap. Black represents areas with no differences and white represents areas with differences.

Parent topic: Analyzing Bitmaps for Differences


Graphically Show Areas of Difference Between a Baseline and a Result Bitmap

To graphically show the differences between a baseline and a result bitmap:
Click Differences > Show. The Bitmap Tool displays a Differences window along with the source baseline and result bitmaps from which it was derived.
Parent topic: Analyzing Bitmaps for Differences


Moving to the Next or Previous Difference

You must first create a Differences window and a Zoom window using Differences > Show and Differences > Zoom.

The Scan command on the Differences menu automates zoom mode and causes the bitmap tool to scan for differences from left to right and top to bottom. When the first difference is found, a small square, 32 x 32 pixels, is shown in the Baseline Bitmap, Result Bitmap, and Differences Bitmap windows in the same relative location. In addition, that location is shown in all three panes in the Zoom window.

Click Differences > Next or Differences > Previous.
Parent topic: Analyzing Bitmaps for Differences


Zooming in on the Differences

The Zoom command creates a special, not sizable, Zoom window with three panes and resizes and stacks the Baseline, Differences, and Result windows.

  • The top pane of the Zoom window contains a zoomed portion of the Baseline Bitmap window.
  • The middle pane shows a zoomed portion of the Differences window.
  • The bottom pane shows a zoomed portion of the Result Bitmap window.

All three zoomed portions show the same part of the bitmap. When you move the mouse within any of the three windows, the bitmap tool generates a simultaneous and synchronized real-time display in all three panes of the Zoom window.

While in scan mode, you can capture the Zoom window to examine a specific bitmap difference.

Parent topic: Analyzing Bitmaps for Differences
Related tasks
Zooming the Baseline Bitmap, Result Bitmap, and Differences Window


Working with Result Files

This section describes how you can use result files to interpret the results of your tests.

  • Attaching a Comment to a Result Set
    Describes how to attach a comment to a result set.
  • Comparing Result Files
    Describes how to compare result files.
  • Customizing results
    Describes how to customize results.
  • Deleting Results
    Use the Delete Results dialog box to delete results.
  • Change the default number of result sets
    Describes how to change the default number of result sets.
  • Changing the Colors of Elements In the Results File
    Describes how to change colors of elements in the results file.
  • Fix incorrect values in a script
    Describes how to fix incorrect values in a script.
  • Marking Failed Test Cases
    Describes how to mark failed test cases.
  • Merging Test Plan Results
    Use the Merge Results dialog box to merge another result into the active test-plan results file.
  • Navigating to errors
    Describes how to navigate to errors.
  • Viewing an individual summary
    Describes how to view an individual summary.
  • Storing and Exporting Results
    Describes how to store and to export results.
  • Storing results
    Describes how to store results.
  • Extracting Results
    Extract results in an unstructured ASCII text format to view these results in a new editor window, to send these results to a printer, or to store these results in a new file.
  • Exporting Results
    Export results to a structured file for further manipulation.
  • Displaying a different set of results
    Describes how to display a different set of results.
  • Removing the Unused Space from a Result File
    Describes how to remove the unused space from a result file.
  • Logging Elapsed Time, Thread, and Machine Information
    Describes how to log elapsed time, thread, and machine information.
Parent topic: Running Tests and Interpreting Results


Attaching a Comment to a Result Set

You can attach comments to individual result sets to record useful information about the test run:

  1. Open the result file.
  2. Click Results > Select to display the Select Results dialog.
  3. Select the result set to which you want to attach a comment.
  4. Type the comment in the Comment text field at the bottom of the dialog. The comment displays in the Comment column in the Select Results dialog.
  5. Click OK.

Silk Test Classic displays the comments in the various dialogs that list results sets, such as the Extract Results and Delete Results dialogs.

Parent topic: Working with Result Files


Comparing Result Files

The Compare Two Results command allows you to quickly note only the results that have changed from a prior run without having to look at the same errors over again. The command identifies differences based on the following criteria:

  • A test passes in one test plan run and fails in the other.
  • A test fails in both runs but the error is different.
  • A test is executed in one test plan run but not in the other.

Silk Test Classic uses the test descriptions as well as the test statements to identify and locate the various cases in the test plan. Therefore, if you change the descriptions or statements between runs, Silk Test Classic will not be able to find the test when you run Compare Two Results.

  1. Open two results files.
  2. Make the results set you want to compare to another results set the active window.
  3. Choose Results > Compare Two Results.
  4. On the Compare Two Results dialog, select a results set from the list box and click OK.
  5. When the results set is displayed again, a colored arrow is positioned in the left margin for every test that is different.

    A red arrow indicates that the difference is due to the pass/fail state of the test changing.

    A magenta arrow indicates that the difference is due to the addition or removal of the test in the compared test run.

  6. Click Results > Next Result Difference to search for the next difference or choose Results > Next Error Difference to search for the next difference that is due to the change in a pass/fail state of a test.

Silk Test Classic uses the test descriptions as well as the script, testcase, and testdata statements to identify and locate the various cases in the test plan and in the results set. When test results overlap in the two results set that were merged, the more recent run is used. If you change a test description between runs or modify the statements, Silk Test Classic might be unable to find the test when you try to merge results. Silk Test Classic places these orphaned tests at the top of the results set.

Parent topic: Working with Result Files
Related tasks
Viewing Results Using the TrueLog Explorer


Customizing results

You can modify the way that results appear in the results file as follows:

  • Change the colors of elements in the results file

  • Change the default number of results sets

  • Display a different set of results

  • Remove the unused space in a results file

You can also view an individual summary.

Parent topic: Working with Result Files


Deleting Results

You can use the Delete Results dialog box to delete results.

  1. Click Results > Delete.
    Note: This menu is only available when a results file is active.
    Silk Test Classic displays the Delete Results dialog box.
  2. Select the result that you want to delete from the list. The most current results set displayed first.
  3. Click OK.
Parent topic: Working with Result Files


Change the default number of result sets

  1. Click Options > Runtime. The Runtime Options dialog box displays.
  2. In the History Size field, change the number to the number of results files you want.
    Note: By default, five result sets are kept.
Parent topic: Working with Result Files


Changing the Colors of Elements In the Results File

  1. In Silk Test Classic, click Options > Editor Colors to display the Editor Colors dialog.
  2. Select an element from the Editor Item list box.
  3. Select one of the 16 colors from the palette or modify the RGB values of the selected color. To modify RGB value, select the color. Slide the bar to the left or right, click the spin buttons, or type specific RGB values until you get the color you want.
  4. When you are satisfied with the color, click OK.

To revert to the default colors, click Reset. By default, these results file elements are displayed in the following colors:

Results file element | Default color/icon
Error messages and warnings | Red plus sign (bold on black-and-white monitor)
Warnings only | Purple plus sign
Test descriptions of executed tests | Dark blue
Test descriptions of unexecuted tests | Grayed out
Other descriptive lines | Black
Parent topic: Working with Result Files
Related tasks
Setting the Editor Colors


Fix incorrect values in a script

  1. Make the results file active.
  2. Click Results > Update Expected Value.
  3. Optionally, select Run > Testcase in order to run the test and confirm that it now passes. The expected values in the script are replaced with the actual values found at runtime.
Parent topic: Working with Result Files


Marking Failed Test Cases

When a test plan results file shows test case failures, you might choose to fix and then rerun them one at a time. You might also choose to rerun the failed test cases at a slower pace without debugging them to watch their execution more carefully.

Make the results file active and click Results > Mark Failures in Plan.

All failed test cases are marked and the test plan is made the active file.

Parent topic: Working with Result Files


Navigating to errors

To find and expand the next error or warning message in the results file, choose Edit > Find Error. To skip warning messages and find error messages only, in the Runtime Options dialog, uncheck the check box labeled Find Error stops at warnings.

You can also use the Find, Find Next, and Go to Line commands on the Edit menu to navigate through a results file.

To expand an error message to reveal the cause of an error, click the red plus sign preceding the message. In addition to the cause, you can see the call stack which is the list of 4Test functions executing at the time the error occurred.

There are several ways to move from the results file to the actual error in the script:

  • Double-click the margin next to an error line to go to the script file that contains the 4Test statement that failed.

  • Click an error message and choose Results > Goto Source.

  • Click an error message and press Enter.

To navigate from a testplan test description in a results file to the actual test in the testplan, click the test description and click Results > Goto Source.

Parent topic: Working with Result Files
Related reference
Runtime Options Dialog Box


Viewing an individual summary

  1. Click a testcase line in a suite or script results file, or click a test description in a testplan results file.
  2. Click Results > Show Summary.
Parent topic: Working with Result Files


Storing and Exporting Results

You can store and export results in the following ways:

  • Store results in an unstructured ASCII format.
  • Export results to a structured file for further manipulation.
Parent topic: Working with Result Files


Storing results

Silk Test Classic allows you to extract the information you want in an unstructured ASCII text format and send it to a printer, store it in a file, or look at it in an editor window.

To store results in an unstructured ASCII format

  1. Click Results > Extract.
  2. In the Extract To group box on the Extract Results dialog, select the radio button for the destination of the extracted output: Window (default), File, or Printer.
  3. In the Include group box, check one or more check boxes indicating which optional text, if any, to extract. (This optional text is in addition to the output selected in the Expand group box.) The choices are:
  4. Select a radio button in the Expand group box indicating which units to extract information about. Select Scripts, Scripts and Testcases (default), or Anything with Errors.
  5. Select one or more results sets from the Results to Extract group box.
  6. Click OK.
Parent topic: Working with Result Files
Related tasks
Extracting Results


Extracting Results

Use the Extract Results dialog box to extract results in an unstructured ASCII text format.

  1. Click Results > Extract. This menu is only available if the active file is a results file.
  2. Select the destination of the extracted output.
    • To view the extracted results in a new editor window, select Window.
    • To store the extracted results in a new file, select File.
    • To send the extracted results to a printer, select Printer.
    The default setting is Window.
  3. Select which information you want to extract.
    • To extract only script information, select Scripts.
    • To extract script and test case information, select Scripts and testcases.
    • To extract all error information, select Anything with errors.
    The default setting is Scripts and testcases.
  4. Optional: Specify which optional text to extract.
    • Check the Output text check box to extract the output of sprint statements.
    • Check the Error text check box to extract text generated by the LogError and ExceptLog functions.
    • Check the Summary text check box to extract the description of which tests passed and failed and the number of errors that were produced by failed tests.
  5. Select the results that you want to extract from the Results to extract list. To select more than one result, press Ctrl and click each file you want to extract. The default result is the result that is currently displayed in the results window.
  6. Click OK.
Parent topic: Working with Result Files


Exporting Results

You can use the Export Results dialog box to export your results to a structured file that is suitable for further processing by an application, such as a spreadsheet.

Write header

If checked, the following header information is included in the file: name of the results file, which fields were exported, and how the fields were delimited. Default is checked.

Write paths relative to results file

If checked, the name of the directory and file that stores the results file is included in the file. Silk Test Classic always assigns the extension .res to all results files.

Results to export area

Specifies which results to export. Click to select the results you want exported. To select more than one set, press the Ctrl key, then click each file you want to export. Default is the set currently displayed in the results window.

  1. Click Results > Export. This menu is only available when the active window is a results window. The Export Results dialog appears.
  2. Specify the file name. The default path is based on the current directory and the default file name is based on the name of the .res file. To select a file, click Browse and navigate to the file in the Export Results File Name dialog box.
  3. Optional: Check the corresponding check boxes in the Fields to export area to specify the fields that you want to export to the file.
  4. Optional: In the Export format area, specify how you want the fields delimited in the file.
    The default is to comma delimit the fields and to put quotation marks around strings. Select Custom to specify your own delimiters.
  5. Optional: To include header information in the file, check the Write header check box. Header information contains the name of the results file, which fields were exported, and how the fields were delimited.
  6. Optional: To include the directory and file that stores the results file in the file, check the Write paths relative to the results file check box.
  7. Select the results that you want to export from the Results to export list. By default, the results set that is currently displayed in the results window is extracted.
  8. Click OK. The information is saved in a delimited text file. You can import that file into an application that can process delimited files, such as a spreadsheet.
Parent topic: Working with Result Files


Displaying a different set of results

  1. Click Results > Select. Silk Test Classic displays the Select Results dialog with the most current results set displayed first.
  2. Select the set of results you want to see and click OK.
Parent topic: Working with Result Files


Removing the Unused Space from a Result File

  1. Open a result file.
  2. Click Results > Compact. The file size is reduced.
Parent topic: Working with Result Files


Logging Elapsed Time, Thread, and Machine Information

Using the Runtime Options dialog box, you can specify that you want to log the elapsed time, the thread number, and the current machine information during execution. This information is then written to the results file where you can display and sort it. For example, if you encounter nested test cases in the results files because you use multi-threading, check this check box to record thread number information in your results file. Then, you can sort the lines in your results file by the thread numbers to better navigate within the nested test cases.

  1. Click Options > Runtime to open the Runtime Options dialog box.
  2. In the Results area, check the log elapsed time, thread, and machine for each output line check box.
  3. Click OK.
Parent topic: Working with Result Files
Related reference
Runtime Options Dialog Box


Debugging Test Scripts

Errors encountered during playback can be caused by a variety of factors, such as changes in the application under test (AUT), improper test step flow, or environmental changes. Quickly diagnosing and fixing these errors using debugging features minimizes test maintenance and allows a more efficient team testing effort.

Silk Test Classic automatically raises an exception in response to many of errors or inconsistencies in your scripts and your keyword-driven tests. However, some problems might cause a script or a keyword-driven test to work in unexpected ways without generating an exception. To solve such problems, use the debugger.

Debugging enables you to manage, examine, reset, or step through the actions in a script or keyword-driven test. While debugging, you can specify breakpoints to stop the execution before or after a specific action, and you can examine the values of any local and global variables. You can also enter expressions to evaluate. This lets you identify exactly where an error might be occurring.

You can also use the debugger to find problems in your application under test (AUT). Use the debugging facilities to step through the application and to determine the exact location where a problem occurs.

To start debugging, open the test script or the keyword-driven test script in the editor and click Run > Debug in the Silk Test Classic menu. You can also click Debug in the toolbar.

The debugger enables you to view the results of your testing in the following ways:

  • View the debugging transcript when you debug a script. For additional information, see Viewing the Debugging Transcripts. Silk Test Classic records the error information and the output of any print statements in the transcript instead of into a results file.
  • Examine the debugging variables while you are debugging a test script. For additional information, see Viewing Variables.
  • View the call stack. The call stack is a description of all function calls that are currently active in the script which you are debugging. By viewing the call stack, you can trace the flow of execution, which might uncover errors generated by an erroneous flow of control in the script. To view the current call stack, choose View > Call Stack in the Silk Test Classic menu. Silk Test Classic displays the call stack in a new window. To return to the script being debugged, press F6 or choose View > Module and select the script from the list.

You cannot use the debugger from plan (*.pln) files, however, you could call test cases from a main() function and debug the test cases from there.

Note: You cannot modify files while you are using the debugger. To fix a problem in a file, stop the debugger by clicking Debug > Exit in the Silk Test Classic menu.
  • Designing and Testing with Debugging in Mind
    Describes how to design and how to test scripts to ensure that the scripts can be easily debugged at a later point in time.
  • Executing a Script in the Debugger
    Describes how to execute a test script or a keyword-driven test script in the debugger.
  • Debugging a Test Script
    Start the debugger to debug your test scripts.
  • Debugger Menus
    Describes the additional menus that are available during debugging.
  • Stepping Into and Over Functions
    Describes how to step into and over functions during debugging.
  • Working with Scripts During Debugging
    Describes how to work with scripts during debugging.
  • Exiting the Debugger
    Describes how to exit the debugger.
  • Breakpoints
    Describes breakpoints.
  • Viewing Variables
    Describes how to view variables during debugging.
  • Changing the Value of a Variable
    Describes how to change the value of a variable.
  • Globals Dialog Box
    Describes the Globals dialog box.
  • Locals Dialog Box
    Describes the Locals dialog box.
  • Expressions
    Describes how you can work with expressions during debugging.
  • Enabling View Trace Listing
    Describes how to enable view trace listing.
  • Viewing a List of Modules
    Describes how to view a list of modules during debugging.
  • View Module Dialog Box
    Describes the View Module dialog box.
  • Viewing the Debugging Transcripts
    View the debugging transcripts to see error information.
  • Transcript Dialog Box
    Describes the Transcript dialog box.
  • Call Stack Dialog Box
    Describes the Call Stack dialog box.
  • Debugging Tips
    Provides tips that might help you in debugging your tests.
Related concepts
Viewing Variables


Designing and Testing with Debugging in Mind

Designing and testing a script to facilitate debugging might significantly reduce test maintenance costs. The following suggestions might help you create debuggable scripts:

  • Plan for debugging and robustness when you are designing a script, by having your functions check for valid input and output, and by performing operations in the script that inform you if a problem occurs.
  • Test each function while you write it, by building it into a small script that calls the function with test arguments and performs some functional validation. When you have finished the coding of a script, you can use the debugger to step through the execution of each function in the script.
  • To find errors in control loops, test each routine with the full range of valid data values, including the highest and lowest valid values.
  • Test each routine with invalid values to ensure that the routine rejects such values without crashing.
  • Test each routine with null (empty) values. Depending on the purpose of the script, it might be useful to provide default values if the input is incomplete.
Parent topic: Debugging Test Scripts


Executing a Script in the Debugger

Once you have set one or more breakpoints in your test script or your keyword-driven test script, perform the following actions to execute the script:

  1. In the Silk Test Classic menu, click Debug > Run. Silk Test Classic executes the script until it reaches the line in which the first breakpoint is located, until an error occurs, or until the script ends. A blue arrow marks the line where Silk Test Classic stopped running the script.
  2. Click Debug > Continue. Silk Test Classic executes the script until it reaches the line in which the first breakpoint is located, until an error occurs, or until the script ends.
  3. Perform the following actions as required:
    • Click Debug > Step Into to execute the current line in the active script or in a file that is called by the active script. This action is available only if the execution has stopped at a breakpoint. If the current line contains a function call, control passes into the function and the execution stops at the first statement in the function.
    • Click Debug > Step Over to execute the current line of code in the active script or in a file that is called by the active script, without stepping into any functions called by the current line. The execution stops at the next statement. This action is available only if the execution has stopped at a breakpoint.
    • Click Debug > Run to Cursor to execute the script until the line containing the cursor.
    • Click Debug > Finish Function to execute the script until the current function returns.
Parent topic: Debugging Test Scripts


Debugging a Test Script

Start the debugger to debug your test scripts.

Note: You cannot modify files while you are using the debugger. To fix a problem in a file, stop the debugger by clicking Debug > Exit in the Silk Test Classic menu.
  1. To debug a script that is not currently active in the editor, click File > Debug.
    • To debug the active script, click Run > Debug. Silk Test Classic enters the debugger and pauses without setting a breakpoint.
    • To debug a specific test case from the active script, click Run > Testcase. Then select a test a test case from the Run Testcase dialog, and click Debug. Silk Test Classic enters the debugger and sets a breakpoint at the first line of the test case.
    • To debug an application state, click Run > Apllication State. Then select an application state from the Run Application State dialog box, and click Debug. Silk Test Classic enters the debugger and sets a breakpoint at the first line of the application state definition.
    • To debug a plan file, call the test cases in the plan file from a main() function and debug the plan file from there from there. You cannot use the debugger from plan files (*.pln).
  2. If you want to debug a script that is not currently active in the editor, select the script file from the Debug dialog box. Silk Test Classic enters the debugger and pauses without setting a breakpoint.
  3. Click Open. Silk Test Classic performs the following actions:
    • Opens the selected script file in debugging mode.
    • Marks the current line, which is the next line to be executed, with a triangle.
    • Changes the menu item from Run to Continue.
    • When script execution completes, a message box displays indicating that the script has terminated.

During script execution, Silk Test Classic displays a transcript window, which is similar to the results window. Unlike the results file, however, the output from debugging a script is not saved in a file, there are no statistics, and all the information is expanded automatically. The transcript window contains the script name, the test case names, and a list of the errors encountered and their line numbers. At the bottom of the transcript window is a text field in which you can enter any statement to execute. The results of each statement you execute appear in the transcript window.

Special debugging commands are available.

Parent topic: Debugging Test Scripts


Debugger Menus

In debugging mode, the menu bar includes the following three additional menus:

  • The commands in the Debug menu enable you to control the flow of the script.
  • The commands in the Breakpoint menu enable you to add or remove breakpoints.
  • The commands in the View menu enable you to view various elements of the running script, for example local and global variables, the call stack, and breakpoints, and to evaluate expressions.
Parent topic: Debugging Test Scripts
Related reference
Debug Menu
Breakpoint Menu
View Menu


Stepping Into and Over Functions

To locate a bug in your code you can divide the script into discrete functions and debug each function separately. One way to do this is with the following commands on the Debug menu:

Step Into
Step through the function one line at a time, executing the current line in the active script or in a file that is called by the active script. This action is available only if the execution has stopped at a breakpoint. If the current line contains a function call, control passes into the function and the execution stops at the first statement in the function.
Step Over
Speed up debugging if you know a particular function is bug-free, executing the current line of code in the active script or in a file that is called by the active script, without stepping into any functions called by the current line. The execution stops at the next statement. This action is available only if the execution has stopped at a breakpoint.
Finish Function
Execute the script until the current function returns. Silk Test Classic sets the focus at the line where the function returns. Try using Finish Function in combination with Step Into to step into a function and then run it.
Parent topic: Debugging Test Scripts


Working with Scripts During Debugging

To run the script you are debugging
Click Debug > Run. The script runs until a breakpoint is hit, an error occurs, or it terminates.
To reset a script
Click Debug > Reset. This frees memory, frees all variables, and clears the call stack. The focus will be at the first line of the script.
To stop execution of a running script
Press Shift+Shift when running a script on the same machine or choose Debug > Abort when running a script on a different machine.
Parent topic: Debugging Test Scripts


Exiting the Debugger

You can leave the debugger whenever the execution is stopped.

To exit the debugger, click Debug > Exit in the Silk Test Classic menu.

Parent topic: Debugging Test Scripts


Breakpoints

A breakpoint is a line in the script where execution stops so that you can check the script’s status. The debugger lets you stop execution on any line by setting a breakpoint. A breakpoint is denoted as a large red bullet.

One useful way to debug a script is to pause it with breakpoints, observe its behavior and check its state, then restart it. This is useful when you are not sure what lines of code are causing a problem.

During debugging, you can:

  • Set breakpoints on any executable line where you want to check the call stack.
  • Examine the values in one or more variables.
  • See what a script has done so far.

You cannot set breakpoints on blank lines or comment lines.

  • Setting Breakpoints
    Describes how to set breakpoints during debugging.
  • Viewing Breakpoints
    Describes how to view a list of breakpoints.
  • Deleting Breakpoints
    Describes how to delete breakpoints.
  • Add Breakpoint Dialog Box
    Describes the Add Breakpoint dialog box.
  • Delete Breakpoint Dialog Box
    Describes the Delete Breakpoint dialog box.
  • Breakpoint Dialog Box
    Describes the Breakpoint dialog box.
Parent topic: Debugging Test Scripts


Setting Breakpoints

During debugging, you can set breakpoints on most lines in the script except for blank lines or comment lines.

Setting a breakpoint on the first line of a function or test case

  1. In the Silk Test Classic menu, click Breakpoint > Add.
  2. Double-click a module name to list the functions, which are declared in the module, in the Function list.
  3. Double-click a function name in the Function list to set a breakpoint on the first line of that function.

Setting a breakpoint on a line in a function or test case

Do one of the following:

  • Double-click in the left margin of the line.
  • Click on the line where you want to set a breakpoint, right-click, and select Toggle Breakpoint.
  • Place the cursor on the line where you want to set a breakpoint and choose Breakpoint > Toggle in the Silk Test Classic menu.

Setting a breakpoint on a specific line in a script

  1. In the Silk Test Classic menu, click Breakpoint > Add.
  2. In the Breakpoint field, type the number of the line on which you want to set a breakpoint. For example entering 8 sets a breakpoint on the eighth line of the script.
  3. Click OK.

Setting temporary breakpoints

Click Debug > Run To Cursor to set a temporary breakpoint, which is indicated by a hollow red circle in the left margin of the line where the cursor is located. When the script is executed the next time in debugging mode, the script execution stops at the marked line and the breakpoint is cleared.

Parent topic: Breakpoints


Viewing Breakpoints

To view a list of all the breakpoints in a script, click View > Breakpoints.
Parent topic: Breakpoints


Deleting Breakpoints

You can delete breakpoints in any of the following ways:

All breakpoints

  1. Click Breakpoint > Delete All.

  2. Click Yes.

An individual breakpoint

Place the cursor on the line where the breakpoint is set and click Breakpoint > Toggle .

or

Double-click in the left margin of the line

One or more breakpoints

  1. Click Breakpoint > Delete.

  2. Select one or more breakpoints from the list box and click OK.

Parent topic: Breakpoints


Add Breakpoint Dialog Box

Use to add a breakpoint at any executable line of a function. This is available only in debugging mode.

Click Breakpoint > Add.

Breakpoint
Type the name of a new breakpoint.
Module
Displays all currently loaded scripts and include files. Click on an item from this list and a list of the file’s functions and test cases display in the Function list.
Function
Displays all functions and test cases from the module you selected at the Module field. Select the function that you want to enter a breakpoint into.
Parent topic: Breakpoints
Related concepts
Breakpoints
Debugging Test Scripts


Delete Breakpoint Dialog Box

Use the Delete Breakpoint dialog box to delete one or more breakpoints. This is available only in debugging mode.

Click Breakpoint > Delete.

Breakpoints

Lists all breakpoints from the current file by name. Select a breakpoint and then click OK to delete it.

Parent topic: Breakpoints


Breakpoint Dialog Box

Use to view breakpoints in the current script file. You must be in debug mode to access this option.

Click View > Breakpoints.

Parent topic: Breakpoints


Viewing Variables

To view a list of all the local variables that are in scope (accessible) from the current line, including their values, choose View > Local Variables.

To view a list of global variables, choose View > Global Variables. The variables and their values are listed in a new window.

If a variable is uninitialized, it is labelled <unset>.

If a variable has a complex value, like an array, Silk Test Classic might need to display its result in collapsed form. To expand or collapse the display, click View > Expand Data and View > Collapse Data in the Silk Test Classic menu or double-click the plus (+) icon.

To return to the script being debugged, press F6 or choose View > Module and select the script from the list.

Parent topic: Debugging Test Scripts


Changing the Value of a Variable

To change the value of an active variable, select the variable and type its new value in the Set Value field.

While viewing variables, you can also change their values to test various scenarios.

When you resume execution, Silk Test Classic uses the new values.

Parent topic: Debugging Test Scripts


Globals Dialog Box

Use to view all global variables that are in scope (accessible) from the current source line and their current values. This is available only while Silk Test Classic is in debugging mode.

Click View > Global Variables.

Set Value

Type a new value for the selected variable. A script must be running for the value to be set.

List of variables

Appears in alphabetical order. If a variable is uninitialized, Silk Test Classic labels it <unset>. If a variable has a complex value, like an array, Silk Test Classic may display its result in collapsed form.

Click View > Expand Data or View > Collapse Data to manipulate the display or double-click on the plus/minus symbols.

Parent topic: Debugging Test Scripts


Locals Dialog Box

Use the Locals window to view all local variables that are in scope (accessible) in the current function declaration and their current values.

Click View > Local Variables.

You can set a new value for the variable in the Set Variable text field. This is available only while Silk Test Classic is in debugging mode.

If a variable is uninitialized, it is labeled <unset>. If a variable has a complex value, like an array, its result is displayed in collapsed form. Use View > Expand Data or View > Collapse Data to manipulate the display, or double-click on the plus (+) and minus (-) symbols.

Parent topic: Debugging Test Scripts


Expressions

If you type an identifier name, the result is the value which that variable currently has in the running script. If you type a function name, the result is the value that the function returns. Any function that you specify must return a value, and must be in scope at the current line.

Properties and methods for a class are valid in expressions, as long as the declaration for the class they belong to is included in one of the modules used by the script being debugged.

If an expression evaluates to a complex value, like an array, Silk Test Classic might display its result in collapsed form. To expand or collapse the display, click View > Expand Data and View > Collapse Data in the Silk Test Classic menu or double-click the plus (+) icon.

When a script reaches a breakpoint, you can evaluate expressions.

  • Evaluating Expressions
    Use the Expressions window to evaluate expressions during debugging.
Parent topic: Debugging Test Scripts
Related concepts
Checking the Precedence of Operators


Evaluating Expressions

You can use the Expressions window to evaluate an expression during debugging and to check the result. A script must be running in order for the evaluation to occur.

  1. Click View > Expression. The View menu item is available only while Silk Test Classic is in debugging mode.
  2. Type an expression into the input field in the top of the window.
    • If you type an expression into the input field, the result is the value of that expression.
    • If you type an variable name into the input field, the result is the value that the variable currently has in the running script.
    • If you type a function name into the input field, the result is the value that the function returns. Any function that you specify must return a value, and must be in scope at the current line.
    Properties and methods for a class are valid in expressions, as long as the declaration for the class they belong to is included in one of the modules used by the script being debugged.
  3. Press Enter. The Expression window displays the result of the evaluation directly beneath the expression.

If an expression evaluates to a complex value, like an array, Silk Test Classic might display its result in collapsed form. To expand or collapse the display, click View > Expand Data and View > Collapse Data in the Silk Test Classic menu or double-click the plus (+) icon.

Parent topic: Expressions


Enabling View Trace Listing

When you run a script, Silk Test Classic can record all the methods that the script invoked into a transcript. Each entry in the transcript includes the method name and the arguments passed into the method. You can use this information to debug the script, because you can see exactly which functions were actually called by the running script.

  1. Click Options > Runtime to display the Runtime Options dialog box.
  2. Check the Print Agent Calls and the Print Tags with Agent Calls check boxes.
  3. Run the script. The transcript contains error information and the output from print statements, and additionally lists all methods that are called by the script.
  4. To check the agent trace during debugging, when execution pauses, click View > Transcript.
Parent topic: Debugging Test Scripts
Related reference
Runtime Options Dialog Box
Transcript Dialog Box


Viewing a List of Modules

  1. Click View > Module. Silk Test Classic displays a list of modules in the View Module dialog. The list includes all the modules loaded at startup, which means all modules which are loaded by startup.inc, including winclass.inc, so that you can set breakpoints in functions, window class declarations, and so on.
  2. Double-click the name of a module to view the module in a debug window.
Parent topic: Debugging Test Scripts


View Module Dialog Box

Use the View Module dialog box to view the modules used by the script being debugged. This is available only while in debugging mode.

Click View > Modules.

Double-click on a module name to view it in a debugging window. The list includes all the modules that loaded by startup.inc, so you can set breakpoints in GUI functions, classes, and so forth.

Parent topic: Debugging Test Scripts


Viewing the Debugging Transcripts

To see the error information in the debugging transcripts during debugging:

  1. Wait until the execution is stopped.
  2. In the Silk Test Classic menu, click View > Transcript. Silk Test Classic displays the transcript in a new window.
  3. To save the contents of the transcript to a text file, choose File > Save.
  4. To send commands to the application under test, use the Execute field in the Transcript window. Type a valid command into the field and click Execute. For example, you might want to print the value of a variable or the contents of a window.
Parent topic: Debugging Test Scripts


Transcript Dialog Box

Use the Transcript dialog box to view the debugging transcript. This dialog contains the script name and the test case names and lists error information, output from print commands, and all methods called by the script. You must be in debug mode to access this option. The contents of the transcript window are not written to disk. To save its contents to a text file, choose File > Save.

Click View > Transcript.

At the bottom of the transcript window is a text field in which you can enter any statement to execute. The results of each statement you execute appear in the transcript window.

Parent topic: Debugging Test Scripts
Related tasks
Enabling View Trace Listing


Call Stack Dialog Box

Use to view the current call stack. This is available only in debugging mode.

Click View > Call Stack.

Parent topic: Debugging Test Scripts


Debugging Tips

This section provides tips that might help you in debugging your tests.

  • Checking the Precedence of Operators
    Describes how you can check the precedence of operators in an expression.
  • Checking for Code that Never Executes
    Describes how to check for code that does not execute.
  • Global and Local Variables with the Same Name
    Describes global and local variables with the same name.
  • Handling Global Variables with Unexpected Values
    Describes how to handle global variables with unexpected values during debugging.
  • Incorrect Usage of Break Statements
    Describes how you can handle break statements that have been used incorrectly
  • Incorrect Values for Loop Variables
    Describes how you can handle incorrect values for loop variables.
  • Infinite loops
    Describes how you can handle infinite loops.
  • Typographical Errors
    Describes a scenario for typographical errors.
  • Uninitialized Variables
    Describes how you can handle uninitialized variables during debugging.
Parent topic: Debugging Test Scripts


Checking the Precedence of Operators

The order in which 4Test applies operators when it evaluates an expression may not be what you expect. To ensure that an expression works as expected, use parentheses or break the expression down into intermediate steps. To evaluate an expression and to check the result of the expression, click View > Expression in the Silk Test Classic menu.

Parent topic: Debugging Tips
Related concepts
Expressions


Checking for Code that Never Executes

To check for code that never executes, step through the script with Debug > Step Into. For additional information, see Stepping Into and Over Functions.

Parent topic: Debugging Tips
Related concepts
Stepping Into and Over Functions


Global and Local Variables with the Same Name

It is usually not a good programming practice to give different variables the same names. If a global and a local variable with the same name are in scope, which means accessible, at the same time, your code can access only the local variable.

To check for identical names, click View > Local Variables and View > Global Variables in the Silk Test Classic menu to see if two variables with the same name are in scope simultaneously.

Parent topic: Debugging Tips
Related tasks
Viewing Variables


Handling Global Variables with Unexpected Values

When you write a function that uses global variables, ensure that each variable has an appropriate value when the function exits. If another function uses the same variable later, and the variable has an unexpected value on entry to the function, an error could occur.

During debugging, to check that a variable has a reasonable value on entry to a function, set a breakpoint on the line that calls the function and click View > Global Variables in the Silk Test Classic menu to check the value of the variable.

Parent topic: Debugging Tips
Related tasks
Viewing Variables


Incorrect Usage of Break Statements

A break statement transfers control of the script out of the innermost nested for, for each, while, switch, or select statement only. Break exits from a single loop level, not from multiple levels. To ensure that the flow of control works as you expect, click Debug > Step Into in the Silk Test Classic menu to step through the script one line at a time. For additional information, see Stepping Into and Over Functions.

Parent topic: Debugging Tips
Related concepts
Stepping Into and Over Functions


Incorrect Values for Loop Variables

When you write a for loop or a while loop, be sure that the initial, final, and step values for the variable that controls the loop are correct. Incrementing a loop variable one time more or less than you really want is a common source of errors.

To ensure that a control loop works as you expect, click Debug > Step Into in the Silk Test Classic menu to step through the execution of the loop one statement at a time, and watch how the value of the loop variable changes using View > Local Variables. See Stepping Into and Over Functions.

Parent topic: Debugging Tips
Related concepts
Stepping Into and Over Functions


Infinite loops

To check for infinite loops, click Debug > Step Into in the Silk Test Classic menu to step through the script one line at a time. For additional information, see Stepping Into and Over Functions.

Parent topic: Debugging Tips
Related concepts
Stepping Into and Over Functions


Typographical Errors

It is easy to make typographical errors that the 4Test compiler cannot catch. If a line of code does nothing, a typographical error might be the problem.

Parent topic: Debugging Tips


Uninitialized Variables

Silk Test Classic does not initialize variables for you. So if you have not initialized a variable on entry to a function, it will have the value <unset>. It is better to explicitly give a value to a variable than to trust that another function has already initialized it for you. Also, 4Test does not keep local variables after a function exits. The next time the function is called, the local variables could be uninitialized.

If you are in doubt about whether a variable has a reasonable value at a particular point, set a breakpoint there and click View > Global Variables or ViewLocal Variables in the Silk Test Classic menu to check the value of the variable.

Parent topic: Debugging Tips


Setting Silk Test Classic Options

This section describes the Silk Test Classic options.

  • Setting General Options
    Set the general options to configure aspects of the general system behavior, such as the editor and your workspace
  • Setting the Editor Font
    Use the Editor Font dialog box to configure the screen font for the editor.
  • Setting the Editor Colors
    Use the Editor Colors dialog box to configure screen colors for various elements of the editor.
  • Runtime Options Dialog Box
    Describes the Runtime Options dialog box.
  • Agent Options Dialog Box
    Describes the Agent Options dialog box.
  • Extensions Dialog Box
    Describes the Extensions dialog box that enables AUTs and extensions that use the Classic Agent.
  • Setting Recording Options for the Open Agent
    Set the recording options to optimize recording with the Open Agent.
  • Setting Recording Options for the Classic Agent
    Set the recording options to optimize recording with the Classic Agent.
  • Setting Replay Options for the Open Agent
    Set the replay options to optimize replaying tests with the Open Agent.
  • Defining which Custom Locator Attributes to Use for Recognition
    If a control has custom attributes, you can use the custom attributes in the locator of the control to enable stable recognition of the control.
  • Setting Classes to Ignore
    Specify the names of classes in the Transparent classes grid to ignore the classes during recording and replay.
  • Custom Controls Dialog Box
    Describes how you can set options to support custom controls.
  • Property Sets Dialog Box
    Describes the Property Sets dialog box.
  • DOM Extensions Dialog Box
    Describes the DOM Extensions dialog box.
  • Extension Application Dialog Box
    Describes the Extension Application dialog box.
  • Extension Options (ActiveX) Dialog Box
    Describes the Extension Options for ActiveX.
  • Extension Options Dialog Box (Java)
    Describes the Extension Options for Java dialog box.
  • TrueLog Options - Classic Agent Dialog Box
    Describes the TrueLog Options - Classic Agent dialog box.
  • TrueLog Options - Open Agent Dialog Box
    Describes the TrueLog Options - Open Agent dialog box.


Setting General Options

You can use the general options to configure aspects of the general system behavior, such as the editor and your workspace. Options that you set in the General Options dialog box are written to the partner.ini file.

  1. Click Options > General. The General Options dialog box appears.
  2. Check the Create backups check box to create a backup file each time you save a file. The backup file has an underscore _ appended to the extension. By default, this check box is checked.
  3. Check the Show full path check box to see the full path of files in Silk Test Classic. This option is useful if you have a complex directory structure, or if you work from both local and network copies. By default, this check box is checked.
  4. Check the Save files before running check box so that all open modified files are written to disk before executing a script, suite, or test plan. By default, this check box is checked. If you uncheck the check box, only the modified script, suite, or test plan is written to disk before running it.
  5. From the Save outline list, select in which state outline files are saved.

    Outline files include .pln, .inc, .t, and .g.t files.

  6. In the Width of tabs field, specify the number of spaces in a tab stop. The default is 4 spaces.
  7. Check the Show toolbar check box to display the toolbar. By default, this check box is checked.
  8. Check the Show toolbar tips check box to display a on-screen description of a toolbar button (ToolTip) when you place the mouse cursor over the button. Silk Test Classic uses the standard Windows mechanism for displaying ToolTips. You can customize the appearance of the ToolTips by using the standard Windows Display Properties dialog box. By default, this check box is checked.
  9. In the Project history size field, specify the number of recent projects to display on the File menu. You can specify an integer from 0 to 4. The default size is 4.
  10. In the File history size field, specify the number of recent file actions to display on the File menu. You can specify an integer from 0 to 9. The default size is 9.
  11. Specify the extensions for include files in the Include file extensions field. Separate the extensions with a space. Files with other extensions are treated like text files, and are displayed in the text editor only. The default include file extensions are inc, lib, and opt.
  12. Check the Prefer Locator check box to use locators to resolve the window declaration, whenever both locators and tags are present. By default, this check box is checked.
  13. In the Data file for attributes and queries field, specify the default path for the test-plan initialization file. Specify the full path and file name. The file extension is arbitrary. The default test-plan initialization file is testplan.ini.
    Note: You can only specify one data file for attributes and queries at a time.
  14. In the Help files for library browser field, specify the files that Silk Test Classic should use to compile its help file (4test.hlp) for the Library Browser. Separate the entries with a comma. The default file is 4test.txt, which includes information for all the built-in classes and functions.
  15. To disable saving object files during compilation, uncheck all check boxes in the Auto-Complete area as well as the Save object files during compilation check box on the Runtime Options dialog box.
    1. Check the Function tip check box to display the function signature in a tooltip whenever you type an open parenthesis ( after a function, test case, or method in a 4Test file. The function signature includes the return argument type, the pass-mode, the data type, the names of any arguments, and any optional attributes that are defined. The first argument is highlighted in bold text. As you enter each argument and then type a comma, the next argument that you are expected to type is highlighted. The expected argument is always indicated with bold text; for example, if you backspace or delete an argument within your function, the expected argument is updated accordingly in the function tip.
    2. Check the Member list check box to display the members from which you can select when you type a period "." after a member name in a 4Test file. The members that you see in the MemberList are dependant upon the MemberList Options that you have selected.
    3. Check the Datatype list check box to display the list of the built-in and user-defined non-winclass types whenever you type the keyword of after a list, an array [ ], or a varargs; for example, list of.
    4. Check the Appstate list check box to display a list of the currently defined application states when you type the keyword appstate as part of a test case declaration; for example testcase foo () appstate.
  16. Specify how much detail appears in your MemberList by selecting the inheritance level from the Inheritance Level list.
    • Select Below AnyWin Class to display methods for any class derived from the AnyWin class. This is the default inheritance level.
      Note: Methods that are defined in and above the AnyWin class, such as Click and Exist, which are defined in the Winclass, are not displayed in the MemberList.
    • Select All to display the complete inheritance for members all the way up through AnyWin and the control classes, including the Winclass.
    • Select None to display only the members that are defined in the class of the current object and window declaration.
  17. Specify which members are displayed in your MemberList by checking the corresponding check boxes.
    1. Check the Show methods check box to display all methods that are defined in the referenced .t, and .inc files. Methods are indicated in the Memberlist with a red icon.
    2. Check the Show window children check box to display all window objects of type WINDOW that are defined in window declarations in the referenced .t and .inc files. Works with the parent statement, the with statement, and the this keyword. Window children are indicated in the Memberlist with a yellow icon.
    3. Check the Show properties check box to display all properties that are defined in the referenced .t, and .inc files. Properties are indicated in the Memberlist with a blue icon.
    4. Check the Show variables check box to display all variables that are defined in the referenced .t and .inc files, including native data types, data, and records. Fields defined for records and nested records are also displayed. Variables and fields are indicated in the Memberlist with a red icon.
    5. Check the Show membertype check box to display attributes for the selected members, such as the class for window children, the data type for properties and variables, and the return type for method functions. By default, this check box is unchecked.
  18. Click OK.
Parent topic: Setting Silk Test Classic Options
Related concepts
Attributes and Values
Overview of Test Plan Queries
Related tasks
Sharing a Test Plan Initialization File
Modifying the Definition of an Attribute


Setting the Editor Font

You can use the Editor Font dialog box to select a screen font in the family, size, and style of your choice.

  1. Click Options > Editor Font. The Editor Font dialog box appears.
  2. Select a font family from the Font list. The default font is Courier.
  3. Select a style for the selected font from the Font style list. The default font style is Regular.
  4. Select a point size for the selected font from the Size list.
  5. Click OK. Silk Test Classic changes the font family, size, and style for all open windows.
While you make your selections, the Sample displays a line of text in the selected font family, style, and point size.
Parent topic: Setting Silk Test Classic Options
Related tasks
Displaying Double-Byte Characters in the Editor


Setting the Editor Colors

You can use the Editor Colors dialog box to set the screen colors for various elements of 4Test code, results information, and the test plan, if available. You can select any of the provided screen colors or create your own color by modifying the RGB values of these colors.

Reset
Click to revert to the default colors.
Text background
Enables you to set the background color for all editor windows (.inc, .pln, .res, .t,). The default value for Text background is white.
  1. Click Options > Editor Colors. The Editor Colors dialog box appears.
  2. Select the editor item, the color of which you want to change, from the Editor item list. You can change the colors of the following items:
    • 4Test strings
    • 4Test numbers
    • 4Test keywords
    • 4Test comments
    • 4Test other
    • Results summary
    • Results output
    • Results errors
    • Results warnings
    • Results not executed
    • Results other
    • Testplan test description
    • Testplan statements
    • Testplan comments
    • Testplan other
    • Difference text changed
    • Difference text added
    • Difference text deleted
    • Difference text other
    • Text background
  3. Select the new color for the item.
  4. To change the RGB values of the selected color, slide the corresponding bars to the left or right, click the corresponding spin buttons, or type the value into the corresponding fields.
  5. Optional: Click Reset to revert to the default colors.
  6. Click OK.
Parent topic: Setting Silk Test Classic Options
Related tasks
Changing Colors in a Test Plan
Changing the Colors of Elements In the Results File


Runtime Options Dialog Box

Use this dialog box to specify settings that Silk Test Classic uses when it runs a script.

Click Options > Runtime.

4Test area

Agent name
Specifies the name of the agent on the target machine, that is, the machine on which you want to run a script or suite. Specify a value only if you want to run your script on a machine other than the host machine.
Network
If you are testing applications across a network, select either TCP/IP or NetBIOS as the networking protocol to use. If you choose the Open Agent as the default agent, only TCP/IP is available.
Default Agent
Specifies which agent, the Classic Agent or the Open Agent, to use by default. For example, if your test cases target an Apache Flex environment, specify the Open Agent as the default agent. For projects created prior to Silk Test Classic 2008, the Classic Agent is selected by default. You can change the agent if necessary.
Arguments
Specifies the arguments, if any, that you want to pass to the script at runtime. Separate multiple arguments with spaces. For example, suppose your script takes two arguments: the number of iterations to perform and the name of a test data file. In this case, you would enter 5 test1.dat.
Use path

Specifies one or more paths along which Silk Test Classic searches for include files. Include files can be named in the Use files field or in a script’s use statement. If you specify a path, Silk Test Classic searches the current directory and then each of the directories in the path named here. If you do not specify a search path, Silk Test Classic searches the current directory only. The syntax for a path is the same as that used by the native operating system. By default, the Use path is set to c:\Program Files\Silk\<SilkTest install directory>. Click Browse to select an additional include path. The Use path field contains a maximum of 1024 characters. Silk Test Classic displays the first 256 characters of a directory. The 257th character is truncated.

Use files
Specifies the names of one or more include files for Silk Test Classic to automatically load at startup. Do not specify files in this field if you intend to include a use statement for the files in a script. Type the file names as you would type any other operating system path. You can use an absolute path or a relative path. However, it is recommended that you use a relative path. For example, to include the Java SWT extensions for the Open Agent, the relative path is extend\JavaSWT\JavaSWT.inc. Click Browse to select an additional include file. The Use files field contains a maximum of 1024 characters. Silk Test Classic displays the first 256 characters of a directory. The 257th character is truncated. When you enable extensions or configure an application, Silk Test Classic adds an include file based on the technology or browser type that you enable to the Use files box. For extensions that use the Open Agent, Silk Test Classic names the include file <technology_type>.inc. For instance, if you configure an Apache Flex application, a file named flex.inc is added. If you configure a Web application for a Internet Explorer browser, Silk Test Classic adds the explorer.inc file. Extensions that use technologies on the Classic Agent are located in the directory C:\Users\<Current user>\Documents\Silk Test Classic Projects\<Project name>\extend\. Technology domains that use the Open Agent are located in the directory C:\Users\<Current user>\Documents\Silk Test Classic Projects\<Project name>\extend\<technology type>.
Object filepath
Specifies the location from which Silk Test Classic reads and writes object files. Leave the field empty if you want to store object files in the same directory as their corresponding source files, specify an absolute path if you want to store all object files in the same directory, or specify a relative path if you want object files to be stored in a directory relative to the directory containing the source files.
GUI targets
Specifies the platforms for which you want to compile your scripts and include files (using conditional compilation). You can specify as many GUI targets as you want; separate each GUI specifier with a comma. You use this field when doing distributed testing with multiple platforms; if networking is disabled, then the field is ignored. Silk Test Classic implicitly includes the local host GUI type.
Default Browser
Specifies the Web browser to use when testing Web applications. Make sure the extension with which you are testing appears in the Default Browser field.
Save object files during compilation
Creates an object file from a script or include file when it is compiled. (An object file is always created for a script or include file when it is saved.) The default is checked. Checking this option will minimize compilation time for features such as Auto-Complete and Projects, which rely on frequent compilation.

To disable saving object files during compilation, the Auto-Complete options on the General Options dialog box as well as this option need to be unchecked.

Compiler constants
Opens the Compiler Constants dialog box, where you can define constants and assign values to them. You can use the defined constants in scripts and include files anywhere you can specify an expression. Constants are evaluated and replaced with their values at compile time. To define a constant, specify its name in the Constant Name field and its value in the Value field, then click Add. You can edit or delete an existing constant by selecting it and clicking Edit or Remove.

Results area

Directory/File
Specifies the name of the directory, or the name of the directory and file that stores the results of script runs. Silk Test Classic always assigns the extension .res to all results files. If you supply a different extension, Silk Test Classic will override it. If you leave the field empty (the default), Silk Test Classic gives the results file the same name as the script and stores it in the same directory as the script. If you supply only a directory name, Silk Test Classic gives the results file the same name as the script and stores it in the directory you specify.
Note: If you provide a local or remote path in this field, the path cannot be validated until script execution time. Silk Test Classic can only validate the path when the script is executing.
History size
Specifies an integer representing how many sets of results to keep for a script. Once this number is reached, Silk Test Classic automatically deletes the oldest set of results each time it generates new results. A value of 0 saves all results files. Default is 5.
Write to disk after each line
If checked, writes the results file to disk whenever the script generates output, as in the case of a print statement. Selecting this option ensures that in the event of system failure, Silk Test Classic will produce a results file containing output up to the time of system failure. The disadvantage of selecting this option is that file I/O slows down script execution. By default, this check box is checked.
Find Error stops at warning
If checked, the Edit > Find Error menu option locates error messages and warnings in results files. Otherwise, the command locates error messages only. By default, this check box is checked.
Show overall summary
If checked, displays the summary of results for the entire script, suite, or test plan, including the start and elapsed time of execution, and the total number of errors and warnings. By default, this check box is checked.
Log elapsed time, thread, and machine for each output line
If checked, records this information in the results file for each line that is written. Default is unchecked. To view this information, make the results file active, then choose Results > View Options and check Elapsed time, Thread number, or Current machine.

Execution area

Minimize while running
If checked, Silk Test Classic runs minimized while you run a script, suite, or test plan. By default, this check box is unchecked.
Show detailed status window
If checked, Silk Test Classic displays the Runtime Status window while you are running a script or suite when Silk Test Classic is not minimized. By default, this check box is checked.
Save status window position

If checked, Silk Test Classic remembers the position and size of the Runtime Status window if you change it during script execution. The next time you run a script, the Runtime Status window appears in the new position and/or the new size. Default is unchecked, in which case the Runtime Status window always comes up in the same location and as the default size.

Animated Run Mode (Slow-Motion)
If checked, Silk Test Classic waits one second after each interaction with the application under test is executed. Typically, you will only use this check box if you want to watch the test case run. For instance, if you want to demonstrate a test case to someone else, you might want to check this check box. You can set this check box in the Run Testcase dialog box also, which enables you to enable or disable animated run mode each time you run a test case. When you enable or disable Animated Run Mode in the Run Testcase dialog box, Silk Test Classic makes the same change in the Runtime Options dialog box. Likewise, when you enable or disable animated run mode in the Runtime Options dialog box, Silk Test Classic makes the same change in the Run Testcase dialog box. Executions of the default base state and functions that include one of the following strings are not delayed:
  • BaseStateExecutionFinished
  • Connecting
  • Verify
  • Exists
  • Is
  • Get
  • Set
  • Print
  • ForceActiveXEnum
  • Wait
  • Sleep

Debugging area

Print agent calls
If checked, specifies whether or not you want the results file for each test run to include a list of all method calls made by your script. Each entry includes the method name and the arguments passed to it. This is a useful feature for debugging because it tells you exactly which methods were actually called by the running program. By default, this check box is unchecked.
Print tags with agent calls
If checked and Print agent calls is also checked, includes tags with the method calls in your results files. By default, this check box is unchecked.
  • Compiler Constants Dialog Box
    Describes the Compiler Constants dialog box.
Parent topic: Setting Silk Test Classic Options
Related concepts
Setting the Default Agent
Connecting to the Default Agent
Overview of Test Frames
Starting Silk Test Classic from the Command Line
Window Declarations
Navigating to errors
Logging Elapsed Time, Thread, and Machine Information
Running a Test Plan
Passing Arguments to a Script
Overview of the Results File
Related tasks
Setting the Default Agent Using the Runtime Options Dialog Box
Testing the Ability of the Recovery System to Close the Dialog Boxes of Your Application
Testing with a Remote Open Agent
Enabling View Trace Listing
Setting a Test Case to Use Animation Mode


Compiler Constants Dialog Box

Use to define constants and assign values to them. You can use the defined constants in scripts and include files anywhere you can specify an expression. Constants are evaluated and replaced with their values at compile time.

Click Options > Runtime Options and then click Compiler Constants.

Constant Name and Value
Displays the list of defined constants and the values associated with them.
Constant Name
Type the name of the constant you want to add to the list.
Value
Type the value of the constant you specified in the Constant Name box.
Edit
Click to modify the constant you selected from the Constant Name and Value box. You must select a constant from the list before the Edit button is available.
Remove
Click to delete the constant you selected from the Constant Name and Value box. You must select a constant from the list before the Remove button is available.
Add
Specify a Constant Name and Value in the appropriate boxes and then click Add to add the new constant to the list.
Parent topic: Runtime Options Dialog Box


Agent Options Dialog Box

Use to set global options for how the agent interacts with the application under test. Options you specify within the tabs are saved in the partner.ini file. If you work on multiple projects, you might want to have a custom set of agent options for each project. To do this, save your options in a file with a name other than partner.ini.

Click Options > Agent.

Any option you set in the Agent Options dialog box can be changed by the same option set to a different value within a script.

4Test statement which sets the selected option

When you set an option, this field displays the 4Test statement that represents the selected option. For example, if you set the Window timeout to 5 seconds on the Timing tab the following 4Test statement displays:

Agent.SetOption(OPT_WINDOW_TIMEOUT,5)

The statement uses the SetOption method to operate on the agent object. OPT_WINDOW_TIMEOUT is the internal 4Test name of the Window Timeout option, and 5 is the current, default value of the option, five seconds.

This code is useful if you want to set a local value for a given agent. You can type or change the code yourself, then click Copy to Clipboard to copy the statement to the clipboard.

  • Timing Tab
    Describes the Timing tab on the Agent Options dialog box.
  • Verification Tab
    Describes the Verification tab on the Agent Options dialog box.
  • Close Tab
    Describes the Close tab on the Agent Options dialog box.
  • Bitmap Tab
    Describes the Bitmap tab on the Agent Options dialog box.
  • Synchronization Tab
    Describes the Synchronization tab on the Agent Options dialog box.
  • Setting Advanced Options
    Set advanced options to enable fallback support for hybrid apps, to specify whether locator attribute names should be case sensitive, and so on.
  • Other Tab
    Describes the Other tab on the Agent Options dialog box.
  • Compatibility Tab
    Describes the Compatibility tab on the Agent Options dialog box.
Parent topic: Setting Silk Test Classic Options
Related concepts
Specifying Options Sets
Specifying Buttons, Keys, and Menus that Close Windows
Related reference
Agent Options


Timing Tab

The Timing tab is available on the Agent Options dialog box and contains the following options:

Window timeout (seconds)
Specifies the number of seconds Silk Test Classic waits for a window to appear and be in the correct state. If a window does not appear in the correct state within the specified timeout, Silk Test Classic raises an exception. The correct state of the window depends on how you set the options on the Verification tab, which determine whether Silk Test Classic checks whether a window is enabled, active, exposed, or unique. Default is 5 seconds, unless you have enabled enhanced support for Visual Basic, in which case the default is 20 seconds for 32-bit applications.
Window retry interval (seconds)
Specifies the number of seconds Silk Test Classic waits between attempts to verify a window, if the window does not exist or is in the incorrect state. Silk Test Classic continues trying to find the window until the time specified by the Window timeout option is reached. The correct state of the window depends on how you set the options on the Verification tab, which determine whether or not Silk Test Classic checks whether a window is enabled, active, exposed, or unique. Default is 0.06 seconds.
Keyboard event delay (seconds)

Specifies the delay used before each keystroke in a script. Default is 0.02 seconds. You can specify a number in increments of .001 from .001 to 999.999 seconds, inclusive.

Setting a keyboard event delay is necessary only if objects seem not to be recognized. This often appears as a win.SetActive() being executed before the action to display the window or the wrong window may be made active. The amount you may need to adjust the timing depends upon the speed of the machine you are working on and the application that you are testing. We recommend starting with a delay of .001 and incrementing only by .001 if necessary.

Setting this value to .001 is necessary only for client/server application testing – if you are testing a Web application, a setting of .001 radically slows down the browser. However, setting this to 0 (zero) may cause basic application testing to fail.

Mouse event delay (seconds)
Specifies the delay used after each mouse event (when the mouse is moved to an object) in a script. The delay affects moving the mouse, pressing buttons, and releasing buttons. Default is 0.02 seconds.
Application ready timeout (seconds)
Specifies the number of seconds that the agent waits for an application to become ready. If the application is not ready within the specified timeout, Silk Test Classic raises an exception. Default is 10 seconds. This option applies only if the application or extension knows how to communicate to the agent that it is ready. To find out whether the extension has this capability, see the documentation that comes with the extension. To require the agent to confirm the ready state of an application, select the Verify That an Application is Ready (Requires an Extension) check box on the Verification tab.
Application ready retry interval (seconds)
Specifies the number of seconds Silk Test Classic waits between attempts to verify that an application is ready. Silk Test Classic continues to test the application for readiness if it is not ready until the time specified by the Application ready timeout option is reached. Default is 0.1 seconds.
Timeout to wait for active window (seconds)

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Enter the maximum time, in seconds, to wait for a window to become active.

Retry interval to wait for active window (seconds)

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Enter the maximum time, in seconds, to wait for a window to become active before trying to verify the object again.

Timeout to wait for an enabled window (seconds)
Enter the maximum time, in seconds, to wait for a window to become enabled.

4Test statement which sets the selected option

When you set an option, this field displays the 4Test statement that represents the selected option. For example, if you set the Window timeout to 5 seconds on the Timing tab, the following 4Test statement displays:

Agent.SetOption(OPT_WINDOW_TIMEOUT,5)

The statement uses the SetOption method to operate on the agent object. OPT_WINDOW_TIMEOUT is the internal 4Test name of the Window Timeout option and 5 is the current, default value of the option, five seconds.

This code is useful if you want to set a local value for a given agent. You can type or change the code yourself, then click the Copy to Clipboard button to copy the statement to the clipboard.

Copy to Clipboard
Copies the 4Test statement which sets the option to the clipboard.
Parent topic: Agent Options Dialog Box
Related concepts
How Does Silk Test Classic Synchronize Tests?
Related reference
Find Method
FindAll Function


Verification Tab

The Verification tab is available on the Agent Options dialog box and contains the following options:

Verify that windows are active
If checked, verifies that windows are active before interacting with them. Default is checked.
Verify that windows are enabled
If checked, verifies that windows are enabled before interacting with them. Default is checked.
Verify that windows are exposed
If checked, verifies that windows are exposed (that is, not covered, obscured, or logically hidden by another window) before interacting with them. Default is checked.
Verify that a tag uniquely identifies a window
If checked, verifies that each tag used by the script matches only one window. Default is checked.
Verify that coordinates passed to a method are inside the window
If checked, verifies that the coordinates, passed to a method, are inside the window before the mouse is pressed. If checked and coordinates fall outside the window, Silk Test Classic raises the E_COORD_OUTSIDE_WINDOW exception. Typically, you use the checking feature unless you need to be able to pass coordinates outside of the window, such as negative coordinates.
Note: The MoveMouse, PressMouse, and ReleaseMouse methods never verify their coordinates. Default is checked.
Verify the class tag for methods of class Control
If checked, verifies that objects are of the specified type before interacting with them. This option is unchecked and disabled.
Verify that an application is ready (requires an extension)
If checked, synchronizes the agent with the application under test. Calls made to the agent will not proceed until the application is ready. This option applies only if you have an extension enabled in the Extensions dialog box. Default is checked.

4Test statement which sets the selected option

When you set an option, this field displays the 4Test statement that represents the selected option. For example, if you set the Window timeout to 5 seconds on the Timing tab, the following 4Test statement displays:

Agent.SetOption(OPT_WINDOW_TIMEOUT,5)

The statement uses the SetOption method to operate on the agent object. OPT_WINDOW_TIMEOUT is the internal 4Test name of the Window Timeout option and 5 is the current, default value of the option, five seconds.

This code is useful if you want to set a local value for a given agent. You can type or change the code yourself, then click the Copy to Clipboard button to copy the statement to the clipboard.

Copy to Clipboard
Copies the 4Test statement which sets the option to the clipboard.
Parent topic: Agent Options Dialog Box
Related reference
Active and Enabled Statuses


Close Tab

The Close tab is available from the Agent Options dialog box and contains the following options:

List of buttons used to close a window
Specifies a list of strings representing the list of buttons used to close windows closed with the Close, CloseWindows, and Exit methods. The preferred way to specify these buttons is with the lsCloseWindowButtons variable in the object’s declaration. Default is Cancel, Close, Exit, Done. If the UI of the application is localized, you need to replace the strings with the localized strings.
Keystrokes used to close a dialog box window
Specifies a list of strings representing the keystroke sequence used to close dialog boxes (used by Close, CloseWindows, and Exit). The preferred way to specify this keystroke sequence is with the lsCloseDialogKeys variable in the object’s declaration. Default is <Esc>.
List of menus used to close a window
Specifies a list of strings representing the list of menu items used to close windows with Close, CloseWindows, and Exit. The preferred way to specify these menu items is with the lsCloseWindowMenus variable in the object’s declaration. Default is File/Exit*, File/Quit*.
List of buttons used to close a confirmation window
Specifies a list of strings representing the list of buttons used to close confirmation dialog boxes, which means dialog boxes or message boxes that appear when closing windows with the Close, CloseWindows, and Exit methods. The preferred way to specify these buttons is with the lsCloseConfirmButtons variable in the object’s declaration. Default is No.
Name of Close item on system menu
Specifies a list of strings representing the list of menu items on the system menu used to close windows with the Close, CloseWindows, and Exit methods. Default is Close.

4Test statement which sets the selected option

When you set an option, this field displays the 4Test statement that represents the selected option. For example, if you set the Window timeout to 5 seconds on the Timing tab, the following 4Test statement displays:

Agent.SetOption(OPT_WINDOW_TIMEOUT,5)

The statement uses the SetOption method to operate on the agent object. OPT_WINDOW_TIMEOUT is the internal 4Test name of the Window Timeout option and 5 is the current, default value of the option, five seconds.

This code is useful if you want to set a local value for a given agent. You can type or change the code yourself, then click the Copy to Clipboard button to copy the statement to the clipboard.

Copy to Clipboard
Copies the 4Test statement which sets the option to the clipboard.
Parent topic: Agent Options Dialog Box


Bitmap Tab

The Bitmap tab is available from the Agent Options dialog box and contains the following options:

Bitmap match count
Specifies an integer representing the number of consecutive snapshots that must be the same for the bitmap to be considered stable. Snapshots are taken up to the number of seconds specified by the Bitmap match timeout option, with a pause specified by Bitmap match interval occurring between each snapshot. This option affects the CaptureBitmap, GetBitmapCRC, VerifyBitmap, and WaitBitmap methods. Default is 5.
Bitmap match interval (seconds)
Specifies a number representing the time interval between snapshots to use for ensuring the stability of the bitmap image. The snapshots are taken up to the time specified by the Bitmap match timeout option. This option affects the CaptureBitmap, GetBitmapCRC, VerifyBitmap, and WaitBitmap methods. Default is 0.1 seconds.
Bitmap match timeout (seconds)
Specifies a number representing the total time allowed for a bitmap image to become stable. During the time period, Silk Test Classic takes multiple snapshots of the image, waiting the number of seconds specified by the Bitmap match interval option between snapshots. If the timeout period is reached before the number of bitmaps specified by the match count option, Silk Test Classic stops taking snapshots and raises the exception E_BITMAP_NOT_STABLE. This option affects the CaptureBitmap, GetBitmapCRC, VerifyBitmap, and WaitBitmap methods. Default is 5 seconds.
Bitmap compare tolerance (pixels)
Specifies an integer representing the number of pixels of difference below which two bitmaps are considered to match. If the number of pixels that are different is smaller than the number specified with this option, the bitmaps are considered identical. The maximum tolerance is 32,767 pixels. The bitmap pixel tolerance is used by the VerifyBitmap and WaitBitmap methods, as well as the SYS_ CompareBitmap function. Default is 0 pixels.

You can also get and set bitmap options using the GetOption and SetOption methods.

4Test statement which sets the selected option

When you set an option, this field displays the 4Test statement that represents the selected option. For example, if you set the Window timeout to 5 seconds on the Timing tab, the following 4Test statement displays:

Agent.SetOption(OPT_WINDOW_TIMEOUT,5)

The statement uses the SetOption method to operate on the agent object. OPT_WINDOW_TIMEOUT is the internal 4Test name of the Window Timeout option and 5 is the current, default value of the option, five seconds.

This code is useful if you want to set a local value for a given agent. You can type or change the code yourself, then click the Copy to Clipboard button to copy the statement to the clipboard.

Copy to Clipboard
Copies the 4Test statement which sets the option to the clipboard.
  • Bitmap Agent Options
    Lists the agent options which determine the behavior of bitmap verification.
Parent topic: Agent Options Dialog Box
Related concepts
Overview of Verifying Bitmaps


Bitmap Agent Options

The following table lists the agent options which determine the behavior of bitmap verification.

Option | Description
opt_bitmap_match_count | The number of successive snapshots that must be the same for the bitmap to be considered stable.
opt_bitmap_match_interval | The time interval between snapshots to use for ensuring the stability of the image.
opt_bitmap_match_timeout | The total time allowed for a bitmap to become stable.
opt:bitmap_pixel_tolerance | The number of pixels that is allowed to be different for two bitmaps to be considered equivalent.
To set these options globally for a group of scripts, use the Agent Options dialog box. To set these options locally within a script or test case, use the SetOption method. For example:
Agent.SetOption (OPT_BITMAP_MATCH_COUNT, 3)
Parent topic: Bitmap Tab
Related concepts
Overview of Verifying Bitmaps


Synchronization Tab

This functionality is supported only if you are using the Open Agent.

The Synchronization tab is available on the Agent Options dialog box contains the following options:

Synchronization mode

Select the synchronization algorithm for the ready state of a Web application. The synchronization algorithm configures the waiting period for the ready state of an invoke call.

HTML mode
Using the HTML mode ensures that all HTML documents are in an interactive state. With this mode, you can test simple web pages. If more complex scenarios with Java script are used, it might be necessary to manually script synchronization functions.
AJAX mode
Using the AJAX mode eliminates the need to manually script synchronization functions (such as wait for objects to appear or disappear, wait for a specific property value, and so on), which eases the script creation process dramatically. This automatic synchronization is also the base for a successful record and replay approach without manual script adoptions.
Synchronization timeout (seconds)
Enter the maximum time, in seconds, to wait for an object to be ready.
Synchronization exclude list

Type the entire URL or a fragment of the URL for any service or Web page that you want to exclude.

Some AJAX frameworks or browser applications use special HTTP requests, which are permanently open in order to retrieve asynchronous data from the server. These requests may let the synchronization hang until the specified synchronization timeout expires. To prevent this situation, either use the HTML synchronization mode or specify the URL of the problematic request in the Synchronization exclude list setting.

For example, if your web application uses a widget that displays the server time by polling data from the client, permanent traffic is sent to the server for this widget. To exclude this service from the synchronization, determine what the service URL is and enter it in the exclusion list.

For example, you might type:

http://example.com/syncsample/timeService
timeService
UICallBackServiceHandler

Separate multiple entries with a comma.

If your application uses only one service, and you want to disable that service for testing, you must use the HTML synchronization mode rather than adding the service URL to the exclusion list.

4Test statement which sets the selected option

When you set an option, this field displays the 4Test statement that represents the selected option. For example, if you set the Window timeout to 5 seconds on the Timing tab, the following 4Test statement displays:

Agent.SetOption(OPT_WINDOW_TIMEOUT,5)

The statement uses the SetOption method to operate on the agent object. OPT_WINDOW_TIMEOUT is the internal 4Test name of the Window Timeout option and 5 is the current, default value of the option, five seconds.

This code is useful if you want to set a local value for a given agent. You can type or change the code yourself, then click the Copy to Clipboard button to copy the statement to the clipboard.

Copy to Clipboard
Copies the 4Test statement which sets the option to the clipboard.
Parent topic: Agent Options Dialog Box
Related concepts
How Does Silk Test Classic Synchronize Tests?


Setting Advanced Options

Set advanced options to enable fallback support for hybrid apps, to specify whether locator attribute names should be case sensitive, and so on.
  1. Click Options > Agent. The Agent Options dialog box opens.
  2. Click the Advanced tab. The Advanced Options page displays.
  3. To test an embedded Chrome application, specify the executable and the port as a value pair in the Enable embedded Chrome support field. For example, myApp.exe=9222. To specify multiple embedded Chrome applications, separate the value pairs with a comma.
  4. Enable Fallback support for web views on Android and iOS to enable the mobile native fallback support for hybrid mobile applications that are not testable with the default browser support.
  5. Enable Microsoft Accessibility to enable Microsoft Accessibility in addition to the normal Win32 control recognition.
  6. Enable Remove focus on capture text to remove the focus from the window before capturing a text. A text capture is performed during recording and replay by the following methods:
    • TextClick
    • TextCapture
    • TextExists
    • TextRect
  7. Enable Match locator attribute values case sensitive to set locator attribute names to be case sensitive. The names of locator attributes for mobile web applications are always case insensitive, and this option is ignored when recording or replaying mobile web applications.
  8. Click OK.
Parent topic: Agent Options Dialog Box
Related concepts
Testing Hybrid Applications on Android
Testing Hybrid Applications on iOS
Agent Options


Other Tab

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

The Other tab is available on the Agent Options dialog box and contains the following options:

Tolerance to use when sizing windows (pixels)

Specifies an integer representing the number of pixels allowed for a tolerance when a resized window does not end at the specified size. For some windows and GUIs, you can’t always resize the window to the particular size specified. If the ending size is not exactly what was specified and the difference between the expected and actual sizes is greater than the tolerance, Silk Test Classic raises an exception. Windows cannot be sized smaller than will fit comfortably with the title bar. Default is 0 pixels.

Tolerance to use when moving windows (pixels)

Specifies an integer representing the number of pixels allowed for a tolerance when a moved window does not end up at the specified position. For some windows and GUIs, you can’t always move the window to the particular pixel specified. If the ending position is not exactly what was specified and the difference between the expected and actual positions is greater than the tolerance, Silk Test Classic raises an exception.

The tolerance can be set through the Control Panel, by setting the desktop window granularity option. If the granularity is zero, you can place a window at any pixel location. If the granularity is greater than zero, the desktop is split into a grid of the specified pixels in width, determining where a window can be placed. In general, the tolerance should be greater than or equal to the granularity. Default is 0 pixels.

Events used to invoke popup menus
Specifies a string, which is the command (keystrokes or mouse buttons) used to display pop-up menus. To use mouse buttons, specify <button1>, <button2>, or <button3> in the command sequence. Default is <Button2><Up><Down>. If you are testing Java applications or applets, we recommended that you set this options to <Button2>.
Pick menus before getting menu item information
If checked, picks the menu before checking whether an item on it exists, is enabled, or is checked. You might see menus pop up on the screen even though your script does not explicitly call the Pick method. Default is unchecked.
Pick dropdowns before getting item information
If checked, drops down the combo box before trying to access the contents. This is usually not needed, but some combo boxes only get populated after they are dropped down. Check this option if you are having problems getting the contents of a combo box, such as the Location combo box in Internet Explorer. Default is unchecked.
Consider case when matching items in controls
Check this option to consider case when looking for an item in a control. Default is unchecked.
Show windows which are out of view
If checked, allows controls that are not currently scrolled into view to be seen by the agent. This option is useful for testing Web applications. If unchecked, controls not currently in view are invisible. Default is checked.
Automatically scroll windows into view
If checked, scrolls a control into view before recording events against it or capturing its bitmap. This option is useful for testing web applications. This option applies only if Show windows which are out of view is enabled. This option is useful for testing web applications in which a dialog contains a scroll bar. Default is unchecked.
Enable communication with SilkBean
If checked, enables communication with the SilkBean for all scripts in a test session. The SilkBean is a utility that allows you to perform cross-platform testing of 100% pure Java controls in standalone Java applications. This option applies only if you enable Java support on Silk Test Classic. Default is unchecked.

We strongly recommend that you keep the default settings for Show windows which are out of view and Automatically scroll windows into view. If you do change the values, save them in a custom options set.

4Test statement which sets the selected option

When you set an option, this field displays the 4Test statement that represents the selected option. For example, if you set the Window timeout to 5 seconds on the Timing tab, the following 4Test statement displays:

Agent.SetOption(OPT_WINDOW_TIMEOUT,5)

The statement uses the SetOption method to operate on the agent object. OPT_WINDOW_TIMEOUT is the internal 4Test name of the Window Timeout option and 5 is the current, default value of the option, five seconds.

This code is useful if you want to set a local value for a given agent. You can type or change the code yourself, then click the Copy to Clipboard button to copy the statement to the clipboard.

Copy to Clipboard
Copies the 4Test statement which sets the option to the clipboard.
Parent topic: Agent Options Dialog Box


Compatibility Tab

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

The Compatibility tab is available from the Agent Options dialog box. Use the following options only if you are upgrading from a previous release of Silk Test Classic and want to use functionality that matches the previous release.

Don't group radio buttons into a list
If unchecked, treats radio buttons as a group of class RadioList. Otherwise, uses the Release 1.x method of treating radio buttons as individual objects. Default is unchecked.
Use release 1.x version of the class library
If checked, uses QA Partner Release 1 versions of GetChildren, GetClass, and GetParent. Otherwise, uses Release 2 and later versions. Default is unchecked.
Use release 1.x window tags
If checked, generates and operates on tags compatible with Silk Test Classic releases earlier than QA Partner Release 2. Otherwise, uses Release 2 or later tags. Default is unchecked. The Release 2 algorithm affects tags that use index numbers and some tags that use captions. In general, Release 2 tags are more portable, while the earlier algorithm generates more platform-dependent tags. Use this option only if you must run old scripts without any changes.
Don't trim spaces when getting items in controls
If checked, leading and trailing spaces are not trimmed from items on windows. Default is unchecked.
Add ‘Window tags’ to the Record menu
If checked, includes the Record Window Tags menu item on the Record menu. Selecting the Record Window Tags menu item opens the Record Window Tags dialog. Use the Record Window Tags dialog to capture and paste window tags for individual objects into your script or test frame. This dialog is equivalent to the QA Partner Release 1.x Paste Window dialog box, allowing you to paste Release 1.x style window tags into your script. Default is unchecked.
Only use Agent-based clicks (not API-based clicks)
If checked, use API-based clicks when available. An API click is generated internally by the browser, instead of by the agent. API clicks are more reliable than agent clicks, which can click the wrong location of an object. API-based clicks are for browsers only. If cleared, use agent-based clicks even when API-based clicks are available. Default is unchecked.
Use ANSI call

If checked, converts all string parameters (return type, string arguments, strings in record structures that are used as arguments) from W (wide-character, Unicode) to A (ANSI) character format before calling the DLL function internally. Return values and pass-mode variables set to inout that are strings or contain strings within record structures get converted back from A (ANSI) format to W (wide-character) format after calling the DLL. Using this check box makes an ANSI call transparent, as the conversion is done internally. Default is unchecked.

The DLL calling stack does not support return values that are pointers to a record structure. To determine if the function succeeded, use the inout or out pass-mode variable and use the return-type variable as a flag.

Important: If you use DLL functions where you specify string sizes in bytes, remember that W (wide-character) strings are assigned 2 bytes per character, and A (ANSI) strings are assigned 1 byte per character. If you pass a buffer of 1000 characters via an ANSI call, you use 1000 bytes of space, not 2000 bytes. But if you return a string of 1000 characters from a DLL, the W (wide-character) buffer will have 2000 bytes.

4Test statement which sets the selected option

When you set an option, this field displays the 4Test statement that represents the selected option. For example, if you set the Window timeout to 5 seconds on the Timing tab, the following 4Test statement displays:

Agent.SetOption(OPT_WINDOW_TIMEOUT,5)

The statement uses the SetOption method to operate on the agent object. OPT_WINDOW_TIMEOUT is the internal 4Test name of the Window Timeout option and 5 is the current, default value of the option, five seconds.

This code is useful if you want to set a local value for a given agent. You can type or change the code yourself, then click the Copy to Clipboard button to copy the statement to the clipboard.

Copy to Clipboard
Copies the 4Test statement which sets the option to the clipboard.
Parent topic: Agent Options Dialog Box


Extensions Dialog Box

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Use to enable extensions for applications under test.

Click Options > Extensions.

The Extensions dialog box displays the runtime environments for all extensions that you have installed, or that work with the Classic Agent. The environments listed in the dialog box are used for running the applications that you want to test. The extensions enable Silk Test Classic to recognize the non-standard controls in your environment. If you are using a project, the information you specify in the Extensions dialog box is stored in the partner.ini file. If you are not using a project, the information you specify in the Extensions dialog box is stored in the extend.ini file.

Application Column
Displays the browser and runtime environments that the installation program installed and recognizes automatically. For applications and runtime environments that do not use standard names, or for stand-alone applications, you must use the New button to manually add the name of the executable or DLL file to the Extensions dialog box. If the executable name contains spaces, you must enclose the name in quotation marks.
Primary Extension Column

For each application listed in the Application column, the Primary Extension column displays the currently selected primary extension, or Disabled or None, if applicable. To change a primary extension, click in the Primary Extension column, then use the embedded list box to select one of the available options.

Keep in mind that you cannot enable more than one primary extension for an application. Primary extensions are the ones listed in the list boxes of the Extensions dialog box, such as DOM and .NET. Secondary extensions, which are checked with the check boxes in the Extensions dialog box, Java, ActiveX, and Accessibility, are the only ones that can co-exist with another extension. Thus, for example, an embedded browser in a .NET application is not allowed, since both IE DOM and .NET are primary extensions.

Also, remember that not all of the Primary Extensions in the list box can be applied to a new application. Only IE DOM, which has superseded the IE4 OCX extension for embedded browser applications, or .NET extensions make sense for new applications.

Other Extensions
You can use the check boxes in the Other Extensions columns to enable other extensions required for testing each application that is launched in the runtime environment listed in the Application column. When a check box in the Other Extensions column is checked, the corresponding button in the Options area is enabled.
Java
Enables Java support for an application running on the host machine or an applet running in a browser. When the Java check box is checked, the Java button in the Options area is enabled. Click the Java button to display the Extension Options dialog box for Java and select Java extension options for the currently selected application.
ActiveX
Enables ActiveX and Visual Basic support for an application running on the host machine. When the ActiveX check box is checked, the ActiveX button in the Options area is enabled. Click the ActiveX button to display the Extension Options dialog box for ActiveX and select ActiveX extension options for the currently selected application.
Accessibility
Enables Windows Accessibility. When the Accessibility check box is checked, the Accessibility button in the Options area is enabled. Click the Accessibility button to display the Windows Accessibility dialog box.
.NET
Enables .NET support for an application running on the host machine.
Options area

The buttons in the Options area are disabled until a corresponding extension is enabled for the currently selected application.

Extension
Enabled only when a browser is enabled in the Primary Extension column for the currently selected application. Click Extension to display the DOM Extensions dialog box and specify options for the DOM extension.
Java
Enabled only when a Java check box is checked in the Other Extensions column for the currently selected application. Click Java to display the Extension Options dialog box for Java and redirect output from the Java console to a local file. This allows you to scroll and copy text more easily.
ActiveX
Enabled only when an ActiveX check box is checked in the Other Extensions column for the currently selected application. Click ActiveX to display the Extension Options dialog box for ActiveX and select ActiveX and Visual Basic options.
Accessibility
Enabled only when an Accessibility check box is checked in the Other Extensions column for the currently selected application. Click Accessibility to display the Windows Accessibility dialog box.
New

Displays the Extension application dialog box where you can add one or more runtime environments to the Extensions dialog box for testing applications.

Duplicate

Active only when you select a runtime environment in the Application column that you entered manually. You cannot duplicate runtime environments that are installed by default. Click Duplicate to add a new application that has all the same settings, primary and other extensions and other options, as the selected application, but with a different name.

Remove

Active only when you select a runtime environment in the Application column that you entered manually. You cannot remove runtime environments that are installed by default. Click Remove to delete a runtime environment from the dialog box.

Details

Active only when you select a runtime environment with an enabled Primary Extension. Click Details to display detailed information about the runtime environment, including version, help text, and executable modules.

  • Extension Details Dialog Box
    Describes the Extension Details dialog box.
Parent topic: Setting Silk Test Classic Options


Extension Details Dialog Box

Use the Extension Details dialog box to view more information about the selected extension. Access this dialog box by clicking Options > Extensions, enabling and selecting the extension for which you want to view details, and then clicking Details.

This dialog box contains:
File
Displays the file name associated with the selected extension.
Version
Displays the version of the file associated with the selected extension.
Include
Displays the name of the include file associated with the selected extension, if applicable.
Help text
Displays the file name of the help text associated with the selected extension, if applicable.
Prop set
Displays the name of the property set associated with the selected extension.
Modules
Displays the name of modules associated with the selected extension, if applicable.
Parent topic: Extensions Dialog Box


Setting Recording Options for the Classic Agent

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

You can set the recording options to optimize recording with the Classic Agent in the following two ways:
  • In the Recorder Options dialog box.
  • Within a script, by using the SetOption method.

Using SetOption overrides the value specified for the option in the Recorder Options dialog box. If you do not set an option with SetOption, the value specified in the Recorder Options dialog box is the default.

To set the recording options in the Recorder Options dialog box, perform the following actions:

  1. Click Options > Recorder. The Recorder Options dialog box opens.
  2. To set Ctrl+Shift as the shortcut key combination to use to pause recording, check the Change hotkey to Ctrl+Shift check box. By default, Ctrl+Alt is the shortcut key combination.
  3. To record the tags that are specified in the Record Window Declarations Options dialog box, check the Record multiple tags check box. If checked, Silk Test Classic records multiple tags whenever recording. If this check box is disabled, see the description of the multiple tags agent option.
    Note: If you change the setting for Record Multiple Tags here, the check box on the Record Window Declarations Options dialog box is automatically updated.
  4. To add new declarations to the INC file during recording, check the Auto Declaration check box.
  5. To verify the test application using properties instead of attributes, check the Verify using properties check box. This option is checked automatically if you have enabled enhanced support for Visual Basic. This feature requires properties for verification. You cannot uncheck the Verify using properties check box without disabling enhanced support for Visual Basic.
  6. Specify the file that contains the definitions for the used property sets in the Data file for property sets field.
  7. To record events at a lower level for selected controls, check the corresponding check boxes in the Recorded Events list. For example, you might want to record a click in a check box, instead of recording an actual selection. If you specify that you want to record only low-level events in check boxes, Silk Test Classic records something like the following when you select a check box: Find.CaseSensitive.Click (1, 41, 10). If you are using a high-level event, Silk Test Classic records something like the following: Find.CaseSensitive.Check ().
  8. Uncheck the Ignore mouse move events check box to record mouse movements. If this check box is unchecked, Silk Test Classic records mouse movements that cannot be built into higher-level actions and that occur while a mouse button is pressed. Leave this check box checked unless you are testing an application, such as a drawing application, where mouse movements themselves are significant.
  9. To record mouse movements that cannot be built into higher-level actions and that occur while a mouse button is pressed when you select the Record Testcase and Record Actions commands, uncheck the Ignore mouse move events check box. Leave the check box checked unless you are testing an application where mouse movements themselves are significant.
  10. Uncheck the Don't record BeginDrag/EndDrag check box to record BeginDrag and EndDrag methods when you press a mouse button on an object and do a drag operation on a listview, treeview, or list box.
  11. Click OK.
Parent topic: Setting Silk Test Classic Options


Defining which Custom Locator Attributes to Use for Recognition

The Open Agent includes a sophisticated locator generator mechanism that guarantees locators are unique at the time of recording and are easy to maintain. Depending on your application and the frameworks that you use, you might want to modify the default settings to achieve the best results and stable recognition of the controls in your application. You can use any property that is available in the respective technology as a custom attribute, given that the property is either a number, like an integer or a double, a string, an item identifier, or an enumeration value.

A well-defined locator relies on attributes that change infrequently and therefore requires less maintenance. Using a custom attribute is more reliable than other attributes like caption or index, since a caption will change when you translate the application into another language, and the index might change when another object is added.

In xBrowser, WPF, Java SWT, and Swing applications, you can also retrieve arbitrary properties, such as a WPFButton that defines myCustomProperty, and then use those properties as custom attributes. To achieve optimal results, the application developers can add a custom automation ID to the controls that you want to interact with in your test. In Web applications, the application developers can add an attribute to controls that you want to interact with, such as <div myAutomationId=”my unique element name” />. This approach can eliminate the maintenance associated with locator changes. Or, in Java SWT, the UI developer can define a custom attribute, for example testAutomationId, for a widget that uniquely identifies the widget in the application. You can then add that attribute to the list of custom attributes, in this case testAutomationId, and you can then identify controls by that unique ID. This approach can eliminate the maintenance associated with locator changes.

If more than one objects have the same custom attribute value assigned, all the objects with that value will be returned when you call the custom attribute. For example, if you assign the unique ID loginName to two different text boxes, both text boxes will be returned when you call the loginName attribute.

To define which custom attributes of a locator should be used for the recognition of the controls in your AUT:
  1. Click Options > Recorder and then click the Custom Attributes tab.
  2. From the Select a tech domain list box, select the technology domain for the application that you are testing.
    Note: You cannot set custom attributes for Flex or Windows API-based client/server (Win32) applications.
  3. Add the attributes that you want to use to the list. If custom attributes are available, the locator generator uses these attributes before any other attribute. The order of the list also represents the priority in which the attributes are used by the locator generator. If the attributes that you specify are not available for the objects that you select, Silk Test Classic uses the default attributes for the application that you are testing. Separate attribute names with a comma.
  4. Click OK. You can now record or manually create a test case.
Parent topic: Setting Silk Test Classic Options
Related concepts
Supported Locator Attributes
How Can the Application Developers Make Applications Ready for Automated Testing?
Related tasks
Recording Test Cases for Standard and Web Applications
Recording Locators Using the Locator Spy
Setting Recording Options for the Open Agent


Setting Classes to Ignore

To specify the names of any classes that you want to ignore during recording and replay:

  1. Click Options > Recorder. The Recording Options dialog box opens.
  2. Click the Transparent Classes tab.
  3. In the Transparent classes grid, type the name of the class that you want to ignore during recording and replay. Separate class names with a comma.
  4. Click OK.
Parent topic: Setting Silk Test Classic Options


Property Sets Dialog Box

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Use the Property Sets dialog box to view existing property sets and create, modify, combine, and delete property sets. Property sets are used to verify properties in test cases.

To open the Property Sets dialog box, click Options > Property Sets.

The Property Sets dialog box includes the following items:

Item
Description
Property Sets
Displays the list of available property sets.
New
Click to access the New Property Set dialog box where you can create new property sets.
Combine
Click to access the Combine Property Sets dialog box where you can combine existing property sets into a new property set.
Edit
Click to access the Edit Property Set dialog box where you can modify and delete property sets.
Remove
Click to delete the selected property set. Select the property set that you want to remove, click Remove, and then click Yes to delete the selected property set.
  • New Property Set Dialog Box
    Describes the New Property Set dialog box.
  • Combine Property Sets Dialog Box
    Describes the Combine Property Sets dialog box.
Parent topic: Setting Silk Test Classic Options


New Property Set Dialog Box

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Use the New Property Set dialog box to create property sets, which are used to verify properties in test cases. Use the Edit Property Set dialog box to modify and delete property sets.

To access the New Property Set dialog box, click Options > Property Sets > New or click Define on the Verify Window dialog box.

To access the Edit Property Set dialog box, click Options > Property Sets > Edit.

The dialog boxes contain the following items:
Name
Type the name of the property set you want to create. Property set names are not case sensitive and they can be any length and consist of any combination of alphanumeric characters and underscore characters.
List of property sets
Displays existing property sets. This list changes, depending on whether you are adding new property sets or editing them.
Class
Type the name of the property set’s class. The name of the class is not validated, so be sure to type carefully. Invalid names are ignored at runtime.
Property
Type the property of the class you have just identified.
Add
Click to add the class/property pair to the list.
Edit
Click after selecting a class/property set you want to edit.
Remove
Click after selecting a class/property set you want to delete.
Parent topic: Property Sets Dialog Box


Combine Property Sets Dialog Box

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Use the Combine Property Sets dialog box to combine existing property sets.

To open the dialog box, click Options > Property Sets > Combine. You must select an existing property set before Combine is enabled.

The Combine Property Sets dialog box includes the following items:

Name
Specify a name for the property set you are creating.
Property sets to combine
From this list, select at least two property sets that you want to combine into a new property set.
Note: If any of the existing property sets are modified, the combined property set will be modified as well.
Parent topic: Property Sets Dialog Box


DOM Extensions Dialog Box

Use to set object and table recognition options for the DOM extension.

Click Options > Extensions, enable a primary extension in the Primary Extension column, and then click Extension in the Options area.

Note: The primary extension must be enabled before you can click Extension.

The information that you enter on this dialog box is saved in the domex.ini file in your <SilkTest installation directory>\Extend directory. To avoid any confusion, we recommend that you do not have the domex.ini file open while you are working with the DOM Extensions dialog box.

There are several DOM extension options that are not available through the DOM Extensions dialog box.

Show the following components area

Borderless Table

Check the Table check box and set a value for borderless table recognition. .76 is the threshold where Silk Test Classic starts to recognize more objects within tables, such as images, hidden text, check boxes, textfields, and buttons.

Meta
If checked, the DOM extension records Meta objects. Default is checked. Uncheck this check box if you do not want the DOM extension to record Meta objects.
Hidden
If checked, the DOM extension records Hidden objects. Default is checked. Uncheck this check box if you do not want the DOM extension to record Hidden objects.
XML
If checked, the DOM extension records XML objects. Default is unchecked. Check this check box if you want the DOM extension to record XML objects.
Invisible
If checked, the DOM extension records invisible objects. Default is checked. Uncheck this check box if you do not want the DOM extension to record invisible objects. If your browser-based application consists of pages that contain many invisible objects that you do not need to test, then you can improve performance by un-checking this check box in order to ignore all invisible objects.
Form
If checked, the DOM extension records Form objects. Default is unchecked. Check this check box if you want the DOM extension to record Form objects.
Text
If checked, the DOM extension records Text objects. Default is checked. Uncheck this check box if you do not want the DOM extension to record Text objects. If you are testing a transaction type page with a lot of text, consider un-checking the Text check box. This prevents Silk Test Classic from recording many text objects, which helps your declarations to be clean. If, on the other hand, you're looking for formatting and styles of text objects, you'll want to select this option.
BodyText
If checked, the DOM extension records BodyText objects, which is text that is not contained within an HTML tag. (In previous releases, body text appeared as HtmlText.) Default is unchecked. We suggest keeping this option unchecked for improved performance, particularly when recording window declarations on large pages. Should you need to record body text, check this check box. Silk Test Classic sometimes treats body text differently from HTML text that is in an HTML tag. For example, GetChildren() will not return body text. Also, Record Window Declarations will not highlight the window declaration of a body text object when the cursor is moved over it, and other recorders such as Record Window Identifiers will not detect it. IsVisible() returns FALSE for body text.
List Item
If checked, the DOM extension shows the text contained within HtmlList controls in your browser. Default is checked. If mouse events are associated with your list items, check this check box so Silk Test Classic can interact with the list items. This setting is global. However, if you want to set this option for only certain points in your script, use BrowserPage.SetUserOption() as described in SetUserOption().

Object recognition options area

Use Browser nearest text
Determines how the DOM extension finds the closest static text for HtmlTable, HtmlLink-text, HtmlColumn, HtmlLink-image, HtmlImage, HtmlHeading, HtmlText, HtmlRadioList, and HtmlPushbutton. Check this check box if you want Silk Test Classic to use the DOM extension to find the closest static text for the objects listed above. This does not apply to invisible objects such as XML, Meta, and Hidden; those objects do not rely on any text on a page and so it would be meaningless to try to associate them with any objects. Uncheck this check box if you want to use the Agent to determine closest static text for the objects listed above.
Use virtual column

Affects how the DOM extension records asymmetric tables. These are tables that use either column span or row span attributes, or tables whose rows don't have the same number of columns. An example of an asymmetric table is a typical calendar page that has the month of January written across the top row and the seven days of the week in seven columns across the 2nd row.

We highly recommend that you check this box if you are working with tables that have asymmetrical rows.

Check this check box if you want to create virtual columns for any row in a table. In the example above, it causes the top row to contain one real column for "January", followed by 6 virtual columns which are blank and align with Mon, Tues, etc. These virtual columns appear where there are none in order to complete the table and they are named virtual1, virtual2, and so on. These virtual columns cause the table to be symmetrical.

Uncheck this check box to avoid creating virtual columns. This causes Silk Test Classic to record the top row as the name for first column. This occurs because there is no 2nd column in the top row; Mon is promoted to the name of the second column, and so on.

Search whole DOM tree
Determines how windows declarations are found. To search the entire DOM tree when you record windows declarations, check the Search whole DOM tree check box.
Parent topic: Setting Silk Test Classic Options


Extension Application Dialog Box

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Use the Extension Application dialog box to add one or more runtime environments to the Extensions dialog box for testing applications.

Click Options > Extensions and then click New.

Enter name(s) of executable or DLL file
Type the name of the executable or DLL that you want to add, separated by commas. If the executable name contains spaces, enclose the name in quotation marks. Note that after enabling a new application, you may need to run the Extension Enabler on the target machine and restart any applications affected by these changes.
Browse button
Click to browse to the executable you want to add.
Parent topic: Setting Silk Test Classic Options


Extension Options (ActiveX) Dialog Box

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Use to specify options for the currently selected extension.

Click Options > Extensions, select the appropriate extension, enable ActiveX in the Other Extensions column, and then click ActiveX.

Ignore VB and SS Frames
Check this check box to allow scripts created prior to Silk Test Classic 5.0 to run properly. When this option is selected, the frame is essentially ignored and objects in VB and SS (Sheridan OCX) frames are treated as children of the main window rather than child objects of the containing frame. If you do not select this option for scripts created prior to Silk Test Classic 5.0, you will need to re-record window declarations in the current release and edit your scripts.
Note: If the controls inside the VB and SS frames are windowless, then this option will not work properly. In this case, you can use this option successfully only if you change the controls so that they have windows.

Do not select this option for window declarations recorded In Silk Test Classic 5.0 or later, which treats objects in these frames as children of the frame and grandchildren of the main window. The window declarations file reflects this deeper nesting.

Note: This change brings Silk Test Classic into conformance with current MS Windows architecture.
Parent topic: Setting Silk Test Classic Options


Extension Options Dialog Box (Java)

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Use the Extension Options dialog box for Java to specify options for the currently selected extension.

Click Options > Extensions, select the appropriate extension, and then click Java.

Java console filename
Type the path to the file to which you want to redirect Java console output.
Redirect Java console output
Check this check box if you want to redirect output from the Java console to a local file where you can easily scroll and copy the text. When testing with the SilkBean, you cannot redirect console output using this option.
Parent topic: Setting Silk Test Classic Options


TrueLog Options - Classic Agent Dialog Box

Use the TrueLog Options - Classic Agent dialog box to enable TrueLog for the Classic Agent and to customize the information that the TrueLog collects for Silk Test Classic.

Click Options > TrueLog.

Logging bitmaps and controls in TrueLog may adversely affect the performance of Silk Test Classic. Because capturing bitmaps and logging information can result in large TrueLog files, you may want to log test cases with errors only and then adjust the TrueLog options for test cases where more information is needed.

Note: By default, TrueLog Explorer is enabled when you are using the Open Agent, and disabled when you are using the Classic Agent. When TrueLog Explorer is enabled, the default setting is that screenshots are only created when an error occurs in the script and only test cases with errors are logged.

For additional information about TrueLog Explorer, refer to the Silk TrueLog Explorer User Guide, located in (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Documentation or (in Microsoft Windows 10) Start > Silk.

Logging Settings tab

Enables the TrueLog capture and configures the TrueLog.

Enable TrueLog

Captures TrueLog data and activates logging settings. You can also enable or disable TrueLog each time you run a test case by checking this check box in the Run Testcase dialog box. When you enable or disable TrueLog in the Run Testcase dialog box, Silk Test Classic makes the same change in the TrueLog Options dialog box. Likewise, when you enable or disable TrueLog in the TrueLog Options dialog box, Silk Test Classic makes the same change in the Run Testcase dialog box.

All testcases
Logs activity for all test cases, both successful and failed.
Testcases with errors
Logs activity for only those test cases with errors.
TrueLog file
Designates the location and name of the TrueLog file. This path is relative to the machine on which the agent is running. The name defaults to the name used for the results file, with an .xlg extension. The location defaults to the same folder as the test case .res file.
Note: If you provide a local or remote path in this field, the path cannot be validated until script execution time.
Log the following for controls
Logs certain types of information about the controls on the active window or page.
Control information

Logs the GUI control’s hierarchy, name, type, and other attributes for the active window or page. This information appears on the Controls tab of the Information window in TrueLog Explorer. This is selected by default when you enable TrueLog. If you choose to log control information, you may optionally decide to log:

Control creation/deletion
Tracks the creation and/or deletion of controls on the active window or page. TrueLog updates the control hierarchy after each action. Choosing this option may adversely affect performance.
Include static text controls
Includes the static text controls in the logged hierarchy. To keep TrueLogs small, leave this option turned off for browser testing.
Track low level events
Logs keyboard and mouse events. For each mouse click and key press a new Action node is created on the Tree List in the TrueLog. Use caution when selecting this option for browser applications, as you can significantly impact performance.
Log the following for browsers

Identifies the browser events you want to capture.

Download events
Captures all events that trigger page downloads. Selected by default.
Navigate events
Captures all events that cause new pages to appear. Selected by default.
Terminate events
Captures all events that cause a browser to close. Selected by default.
New window events
Captures all events that cause a new browser window to appear. Selected by default.
MouseMove calls
Logs all scripted MouseMove calls. This is useful for tracking JavaScript MouseOver events. By including this information in TrueLogs, you may significantly affect performance. This information appears as an Action node in the Tree List.
TrueLog delay
Allows Windows time to draw the application window before a bitmap is taken. The delay can be used for browser testing. You can insert a Browser.WaitForReady call in your script to ensure that the DocumentComplete events are seen and processed. If WindowActive nodes are missing from the TrueLog, you need to add a Browser.WaitForReady call. You can also use TrueLog Delay to optimize script performance. Set the delay as small as possible to get the correct behavior and have the smallest impact on script execution time. The default setting is 0.
Enable bitmap capture

Controls when TrueLog captures screenshots of the application under test. Bitmap files are included in TrueLog (.xlg) files. Selected by default.

As specified on action settings tab
Enables the capture of bitmaps for each action type you select on the Action Settings tab. This setting also causes a bitmap capture each time a window becomes active in your application.
On error
Captures a bitmap when an error occurs in your test case.
Window only
Saves the bitmaps for the active window.
Desktop
Saves a bitmap of the entire desktop.
Before error bitmap
Captures the bitmap before the error occurred.
TrueLog Presets

Sets pre-determined logging levels.

Minimal

Logs test cases with errors; enables bitmap capture of desktop on error; does not log any actions.

Default
Logs test cases with errors; enables bitmap capture of window on error; logs data for Select and SetText actions; enables bitmap capture for Select and SetText actions.
Full

Logs all test cases; logs all control information; logs all events for browsers except for MouseMove events; enables bitmap capture of the window on error; captures bitmaps for all actions.

If you enable Full logs and encounter a Window Not Found error, you may need to manually edit your script.

Action Settings tab

The Action Settings tab on the TrueLog Options - Classic Agent dialog box selects the scripted actions you want to include in the TrueLog. When enabled, these actions appear as nodes in the Tree List view of the TrueLog.

Select actions to log
Enable

Selects the action to log. Each action corresponds to a 4Test method, except for Click and Select.

Click

Records mouse clicks on many controls, such as PushButton, ScrollBar, TextField, and HtmlLink. To record Click methods on a CheckBox, choose Select, not Click.

Select

Records actions on multiple methods of multiple types of controls, including ListBox, TreeView, ComboBox, RadioButton, and CheckBox. Here is a partial list of what Select records:

  • Select (ListBox, TreeView, ComboBox, RadioButton)
  • DoubleSelect, SelectList, SelectRange (ListBox, TreeView)
  • Click (ListBox, TreeView, ComboBox, RadioButton, CheckBox)
  • Check, Uncheck, Toggle, SetState (CheckBox)
Bitmap

Selects the point in time you want bitmaps to be captured:

None
Never captures bitmaps.
Before
Captures bitmaps before errors occur.
After

Captures bitmaps after errors occur.

Both

Capture bitmaps both before and after errors occur.

Parent topic: Setting Silk Test Classic Options


TrueLog Options - Open Agent Dialog Box

Use the TrueLog Options - Open Agent dialog box to enable TrueLog for the Open Agent and to customize the information that the TrueLog collects for Silk Test Classic.

Click Options > TrueLog.

You can additionally use the Difference Viewer to analyze results for test cases that use the Open Agent.

Logging bitmaps and controls in a TrueLog may adversely affect the performance of Silk Test Classic. Because capturing bitmaps and logging information can result in large TrueLog files, you may want to log test cases with errors only and then adjust the TrueLog options for test cases where more information is needed.

Note: By default, TrueLog Explorer is enabled when you are using the Open Agent, and disabled when you are using the Classic Agent. When TrueLog Explorer is enabled, the default setting is that screenshots are only created when an error occurs in the script and only test cases with errors are logged.

For additional information about TrueLog Explorer, refer to the Silk TrueLog Explorer User Guide, located in (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Documentation or (in Microsoft Windows 10) Start > Silk.

Enable TrueLog

Captures TrueLog data and activates logging settings. You can also enable or disable TrueLog each time you run a test case by checking this check box in the Run Testcase dialog box. When you enable or disable TrueLog in the Run Testcase dialog box, Silk Test Classic makes the same change in the TrueLog Options dialog box. Likewise, when you enable or disable TrueLog in the TrueLog Options dialog box, Silk Test Classic makes the same change in the Run Testcase dialog box.

All testcases
Logs activity for all test cases, both successful and failed.
Testcases with errors
Logs activity for only those test cases with errors.
TrueLog Location
The path is relative to the machine on which the agent is running. The default path is the path of the Silk Test Classic project folder, and the default name is the name of the suite class, with a .tlz suffix. To ensure that TrueLog files are not overwritten, for example when you perform parallel testing, you can add placeholders to the TrueLog file name. These placeholders are replaced with the appropriate data at execution time.
Note: The path is validated at execution time. Tests that are executed by Silk Central set this value to the Silk Central results directory to enable the screenshots to be shown in the result view.
Screenshot mode
Controls when TrueLog Explorer captures test application screens during playback of the application under test. Bitmap files are included in TrueLog (.xlg) files.
Note: For test cases with errors, TrueLog Explorer always captures a screen, independent of the screenshot mode you have selected.
None
Captures no screens during playback.
Active Window
Captures only the active window of the test application during playback.
Active Application
Captures the test application and any windows within the test application.
Desktop

Captures the entire desktop area.

Delay

Allows Windows time to draw the application window before a bitmap is taken. You can also use Delay to optimize script performance. Set the delay as small as possible to get the correct behavior and have the smallest impact on script execution time. The default setting is 0.

Parent topic: Setting Silk Test Classic Options
Related concepts
TrueLog Explorer
Opening the TrueLog Options Dialog Box
Setting TrueLog Options


Troubleshooting the Open Agent

This section provides information and workarounds for working with the Open Agent.

  • Troubleshooting Apache Flex Applications
    Provides help and troubleshooting information for working with Apache Flex applications.
  • Troubleshooting Basic Workflow Issues with the Open Agent
    Describes how to troubleshoot basic workflow issues with the Open Agent.
  • Error Messages
    Provides help and troubleshooting information for error messages.
  • Handling Exceptions
    Provides help and troubleshooting information for handling exceptions.
  • Troubleshooting Java Applications
    Help and troubleshooting information for working with Java applications.
  • Multiple Machines Testing
    Provides help and troubleshooting information for testing on multiple machines.
  • Other Problems
    Provides help and troubleshooting information for problems that are not covered by another section.
  • Troubleshooting Projects
    Provides solutions to common problems that you might encounter when you are working with projects in Silk Test Classic.
  • Recognition Issues
    Provides help and troubleshooting information for recognition issues.
  • Tips
    Provides general troubleshooting tips.
  • Troubleshooting Web Applications
    Provides solutions for common problems that might lead to a failure of a Web application test.


Troubleshooting Apache Flex Applications

This functionality is supported only if you are using the Open Agent.

This section provides help and troubleshooting information for working with Apache Flex applications.

  • Why Cannot Silk Test Classic Recognize Apache Flex Controls?
    Describes what you can try when Silk Test Classic cannot recognize controls for an Apache Flex application.
Parent topic: Troubleshooting the Open Agent
Related concepts
Testing Apache Flex Applications


Why Cannot Silk Test Classic Recognize Apache Flex Controls?

This functionality is supported only if you are using the Open Agent.

If Silk Test Classic cannot recognize the controls of an Apache Flex application, which you are accessing through a Web server, you can try the following things:
  • Compile your Apache Flex application with the Adobe automation libraries and the appropriate FlexTechDomain.swc for the Apache Flex version.
  • Use runtime loading.
  • Apache Flex controls are not recognized when embedding an Apache Flex application with an empty id attribute.
Parent topic: Troubleshooting Apache Flex Applications
Related concepts
Testing Apache Flex Applications


Troubleshooting Basic Workflow Issues with the Open Agent

The following troubleshooting tips might help you with the basic workflow:

Why is my application not displayed in the Select Application dialog box?

If the application that you want to test is not displayed in the Select Application dialog box, try the following:
  • Uncheck the Hide processes without caption check box. This check box is checked by default and prevents applications without a caption from being displayed in the dialog box.
  • Run Silk Test Classic with elevated privileges.
    1. Close Silk Test Classic.
    2. Stop the Open Agent.
    3. Run Silk Test Classic as an administrator.
  • Use the Task Manager to check if the application is running under a different user account.
  • Ensure that the application is not started with the runas command or a similar command.
Parent topic: Troubleshooting the Open Agent
Related reference
Troubleshooting Configuration Test Failures
Troubleshooting Web Applications
Troubleshooting Java Applications


Error Messages

This section provides help and troubleshooting information for error messages.

  • Agent not responding
    Describes how to troubleshoot an unresponsive agent.
  • Control is not responding
    Describes what to do if a control is not responding.
  • Functionality Not Supported on the Open Agent
    Describes what happens if you use functionality, which is supported only with the Classic Agent, in an Open Agent script.
  • Unable to Connect to Agent
    Describes what to do if you cannot connect to the agent.
  • Window is not active
    Describes the window is not active error.
  • Window is not enabled
    Describes the window is not enabled error.
  • Window is not exposed
    Describes the window is not exposed error message.
  • Window not found
    Describes the window not found error message.
Parent topic: Troubleshooting the Open Agent


Agent not responding

Problem

You get the following error message:

Error: Agent not responding

This error can occur for a number of reasons.

Solution

Try any or all of the following:

  • Restart the application that you are testing.

  • Restart Silk Test Classic.

  • Restart the Host machine.

If you are recording declarations on a very large page and get this error, consider increasing the AgentTimeout.

Parent topic: Error Messages


Control is not responding

Problem

You run a script and get the following error: Error: Control is not responding

This is a catch-all error message. It usually occurs in a Select( ) statement when Silk Test Classic is trying to select an item from a ListBox, TreeView, ListView, or similar control.

The error can occur after the actual selection has occurred, or it can occur without the selection being completed. In general the error means that the object is not responding to the messages Silk Test Classic is sending in the manner in which it expects.

Solution

Try these things to eliminate the error message:

  • If the line of code is inside a Recording block, remove the Recording keyword.

  • Set the following option just before the line causing the error: Agent.SetOption(OPT_VERIFY_RESPONDING, FALSE).

  • If the selection is successful, but you still get the error, try using the Do . . . except feature.

Parent topic: Error Messages
Related reference
do ... except Statement


Functionality Not Supported on the Open Agent

If you use Classic Agent functionality in an Open Agent script, an error message displays, stating that the functionality is not supported on the Open Agent.

Example

For example, if you try to call the ClearTrap function of the Classic Agent on a MainWin object in an Open Agent script, the following error message displays:
The Open Agent does not support the function 'MainWin::ClearTrap'#
Parent topic: Error Messages


Unable to Connect to Agent

Problem

You get the following error message: Error: Unable to connect to agent

This error can occur for a number of reasons.

Solution

Connect to the default agent

Click Tools > Connect to Default Agent.

The command starts the Classic Agent or the Open Agent on the local machine depending on which agent is specified as the default in the Runtime Options dialog. If the agent does not start within 30 seconds, a message is displayed. If the default agent is configured to run on a remote machine, you must connect to it manually.

Restart the agent that you require for testing

Click (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Tools > Silk Test Open Agent or (in Microsoft Windows 10) Start > Silk > Silk Test Open Agent or (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Tools > Silk Test Classic Agent or (in Microsoft Windows 10) Start > Silk > Silk Test Classic Agent.

Parent topic: Error Messages


Window is not active

Problem

You run a script and get the following error: Error: Window 'name' is not active.

This error means that the object Silk Test Classic is trying to act on is not active. This message applies to top-level windows (MainWin, DialogBox, ChildWin).

Solution

You can correct the error by doing one of the following:

  1. Edit the script and add an explicit SetActive() statement to the window you are trying to act on just above the line where the error is occurring. An easy way to do this is to double-click the error in the results file. You will be brought to the line in the script. Insert a new line above it and add a line ending with the SetActive() method.

  2. Tell Silk Test Classic not to verify that windows are active. There are two ways to do this:

    To turn off the verification globally, uncheck the Verify that windows are active option on the Verification tab in the Agent Options dialog (Options > Agent).

    To turn off the option in your script on a case by case basis, add the following statement to the script, just before the line causing the error: Agent.SetOption(OPT_VERIFY_EXPOSED, FALSE).

  3. Then add the following line just after the line causing the error: Agent.SetOption(OPT_VERIFY_EXPOSED, TRUE).

    This means Silk Test Classic will execute the action regardless of whether the window is active.

  4. Extend the window time out to be greater than 10 by inserting the Agent - Window Timeout to >= 10 into your partner.ini.

Parent topic: Error Messages


Window is not enabled

Problem

You run a script and get the following error: Error: Window 'name' is not enabled.

This error means that the object that Silk Test Classic is trying to act on is not enabled. This message applies to controls inside top-level windows (such as PushButton and CheckBox).

Solution

You can correct this problem in one of two ways.

  • If the object is indeed disabled, edit the script and add the actions that will enable the object.

  • If the object is in fact enabled and you want the script to perform the action, tell Silk Test Classic not to verify that a window is enabled:

To turn off the verification globally, uncheck the Verify that windows are enabled option on the Verification tab in the Agent Options dialog box (Options > Agent).

To turn off the option in your script on a case-by-case basis, add the following statement to the script, just before the line causing the error: Agent.SetOption(OPT_VERIFY_ENABLED, FALSE)

Then add the following line just after the line causing the error: Agent.SetOption(OPT_VERIFY_ENABLED, TRUE).

This means Silk Test Classic will execute the action regardless of whether the window is enabled.

Parent topic: Error Messages


Window is not exposed

Problem

You run a script and get the following error: Error: Window 'name' is not exposed.

Sometimes, applications are written such that windows are hidden to the operating system, even though they are fully exposed to the user. A running script might generate an error such as Window not exposed, even though you can see the window as the script runs.

Solution

While it might be tempting to simply turn off the checks for these verifications from the Agent Options > Verification dialog box, the best course of action is to take such errors on a case by case basis, and only turn off the verification in cases where the window is genuinely viewable, but Silk Test Classic is getting information from the operating system saying the object is not visible.

  1. Add the following statement to the script, just before the line causing the error: Agent.SetOption(OPT_VERIFY_EXPOSED, FALSE).

  2. Then add the following line just after the line causing the error: Agent.SetOption(OPT_VERIFY_EXPOSED, TRUE).

This means Silk Test Classic will execute the action regardless of whether it thinks the window is exposed.

Parent topic: Error Messages


Window not found

Problem

You run a script and get the following error: Error: Window 'name' was not found.

Resolution

This error occurs in the following situations:

When the window that Silk Test Classic is trying to perform the action on is not on the desktop.

If you are watching the script run, and at the time the error occurs you can see the window on the screen, it usually means the tag that was generated is not a correct tag. This could happen if the application changed from the time the script or include file was originally created.

To resolve this issue, enable view trace listing in your script.

The window is taking more than the number of seconds specified for the window timeout to open.
To resolve this issue, set the Window Timeout value to prevent Window Not Found exceptions
Only if you are using the Classic Agent, in the TrueLog Options -Classic Agent dialog box, if all of the following options are set
  • The action PressKeys is enabled.
  • Bitmaps are captured after or before and after the PressKeys action.
  • PressKeys actions are logged.

    The preceding settings are set by default if you select Full as the TrueLog preset.

To resolve this issue, modify your test case.

Parent topic: Error Messages
Related concepts
Setting the Window Timeout Value to Prevent Window Not Found Exceptions
Related tasks
Enabling View Trace Listing


Handling Exceptions

This section provides help and troubleshooting information for handling exceptions.

  • Default Error Handling
    Describes default error handling.
  • Custom Error Handling
    Describes how to add to the default error handling.
  • Trapping the exception number
    Describes how to trap the exception number.
  • Defining Your Own Exceptions
    Describes how to define your own exceptions.
  • Using do...except Statements to Trap and Handle Exceptions
    Describes how to use do...except to trap and handle exceptions.
  • Programmatically Logging an Error
    Describes how to programmatically log an error.
  • Performing More than One Verification in a Test Case
    Describes how to perform more than one verification in a test case.
  • Writing an Error-Handling Function
    Describes how you can write an error-handling function.
  • Exception Values
    Describes the exceptions that are generated by Silk Test Classic under specific error conditions.
Parent topic: Troubleshooting the Open Agent


Default Error Handling

If a test case fails, for example if the expected value doesn’t match the actual value in a verification statement, by default Silk Test Classic calls its built-in recovery system, which:

  • Terminates the test case.
  • Logs the error in the results file.
  • Restores your application to its default base state in preparation for the next test case.

These runtime errors are called exceptions. They indicate that something did not go as expected in a script. They can be generated automatically by Silk Test Classic, such as when a verification fails, when there is a division by zero in a script, or when an invalid function is called.

You can also generate exceptions explicitly in a script.

However, if you do not want Silk Test Classic to transfer control to the recovery system when an exception is generated, but instead want to trap the exception and handle it yourself, use the 4Test do...except statement.

Parent topic: Handling Exceptions
Related concepts
Custom Error Handling
Related reference
do ... except Statement


Custom Error Handling

You can also use do ... except to perform some custom error handling, then use the re-raise statement to pass control to the recovery system as usual.

Example: do ... except

The Text Editor application displays a message box if a user searches for text that does not exist in the document. You can create a data-driven test case that verifies that the message box appears and that it displays the correct message. Suppose you want to determine if the Text Editor application is finding false matches, that is, if it is selecting text in the document before displaying the message box. That means that you want to do some testing after the exception is raised, instead of immediately passing control to the recovery system. The following code sample shows how you can use do ... except to keep the control inside the test case:

testcase Negative (SEARCHINFO Data)
  STRING sMatch
  TextEditor.File.New.Pick ()
  DocumentWindow.Document.TypeKeys (Data.sText + Data.sPos)
  TextEditor.Search.Find.Pick ()
  Find.FindWhat.SetText (Data.sPattern)
  Find.CaseSensitive.SetState (Data.bCase)
  Find.Direction.Select (Data.sDirection)
  Find.FindNext.Click ()

  do
    MessageBox.Message.VerifyValue (Data.sMessage)
  except
    sMatch = DocumentWindow.Document.GetSelText ()

    if (sMatch != "")
      Print ("Found " + sMatch + " not " + Data.sPattern)
    reraise
  MessageBox.OK.Click ()

  Find.Cancel.Click ()
  TextEditor.File.Close.Pick ()
  MessageBox.No.Click ()
This following tasks are performed in the example:
  • A test is performed after an exception is raised.
  • A statement is printed to the results file if text was selected.
  • The recovery system is called.
  • The recovery system terminates the test case, logs the error, and restores the test application to its default base state.
As the example shows, following the do keyword is the verification statement, and following the except keyword are the 4Test statements that handle the exception. The exception-handling statements in this example perform the following tasks:
  • Call the GetSelText method to determine what text, if any, is currently selected in the document.
  • If the return value from the GetSelText method is not an empty string, it means that the application found a false match.
  • If the application found a false match, print the false match and the search string to the results file.
  • Re-raise the exception to transfer control to the recovery system.
  • Terminate the test case.

The reraise statement raises the most recent exception again and passes control to the next exception handler. In the preceding example, the reraise statement passes control to the built-in recovery system. The reraise statement is used in the example because if the exception-handling code does not explicitly re-raise the exception, the flow of control passes to the next statement in the test case.

Parent topic: Handling Exceptions
Related concepts
Default Error Handling


Trapping the exception number

Each built-in exception has a name and a number (they are defined as an enumerated data type, EXCEPTION). For example, the exception generated when a verify fails is E_VERIFY ( 13700), and the exception generated when there is a division by zero is E_DIVIDE_BY_ZERO ( 11500).

All exceptions are defined in 4test.inc, in the directory where you installed Silk Test Classic.

You can use the ExceptNum function to test for which exception has been generated and, perhaps, take different actions based on the exception. You would capture the exception in a do...except statement then check for the exception using ExceptNum.

For example, if you want to ignore the exception E_WINDOW_SIZE_ INVALID, which is generated when a window is too big for the screen, you could do something like this:

do
Open.Invoke ()
except
if (ExceptNum () != E_WINDOW_SIZE_INVALID)
 reraise

If the exception is not E_WINDOW_SIZE_INVALID, the exception is reraised (and passed to the recovery system for processing). If the exception is E_ WINDOW_SIZE_INVALID, it is ignored.

Parent topic: Handling Exceptions


Defining Your Own Exceptions

In addition to using built-in exceptions, you can define your own exceptions and generate them using the raise statement.

Consider the following test case:

testcase raiseExample ()
   STRING sTestValue = "xxx"
   STRING sExpected = "yyy"
   TestVerification (sExpected, sTestValue)

TestVerification (STRING sExpected, STRING sTestValue)
  if (sExpected == sTestValue)
    Print ("Success!")
  else
    do
      raise 1, "{sExpected} is different than {sTestValue}"
    except
print ("Exception number is {ExceptNum()}")
      reraise

The TestVerification function tests two strings. If they are not the same, they raise a user-defined exception using the raise statement.

Raise Statement

The raise statement takes one required argument, which is the exception number. All built-in exceptions have negative numbers, so you should use positive numbers for your user-defined exceptions. raise can also take an optional second argument, which provides information about the exception; that information is logged in the results file by the built-in recovery system or if you call ExceptLog.

In the preceding test case, raise is in a do...except statement, so control passes to the except clause, where the exception number is printed, then the exception is reraised and passed to the recovery system, which handles it the same way it handles built-in exceptions.

Here is the result of the test case:

Testcase raiseExample - 1 error
Exception number is 1
yyy is different than xxx
Occurred in TestVerification at except.t(31)
Called from raiseExample at except.t(25)

Note that since the error was re-raised, the test case failed.

Parent topic: Handling Exceptions


Using do...except Statements to Trap and Handle Exceptions

Using do...except you can handle exceptions locally, instead of passing control to the built-in error handler, which is part of the recovery system of Silk Test Classic. The do...except statement has the following syntax:

do
<statements>
except
<statements>

If an exception is raised in the do clause of the statement, control is immediately passed to the except clause, instead of to the recovery system.

If no exception is raised in the do clause of the statement, control is passed to the line after the except clause. The statements in the except clause are not executed.

Consider this simple test case:

testcase except1 (STRING sExpectedVal, STRING sActualVal)

do
 Verify (sExpectedVal, sActualVal)
 Print ("Verification succeeded")
except
 Print ("Verification failed")

This test case uses the built-in function Verify, which generates an exception if its two arguments are not equivalent. In this test case, if sExpectedVal equals sActualVal, no exception is raised, Verification succeeded is printed, and the test case terminates. If the two values are not equal, Verify raises an exception, control immediately passes to the except clause, the first Print statement is not executed, and Verification failed is printed.

Here is the result if the two values "one" and "two" are passed to the test case:

Testcase except1 ("one", "two") - Passed
Verification failed

The test case passes and the recovery system is not called because you handled the error yourself.

You handle the error in the except clause. You can include any 4Test statements, so you could, for example, choose to ignore the error, write information to a separate log file, and log the error in the results file.

Parent topic: Handling Exceptions


Programmatically Logging an Error

Test cases can pass, even though an error has occurred, because they used their own error handler and did not specify to log the error. If you want to handle errors locally and generate an error (that is, log an error in the results file), you can do any of the following:

  • After you have handled the error, re-raise it using the reraise statement and let the default recovery system handle it.
  • Call any of the following functions in your script:
    LogError (string, [cmd-line])

    Writes string to the results file as an error (displays in red or italics, depending on platform) and increments the error counter.

    This function is called automatically if you don’t handle the error yourself.

    cmd-line is an optional string expression that contains a command line.

    LogWarning (string)
    Same as LogError, except it logs a warning, not an error.
    ExceptLog ( )
    Calls LogError with the data from the most recent exception.
Parent topic: Handling Exceptions


Performing More than One Verification in a Test Case

If the verification fails in a test case with only one verification statement, usually an exception is raised and the test case is terminated. However, if you want to perform more than one verification in a test case, before the test case terminates, this approach would not work.

Classic Agent Example

For example, see the following sample test case:
testcase MultiVerify ()
  TextEditor.Search.Find.Pick ()
  Find.VerifyCaption ("Find")
  Find.VerifyFocus (Find.FindWhat)
  Find.VerifyEnabled (TRUE)
  Find.Cancel.Click ()

The test case contains three verification statements. However, if the first verification, VerifyCaption, fails, an exception is raised and the test case terminates. The second and the third verification are not executed.

To perform more than one verification in a test case, you can trap all verifications except the last one in a do...except statement, like the following sample for the Classic Agent shows:
testcase MultiVerify2 ()
   TextEditor.Search.Find.Pick ()
   do
      Find.VerifyCaption ("Find")
   except
      ExceptLog ()
   do
      Find.VerifyFocus (Find.FindWhat)
   except
      ExceptLog ()
   Find.VerifyEnabled (TRUE)
   Find.Cancel.Click ()

All the verifications in this example are executed each time that the test case is run. If one of the first two verifications fails, the 4Test function ExceptLog is called. The ExceptLog function logs the error information in the results file, then continues the execution of the script.

Open Agent Example

For example, you might want to print the text associated with the exception as well as the function calls that generated the exception. The following test case illustrates this:
testcase VerifyTest ()
   STRING sTestValue = "xxx"
   STRING sExpectedValue = "yyy"
   CompValues (sExpectedValue, sTestValue)

CompValues (STRING sExpectedValue, STRING sTestValue)
   do
      Verify (sExpectedValue, sTestValue)
   except
      ErrorHandler ()

ErrorHandler ()
   CALL Call
   LIST OF CALL lCall
   lCall = ExceptCalls ()
   Print (ExceptData ())
   for each Call in lCall
      Print("Module: {Call.sModule}",
      "Function: {Call.sFunction}",
      "Line: {Call.iLine}")
  • The test case calls the user-defined function CompValues, passing two arguments.
  • CompValues uses Verify to compare its arguments. If they are not equal, an exception is automatically raised.
  • If an exception is raised, CompValues calls a user-defined function, ErrorHandler, which handles the error. This is a general function that can be used throughout your scripts to process errors the way you want.
  • ErrorHandler uses two built-in exception functions, ExceptData and ExceptCalls.
    Except Data
    All built-in exceptions have message text associated with them. ExceptData returns that text.
    ExceptCalls
    Returns a list of the function calls that generated the exception. You can see from ErrorHandler above, that ExceptCalls returns a LIST OF CALL. CALL is a built-in data type that is a record with three elements:
    • sFunction
    • sModule
    • iLine
    ErrorHandler processes each of the calls and prints them in the results file.

  • Silk Test Classic also provides the function ExceptPrint, which combines the features of ExceptCalls, ExceptData, and ExceptNum.

    Testcase VerifyTest - Passed
*** Error: Verify value failed - got "yyy", expected "xxx"
Module: Function: Verify Line: 0
Module: except.t Function: CompValues Line: 121
Module: except.t Function: VerifyTest Line: 112

    The second line is the result of printing the information from ExceptData. The rest of the lines show the processing of the information from ExceptCalls.

    This test case passes because the error was handled locally and not re-raised.

Parent topic: Handling Exceptions


Writing an Error-Handling Function

If you want to customize your error processing, you will probably want to write your own error-handling function, which you can reuse in many scripts.

Open Agent Example

For example, you might want to print the text associated with the exception as well as the function calls that generated the exception. The following test case illustrates this:
testcase VerifyTest ()
   STRING sTestValue = "xxx"
   STRING sExpectedValue = "yyy"
   CompValues (sExpectedValue, sTestValue)

CompValues (STRING sExpectedValue, STRING sTestValue)
   do
      Verify (sExpectedValue, sTestValue)
   except
      ErrorHandler ()

ErrorHandler ()
   CALL Call
   LIST OF CALL lCall
   lCall = ExceptCalls ()
   Print (ExceptData ())
   for each Call in lCall
      Print("Module: {Call.sModule}",
      "Function: {Call.sFunction}",
      "Line: {Call.iLine}")
  • The test case calls the user-defined function CompValues, passing two arguments.
  • CompValues uses Verify to compare its arguments. If they are not equal, an exception is automatically raised.
  • If an exception is raised, CompValues calls a user-defined function, ErrorHandler, which handles the error. This is a general function that can be used throughout your scripts to process errors the way you want.
  • ErrorHandler uses two built-in exception functions, ExceptData and ExceptCalls.
    Except Data
    All built-in exceptions have message text associated with them. ExceptData returns that text.
    ExceptCalls
    Returns a list of the function calls that generated the exception. You can see from ErrorHandler above, that ExceptCalls returns a LIST OF CALL. CALL is a built-in data type that is a record with three elements:
    • sFunction
    • sModule
    • iLine
    ErrorHandler processes each of the calls and prints them in the results file.

  • Silk Test Classic also provides the function ExceptPrint, which combines the features of ExceptCalls, ExceptData, and ExceptNum.

    Testcase VerifyTest - Passed
*** Error: Verify value failed - got "yyy", expected "xxx"
Module: Function: Verify Line: 0
Module: except.t Function: CompValues Line: 121
Module: except.t Function: VerifyTest Line: 112

    The second line is the result of printing the information from ExceptData. The rest of the lines show the processing of the information from ExceptCalls.

    This test case passes because the error was handled locally and not re-raised.

Parent topic: Handling Exceptions


Exception Values

This section describes the exceptions that are generated by Silk Test Classic under specific error conditions.

Exception value Description
E_ABORT
Script aborted by user.
E_APP_NOT_READY
The application is not ready.
E_APP_NOT_RESPONDING
 The application is not responding to input.
E_APPID_INVALID
 The specified application ID is not a valid application.
E_BITMAP_NOT_STABLE
The bitmap timeout period set with
OPT_BITMAP_MATCH_TIMEOUT
was reached before the image stabilized.
E_BITMAP_REGION_INVALID
The specified region was off the screen.
E_BITMAPS_DIFFERENT
 The comparison failed when comparing two bitmaps.
E_CANT_CLEAR_SELECTION
 The selection cannot be cleared.
E_CANT_CLOSE_WINDOW
 The window cannot be closed (often resulting when a confirmation dialog box pops up).
E_CANT_COMPARE_BITMAP
Silk Test Classic ran out of a system resource (such as memory) needed to compare the bitmaps.
E_CANT_CONVERT_RESOURCE
 The specified resource cannot be handled by GetResource, although it is a valid resource for the widget.
E_CANT_EXIT_APP
Silk Test Classic was unable to close the application.
E_CANT_EXTEND_SELECTION
 The list box selection can not be extended because nothing is selected.
E_CANT_MAXIMIZE_WINDOW
The window can not be maximized.
E_CANT_MINIMIZE_WINDOW
The window can not be minimized.
E_CANT_MOVE_WINDOW
The window can not be moved.
E_CANT_RESTORE_WINDOW
 The window size can not be restored.
E_CANT_SET_ACTIVE
The window can not be set active.
E_CANT_SET_FOCUS
 The window can not be given the input focus.
E_CANT_SIZE_WINDOW
The window can not be resized.
E_CANT_START_APP
The application cannot be started.
E_COL_COUNT_INVALID
The specified value is not a valid character count.
E_COL_NUM_INVALID
The specified value is not a valid character position.
E_COL_START_EXCEEDS_END
The starting character exceeds the end character position.
E_COLUMN_INDEX_INVALID
The specified index is not a valid column index. All DataGrid methods that use DataGridCell, DataGridRow, or DataGridCol as a parameter may see this exception raised.
E_COLUMN_NAME_INVALID
 The specified index is not a valid column index. All DataGrid methods that use DataGridCell, DataGridRow, or DataGridCol as a parameter may see this exception raised.
E_CONTROL_NOT_RESPONDING
The control is not responding. Raised after checking whether a specified action took place.
E_COORD_OFF_SCREEN
The specified mouse coordinate is off the screen.
E_COORD_OUTSIDE_WINDOW
 The specified coordinate is outside the window. This exception is never raised if the OPT_VERIFY_COORD option is set to FALSE.
E_CURSOR_TIMEOUT
The cursor timeout period was reached before the correct cursor appeared.
E_DELAY_INVALID
The specified delay is not valid.
E_FUNCTION_NOT_REGISTERED
The function called is a user-defined function that hasn't been registered by the application.
E_GRID_HAS_NO_COL_HDR
The specified DataGrid has no column header. All DataGrid methods that use DataGridCell, DataGridRow, or DataGridCol as a parameter may see this exception raised.
E_GUIFUNC_ID_INVALID
The specified function is not a valid function.
E_INTERNAL
Internal Silk Test Classic error.
E_INVALID_REQUEST
Invalid argument count or argument, or wrong number of arguments.
E_ITEM_INDEX_INVALID
 The specified index is not a valid item index.
E_ITEM_NOT_FOUND
The specified item was not found.
E_ITEM_NOT_VISIBLE
The specified item is not visible.
E_KEY_COUNT_INVALID
The repeat count used in the key specification is not a valid number.
E_KEY_NAME_INVALID
The specified key name is not valid.
E_KEY_SYNTAX_ERROR
The syntax used in the key specification is not valid.
E_LINE_COUNT_INVALID
The specified line count is not valid.
E_LINE_NUM_INVALID
The specified line number is not valid.
E_LINE_START_EXCEEDS_END
The specified start line exceeds the end line number.
E_MOUSE_BUTTON_INVALID
The specified mouse button is not valid
E_NO_ACTIVE_WINDOW
 No window is active.
E_NO_COLUMN
 GuptaTable exception.
E_NO_DEFAULT_PUSHBUTTON
The dialog box does not have a default button.
E_NO_FOCUS_WINDOW
 No window has the input focus.
E_NO_SETFOCUS_CELL
GuptaTable exception.
E_NO_SETFOCUS_COLUMN
 GuptaTable exception.
E_NO_SETTEXT_CELL
GuptaTable exception.
E_NOFOCUS_CELL
No cell in the Gupta table has input focus.
E_NOFOCUS_COLUMN
 No column in the Gupta table has input focus.
E_NOFOCUS_ROW
No row in the Gupta table has input focus.
E_NOT_A_TABLEWINDOW
 The specified window is not a Gupta table.
E_OPTION_CLASS_MAP_INVALID
The mapping specified with the OPT_CLASS_MAP option is not valid.
E_OPTION_EVTSTR_LENGTH
The length of the event string given in OPT_MENU_INVOKE_POPUP was too long.
E_OPTION_NAME_INVALID
The specified agent option does not exist.
E_OPTION_TOO_MANY_TAGS
The maximum number of tags was exceeded when specifying buttons and menu items using one or more of these options:
  • OPT_CLOSE_CONFIRM_BUTTONS
  • OPT_CLOSE_WINDOW_BUTTONS
  • OPT_CLOSE_WINDOW_MENUS
E_OPTION_TYPE_MISMATCH
Mismatch between type of agent option and type of specified value.
E_OPTION_VALUE_INVALID
The specified agent option is not valid.
E_OUT_OF_MEMORY
The system has run out of memory.
E_POS_INVALID
The specified position is not valid.
E_POS_NOT_REACHABLE
The specified position cannot be reached. It is out of range of the object.
E_RESOURCE_NOT_FOUND
 The widget does not contain the specified resource.
E_ROW_INDEX_INVALID
The specified index is not a valid row index. All DataGrid methods that use DataGridCell, DataGridRow, or DataGridCol as a parameter may see this exception raised.
E_SBAR_HAS_NO_THUMB
The scroll bar thumb can not be clicked to scroll a page because the scroll bar does not have a thumb.
E_SQLW_BAD_COLUMN_NAME
A bad column name was specified for the Gupta table.
E_SQLW_BAD_COLUMN_NUMBER
A bad column number was specified for the Gupta table.
E_SQLW_BAD_ROW_NUMBER
 A bad row number was specified for the Gupta table.
E_SQLW_CANT_ENTER_TEXT
GuptaTable exception.
E_SQLW_INCORRECT_LIST
GuptaTable exception.
E_SQLW_NO_EDIT_WINDOW
GuptaTable exception.
E_SQLW_TABLE_WINDOW_HIDDEN
 GuptaTable exception.
E_SQLW_TOO_BIG_LIST
GuptaTable exception.
E_SYSTEM
A system operation has failed.
E_TAG_SYNTAX_ERROR
The tag syntax is not valid: invalid coordinate or index, multiple indices specified, the window part is not the last part of the tag, or the tilde (~) is not followed by a child window.
E_TIMER
The specified timer operation is redundant. For example, a pause operation specified for a stopped timer.
E_TRAP_NOT_SET
Attempted to clear a trap that was not set.
E_UNSUPPORTED
The specified method is not supported on the current platform.
E_VAR_EXPECTED
A function or method call has not passed a variable for a required parameter or an expression failed to specify a variable required by an operator.
E_VERIFY
User-specified verification failed.
E_WINDOW_INDEX_INVALID
The tag uses an invalid index number.
E_WINDOW_NOT_ACTIVE
 The specified window is not active.
E_WINDOW_NOT_ENABLED
The specified window is not enabled.
E_WINDOW_NOT_EXPOSED
The specified window is not exposed.
E_WINDOW_NOT_FOUND
The specified window is not found. Raised by any method that operates on a window, except Exists.
E_WINDOW_NOT_UNIQUE

The specified identifier does not represent a unique window. Raised by any method that operates on a window. Affected by the value set with the OPT_VERIFY_UNIQUE option.

If you receive this exception, you might try using a slightly modified tag syntax to refer to a window with a non-unique tag. You can either include an index number after the object, as in Dbox ("Cancel[2]"), or you can specify the window by including the text of a child that uniquely identifies the window, such as Dbox/uniqueText/..., where the unique text is the tag of a child of that window.

E_WINDOW_SIZE_INVALID
The window size is too big for the screen or it is negative.
E_WINDOW_TYPE_MISMATCH
 The specified window is not valid for this method. Raised when the type of window used is not the type the method accepts.
Parent topic: Handling Exceptions
Related concepts
Apache Flex Exception Values
Default Error Handling
Related reference
Active and Enabled Statuses


Multiple Machines Testing

This section provides help and troubleshooting information for testing on multiple machines.

  • Setting Up the Recovery System for Multiple Local Applications
    Describes how to set up the recovery system for multiple local applications.
  • two_apps.t
    The sample script file for the Classic Agent that describes how you can locally test multiple applications.
  • two_apps.inc
    The sample include file for the Classic Agent that describes how you can locally test multiple applications.
Parent topic: Troubleshooting the Open Agent


Setting Up the Recovery System for Multiple Local Applications

Problem

By default, the recovery system will only work for the single application assigned to the const wMainWindow. With distributed testing, you can get recovery on multiple applications by using multitestcase instead of testcase.

You might ask whether you can get the recovery system to work on multiple applications that are running locally using multitestcase locally. The answer is no; multitestcase is for distributed testing only.

But you can use the following solution instead, using testcase.

Solution

To get recovery for multiple local applications, set up your frame file to do the following:

  1. Get standard wMainWindow declarations for each application. The easiest way is to select File > New > Test Frame for each application, then combine the wMainWindow declarations into a single frame file or include them with use.
  2. Make the global wMainWindow a variable of type WINDOW, rather than a constant.
  3. Assign one of the windows to wMainWindow as a starting point.
  4. Create a LIST OF WINDOW and assign the wMainWindow identifier for each application you are dealing with to it.
  5. Define a TestcaseEnter function so that you reassign the wMainWindow variable and call SetAppState on each MainWin in turn.
  6. Define a TestcaseExit function so that you reassign the wMainWindow variable and call SetBaseState on each MainWin in turn.
  7. Then use DefaultBaseState, or your own base state if you want, with each of your test cases. In your test case, use SetActive each time you switch from one application to the other.

Example

The example consists of two sample files. The sample files are for the Classic Agent. If you want to use the example with the Open Agent, you have to change the sample code. For the sample script file, see two_apps.t. For the sample include file, see two_apps.inc. The example uses two demo applications shipped with Silk Test Classic, the Text Editor and the Test Application. To see that the recovery system is working for both applications, turn on the two debugging options in Runtime Options and look at the transcript after running the test script.

The first test case has an intentional error in its last statement to demonstrate the recovery system. The test case also demonstrates how to move data from one application to another with Clipboard.GetText and Clipboard.SetText.

Because the recovery system is on, the DefaultBaseState will take care of invoking each application if it is not already running and will return to the DefaultBaseState after each test case, even if the test case fails.

You can print the sample files out or copy them to the Clipboard, then paste them into Silk Test Classic. You might have to do some cleanup where the indentation of lines is incorrect in the pasted file.

Parent topic: Multiple Machines Testing
Related concepts
two_apps.inc
two_apps.t


two_apps.t

The following sample script file for the Classic Agent shows how you can locally test multiple applications. To use the sample with the Open Agent, you have to change the sample code, for example you have to replace all tags with locators.
testcase Test1 () appstate DefaultBaseState
  //SetActive each time you switch apps
  TestApplication.SetActive()
  TestApplication.File.New.Pick ()
  MDIChildWindow1.TextField1.SetPosition (1, 1)
  MDIChildWindow1.TextField1.TypeKeys ("In Test Application MDI Child Window #1.")
  //SetActive each time you switch apps
  TextEditor.SetActive ()
  TextEditor.File.New.Pick ()
  TextEditor.ChildWin("(untitled)[1]").TextField("#1")
    .TypeKeys ("In Text Editor untitled Document window.<Enter>")
  //SetActive each time you switch apps
  TestApplication.SetActive()
  LIST OF STRING lsTempStrings
  lsTempStrings = MDIChildWindow1.TextField1.GetMultiText()
  Clipboard.SetText([LIST OF STRING]lsTempStrings)
  //SetActive each time you switch apps
  TextEditor.SetActive()
  TextEditor.ChildWin("(untitled)[1]").TextField("#1").SetMultiText(Clipboard.GetText(),2)
  TextEditor.VerifyCaption("FooBar")

testcase Test2 () appstate DefaultBaseState
  wMainWindow = TestApplication
  TestApplication.SetActive()
  TestApplication.File.New.Pick ()
  MDIChildWindow1.TextField1.SetPosition (1, 1)
  MDIChildWindow1.TextField1.TypeKeys ("In Test Application MDI Child Window #1.")
  wMainWindow = TextEditor
  TextEditor.SetActive ()
  TextEditor.File.New.Pick ()
  TextEditor.ChildWin("(untitled)[1]").TextField("#1")
    .TypeKeys ("In Text Editor untitled Document window.<Enter>")
  wMainWindow = TestApplication
  TestApplication.SetActive()
  LIST OF STRING lsTempStrings
  lsTempStrings = MDIChildWindow1.TextField1.GetMultiText()
  Clipboard.SetText([LIST OF STRING]lsTempStrings)
  wMainWindow = TextEditor
  TextEditor.SetActive()
  TextEditor.ChildWin("(untitled)[1]").TextField("#1").SetMultiText(Clipboard.GetText(),2)
Parent topic: Multiple Machines Testing
Related concepts
Setting Up the Recovery System for Multiple Local Applications
two_apps.inc


two_apps.inc

The following sample include file for the Classic Agent shows how you can locally test multiple applications. To use the sample with the Open Agent, you have to change the sample code, for example you have to replace all tags with locators.
// two_apps.inc
// define wMainWindow as a window global var
// and assign one of the apps (your pick) as a starting point.
window wMainWindow = TextEditor
const wMainWindow = TextEditor //replace default def

// Create a list of app MainWins
list of window lwApps = {...}
TextEditor
TestApplication
// Define your own TestCaseEnter.
TestCaseEnter ()
     window wCurrentApp
     for each wCurrentApp in lwApps
          wMainWindow = wCurrentApp
          SetAppState()

// Define your own TestCaseExit.
TestCaseExit (BOOLEAN bException)
  if bException
    ExceptLog()
  window wCurrentApp
  for each wCurrentApp in lwApps
    wMainWindow = wCurrentApp
    if (wCurrentApp.Exists())
      SetBaseState()

window MainWin TextEditor
  tag "Text Editor"

// The working directory of the application when it is invoked
const sDir = "C:\QAP40"
// The command line used to invoke the application
const sCmdLine = "C:\PROGRAMFILES\<SilkTest install directory>\\SILKTEST\TEXTEDIT.EXE"

// The first window to appear when the application is invoked
// const wStartup = ?

// The list of windows the recovery system is to leave open
// const lwLeaveOpen = {?}
Menu File
  tag "File"
  MenuItem New
    tag "New"
  MenuItem Open
    tag "Open"
  MenuItem Close
    tag "Close"
  MenuItem Save
    tag "Save"
  MenuItem SaveAs
    tag "Save As"
  MenuItem Print
    tag "Print"
  MenuItem PrinterSetup
    tag "Printer Setup"
  MenuItem Exit
    tag "Exit"
  Menu Edit
    tag "Edit"
  MenuItem Undo
    tag "Undo"
  MenuItem Cut
    tag "Cut"
  MenuItem Copy
    tag "Copy"
  MenuItem Paste
    tag "Paste"
  MenuItem Delete
    tag "Delete"
  Menu Search
    tag "Search"
  MenuItem Find
    tag "Find"
  MenuItem FindNext
    tag "Find Next"
  MenuItem Replace
    tag "Replace"
  MenuItem GotoLine
    tag "Goto Line"
  Menu Options
    tag "Options"
  MenuItem Font
    tag "Font"
  MenuItem Tabs
    tag "Tabs"
  MenuItem AutomaticIndent
    tag "Automatic indent"
  MenuItem CreateBackups
    tag "Create backups"
  Menu xWindow
    tag "Window"
  MenuItem TileVertically
    tag "Tile Vertically"
  MenuItem TileHorizontally
    tag "Tile Horizontally"
  MenuItem Cascade
    tag "Cascade"
  MenuItem ArrangeIcons
    tag "Arrange Icons"
  MenuItem CloseAll
    tag "Close All"
  MenuItem Next
    tag "Next"
  Menu Help
    tag "Help"
  MenuItem About
    tag "About"

window MessageBoxClass MessageBox
  tag "~ActiveApp/[DialogBox]$MessageBox"
  PushButton OK
    tag "OK"
  PushButton Cancel
    tag "Cancel"
  PushButton Yes
    tag "Yes"
  PushButton No
    tag "No"
  StaticText Message
    mswnt tag "#2"
    tag "#1"

window ChildWin Untitled
  tag "(untitled)"
  parent TextEditor
  TextField TextField1
    tag "#1"

window DialogBox Open
  tag "Open"
  parent TextEditor
  StaticText FileNameText
    tag "File Name:"
  TextField FileName1
    tag "File Name:"
  ListBox FileName2
    tag "File Name:"
  StaticText DirectoriesText
    tag "Directories:"
  StaticText CQap40Text
    tag "c:\qap40"
  ListBox CQap40
    tag "c:\qap40"
  StaticText ListFilesOfTypeText
    tag "List Files of Type:"
  PopupList ListFilesOfType
    tag "List Files of Type:"
  StaticText DrivesText
    tag "Drives:"
  PopupList Drives
    tag "Drives:"
  PushButton OK
    tag "OK"
  PushButton Cancel
    tag "Cancel"
  PushButton Network
    tag "Network"

window MainWin TestApplication
  tag "Test Application"
// The working directory of the application when it is invoked
const sDir = "C:\QAP40"

// The command line used to invoke the application
const sCmdLine = "C:\QAP40\TESTAPP.EXE"

// The first window to appear when the application is invoked
// const wStartup = ?

// The list of windows the recovery system is to leave open
// const lwLeaveOpen = {?}
Menu File
  tag "File"
  MenuItem New
    tag "New"
  MenuItem Close
    tag "Close"
  MenuItem Exit
    tag "Exit"
  MenuItem About
    tag "About"
Menu Control
  tag "Control"
  MenuItem CheckBox
    tag "Check box"
  MenuItem ComboBox
    tag "Combo box"
  MenuItem ListBox
    tag "List box"
  MenuItem PopupList
    tag "Popup list"
  MenuItem PushButton
    tag "Push button"
  MenuItem RadioButton
    tag "Radio button"
  MenuItem StaticText
    tag "Static text"
  MenuItem Scrollbar
    tag "Scrollbar"
  MenuItem Textfield
    tag "Textfield"
  MenuItem DrawingArea
    tag "Drawing area"
  MenuItem KeyboardEvents
    tag "Keyboard events"
  MenuItem Cursors
    tag "Cursors"
  MenuItem ListView
    tag "List view"
  MenuItem PageList
    tag "Page list"
  MenuItem StatusBar
    tag "Status bar"
  MenuItem ToolBar
    tag "Tool bar"
  MenuItem TrackBar
    tag "Track bar"
  MenuItem TreeView
    tag "Tree view"
  MenuItem UpDown
    tag "Up-Down"
Menu Menu
  tag "Menu"
  MenuItem TheItem
    tag "The item"
  MenuItem TheAcceleratorItem
    tag "The accelerator item"
  Menu TheCascadeItem
    tag "The cascade item"
    MenuItem Item1
      tag "Item1"
    MenuItem Item2
      tag "Item2"
  MenuItem Check
    tag "Check"
  MenuItem Uncheck
    tag "Uncheck"
  MenuItem TheCheckItem
    tag "The check item"
  MenuItem Enable
    tag "Enable"
  MenuItem Disable
    tag "Disable"
  MenuItem TheEnableItem
    tag "The enable item"
  Menu Submenu1
    tag "Submenu1"
    MenuItem Item1
      tag "Item1"
    MenuItem Item2
      tag "Item2"
  Menu Submenu2
    tag "Submenu2"
    MenuItem Item1
      tag "Item1"
    MenuItem Item2
      tag "Item2"
  Menu Submenu3
    tag "Submenu3"
    MenuItem Item1
      tag "Item1"
    MenuItem Item2
      tag "Item2"
    MenuItem ThePopupMenu
      tag "The popup menu"
    MenuItem Check
      tag "Check"
    MenuItem Uncheck
      tag "Uncheck"
    MenuItem TheCheckItem
      tag "The check item"
    MenuItem Enable
      tag "Enable"
    MenuItem Disable
      tag "Disable"
    MenuItem TheEnableItem
      tag "The enable item"
    MenuItem AddMenu
      tag "Add menu"
    MenuItem ClearMenus
      tag "Clear menus"
    Menu DisabledMenu
      tag "DisabledMenu"
    MenuItem Item1
      tag "Item1"
    MenuItem Item2
      tag "Item2"
    Menu Menu5
      tag "#5"
    MenuItem MenuItem1
      tag "#1"
    MenuItem MenuItem2
      tag "#2"
  Menu xWindow
    tag "Window"
    MenuItem Cascade
      tag "Cascade"
    MenuItem Tile
      tag "Tile"
    MenuItem ArrangeIcons
      tag "Arrange Icons"
    MenuItem CloseAll
      tag "Close All"
    MenuItem ChangeCaption
      tag "Change Caption"
    MenuItem SysModal1
      tag "SysModal 1"
    MenuItem SysModal2
      tag "SysModal 2"
    MenuItem SysModal3
      tag "SysModal 3"
    MenuItem N1MDIChildWindow1
      tag "1 MDI Child Window #1"

window ChildWin MDIChildWindow1
  tag "MDI Child Window #1"
  parent TestApplication
  TextField TextField1
    tag "#1"
Parent topic: Multiple Machines Testing
Related concepts
Setting Up the Recovery System for Multiple Local Applications
two_apps.t


Other Problems

This section provides help and troubleshooting information for problems that are not covered by another section.

  • Adding a Property to the Recorder
    Describes how to add a property to the Recorder.
  • Cannot Double-Click a Silk Test Classic File and Open Silk Test Classic
    Describes what to do if you cannot double-click a file to open Silk Test Classic.
  • Cannot Extend AnyWin, Control, or MoveableWin Classes
    Describes why you cannot extend the AnyWin, Control, or MoveableWin classes.
  • Cannot open results file
    Describes how to troubleshoot if you cannot open a results file.
  • Common DLL Problems
    Describes common DLL problems.
  • Common Scripting Problems
    Describes common scripting problems.
  • Conflict with Virus Detectors
    Describes conflicts with anti-virus software.
  • Displaying the Euro Symbol
    Describes how to display the Euro symbol.
  • Do I Need Administrator Privileges to Run Silk Test Classic?
    Describes the privileges that you require to run Silk Test Classic.
  • Does Silk Test Classic Support Oracle Forms?
    Describes how Silk Test Classic supports applications that are based on Oracle Forms.
  • General Protection Faults
    Describes how to resolve various general protection faults.
  • Running Global Variables from a Test Plan Versus Running Them from a Script
    Describes a workaround for global variable usage.
  • Include File or Script Compiles but Changes are Not Picked Up
    Describes what to do if the include file or script compiles but changes are not picked up.
  • Library Browser Not Displaying User-Defined Methods
    Describes what to do if the library browser does not display user-defined methods.
  • Maximum Size of Silk Test Classic Files
    Describes the maximum size of Silk Test Classic files.
  • Recorder Does Not Capture All Actions
    Describes what to do if the Silk Test Recorder does not capture all actions.
  • Relationship between Exceptions Defined in 4test.inc and Messages Sent To the Result File
    Describes the relationship between exceptions defined in 4test.inc and messages sent to the result file.
  • The 4Test Editor Does Not Display Enough Characters
    Describes what you can do if the Silk Test 4Test Editor does not display enough characters.
  • Silk Test Classic Support of Delphi Applications
    Describes support for Delphi applications.
  • Stopping a Test Plan
    Describes how to stop a test plan.
  • Using a Property Instead of a Data Member
    Describes when you should use a property instead of a data member.
  • Using File Functions to Add Information to the Beginning of a File
    Describes how to use Silk Test Classic file functions to add information to the beginning of a file.
  • Why do I get error 07002 when updating an Excel sheet?
    Brief description of concept. Should be written as a fragment. Contains no more than two sentences.
  • Why Does the Str Function Not Round Correctly?
    Describes why the str function does not round correctly.
Parent topic: Troubleshooting the Open Agent


Adding a Property to the Recorder

  1. Write a method.
  2. Add a property to the class.
  3. Add the property to the list of property names.

For example, if you have a text field that is ReadOnly and you want to add that property to the recorder you can do the following:

  1. Write the method Boolean IsReadOnly() for the TextField class.
  2. Add the property, bReadOnly to the class.
  3. Add bReadOnly to the list of property names.
  4. Compile. bReadOnly will appear in the Recorder after you compile.
    Winclass TextField : TextFieldBOOLEAN IsReadOnly()
STRING sOriginalText = this.GetText()
STRING sNewText = "xxx"
this.SetText(sNewText)
if this.GetText()==sOriginalText
return TRUE
else
return FALSE
property bReadOnly
BOOLEAN Get()
return this.IsReadOnly()
LIST OF STRING IsPropertyNames = {…}
"bReadOnly"
Parent topic: Other Problems


Cannot Double-Click a Silk Test Classic File and Open Silk Test Classic

Problem

Silk Test Classic does not open automatically when you double-click a .t, .inc, .s, .g.t, .pln, .res, .stp, or .vtp file.

Cause

During the install process, Silk Test Classic is associated with these file types. However if these file type associations have been changed after Silk Test Classic setup, these file types may not be opened with Silk Test Classic when double-clicking such a file.

Note: File type associations are only available for Microsoft Windows platforms.

Solution

You can either manually associate these file types with Silk Test Classic in Windows, under Start > Settings > Control Panel > Folder Options, or reinstall Silk Test Classic.

Parent topic: Other Problems


Cannot Extend AnyWin, Control, or MoveableWin Classes

The AnyWin, Control, and MoveableWin classes are logical (virtual) classes that do not correspond to any actual GUI objects, but instead define methods common to the classes that derive from them. This means that Silk Test Classic never records a declaration that has one of these classes.

Furthermore, you cannot extend or override logical classes. If you try to extend a logical class, by adding a method, property or data member to it, that method, property, or data member is not inherited by classes derived from the class. You will get a compilation error saying that the method, property, or data member is not defined for the window that tries to call it.

You can also not override the class, by rewriting existing methods, properties, or data members. Your modifications are not inherited by classes derived from the class.

Parent topic: Other Problems
Related reference
Attribute Declaration
Parent Statement
Multitag Statement
window Declaration


Cannot open results file

Problem

Silk Test Classic crashes while running a script and reports the error Can't open results file.

Solution

While Silk Test Classic is running a script, it temporarily stores results in a journal file (.jou) which is converted to a .res file when the script finishes running.

To solve this issue, delete all .jou files in the same directory as the script. You do not have to delete your results files.

Then restart Silk Test Classic and run your script again.

Parent topic: Other Problems


Common DLL Problems

Here are some issues that could come up if you are calling DLL functions in a script.

Difficulty creating DLLs to use with Silk Test

Only specific data types are compatible with 4Test. These data types are listed in C data types for DLL functions.

If your DLL calls have data types not supported by 4Test, then the functions must be wrapped such that only compatible data types are used for the return type and arguments of the function. Any data types can be used inside the DLL function.

Error after compile: dll not found

In the DLL declaration, use the fully qualified path of the DLL, not just the file name.

Error executing 'CallDllFunction'

When the communication timeout between the Open Agent and the application under test is too small, the CallDllFunction might generate the error message Error executing 'CallDllFunction'. Communication timeout between agent and application.

To solve this issue, increase the timeout.
  1. Stop the Open Agent.
  2. Open the file %OPEN_AGENT_HOME%/agent/openAgent.ini.
  3. Append the following code to the file:
    -DDefaultCommTimeout=300000
    This code sets the timeout to 300000 milliseconds, which means 5 minutes. To specify no timeout, set the value to -1.
  4. Restart the Open Agent.

Error in results file: dll could not be loaded

Make sure the directory containing the DLL is on the path.

Error in results file: dll not found

This usually means that your path does not include the directory containing the DLL. If you are running remotely, make sure that the path on the machine running the agent includes the DLL directory.

Error in results file: function <name> not found in dll

The most likely scenario is that the DLL is a C++ library and the function name has been mangled. To use functions in a C++ library, you need to wrap the functions with the C wrapper and recompile. Then Silk Test Classic can access the function in the library.

If this is not the problem, there might be a typo in the function name in the DLL.

Warning in results file: String buffer size was increased from x to 256 characters

If the user calls a DLL function with an output string buffer that is less then the minimum size of 256 characters, the original string buffer is resized to 256 characters and a warning is printed. This warning, String buffer size was increased from x to 256 characters (where x is the length of the given string plus one) alerts the user to a potential problem where the buffer used might be shorter than necessary.

Parent topic: Other Problems


Common Scripting Problems

Here are some common problems that occur with scripts.

Typographical errors

It is very easy to make typographical errors that the 4Test compiler cannot catch. If a line of code does nothing, this might be the problem.

Global variables with unexpected values

When you write a function that uses global variables, make sure that each variable has an appropriate value when the function exits. If another function uses the same variable later, and it has an unexpected value on entry to the function, an error could occur.

To check that a variable has a reasonable value on entry to a function, set a breakpoint on the line that calls the function and use the command View > Global Variables to check the variable's value.

Uninitialized variables

Silk Test Classic does not initialize variables for you. So if you have not initialized a variable on entry to a function, it will have the value <unset>. It is better to explicitly give a value to a variable than to trust that another function has already initialized it for you. Also, remember that 4Test does not keep local variables around after a function exits; the next time the function is called, its local variables could be uninitialized.

If you are in doubt about whether a variable has a reasonable value at a particular point, set a breakpoint there and use View > Global Variables or View > Local Variables to check the variable's value.

Global and local variables with the same name

It is usually not good programming practice to give different variables the same names. If a global and local variable with the same name are in scope (accessible) at the same time, your code can only access the local variable.

To check for repeated names, use View > Local Variables and View > Global Variables to see if two variables with the same name are in scope simultaneously.

Incorrect values for loop variables

When you write a for loop or a while loop, be sure that the initial, final, and step values for the variable that controls the loop are correct. Incrementing a loop variable one time more or less than you really want is a common source of errors.

To make sure a control loop works as you expect, use Debug > Step Into to step through the execution of the loop one statement at a time, and watch how the value of the loop variable changes using View > Local Variables.

Checking the precedence of operators

The order in which 4Test applies operators when it evaluates an expression may not be what you expect. Use parentheses, or break an expression down into intermediate steps, to make sure it works as expected. You can use View/Expression to evaluate an expression and check the result.

Incorrect uses of break statements

A break statement transfers control of the script out of the innermost nested for, for each, while, switch, or select statement only. In other words, break exits from a single loop level, not from multiple levels. Use Debug > Step Into to step through the script one line at a time and ensure that the flow of control works as you expect.

Infinite loops

To check for infinite loops, step through the script with Debug > Step Into.

Code that never executes

To check for code that never executes, step through the script with Debug > Step Into.

Parent topic: Other Problems


Conflict with Virus Detectors

Problem

Silk Test Classic will occasionally have problems on machines running virus detectors that use heuristic or algorithmic virus detection in addition to the standard pattern recognition. What happens is that while Silk Test Classic is running, the virus detector identifies Silk Test Classic as displaying "virus-like" behavior, and kills or otherwise disables the agent. This leads to unpredictable and inconsistent behavior in Silk Test Classic, including loss of communications with the agent and inconsistent test results or object recognition.

Solution

To avoid this problem the only solution is to temporarily disable the virus detector while Silk Test Classic is running.

Parent topic: Other Problems


Displaying the Euro Symbol

Problem

You want to display the Euro (€) symbol.

Solution

Download a Euro-enabled font from Microsoft. Double check that you can see the Euro symbol by opening Notepad on the machine where you installed the font and entering the ASCII code for the Euro symbol. As long as you see the symbol in notepad, you should be able to see it within Silk Test Classic.

In Silk Test Classic, click Options > Editor Font and be sure that your font is set to Arial, Courier New, or Times New Roman.

Parent topic: Other Problems


Do I Need Administrator Privileges to Run Silk Test Classic?

You require the following privileges to install or run Silk Test Classic:

  • To install Silk Test Classic, you must have local administrator privileges.
  • To install Silk Test Classic on a Windows server, you must have domain-level administrator privileges.
  • To run Silk Test Classic with the Classic Agent, you must have administrator privileges.
  • If you have installed Silk Test Classic into the Program Files folder, you must have administrator privileges to run Silk Test Classic with the Open Agent.
  • If you have installed Silk Test Classic into a different location than the Program Files folder, you do not need to have administrator privileges to run Silk Test Classic with the Open Agent.
  • To run Silk Test Classic, you require full access rights to the following folders, including all subfolders:
    • C:\ProgramData\Silk\SilkTest.
    • %APPDATA%\Roaming\Silk\SilkTest.
    • %APPDATA%\Local\Silk\SilkTest.
    • %TEMP%.
Note: If User Account Control (UAC) is activated on your system, Micro Focus recommends that you install Silk Test Classic into a different location than the Program Files folder.
Parent topic: Other Problems


Does Silk Test Classic Support Oracle Forms?

Open Agent

If you are using the Open Agent, Silk Test Classic provides built-in support for testing applications that are based on Oracle Forms with a Java version up to Java 1.7 update 60. For additional information, see Oracle Forms Support.

Classic Agent

If you are using the Classic Agent, Silk Test Classic handles Oracle Forms applications as any Java applet that consists of custom classes.

All children of the applet are seen as CustomWins, with native class names such as oracle.ewt.* and oracle.forms.*. You need to declare winclasses for any classes that you plan to use, and you can only interact with classes through scripting. For more efficient declaration of classes, use the CaptureAllClasses function instead of clicking Record > Class to record each class separately.

As with any application consisting of custom classes, if there are objects that Silk Test Classic does not see, check Show All Classes to see if that exposes the ignored objects. If so, then you should add those classes to the [ClassList] section of extend\JavaEx.ini. Uncheck Show All Classes before recording window classes or declarations.

To get started, take a look at our guidelines for when and how to record classes.

If you do not want to record classes for these CustomWin objects, you can click Record > Class and then uncheck the Show All Classes check box in the lower left corner of the dialog box.

Parent topic: Other Problems
Related concepts
Oracle Forms Support


General Protection Faults

Problem

When recording or running tests, you get a General Protection Fault (GPF) or Invalid Page Fault (IPF) in agent.exe or partner.exe.

Solution

It can be very difficult to pin down the cause of these problems. It might involve a combination of your machine's configuration, other applications that are running, and the network's configuration. The best approach is to gather the diagnostic information described below and send it to Technical Support with a detailed description of what scenario led to the error.

Capture the system diagnostics
When the system error message displays, chose the option to capture detailed information on the error. Write the information down.
Capture a debug.log file
  1. Ensure that no Silk Test Classic or Agent processes are running.
  2. Open a DOS prompt window.
  3. Change your working directory to your Silk Test Classic installation directory.
  4. Delete or rename c:\debug.log if the file exists.
  5. Set the following environment variable: set QAP_DEBUG_AGENT=1.
  6. Start the Agent manually: start .\agent.
  7. Start Silk Test Classic manually: start .\partner.
  8. Go through the scenario to reproduce the problem.
  9. The file c:\debug.log file will be created.
  10. Send this file as an attachment to your email to Technical Support.
Monitor CPU and RAM usage

When reproducing this error to gather the diagnostics above, also run a system resource monitor to check on CPU and RAM usage. Note whether CPU or RAM is being exhausted.

Note your system configuration

When sending in these diagnostics, note the version of Silk Test Classic, the operating system and version, and the machine configuration (CPU, RAM, disk space).

Parent topic: Other Problems


Running Global Variables from a Test Plan Versus Running Them from a Script

Problem

When running from a test plan, global variables don’t keep their value from one test case to another.

When test cases are run from a script, global variables are initialized once at the beginning and do not get reset while the script is being run. On the other hand, when you run test cases from a test plan, all global variables get re-initialized after each test case. This is because the Agent reinitializes itself before running each test case. Consequently, you may find that global variables are not as useful when running from a test plan.

Solution

A workaround is to use the FileWriteLine or FileWriteValue function to write the values of the global variables out to a file, then use the FileReadLine or FileReadValue function to read the value back into each variable in each test case.

Parent topic: Other Problems


Include File or Script Compiles but Changes are Not Picked Up

Problem

You compile an include file or script, but changes that you made are not used when you run the script.

Solutions

Did you change the wrong include file?

Make sure that the include file you are compiling is the same as the file that is being used by the script. Just because you have an include file open and have just compiled it does not mean that it is being used by the script. The include file that the script will use is either specified in Runtime Options (Use Files field) or by a use statement in the script.

Is there a time-stamp problem?

If the time stamp for the file on disk is later than the machine time when you do Run > Compile, then the compile does not actually happen and no message is given. This can happen if two machines are sharing a file system where the files are being written out and the time on the machines is not synchronized.

By default, Silk Test Classic only compiles files that need compiling, based on the date of the existing object files and the system clock. This way, you don't have to wait to recompile all files each time a change is made to one file.

If you need to, you can force Silk Test Classic to compile all files by selecting Run > Compile All. Run > Compile All compiles the script or suite and all dependent include files, even if they have not changed since they were last compiled. It also compiles files listed in the Use Files field in the Runtime Options dialog and the compiler constants declared in the Runtime Options dialog. Finally, it compiles the include files loaded at startup, if needed.

Are your object files corrupted?

Sometimes a Silk Test Classic object (.ino or .to) file can become corrupted. Sometimes a corrupted object file can cause Silk Test Classic to assume that the existing compile is up to date and to skip the recompile without any message.

To work around this, delete all .ino and .to files in the directories containing the .inc and .t files you are trying to compile, then compile again.

Parent topic: Other Problems


Library Browser Not Displaying User-Defined Methods

Problem

You add a description for a user-defined method and a user-defined function to 4test.txt. After restarting Silk Test Classic, the new description for the function displays in the Library Browser, but not the description for the method. So you know that the modified 4test.txt file is being used, but your user-defined method is not being displayed in the Library Browser.

Solutions

Only methods defined in a class definition (that is, in your include file where your class is defined) will display in the Library Browser. For example, MyAccept will be displayed.

winclass DialogBox:DialogBox
Boolean MyAccept()
...

Methods you define for an individual object are not displayed in the Library Browser. For example, MyDialogAccept will not display.

DialogBox MyDialog
tag "My Dialog"
Boolean MyDialogAccept()
...

In order to display in the Library Browser, the description in your 4test.txt file must have a return type that matches the return type in your include file declaration. If the 4test.txt description has no returns statement, then the declaration must be for a return type of void (either specified explicitly or by defaulting to type void). Otherwise, the description will not display in the Library Browser.

For more information about adding information to the Library Browser, see Adding to the Library Browser.

Parent topic: Other Problems


Maximum Size of Silk Test Classic Files

The following size limits apply:

  • The limit for .inc, .t, and .pln files (and their associated backup files, .*_) is 64K lines.
  • The size limit for the corresponding object files (.*o) depends on the amount of available system memory.
  • The Silk Test Classic editor limits lines to 1024 characters.
  • The maximum size of a single entry in a .res file is 64K.
  • Test case names can have a maximum of 127 characters. When you create a data-driven test case, Silk Test Classic truncates any test case name that is greater than 124 characters.
Parent topic: Other Problems


Recorder Does Not Capture All Actions

Problem

While recording, the Silk Test Recorder does not capture all actions in your application under test, though you complete the actions.

Cause

The application under test may be "going too fast" and the Silk Test Recorder may not be able to keep up.

Solution

Slow down the interactions with your application while recording. Record a test case at the speed of the Silk Test Recorder.

Parent topic: Other Problems


Relationship between Exceptions Defined in 4test.inc and Messages Sent To the Result File

Silk Test Classic calls LogError automatically when it raises an exception that you have not handled. By reading 4test.inc you can find that Silk Test Classic has a list of exceptions like:

E_ABORT = -10100,
E_TBL_HAS_NO_ROW_HDR = -30100,
E_WINDOW_NOT_FOUND = -27800

Since exception numbers can apply to more than one exception, it can be helpful to query on a particular exception number via
      ExceptNum() to decide how to handle an error. If you need to query on a specific exception message, you can use
      ExceptData(). We recommend using
      MatchStr() with
      ExceptData().

To find the E_... constant for any 4Test exception, you can use:

[-] do
    <code that causes exception>
[-] except
[ ] LogWarning ("Exception number: {[EXCEPTION]ExceptNum ()}")
[ ] reraise

This will print out the exception constant in the warning.

Be sure to remove the LogWarning do..except block after you have found the E_... constant.

Parent topic: Other Problems


The 4Test Editor Does Not Display Enough Characters

Problem

While you can edit 4Test files outside of Silk Test Classic and create lines with more than 1024 characters, the Silk Test 4Test Editor (4Test Editor) does not let you edit or extend these lines.

The line limit of the 4Test Editor is 1024 characters.

Solution

Use the <Shift+Enter> continuation character to break the line into smaller lines.

Parent topic: Other Problems


Silk Test Classic Support of Delphi Applications

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

While there is no support for Delphi controls "out of the box", virtually all of the Delphi objects can be class mapped to standard controls.

The following code sample shows the class mapping for the Classic Agent classes:

[ClassMap]
DialogBox,0x50000044,0x50000044=Ignore
TBitBtn=PushButton
TButton=PushButton
TCheckBox=CheckBox
TComboBox=ComboBox
TDBCheckBox=CheckBox
TDBComboBox=ComboBox
TDBEdit=TextField
TDBListBox=ListBox
TDBLookupComboBox=ComboBox
TDBLookupListBox=ListBox
TDBMemo=TextField
TDBRadioGroup=Ignore
TEdit=TextField
TFlyingPanel=Toolbar
TGroupBox=StaticText
TGroupButton=RadioButton
TListBox=ListBox
TListView=ListView
TMaskEdit=TextField
TMemo=TextField
TPageControl=PageList
TPanel=Ignore
TRadioButton=RadioButton
TRadioGroup=Ignore
TRichEdit=TextField
TRicherEdit=TextField
TScrollBar=ScrollBar
TStatusBar=StatusBar
TTabControl=PageList
TTreeView=TreeView
TUpDown=UpDown

Notes

Silk Test Classic can work with Delphi objects in a variety of ways. The amount of functionality you achieve depends on how deep you want to get involved. You can even create an extension (external) for Delphi objects. Delphi supports DLL calling, and you can use DLL's created in C/C++ in your Delphi application. Class mapping will work in many instances, but not with every object.

If class mapping doesn't work, you can try any of the following workarounds:

  1. Using SendMessage with the Clipboard.

    • Delphi is built with VCL. The VCL (Visual Component Library) is similar to MFC in that all of the classes of objects that Delphi can create are in this library. Instead of C++ it is written in Object Pascal. The VCL source code is shipped with the Delphi product. In the VCL source, you can go to the definition of the object class that you want to support for and add message handlers (windows API messages) for various messages that you define.
    • For example, add a message handler that says that if any object of this class receives a message called QAP_GetValue, get the contents of the listbox, send a message back to the process that sent the message, and send it the value. On the Silk Test Classic side of things you define a new class to support the object and add a method that sends/receives the message to the supported object.
    • For example, here is sample code of a message handler on the Delphi side:
      procedure QAP_GetValue (var Msg: TMessageRecord);
var
ValueToReturn : string;
begin
CopyToClipBoard;
Msg.Result := true;
end;
    • Here is sample code for the Window class on the 4Test side:
      winclass DelphObj : Control
LIST OF STRING GetContents ()
if (SendMessage (this.hWnd, QAP_GetListContents, NULL, NULL))
return Clipboard.GetText ()
else
RaiseError (1, "Couldn't get the contents of {this},
SendMessageEvent not processed correctly")
  2. Using the Extension Kit, create a DLL that does the same thing as above, except passing values directly from application to application rather than relying on the clipboard. This method is preferred over the above because of speed and data type stability.
  3. Use low level 4Test events relying on coordinates to create methods. Silk Test Classic low-level recording should only be used when you want to use recording rather than hand scripting.

Open Agent

To test Delphi applications with the Open Agent you could use the custom control support. For additional information, see Custom Controls (Open Agent).

Parent topic: Other Problems
Related concepts
Custom Controls (Open Agent)


Stopping a Test Plan

Problem

You want to abort a test plan programmatically without using exit. Calling exit just aborts the script and continues on to the next test case.

Solution

You can call
[ ] @("$StopRunning") ()
from a test case or a recovery system function such as ScriptExit(), which is called for each test case in the test plan, or TestCaseExit().

This call will stop everything without even invoking the recovery system. Calling it will generate the following exception message, with no call stack: Exception -200000

Parent topic: Other Problems


Using a Property Instead of a Data Member

Data members are resolved (assigned values) during compilation. If the expression for the data member includes variables that will change at run-time, then you must use a property instead of that data member.

Parent topic: Other Problems


Using File Functions to Add Information to the Beginning of a File

In Silk Test Classic 5.5 SP1 or later, there is no file open mode that allows you to insert information into the beginning of a file. If you use FM_UPDATE, you can read in part of your file before writing, but any write function calls will overwrite the rest of the file.

If you are writing strings rather than structured data, you can use ListRead() and ListWrite() to insert information at the beginning or any other point of a file. Use ListRead() to read the contents of the file into a list, insert the new information at the head or any other point of the list, and use ListWrite() to write it back out.

[-] LIST OF STRING lsNewInfo = {...}
[ ] "*New line one*"
[ ] "*New line two*"
[ ] "*New line three*"
[ ] LIST OF STRING lsFile
[ ] INTEGER i
[ ]
[ ] ListRead (lsFile, "{GetProgramDir ()}\Sample.txt")
[-] for i = 1 to ListCount (lsNewInfo)
[ ] ListInsert (lsFile, i, lsNewInfo[i])
[ ] ListWrite (lsFile, "{GetProgramDir ()}\Sample.txt")
[ ]

Sample.txt before the write:

Line 1
Line 2
Line 3
Line 4
Line 5

Sample.txt after:

*New line one*
*New line two*
*New line three*
Line 1
Line 2
Line 3
Line 4
Line 5
Parent topic: Other Problems


Why do I get error 07002 when updating an Excel sheet?

When you update an Excel sheet, the following error might be thrown:

" *** Error: (07002) [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.

In this case, your query contains a field name that cannot be found. Ensure that the fields exist in the sheet.

Parent topic: Other Problems


Why Does the Str Function Not Round Correctly?

Any decimal/float number has an internal binary representation. Unfortunately, you can never be sure if a decimal value has an exact representation in its binary pendant. If an exact binary representation is not possible (mathematical constraint), the nearest value is used and this leads to the issue where it seems the str function is not rounding correctly. You can workaround this issue. Use the following code to see the internal representation:
[ ] printf("%.a20e\n", 32.495)
[ ] printf("%.a20e\n", 31.495)
Parent topic: Other Problems


Recognition Issues

This section provides help and troubleshooting information for recognition issues.

  • How Can the Application Developers Make Applications Ready for Automated Testing?
    Describes how an application developer can make an application easier to test.
Parent topic: Troubleshooting the Open Agent


How Can the Application Developers Make Applications Ready for Automated Testing?

The attributes available for a specific control in the application under test (AUT) might not be sufficient to guarantee that Silk Test Classic always recognizes the control during automated testing. In such a case the application developer can add custom attributes to the control, which can then be used as locator attributes for the control. The following examples describe how an application developer can include custom attributes in different application types:
  • To include custom attributes in a Web application, add them to the html tag. Type <input type='button' bcauid='abc' value='click me' /> to add an attribute called bcauid.
  • To include custom attributes in a Java SWT application, use the org.swt.widgets.Widget.setData(String <varname>key</varname>, Object <varname>value</varname>) method.
  • To include custom attributes in a Swing application, use the putClientProperty("propertyName", "propertyValue") method.
Parent topic: Recognition Issues
Related tasks
Defining which Custom Locator Attributes to Use for Recognition


Tips

This section provides general troubleshooting tips.

  • Example Test Cases for the Find Dialog Box
    Provides test cases for the Find dialog box.
  • When to use the Bitmap Tool
    Describes when to use the Bitmap Tool.
Parent topic: Troubleshooting the Open Agent


Example Test Cases for the Find Dialog Box

If you want to test the Find dialog box, each test case would need to perform the following tasks:
  1. Open a new document file.
  2. Type text into the document.
  3. Position the insertion point at the top of the file.
  4. Select Find from the Search menu.
  5. Select the forward (down) direction for the search.
  6. Make the search case sensitive.

Non-Data-Driven Test Case for the Classic Agent

testcase FindTest ()
TextEditor.File.New.Pick ()
DocumentWindow.Document.TypeKeys ("Test Case<HOME>")
TextEditor.Search.Find.Pick ()
Find.FindWhat.SetText ("Case")
Find.CaseSensitive.Check ()
Find.Direction.Select ("Down")
Find.FindNext.Click ()
Find.Cancel.Click ()
DocumentWindow.Document.VerifySelText (<text>)
Case
TextEditor.File.Close.Pick ()
MessageBox.No.Click ()

The major disadvantage of this kind of test case is that it tests only one out of the many possible sets of input data to the Find dialog box. To adequately test the Find dialog box, you must record or hand-write a separate test case for each possible combination of input data that needs to be tested. In even a small application, this creates a huge number of test cases, each of which must be maintained as the application changes.

Non-Data-Driven Test Case for the Open Agent

testcase Find ()
  recording
    UntitledNotepad.SetActive()
    UntitledNotepad.New.Pick()
    UntitledNotepad.TextField.TypeKeys("Test Case <LessThan>Home")
    UntitledNotepad.TextField.PressKeys("<Left Shift>")
    UntitledNotepad.TextField.TypeKeys("<GreaterThan>")
    UntitledNotepad.Find.Pick()
    UntitledNotepad.FindDialog.FindWhat.SetText("Case")
    UntitledNotepad.FindDialog.Down.Select("Down")
    Tmp_findNotepad.Find.MatchCase.Check()
    UntitledNotepad.FindDialog.FindNext.Click()
    Tmp_findNotepad.Find.Cancel.Click()
    Tmp_findNotepad.Find.Close()
Parent topic: Tips


Troubleshooting Web Applications

The test of your browser application may have failed for one of the reasons described in this section. If the suggested solutions do not address the problem you are having, you can enable your extension manually.

  • What Can I Do If the Page I Have Selected Is Empty?
    Describes what you can do if the page you are testing is empty or does not contain any HTML elements.
  • Why Do I Get an Error Message When I Set the Accessibility Extension?
    Describes what you can do if you are testing a Web application in Internet Explorer and you get an error message when setting the Accessibility extension.
Parent topic: Troubleshooting the Open Agent


What Can I Do If the Page I Have Selected Is Empty?

If the page you are testing is empty or does not contain any HTML elements, you might receive a Could not recognize any HTML classes in your browser application message. Your configuration might be correct, however, the automated configuration test does not support testing of blank pages or pages that do not contain HTML elements. You can manually verify that your extensions are set properly, open your application, and then record window declarations. If you can record against HTML classes, the extension is configured correctly and you are ready to set up the recovery system using the Basic Workflow bar.

Parent topic: Troubleshooting Web Applications
Related reference
Basic Workflow for the Open Agent


Why Do I Get an Error Message When I Set the Accessibility Extension?

If you are using Internet Explorer to test a Web application and you have set the Accessibility extension, you might get an error message when the start page of the browser is "about:blank". To avoid getting the error message, set the start page of the browser to a different page.

Parent topic: Troubleshooting Web Applications


Using the Runtime Version of Silk Test Classic

The Silk Test Classic Runtime (Runtime) provides a subset of the functionality of Silk Test Classic. Specifically, it allows you to perform all of the tasks associated with executing tests and analyzing results. You are prohibited from editing existing automation or creating new automation. The Runtime is intended to run previously compiled files. If you update a shared file while the Runtime is open, you must close the Runtime and reopen it in order to use the updated file.

Silk Test Classic Runtime is an installation option. For additional information, refer to the Silk Test Installation Guide.

The Silk Test Classic Runtime Help includes the topics that are available from the full version of Silk Test Classic, and additional product-specific information.

  • Installing the Runtime Version
    Describes how you can install the Runtime version of Silk Test Classic.
  • Starting the Runtime Version
    Describes how you can start the Runtime version of Silk Test Classic.
  • Comparing Silk Test Classic and Silk Test Classic Runtime Menus and Commands
    Lists the menus and commands that are available for each agent in Silk Test Classic and Silk Test Classic Runtime.


Installing the Runtime Version

Silk Test Classic Runtime is an installation option. For additional information, refer to the Silk Test Installation Guide.

We strongly recommend that you do not install Silk Test Classic Runtime on the same machine as Silk Test Classic. Silk Test Classic runtime shares files with this product and will overwrite any other installation you already have on your machine.

Note: Silk Test Classic Runtime is sold and licensed separately from standard Silk Test Classic.
Parent topic: Using the Runtime Version of Silk Test Classic


Starting the Runtime Version

You can start Silk Test Classic Runtime from the following locations:

  • The command-line prompt in a DOS window. Enter runtime.exe. The same syntax applies as with starting Silk Test Classic from the command line.
  • The Silk Test Classic GUI. You must have selected the Silk Test Classic Runtime option during installation.

When you start the Runtime, it displays minimized as an icon only; click the icon to maximize the window.

Parent topic: Using the Runtime Version of Silk Test Classic
Related tasks
Starting Silk Test Classic from the Command Line


Comparing Silk Test Classic and Silk Test Classic Runtime Menus and Commands

The table below lists the menus and commands that are available for each agent in Silk Test Classic and those that are available in Silk Test Classic Runtime:

Menu Name | Command | Available in Silk Test Classic | Available in Silk Test Classic Runtime
Breakpoint | Toggle | Classic Agent Open Agent | No
 | Add | Classic Agent Open Agent | No
 | Delete | Classic Agent Open Agent | No
 | Delete All | Classic Agent Open Agent | No
Debug | Abort | Classic Agent Open Agent | No
 | Exit | Classic Agent Open Agent | No
 | Finish Function | Classic Agent Open Agent | No
 | Reset | Classic Agent Open Agent | No
 | Run and Debug/Continue | Classic Agent Open Agent | No
 | Run to Cursor | Classic Agent Open Agent | No
 | Step Into | Classic Agent Open Agent | No
 | Step Over | Classic Agent Open Agent | No
Edit | Undo | Classic Agent Open Agent | No
 | Redo | Classic Agent Open Agent | No
 | Cut | Classic Agent Open Agent | No
 | Copy | Classic Agent Open Agent | Yes
 | Select All | Classic Agent Open Agent | Yes
 | Paste | Classic Agent Open Agent | No
 | Delete | Classic Agent Open Agent | No
 | Find | Classic Agent Open Agent | Yes
 | Find Next | Classic Agent Open Agent | Yes
 | Replace | Classic Agent Open Agent | No
 | Go to Line | Classic Agent Open Agent | Yes
 | Go to Definition | Classic Agent Open Agent | Yes
 | Find Error | Classic Agent Open Agent | Yes
 | Data Driven | Classic Agent Open Agent | No
 | Visual 4Test | Classic Agent Open Agent | Yes
File | New | Classic Agent Open Agent | No
 | Open | Classic Agent Open Agent | Yes
 | Close | Classic Agent Open Agent | Yes
 | Save | Classic Agent Open Agent | No
 | Save Object File | Classic Agent Open Agent | No
 | Save As | Classic Agent Open Agent | No
 | Save All | Classic Agent Open Agent | No
 | New Project | Classic Agent Open Agent | No
 | Open Project | Classic Agent Open Agent | Yes
 | Close Project | Classic Agent Open Agent | Yes
 | Export Project | Classic Agent Open Agent | No
 | Email Project | Classic Agent Open Agent | No
 | Run | Classic Agent Open Agent | Yes
 | Debug | Classic Agent Open Agent | No
 | Check out | Classic Agent Open Agent | No
 | Check in | Classic Agent Open Agent | No
 | Print | Classic Agent Open Agent | Yes
 | Printer Setup | Classic Agent Open Agent | Yes
 | Recent Files and Recent Projects | Classic Agent Open Agent | Yes
 | Exit | Classic Agent Open Agent | Yes
Help | Help Topics | Classic Agent Open Agent | Yes
 | Library Browser | Classic Agent Open Agent | Yes
 | Tutorials | Classic Agent Open Agent | Yes
 | About Silk Test Classic | Classic Agent Open Agent | Yes
Include | Open | Classic Agent Open Agent | Yes
 | Open All | Classic Agent Open Agent | Yes
 | Close | Classic Agent Open Agent | Yes
 | Close All | Classic Agent Open Agent | Yes
 | Save | Classic Agent Open Agent | No
 | Acquire Lock | Classic Agent Open Agent | No
 | Release Lock | Classic Agent Open Agent | No
Options | General | Classic Agent Open Agent | Yes
 | Editor Font | Classic Agent Open Agent | Yes
 | Editor Colors | Classic Agent Open Agent | Yes
 | Runtime | Classic Agent Open Agent | Yes
 | Agent | Classic Agent Open Agent | Yes
 | Extensions | Classic Agent | Yes
 | Application Configurations | Open Agent | Yes
 | Recorder | Classic Agent Open Agent | No
 | Class Map | Classic Agent | Yes
 | Class Attributes | Classic Agent | Yes
 | Property Sets | Classic Agent Open Agent | Yes
 | TrueLog | Classic Agent Open Agent | Yes
 | Silk Central URLs | Classic Agent Open Agent | Yes
 | Open Options Set | Classic Agent Open Agent | Yes
 | Save New Options Set | Classic Agent Open Agent | No
 | Close Options Set | Classic Agent Open Agent | Yes
 | Recent Options Sets | Classic Agent Open Agent | Yes
Outline | Move Left | Classic Agent Open Agent | No
 | Move Right | Classic Agent Open Agent | No
 | Transpose Up | Classic Agent Open Agent | No
 | Transpose Down | Classic Agent Open Agent | No
 | Expand | Classic Agent Open Agent | Yes
 | Expand All | Classic Agent Open Agent | Yes
 | Collapse | Classic Agent Open Agent | Yes
 | Collapse All | Classic Agent Open Agent | Yes
 | Comment | Classic Agent Open Agent | No
 | Uncomment | Classic Agent Open Agent | No
Project | View Explorer | Classic Agent Open Agent | Yes
 | Align | Classic Agent Open Agent | Yes
 | Project Description | Classic Agent Open Agent | No
 | Add File | Classic Agent Open Agent | No
 | Remove File | Classic Agent Open Agent | No
Record | Window Declarations | Classic Agent | No
 | Application State | Classic Agent Open Agent | No
 | Testcase | Classic Agent Open Agent | No
 | Method | Classic Agent Open Agent | No
 | Actions | Classic Agent | No
 | Class | Classic Agent | No
 | Window Identifiers | Classic Agent | No
 | Window Locations | Classic Agent Open Agent | No
 | Defined Window | Classic Agent | No
 | Window Tags | Classic Agent | No
Results | Select | Classic Agent Open Agent | Yes
 | Merge | Classic Agent Open Agent | Yes
 | Delete | Classic Agent Open Agent | Yes
 | Extract | Classic Agent Open Agent | Yes
 | Export | Classic Agent Open Agent | Yes
 | Launch TrueLog Explorer | Classic Agent Open Agent | Yes
 | Convert to Plan | Classic Agent Open Agent | No
 | Compact | Classic Agent Open Agent | Yes
 | Show Summary | Classic Agent Open Agent | Yes
 | Hide Summary | Classic Agent Open Agent | Yes
 | View Options | Classic Agent Open Agent | Yes
 | Go to Source | Classic Agent Open Agent | Yes
 | View Differences | Classic Agent Open Agent | Yes
 | Update Expected Value | Classic Agent Open Agent | No
 | Mark Failures in Plan | Classic Agent Open Agent | Yes
 | Compare Two Results | Classic Agent Open Agent | Yes
 | Next Result Difference | Classic Agent Open Agent | Yes
 | Next Error Difference | Classic Agent Open Agent | Yes
Run | Compile | Classic Agent Open Agent | No
 | Compile all | Classic Agent Open Agent | No
 | Run | Classic Agent Open Agent | Yes
 | Debug | Classic Agent Open Agent | No
 | Application State | Classic Agent Open Agent | Yes
 | Testcase | Classic Agent Open Agent | Yes
 | Show Status | Classic Agent Open Agent | Yes
 | Abort | Classic Agent Open Agent | Yes
Testplan | Go to Script | Classic Agent Open Agent | Yes
 | Detail | Classic Agent Open Agent | No
 | Insert Template | Classic Agent Open Agent | No
 | Completion Report | Classic Agent Open Agent | Yes
 | Mark | Classic Agent Open Agent | Yes
 | Mark All | Classic Agent Open Agent | Yes
 | Unmark | Classic Agent Open Agent | Yes
 | Unmark All | Classic Agent Open Agent | Yes
 | Mark by Query | Classic Agent Open Agent | Yes
 | Mark by Named Query | Classic Agent Open Agent | Yes
 | Find Next Mark | Classic Agent Open Agent | Yes
 | Define Attributes | Classic Agent Open Agent | Yes
 | Run Manual Tests | Classic Agent Open Agent | No
Tools | Start Silk Performer | Classic Agent Open Agent | No
 | Connect to Default Agent | Classic Agent Open Agent | Yes
 | Data Drive Testcase | Classic Agent | No
 | Enable Extensions | Classic Agent | No
 | Open Silk Central | Classic Agent Open Agent | Yes
View/Transcript | Expression | Classic Agent Open Agent | No
 | Global Variables | Classic Agent Open Agent | No
 | Local Variables | Classic Agent Open Agent | No
 | Expand Data | Classic Agent Open Agent | No
 | Collapse Data | Classic Agent Open Agent | No
 | Module | Classic Agent Open Agent | No
 | Breakpoints | Classic Agent Open Agent | No
 | Call Stack | Classic Agent Open Agent | No
 | Transcript | Classic Agent Open Agent | No
Window | Tile Vertically | Classic Agent Open Agent | Yes
 | Tile Horizontally | Classic Agent Open Agent | Yes
 | Cascade | Classic Agent Open Agent | Yes
 | Arrange Icons | Classic Agent Open Agent | Yes
 | Close All | Classic Agent Open Agent | Yes
 | Next | Classic Agent Open Agent | Yes
 | Previous | Classic Agent Open Agent | Yes
 | # filename-filepath | Classic Agent Open Agent | Yes
Workflows | Basic | Classic Agent Open Agent | No
 | Data Driven | Classic Agent Open Agent | No
Parent topic: Using the Runtime Version of Silk Test Classic


Known Issues

This section identifies any known issues with Silk Test Classic and their resolutions.

  • General Issues
    Describes general known issues.
  • Mobile Web Applications
    Describes known issues related to testing mobile web applications.
  • Web Applications
    Describes known issues related to Web applications.
  • SAP Applications
    Describes known issues related to SAP applications.
  • Oracle Forms
    Describes known issues related to applications built with Oracle Forms.
  • Silk Test Classic
    Describes known issues for Silk Test Classic.


General Issues

Object Map Takes a Long Time to Open

If you have a large object map asset it takes a long time to load when you are using .NET 4. Install .NET 4.5 to resolve this issue.

When a remote desktop or remote desktop connection (RDC) is minimized, Silk Test does not function

When you connect through the remote desktop protocol (RDP) to a desktop, you take ownership of the desktop by attaching to the desktop with your mouse and keyboard. If the desktop is minimized without ownership of the desktop being released, any playback of mouse clicks or keystrokes is undefined.

As a workaround, you could use a VNC-based remote viewing tool. This would allow replay to continue even if the client window is minimized.

The Open Agent does not start when the Check Point firewall is installed

When you have a Check Point firewall or a Check Point ZoneAlarm firewall installed on your system, the Open Agent cannot be started, because the firewall interrupts the communication between the Agent and the infoservice.

To start the Open Agent, you have to uninstall the Check Point firewall from your system.

The modifiers parameter in the domDoubleClick method is ignored

You cannot specify the modifier in the overloaded domDoubleClick method. The modifier will not be double-clicked, although you have specified the parameter. The overloaded domDoubleClick method, which allows you to specify the modifier, is deprecated. To specify the modifier, you can use the doubleClick method, if you are using a client that supports an overloaded method with the modifiers parameter, or the PressKeys and ReleaseKeys methods.

Silk Test does not support testing Metro-style apps

Silk Test does not support testing Metro-style apps on Microsoft Windows 8, Microsoft Windows 8.1, or Microsoft Windows 10. Metro-style apps are also known as Windows 8 style, Modern UI style, Windows Store style, or Universal Windows Platform (UWP) apps.

The built-in spell checking in Microsoft Windows 8 might interfere with the replay of tests

The built-in spell checking in Microsoft Windows 8 can be enabled in applications like Internet Explorer 10.

If a word was incorrectly spelled during recording, and you replay typing this word, the spell checker will either mark it, or for commonly misspelled words will automatically fix it, which is the same behaviour a real user would get. If your tests were created on an operating system that did not include the spell checking feature, you might get unexpected results when replying the tests on Microsoft Windows 8. To disable the spell checking, you can do the following:
  1. Press Windows Key + C.
  2. On the Charm bar, click Settings.
  3. Select More PC Settings.
  4. Select General to see the Spelling selections.
    Note: These are system-wide settings, not settings specific to Internet Explorer.
  5. Set Autocorrect misspelled words to off.
  6. Set Highlight misspelled words to off.

When a .NET application is started from DevPartner Studio (DPS), Silk Test might not recognize it

To resolve the issue, perform the following steps:

  1. Go to the Silk Test installation folder (by default, it's located at: C:\Program Files\Silk\SilkTest).
  2. For Windows Forms applications, go to ng\agent\plugins\com.borland.fastxd.techdomain.windowsforms.agent_<version number>.
  3. For Windows Presentation Foundation (WPF) applications, go to ng\agent\plugins\com.microfocus.silktest.techdomain.wpf.agent_<version number>.
  4. In Notepad, open the file plugin.xml, and add the following line to the <loadparameters> section:
    <param name="frameworkAssembly">mscoree.dll</param>
  5. Log out of the computer, and then log back in. Silk Test works as expected with the application that was started by DevPartner Studio.

The highlighting rectangle is out of place when recording clicks on an area of an image

When you record a click on a part of a complex image, for example an area map, the green highlighting rectangle does not highlight the appropriate area of the image. However, the click will be executed correctly during replay.

The Open Agent might not start if Windows Defender is enabled during the installation of Silk Test

If Windows Defender is enabled on your system during the Silk Test installation, you might not be able to start the Open Agent after the installation is complete. Windows Defender might prevent the hotfix setup from performing some required actions. As a workaround, disable Windows Defender during the Silk Test installation.

The IME editor opens out of place when opened from specific locations

The IME editor opens on the top-left corner of the current screen instead of opening near the text field from which it is opened.

This behavior occurs when opening the IME editor from the following locations:
  • The Silk Recorder.
  • The Keyword-Driven Test Editor.
  • The Keywords window.

Silk Test help freezes when you enter characters in the Search box

The Silk Test help might freeze when you enter characters in the Search box on the Index tab in a Compiled HTML Help (.chm) file in Microsoft Windows 8.1, Microsoft Windows RT 8.1, or Microsoft Windows Server 2012 R2. To fix this issue, you have to install a Windows update. The update is available from https://support.microsoft.com/en-us/kb/3080042.

Cannot use Shift+Insert when the Numeric Lock key is active

Using the TypeKeys method to paste the contents of the clipboard with Left Shift+Insert or Right Shift+Insert does not work when the Numeric Lock (Num Lock) key is active.

You can workaround this issue by deactivating the Num Lock in your test script before calling the TypeKeys method.

Parent topic: Known Issues


Mobile Web Applications

Silk Test Classic does not support frames on Apple Safari

Silk Test Classic does not support HTML frames and iframes on Apple Safari on iOS.

Chrome for Android 43 or later: Silk Test Classic does not support zooming and scrolling at the same time

Recording a mobile web application on Chrome for Android 43 or later, while the mobile web application is zoomed and the top-left corner is not visible on the screen, might not work as expected. If the green rectangles for the controls in a mobile web application are not correctly displayed during recording, zoom-out the mobile web application completely, scroll to the top-left corner of the mobile web application, and refresh the Recording window.

Parent topic: Known Issues


Web Applications

Recording with a zoom level different to 100% might not work properly

Recording a Web application with a zoom level different to 100% might not work as expected. Before recording actions against a Web application, set the zoom level in the browser to 100%.

  • Google Chrome
    Describes known issues related to testing Web applications in Google Chrome.
  • Internet Explorer
    Describes known issues related to Internet Explorer.
  • Microsoft Edge
    Describes known issues related to Microsoft Edge.
  • Mozilla Firefox
    Describes known issues related to testing web applications on Mozilla Firefox.
Parent topic: Known Issues


Google Chrome

Locator recording in windows fails with Google Chrome

When you are testing a Web application in Google Chrome, locator recording in windows fails when multiple windows are open during application configuration in the Google Chrome instance, in which the application is running. If you close the other Google Chrome windows during application configuration, the error will not appear.

Background applications in Google Chrome prevent automation support from loading

When you want to test a Web application with Google Chrome and the Continue running background apps when Google Chrome is closed check box is checked, Silk Test cannot restart Google Chrome to load the automation support.

Silk Test cannot record locators in modal dialogs when Windows Aero is disabled

If Windows Aero functionality is disabled, modal dialogs are not recognized and locators in such dialogs cannot be selected. As a workaround, use the Locator Spy or the Identify Object dialog box to manually create and verify locators while a modal dialog is displayed.

Silk Test does not display embedded PDFs

With Google Chrome 42 or later, Google Chrome by default blocks the NPAPI plug-in, which is used to display embedded PDFs. Because of this, Silk Test does not display embedded PDFs in Google Chrome 42 or later, but instead downloads the embedded PDFs.

  • If you are using Google Chrome 44 or prior, you can unblock the NPAPI plug-in in Google Chrome, by typing the following into the address bar:
    chrome://flags/#enable-npapi
  • If you are using Google Chrome 45 or later, the NPAPI plug-in is completely removed from Google Chrome, without an option to re-enable it, and all PDFs are downloaded.

Connection timeouts when executing tests against Google Chrome 49 or prior

When executing tests against Google Chrome 49 or prior on a slow machine, you might experience connection timeouts, causing the tests to fail. The following error message is displayed:
Error executing '*'. Communication with browser automation timed out.

To avoid such connection timeouts, ensure that the test machine has enough processing power. For example, if you are testing on a slow virtual machine (VM), you could enhance the processing power by adding an additional CPU core to the VM.

Parent topic: Web Applications
Related reference
Limitations for Testing with Google Chrome


Internet Explorer

Using Google toolbar interferes with recording Web applications

Using the Google toolbar with Internet Explorer 8 interferes with recording locators for Web applications.

Turn off the Google toolbar before you record Web applications.

Microsoft Silverlight Applications

Some Microsoft Silverlight applications cause Internet Explorer to hang when interacting with Silk Test. On 32-bit platforms, refer to MS KB 2564958 (an update to Active Accessibility) to help prevent the issue.

Locators recorded with Silk Test versions prior to Silk Test 13.5 might no longer work in Internet Explorer

In Silk Test 13.5, we have adapted the normalization of white spaces of the textContents attribute in Internet Explorer. This change was made to improve the cross-browser capabilities of Silk Test, and might affect locators which rely on the textContents attribute, and which are used in scripts that were recorded with releases prior to Silk Test 13.5.

The Open Agent cannot have high elevation enabled when UAC is enabled on Microsoft Windows 8 or later and Internet Explorer 11

You cannot test a Web application in Internet Explorer 11 on Microsoft Windows 8 or later and have UAC enabled and run both Internet Explorer and the Open Agent with high elevation.

Known issues with Input Method Editors (IMEs)

  • Silk Test does not record half-width spaces for Japanese input in Internet Explorer 11.
  • Silk Test does not record IME input in Internet Explorer 11 in compatibility mode.
  • In Japanese IME mode, pressing Space will cause Silk Test to record the current IME candidate. Use Convert to avoid this issue.

Internet Explorer might stop working while testing an Applet with a Java version higher that 1.7 update 71

Internet Explorer might stop working while testing an Applet with a Java version higher that 1.7 update 71 (7u71).

Internet Explorer does not respond during test execution

Internet Explorer 10 or later might become unresponsive during test execution because a thread in Internet Explorer is suspended and creates a deadlock. The root cause of this problem is a new security feature in Internet Explorer.

To solve this issue, disable the security feature.

  1. Open the Registry Editor.
  2. If the OverrideMemoryProtectionSetting entry does not exist in the key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main, create the entry.
  3. Set the value of the registry key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main::OverrideMemoryProtectionSetting to 2.

The JavaScript alert-handling API methods do not work with an embedded Internet Explorer

The following JavaScript alert-handling methods of the BrowserWindow class do not work when testing an embedded Internet Explorer:
  • AcceptAlert method
  • DismissAlert method
  • GetAlertText method
  • IsAlertPresent method
Parent topic: Web Applications


Microsoft Edge

Windows opened out of Microsoft Edge are not supported

Windows which are opened as actual new Microsoft Edge windows, and not as tabs, are not supported. Silk Test Classic cannot close such windows correctly, and the agent is in an invalid state after closing such a window.

JavaScript alerts opened in an iframe or frame cannot be closed

Microsoft Edge cannot close the JavaScript alerts alert(), prompt(), and confirm(), if these alerts were opened in an iframe or frame.

Cannot open the native browser context menu

If a test includes a right click in Microsoft Edge, which opens the native browser context menu, the test will hang. This issue does not occur with HTML menus opened by Microsoft Edge.

Cannot execute tests against Microsoft Edge with UAC disabled

When executing tests against Microsoft Edge with UAC disabled, the following error message displays:
Failed to start application 'Edge'. Unable to parse remote response: Unknown error

To solve this issue, enable UAC.

Parent topic: Web Applications
Related reference
Limitations for Testing with Microsoft Edge


Mozilla Firefox

Calls into applications using Adobe FlashPlayer do not properly synchronize when using Mozilla Firefox

When you are using Mozilla Firefox with a recent Adobe FlashPlayer version, some calls might not synchronize properly. The following issues might occur:
  • Mozilla Firefox might falsely recognize a running script as stalled and a confirmation dialog box might appear asking whether you want to continue the execution of the script, even though the script is running properly.
  • Typing characters might not work because SetFocus is no longer working correctly.
  • The Adobe automation might return an old value although the UI already shows a new value.

If you face one or more of these issues with applications using Adobe FlashPlayer, turn off the ProtectedMode in Adobe FlashPlayer. For additional information, see http://forums.adobe.com/thread/1018071 and read the information provided under Last Resort.

Parent topic: Web Applications


SAP Applications

HierarchyHeaderWidth and ColumnOrder Properties of the SAPTree Class are write only

Other than the automation documentation indicates, the HierarchyHeaderWidth and ColumnOrder properties of the SAPTree class are write only and cannot be read.

Ensure that your scripts use write rather than read with these properties.

GetColumnIndexFromName() of the SapTree Class May Fail with an "unspecified error"

GetColumnIndexFromName() of the SapTree class may fail with an "unspecified error". This is a known issue in SAP automation.

Check the SAP web site to see if the issue has been resolved.

Calling the Select() method of the SAPTree Class on a Context menu item may fail

Calling the Select() method of the SAPTree class on a Context menu item may fail.

Call SelectContextMenuItem on the parent control instead. This problem is a known issue in the SAP automation.

The position property for a horizontal scrollbar always returns 1

The position property for a horizontal scrollbar always returns 1. This is a known issue in SAP automation.

Check the SAP web site to see if the issue has been resolved.

The SAPNetPlan class is not supported

This issue will be resolved in a future release.

Replay error occurs when executing an SAP script

In certain cases, if you record an SAP test and then replay it, the following error might occur: The data necessary to complete this operation is not yet available. This means that Silk Test Classic is executing the recorded actions too fast.

To solve this issue, you can add sleeps to your test script or you can increase the post replay delay to increase the time that Silk Test Classic waits after invoking a function or setting a property. For additional information about this option, see Agent Options. You could also change the script to use SAP automation to replay the problematic action instead of using the xBrowser technology domain. For example, you could change the action DomLink.Select to SapHTMLViewer.SapEvent.

The method getCurrentRow returns a wrong value with SAPGUI client 7.30

If you use SAPGUI client 7.30 and you call the method getCurrentRow, the method might falsely return -1 instead of the row number.

The method resizeWorkingPane is not working correctly with SAPGUI client 7.30

If you use SAPGUI client 7.30 and you call the method resizeWorkingPaneEx, the method will not resize the workingPane and calling getSapWindow().getWidth() will return a wrong value for the window width.

Parent topic: Known Issues
Related reference
Agent Options


Oracle Forms

Silk Test Classic does not support testing Oracle Forms with a Java version higher than 1.7 update 60

Silk Test Classic does not support testing Oracle Forms with a Java version higher than 1.7 update 60 (7u60).

Parent topic: Known Issues


Silk Test Classic

Ensure that the agent.exe and partner.exe processes have been killed before attempting a Silk Test Monitor execution

When running Silk Test monitors or GUI-level tests, Agent.exe or Partner.exe may not close correctly after a monitor execution and the temporary results folder may remain opened. When this happens during a monitor execution, all subsequent monitors fail with the error LoadtestController: 3302 - The results directory could not be cleared and do not clear.

Kill the Agent.exe or Partner.exe process manually on the execution server or create an Action Essential which will automatically kill the processes whenever needed.

Unknown behavior occurs if a window class is declared without a tag

A window class declaration in Silk Test must include a tag, even if the objects in the class are intended to be used only with the Open Agent. Locators can be added to objects of a class. Adding a locator to a class definition will not have an effect. For example, in the following code, the tag line is mandatory.
[-] winclass MyDialogBox : DialogBox
 [ ] tag "[DialogBox]"

If the tag line is present, the code works as it should. However, if the tag line is missing, this leads to unknown errors and possible crashes.

Variables are not displayed correctly in debug mode when "{chr(10)}" is used

When debugging a script that uses the "{chr(10)}" character for line-change, the values of the accessible variables are not displayed correctly and you cannot use Set Value to set the value of a variable.

The INC file for the base state does not compile if the caption of an application contains a single quote

The generated INC file for the base state does not compile if the caption of an application contains a single quote.

Parent topic: Known Issues


Working with Files

This section describes how you can use files in Silk Test Classic.

  • Creating a New File
    Use the New File dialog box to create a new file.
  • Searching for a String in a File
    Use the Find dialog box to search for a string in a file.
  • Replacing a String in a File
    Use the Replace dialog box to replace a string in a file.
  • 4Test Editor
    Describes the 4Test Editor.
  • Setting Up a Printer
    Use the Printer Setup dialog box to set up a printer.
  • Printing the Contents of the Active Window
    Use the Print dialog box to print all or part of the contents of the active editor or results window.
  • Confirm Test Description Identifier Dialog Box
    Describes the Confirm Test Description Identifier dialog box.


Creating a New File

Use the New File dialog box to create a new file.

  1. Click File > New. The New File dialog box appears.
  2. Select the file type. Silk Test Classic supports the following file types:
    • Test frame
    • Test plan
    • 4Test script
    • 4Test include file
    • Keyword-driven test
    • Keyword sequence
    • Suite
    • Text
  3. Click OK.
  • If you have selected any file type except test frame, a new editing window opens. The title bar of the new editing window displays the file type you have chosen and untitled.
  • If you have selected to create a new test frame file, and you are using the Open Agent, the Select Application dialog box displays, allowing you to create a test frame file for a specific application.
  • If you have selected to create a new test frame file, and you are using the Classic Agent, the New Test Frame dialog box displays, allowing you to create a test frame file for an open application. For additional information, see Creating a New Test Frame.
Parent topic: Working with Files
Related reference
Select Application Dialog Box


Searching for a String in a File

Use the Find dialog box to find a string in a file.
  1. Click Edit > Find. The Find dialog box appears.
  2. Type the text that you want to search for the active window into the Find what field. The default string is the last string you searched for.
  3. Check the Wrap Search check box to begin and end the search for the specified text at the current location of the cursor. When the check box is checked, the search continues past the end or beginning of the document back to the current location of the cursor.
  4. Check the Case sensitive check box to make the search sensitive to the case of the text string. The default is to search with case sensitivity off.
  5. Set the direction for the search.
    • Select Up to have the search go from the current location of the cursor towards the top, or beginning, of the file.
    • Select Down to have the search go from the current location of the cursor towards the bottom, or end, of the file. This is the default direction.
  6. Click Find Next to locate the next occurrence of the text string. If the search is successful, the first occurrence of the text string in the file is highlighted. If the search is not successful, an informational message displays.
Parent topic: Working with Files
Related tasks
Replacing a String in a File


Replacing a String in a File

Use the Replace dialog box to replace a string in a file with another string.
  1. Click Edit > Replace. The Replace dialog box appears.
  2. Type the text that you want to replace into the Find what field. The default string is the last string you searched for.
  3. Type the text with which you want to replace the text in the Find what field into the Replace with field.
  4. Check the Case sensitive check box to make the search sensitive to the case of the text string. The default is to search with case sensitivity off.
  5. Set the direction for the search.
    • Select Up to have the search go from the current location of the cursor towards the top, or beginning, of the file.
    • Select Down to have the search go from the current location of the cursor towards the bottom, or end, of the file. This is the default direction.
  6. Click Find Next to locate the next occurrence of the text in the Find What field. If the search is successful, the first occurrence of the text string in the file is highlighted. If the search is not successful, an informational message displays.
  7. Click Replace to replace the next occurrence of the text in the Find What field with the text in the Replace with field.
  8. Click Replace All to replace every instance of the text in the Find What field with the text in the Replace with field.
Parent topic: Working with Files
Related tasks
Searching for a String in a File


4Test Editor

The 4Test Editor, also called test plan editor or the outline, lets you edit a file. When you are in the 4Test Editor, there are a variety of text editing commands available through the Outline menu and the toolbar. You can also AutoComplete to automatically complete functions, members, application states, and data types in your script or include files.

If you have a data driven file open, which is a file with the extension .g.t, a special 4Test Editor is displayed with additional items.

Find values of type

Lets you specify what types of values you want to search for in the file. The default is to search the test case for all types of values, text, numbers, and true/false (booleans). You can uncheck or check the boxes to indicate the values you need to look for.

Next
Click to search down from the cursor’s current location.
Prev
click to search up from the cursor’s current location.

Replace value with

Lets you specify the table and column you are using to replace the highlighted value.

Table
Populated when you first create the .g.t file, or whenever you open the Find/Replace Values dialog box, or when you click the list box arrow. The text that displays depends on the names already saved in your data source. For example, if you are using a Microsoft Excel file as your data source, a list of worksheets and named ranges displays here. Select the table that contains the values you want to use to replace the highlighted value.
Column
Blank when the 4Test Editor is opened with a .g.t file. The text that displays here depends on the names already saved in your data source. Select the column that contains the values you want to replace the highlighted value.
Replace
Click after you have selected a value to replace, and the table and column that contains the values you want to use as replacements.
Parent topic: Working with Files
Related concepts
Overview of AutoComplete
Related reference
test plan
outline


Setting Up a Printer

Use the Printer Setup dialog box to set up a printer.

Options
Click to display the printer’s options dialog box.
Network
Click to display the Connect to Printer dialog box where you can select another printer to use.
  1. Click File > Printer Setup.
  2. Select the printer.
    • To use the default printer, click Default Printer.
    • To use a different printer than the default, click Specific Printer.
  3. Select the printer format.
    • Click Portrait to print the current document in portrait format (8.5 x 11).
    • Click Landscape to print the current document in landscape format (11 x 8.5 inches).
  4. Select the size of the paper that you are using to print from the Size list.
  5. Select the paper source that the printer should use from the Source list.
  6. Click Options to display specific options for the selected printer.
  7. Click Network to select a network printer.
Parent topic: Working with Files
Related tasks
Printing the Contents of the Active Window


Printing the Contents of the Active Window

Use the Print dialog box to print all or part of the contents of the active editor or results window.

  1. Click File > Print. The Print dialog box appears.
  2. Select All lines to print the entire file or Selected lines only to print only lines that you have highlighted.
  3. Enter values for the left, right, top, and bottom margins. The default value for any margin is 0.50 inch.
  4. Type literal text, variables, or a combination of both into the Header and Footer fields. You can also enter the following into the fields:

    • &f to print the file name.

    • &p to print the page number.

    For example, if you type Script: &f in the Header field of a file named testapp.t, the printed header will be: Script: testapp.t.
  5. Select the output resolution from the Print Quality list.
  6. Check the Print Fully Expanded check box to print the entire contents of the file. Uncheck the check box to print the file as it is shown on the screen.
  7. Check the Print Icons check box to print icons.
  8. Click Font to change the font family, the font size, and the style of the text.
  9. Click Setup to display the Printer Setup dialog box where you can reconfigure the printer options.
Parent topic: Working with Files
Related tasks
Setting Up a Printer


Confirm Test Description Identifier Dialog Box

This dialog box is displayed when cut-and-paste editing operations lead to unresolved test description identifiers. For example, this dialog appears if you cut a test description and then pasted it back into the same place. Outwardly, nothing has changed, but the act of cutting and pasting causes a confirmation as to whether you want to retain the original test ID or not.

Parent topic: Working with Files


Using the Silk Test Classic Menus

This section describes the commands that are available in the Silk Test Classic menus.

Menu commands may be enabled or disabled depending on the agent, the testing mode, and the type of file currently opened in the editor.

  • File Menu
    Describes the commands on the File menu.
  • Edit Menu
    Describes the commands on the Edit menu.
  • Outline Menu
    Describes the commands on the Outline menu.
  • Record Menu
    Describes the commands on the Record menu.
  • Run Menu
    Describes the commands on the Run menu.
  • Options Menu
    Describes the commands on the Options menu.
  • Project Menu
    Describes the commands on the Project menu.
  • Tools Menu
    Describes the commands on the Tools menu.
  • Workflows Menu
    Describes the commands on the Workflows menu.
  • Window Menu
    Describes the commands on the Window menu.
  • Breakpoint Menu
    Describes the commands on the Breakpoint menu.
  • Debug Menu
    Describes the commands on the Debug menu.
  • Include Menu
    Describes the commands on the Include menu.
  • Results Menu
    Describes the commands on the Results menu.
  • Testplan Menu
    Describes the commands on the Testplan menu.
  • View Menu
    Describes the commands on the View menu.
  • Help Menu
    Describes the commands on the Help menu.
  • Bitmap Tool Menus
    Describes the menus that are available in the Bitmap Tool.


File Menu

The File menu contains the following commands:

Command (Shortcut)
Description
New (Ctrl+N)
Displays the New File dialog box, which you can use to create a new file. For additional information, see Creating a New File.
New Testplan
Opens the Testplan dialog box where you can create and edit test plans. This menu item is only available when a test plan is open in the active window. For additional information, see Creating a New Test Plan.
Open (Ctrl+O)
Displays the Open dialog box where you can select an existing file to open.
Close
Closes the active window.
Save (Ctrl+S)
Writes the contents of the active window to disk. If you open a file that is owned by someone else or that someone else currently has open, a view-only copy of the file is opened and changes the menu item File > Save to File > Save Object File. You cannot save the source file (since it is locked), but you can select File > Save Object File to write a new object file.
Save Object File
Available only when a script or include file is view-only. Writes the contents of the current include file or script to disk in compiled form. Useful when you are working with a file that you don’t have write access to and for which you want to create an object file.
Save As
Displays the Save As dialog box where you can rename the current document and save it.
Save All
Writes all open files that have changed since the last time you saved them to disk.
New Project
Create a new project or automatically generate a new project based on existing files that you specify. For additional information, see Creating a New Project.
Open Project
Displays the Open Project dialog box where you can specify the project that you want to open. If you already have a project open, you are prompted to close the project before opening another one. For additional information, see Opening an Existing Project.
Close Project
Closes the current project.
Export Project
Exports a project to the specified location. For additional information, see Exporting a Project.
Email Project
Automatically packages a project and sends the packaged project as an email to the specified email address. For additional information, see Emailing a Project.
Run
Displays the Run dialog box where you can select a script, suite, or test plan (if available) to run.
Debug
Displays the Debug dialog box, where you select a script to debug. The script that you select will be opened in Debug mode. For additional information, see Debugging a Test Script.
Printer Setup
Displays the Printer Setup dialog box where you can change printers or specify printing options. For additional information, see Setting Up a Printer.
Print (Ctrl+P)

Displays the Print dialog box where you can print all or part of the contents of the active editor or results window. For additional information, see Printing the Contents of the Active Window.

Recent Files and Recent Projects

Lists the files and projects that were opened most recently in the workspace. You can click on an item to restore it to the foreground of the workspace. Items are prefaced by an integer, n, where the most recent file is listed first. Selecting a recent project causes the current project to close. For example, the most recent file is prefaced by 1. You can select a file by its number to bring to the foreground the second file, press Alt+F+2. By default, nine files and four projects display. You can change number of files and projects displayed by changing the number in the File history size and Project history size fields of the General Options dialog box.

Exit (Alt+F4)

Closes the application.

Parent topic: Using the Silk Test Classic Menus


Edit Menu

The Edit menu is available when you have a file, for example an include file, open.

Command (Shortcut)
Description
Undo (Ctrl+Z)
Backs out of the most recent change you have made in the editor. When you make a change in the editor, the Undo menu item describes the action. For example, if you had just cut some text, the menu item would read Undo Cut. When you select Edit > Undo, the editing action is undone and changes the Redo menu item to describe the undone action. For example Redo Cut. To reverse the undo you just did, click Edit > Redo.
Redo (Ctrl+Y)
Reverses the undo you just accomplished through Edit > Undo. The Redo menu item describes the undo. For example, after undoing a cutting action, the Redo menu item becomes Redo Cut. When you select Edit > Redo, the action is performed again.
Cut (Ctrl+X)
Removes the selected text from the active window and copies it to the clipboard.
Copy (Ctrl+C)
Copies the selected text to the clipboard.
Paste (Ctrl+V)
Inserts text that you have cut or copied to the clipboard into the active window at the current insertion point. You cannot paste graphics into a window.
Delete (Del)
Removes the selected text. Unlike Cut, Delete does not copy text to the clipboard.
Find (Ctrl+F)
Opens the Find dialog box where you can search in the active window for a text string. For additional information, see Searching for a String in a File.
Find Next (F3)
Repeats the last find or replace operation. This menu item changes to Replace Next after a replace operation, or to Replace All after a global replace operation.
Replace (Ctrl+R)
Find and replace a string in a file with another string. For additional information, see Replacing a String in a File.
Go to Line (Ctrl+G)
Opens the Go to Line dialog box, which enables you to go to a specific line in the active file. Type the number of the line that you want to go to into the Line number field and click OK.
Go to Definition (F12)

Available only with a compiled file such as those shipped with Silk Test Classic or those listed in the Use files field of the Runtime Options dialog. Goes to the declaration for a method, function, variable, constant, or data type when you click on a reference to such an item in your 4Test code and then do one of the following:

  • Press F12.
  • Click Edit > Go to Definition.
  • Press Ctrl+.

For example, in the following 4Test code:

String GetHelloWorld()
return "Hello World"
String sHelloWorld = GetHelloWorld()

If you place the cursor somewhere on the reference to GetHelloWorld() on the last line, and press F12, the cursor is placed at the front of the line String GetHelloWorld()(You are prompted to save). The file opens with the correct declaration if the file is not currently open.

Find Error (F4)

Is available in the active error window or results window. How this command works depends on the type of window that is active:

  • If an error window is active, the scan is downward from the cursor position until it finds a line referring to a script file. It looks for that file among open editor windows (or opens it if it is not found) and places the cursor on the appropriate line of the script.
  • If a script window is active, the cursor is placed on the appropriate line of the script.
  • If a results window is active, the cursor is positioned on the next error message or warning in the results window.

To step through each source line that contains an error, make the errors window or script window active and press F4. The relevant error message displays on the status line.

To cycle through each error message or warning in a results file, make the results window active and press F4. The cursor is positioned at the next error message or warning in the results window.

By default, Find Error finds both errors and warnings. If you want to skip over warnings, clear the Find Error Stops at Warning check box in the Runtime Options dialog box.

Data Driven
This sub-menu is available when you are in a script with data-driven test cases. There are four commands available.
Command | Description
Find/Replace Values | Find and replace values in a data-driven test case with links to values in tables and columns. For additional information, see Finding and Replacing Values.
Goto Testcase | Displays the Goto Testcase dialog box.
Validate Replacements | Toggles the checking that the application does to ensure you are only finding and replacing whole values. The default is checked. To switch between these modes, click Edit > Validate Replacements to select or clear the check mark.
Reload Database | Refreshes the link to the data source and reloads the tables and columns from that data source. This is useful if the data source has had any additions or changes since you first opened the .g.t file.
Find Next Difference

Available only when the Difference Viewer is the active window. Finds the next discrepancy between an actual and expected value.

Parent topic: Using the Silk Test Classic Menus


Outline Menu

The Outline menu is available when a file is open in the editor. The menu contains the following commands:

Command (Shortcut)
Description
Move Left (Alt+Left)
Changes the indentation of the selected lines. Moves the current line, the selected lines, or the text cursor, if the current line is empty, to the left. If you shift the code to an invalid position in a script or include file, the invalid lines are marked with an X.
Move Right (Alt+Right)
Changes the indentation of the selected lines. Moves the current line, the selected lines, or the text cursor, if the current line is empty, to the right. If you shift the code to an invalid position in a script or include file, the invalid lines are marked with an X.
Transpose Up (Alt+Up)
Exchanges the current line or selected lines with the previous line.
Transpose Down (Alt+Down)
Exchanges the current line or selected lines with the next line.
Expand (Ctrl+'+')
Expands any collapsed sub-items (children) of the current line or of the selected lines.
Expand All (Ctrl+'*')
Expands all collapsed sub-items in the active window.
Collapse (Ctrl+'-')
Collapses any expanded sub-items of the current line or of the selected lines.
Collapse All (Ctrl+'/')
Collapses all expanded sub-items in the active window.
Comment (Alt+M)
This command Is available if the file in the active window is a 4Test script, an include file, or a plan file. Places a single-line comment, which is indicated by //, at the beginning of the current line or of the selected lines.
Uncomment (Alt+N)
This command is available if the file in the active window is a 4Test script, an include file, or a plan file. If a single line comment exists in the current line or in the selected line, this command removes the comment.
Parent topic: Using the Silk Test Classic Menus


Record Menu

The Record menu contains the following commands:

Command (Shortcut)
Description
Window Declarations (Ctrl+W)

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Opens the Record Windows Declarations dialog box. You can use this dialog to record descriptions, which are called window declarations, of the GUI objects in your application and to insert them into a declarations file, which is called an include file (*.inc).
Application State (Classic Agent: Ctrl+L, Open Agent: Ctrl+Shift+S)
Opens the Record Application State dialog box, which you can use to define an application state routine that Silk Test Classic runs before it executes your test case. For additional information, see Recording an Application State.
Testcase (Ctrl+Shift+T)
Opens the Record Testcase dialog box, which you can use to record an entire test case, specifying the application state of your choice and including verification statements. If you are using the Open Agent, you can select whether you want to record a 4Test test case or a keyword-driven test. For additional information on recording a test case with the Open Agent, see Creating Testcases with the Open Agent. For additional information on recording a test case with the Classic Agent, refer to the Silk Test Classic Classic Agent Help.
Method (Ctrl+Shift+M)
This is only available when an include file or script file is the active window and the insertion point is within a class or object declaration. For additional information, see Recording a Method for a GUI Object.
Actions
Enables you to record additional actions into existing test scripts.
  • For additional information on recording actions with the Open Agent, see Recording Additional Actions Into an Existing Test.
  • For additional information on recording actions with the Classic Agent, refer to the Silk Test Classic Classic Agent Help.
Window Locators (Ctrl+Shift+L)

This functionality is supported only if you are using the Open Agent.

Opens the Locator Spy dialog box, which you can use to record window declarations or locators for the Open Agent. For additional information, see Recording Locators Using the Locator Spy.

Class

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Select one of the following:
Scripted
Displays the Record Class Scripted dialog box, which you can use to record a new Visual Basic, Active X, or Java class declaration.
Accessibility
Displays the Windows Accessibility dialog box, which you can use to record a new class for testing Microsoft applications that have the built-in Accessibility features enabled.
Window Identifiers (Ctrl+I)

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Opens the Record Window Identifiers dialog box, which you can use to record a fully qualified GUI object name.

Window Locations

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Opens the Record Window Locations dialog box, which you can use to record the x, y locations of a graphical control.

Defined Window

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Opens the Record Defined Window dialog box, which you can use to help Silk Test Classic recognize a window while you are recording a test case.

Window Tags

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Opens the Record Window Tags dialog box, which you can use to record tags for windows that Silk Test Classic cannot recognize.

Parent topic: Using the Silk Test Classic Menus


Run Menu

The Run menu contains the following commands:

Command (Shortcut)
Description
Compile (Alt+F9)
Compiles the test plan, suite, or script and all dependent files, such as include files, if they have changed since they were last compiled.
Compile all

Compiles the script or suite and all dependent include files, even if they have not changed since they were last compiled. If the Save object files during compilation checkbox is enabled on the Runtime Options dialog box, then Compile All will create object files (*.o).

If the Save object files during compilation check box is not checked, object files (*.o) are not created when you click Run > Compile all. To force Silk Test Classic to create an object file without enabling the Save object files during compilation check box, you must modify the source file and compile or save it. Compiling saves modified files, and saving saves source, object, and backup files.

Run (F9)
Compiles and runs the 4Test script, suite, or test plan in the active window. For additional information, see Running Tests.
Run All Tests
Executes all the tests in the test plan, first expanding any sub-plans. This command is available only for the testplan editor.
Run Marked Tests
Executes only the marked tests in the test plan, first expanding any sub-plans. This command is available only for the testplan editor.
Debug (Ctrl+F9)
Reads the script in the active window into a debugging window and enters debugging mode. This is available only when the file in the active window is a script.
Application State (Alt+A)
Opens the Run Application State dialog box, which you can use to run or debug an application state that is defined in your test frame file or in the active script file. For additional information, see Run Application State Dialog Box.
Testcase (Alt+T)
Opens the Run Testcase dialog box where you can select a test case to run or debug. For additional information, see Running a Test Case.
Show Status
Shows or hides the Runtime Status dialog box when running a script, suite, test case, or test plan on a target machine that is not the host machine. For additional information, see Runtime Status Dialog Box.
Abort (LShift+RShift)
Terminates the script, suite, test case, or test plan that is currently executing. This command is available only when a program is being run or debugged on a target machine other than the host machine.
Parent topic: Using the Silk Test Classic Menus


Options Menu

The Options menu contains the following commands:

Command (Shortcut)
Description
General
Opens the General Options dialog box, which you can use to set the general system behavior, for example editor options and workspace preferences. For additional information, see Setting General Options.
Editor Font
Opens the Editor Font dialog box, which allows you to select a screen font in the family, size, and style of your choice. For additional information, see Setting the Editor Font.
Editor Colors
Opens the Editor Colors dialog box, which you can use to set the screen colors for various elements of 4Test code, results information, and the test plan, if available. For additional information, see Setting the Editor Colors.
Runtime
Opens the Runtime Options dialog box, which allows you to specify settings that the application uses when it runs a script. For additional information, see Runtime Options Dialog Box.
Agent
Opens the Agent Options dialog box, which allows you to set global options for how the agent software interacts with the application under test. For additional information, see Agent Options Dialog Box.
Extensions

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Opens the Extensions dialog box, which you can use to enable extensions for applications under test on your host machine.

Application Configurations

This functionality is supported only if you are using the Open Agent.

Opens the Edit Application Configurations dialog box, which allows you to add, remove, and modify the application configurations. For additional information, see Modifying an Application Configuration.

Recorder
Opens the Recorder Options dialog box, which allows you to specify settings that are used when recording.
  • For additional information on recording with the Open Agent, see Setting Recording Options for the Open Agent.
  • For additional information on recording with the Classic Agent, refer to the Silk Test Classic Classic Agent Help.
Manage Custom Controls

This functionality is supported only if you are using the Open Agent.

Opens the Manage Custom Controls dialog box, where you can set options for controls that are not defined according to a standard that is known to Silk Test Classic. For additional information, see Managing Custom Controls.

Edit Remote Locations

This functionality is supported only if you are using the Open Agent.

Opens the Remote Locations dialog box and enables you to configure remote locations. Any browsers and mobile devices on the remote location are added to the set of applications that you can test. For additional information, see Editing Remote Locations.

Class Map

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Opens the Class Map dialog box, which you can use to map custom classes to standard supported classes and to enable the user to suppress controls for certain classes.

Property Sets

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Opens the Property Sets dialog box, which allows you to create, modify, combine, and delete property sets, which are used to verify properties in test cases.

Class Attributes

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Opens the Edit Class Attributes dialog box, which allows you to select which attributes you want to record for selected classes.

TrueLog
Opens the TrueLog Options dialog box, which allows you to enable the TrueLog Explorer and to customize the information that TrueLog Explorer collects. For additional information, see Setting TrueLog Options.
Silk Central Configuration

Opens the Silk Central Connection dialog box, which you can use to specify the Silk Central instance that is used for keyword-driven testing. For additional information, see Integrating with Silk Central.

Open Options Set
Opens the Open Options Set dialog box, where you can load the set of custom agent, runtime, and class map options and Library Browser help files that you want to use for the current suite, script, or test plan.
Save New Options Set
Opens the Save Options Set As dialog box, which you can use to save the current set of agent, runtime, and class map options and Library Browser help files.
Close Options Set
Deactivates the current options set. This command is available only when a set of custom agent, runtime, and class map options is in effect. The file name is no longer displayed in the title bar. The default options are now in effect.
Parent topic: Using the Silk Test Classic Menus


Project Menu

The Project menu is only available if you have opened a project. The menu contains the following commands:

Command (Shortcut)
Description
View Explorer

Toggles the Project Explorer view. If you do not want to view the Project Explorer, uncheck the Project > View Explorer check box.

Note: Turning off the Project Explorer view does not close your project. You can continue to work with the files within the project, you just will not see the Project Explorer. If you want to close your project, you must click File > Close Project.
Align
Enables you to change the location of the Files and Global tabs from the left to right side of the main window and vice versa.
Project Description
Displays the Project Description dialog box, which you can use to modify the description of the current project. For additional information, see Project Description Dialog Box.
Add File
Displays the Add File to Project dialog box, where you can select a file to add to the current project.
Remove File
Removes the file selected on the Files tab from the project. The source file is not deleted; it is just removed from the current project. You cannot remove the projectname.ini file.
Parent topic: Using the Silk Test Classic Menus


Tools Menu

The Tools menu contains the following commands:

Command (Shortcut)
Description
Connect to Default Agent
Starts the Classic Agent or the Open Agent on the local machine depending on which agent is specified as the default in the Runtime Options dialog box. If the agent does not start within 30 seconds, a message is displayed. If the default agent is configured to run on a remote machine, you must manually connect to the agent.
Data Driven Testcase
Starts the process of creating a data-driven test case and displays the Select Testcase dialog box. For additional information, see Select Testcase Dialog Box.
Start Silk Performer
Starts Silk Performer. Available only when Silk Performer is installed.
Enable Extensions

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Displays a series of dialogs, beginning with the Enable Extensions dialog box, which guide you through selecting an application and enabling and testing your extension settings.

Open Silk Central
Opens Silk Central and displays it in an embedded browser window. This command is available only for the Testplan Editor. If you are not currently logged in to Silk Central, you will be prompted to log in. For additional information about configuring Silk Central, see Integrating with Silk Central.
Parent topic: Using the Silk Test Classic Menus


Workflows Menu

The Workflows menu has the following commands.

Basic
Displays the Basic workflow bar, which guides you through the process of creating a test case. Using this workflow bar, you create a project, automatically enable and test extension settings, configure the recovery system, and record and run a test case.
  • For additional information on using the basic workflow for the Open Agent, see Basic Workflow for the Open Agent.
  • For additional information on the basic workflow for the Classic Agent, see Basic Workflow for the Classic Agent in the Silk Test Classic Classic Agent Help.
Data Driven
Displays the Data Driven workflow bar, which starts the process of creating a data-driven test case. Using this workflow bar, you select the test case you want to data drive, find and replace values in that test case with links to values in tables and columns, and then select the rows from the tables you want to run for this data-driven test case. For additional information, see Data-Driven Workflow.
Parent topic: Using the Silk Test Classic Menus
Related reference
Basic Workflow for the Open Agent


Window Menu

The Window menu contains the following commands.

Command (Shortcut)
Description
Tile Vertically
Makes each child window of the main window the same size and positions them in an east to west orientation along the x axis. Each window is as tall as the main window frame and is as wide as the width of the frame divided by the total number of child windows.
Tile Horizontally
Makes each child window of the main window the same size and positions them in a north to south orientation along the y axis. Each window is as wide as the main window frame and is as tall as the height of the display divided by the total number of child windows.
Cascade
Layers one child window on top of the other. Except for the top window, which is completely visible, only the title bar of each window shows.
Arrange Icons
Organizes the icons in a row in the main window.
Close All
Closes all open windows. If any file has changed since you last saved it, you are prompted to save the file before closing it.
Next (F6)
Makes the next window in the numbered window history the active window. Repeat this command to cycle through the window history.
Previous (Shift+F6)
Makes the previous window in the window history the active window. Repeat this command to cycle through the window history.
Parent topic: Using the Silk Test Classic Menus


Breakpoint Menu

The Breakpoint menu is available during debugging and contains the following commands.

Command (Shortcut)
Description
Toggle (F5)
  • Adds a breakpoint to the current line, if no breakpoint exists.
  • Removes the breakpoint from the current line, if a breakpoint exists.
Add
Displays the Add Breakpoint dialog box which allows you to add a breakpoint at any executable line of a function. For additional information, see Setting Breakpoints.
Delete
Displays the Delete Breakpoint dialog box, which lets you delete one ore more breakpoints. For additional information, see Deleting Breakpoints.
Delete All
Deletes all breakpoints, first prompting you for confirmation.
Parent topic: Using the Silk Test Classic Menus


Debug Menu

The Debug menu is available only in debugging mode. For additional information about debugging, see Debugging Test Scripts.

The menu contains the following commands.

Command (Shortcut)
Description
Run and Debug/Continue (F9)
Runs the script in the debugging window until reaching the first breakpoint or the end of the script. Execution stops just before the line with the breakpoint.
Step Over (F8)
Available only after using Debug > Run, when the execution has stopped at a breakpoint. Executes the current line of code in the active script or in a file that is called by the active script, without stepping into any functions called by the current line. Control stops at the next statement.
Step Into (F8)
Available only after using Debug > Run, when the execution has stopped at a breakpoint. Executes the current line of code in the active script or in a file called by the active script. If the current line has a breakpoint, the line executes. If the current line contains a function call, control passes into the function and execution stops at the first statement.
Finish Function
Executes the script until the point where the current function returns.
Run to Cursor (Shift+F9)
Sets a temporary breakpoint, which is indicated by a hollow red circle in the margin, on the line that contains the cursor. Executes the script until reaching this temporary breakpoint and then clears the breakpoint.
Abort (LShift+RShift)
Terminates execution of the script you are debugging. Abort appears when you have executed scripts on a target machine. If a script contains a breakpoint, Abort has no effect.
Reset
Frees memory and all variables, and clears the call stack of the script that you are debugging.
Exit
Quits the debugging mode.
Parent topic: Using the Silk Test Classic Menus


Include Menu

The Include menu is available when you have a test plan open.

The menu contains the following commands.

Command (Shortcut)
Description
Open
Opens the sub-plan in the test plan when the cursor is positioned on an include statement in a test plan.
Open All
Opens all sub-plans (indicated by include statements) within the active test plan.
Close
Closes the sub-plan when the cursor is positioned on an open sub-plan in a test plan.
Close All
Closes all open sub-plans in the test plan.
Save
Writes the sub-plan to disk when the cursor is positioned on a sub-plan. When the cursor is positioned on a master test plan, writes the test plan, but not the sub-plans, to disk. To save the master test plan and all sub plans, click File > Save.
Acquire Lock
Locks a sub-plan when the cursor is positioned on an open, read-only test plan or sub-plan. The gray bar changes from gray to yellow, indicating that you have read-write access to the file.
Release Lock
Unlocks the sub-plan or test plan when the cursor is positioned on an open, locked sub-plan or test plan. The margin bar for the test plan or sub-plan turns from yellow to gray. The test plan editor prompts you to save any unsaved changes.
Parent topic: Using the Silk Test Classic Menus


Results Menu

The Results menu is available when a results window is open. The commands that are available from this menu vary depending on the type of file or window that is currently open.

This menu contains the following commands:

Command (Shortcut)
Description
Select
Displays the Select Results dialog box, which allows you to choose which set of results to display. You can also use this dialog to add a comment to individual results sets. This dialog is available only when the active window is a results window. For additional information, see Selecting which Results to Display.
Merge
Displays the Merge Results dialog box, which you can use to combine the active results file with the results file of your choice. This dialog is available only when the active window is the test plan editor results window. For additional information, see Merging Test Plan Results.
Delete
Displays the Delete Results dialog box. When you select a set of results and click OK, the results are deleted. This dialog is available only when the active window is a results window. For additional information, see Deleting Results.
Extract
Displays the Extract Results dialog box, which allows you to place selected information from a results file in ASCII format into a new editor window or a file or send the information to a printer. This dialog is available only when the active window is a results file. For additional information, see Extracting Results.
Export
Displays the Export Results dialog box, which you can use to export your results to a structured file that is suitable for further processing by an application such as a spreadsheet. This dialog is available only when the active window is a results window. For additional information, see Exporting Results.
Launch TrueLog Explorer
Displays the TrueLog Explorer, which you can use to compare results files. This menu item is available only when the active file is a results file. For additional information, see Analyzing Results with the Silk Truelog Explorer.
Convert to Plan
Displays the Convert Results to Plan dialog box, which allows you to transform a results file into a test plan. This dialog is available only when the active window is a results window and you have run a script, a suite, or a single test case from a script. For additional information, see Converting a Results File to a Test Plan.
Compact
Removes unused space in a results file, thereby reducing the file size. This command is available only when the active window is a results window for a test plan.
Show Summary
Displays the results summary for the current suite, test plan, script, or test case, including the start and elapsed time, and error totals. This command is available only when the active window is a results window. By default, a summary is shown for the script.
Hide Summary
Hides the display of results summary of the current suite, script, test plan, or test case. To have the summary hidden by default, see About results file. This dialog is available only when the active window is a results window.
View Options
Displays the View Options dialog box that lets you specify which information you want displayed in the results window and how you want the information sorted. For additional information, see View Options Dialog Box.
Go to Source
Displays the script file that is associated with the current results file, if it is closed, and makes it the active window. If the cursor was positioned at an error message in the results file, Silk Test Classic positions the cursor at the error line in the script. If the cursor was positioned at the results for a particular test case, Silk Test Classic positions the cursor at the beginning of the test case in the script file. This menu item is available only when the active window is a results window.
View Differences
Opens the Difference Viewer when you click on the icon. This menu item is available only when the active window is a results window, and the current line of the results file displays a box icon preceding an error message. For additional information, see Viewing Differences.
Mark Failures in Plan
Marks all test cases in the test plan that generated errors during the last plan execution and makes the test plan the active window. A black stripe in the margin denotes the marked test cases. Use Mark Failures in Plan if you want to fix errors and rerun only failed tests. This menu item is available only when the active window is a the test plan editor results window.
Update Expected Value
Replaces the expected value in the test case with the actual value when an error message is selected. This menu item is available only when the active window is a results window. This works for certain error messages, namely those that contain a box icon and are neither bitmap nor table verification errors. This command updates data within a test case, not data passed in from the test plan. It also makes the associated script file active.
Compare Two Results
Opens the Compare Two Results... dialog box which lets you to see results that have changed from a previous run of the test plan. This command is available only when the active window is a results window for a test plan. For additional information, see Compare Two Results Dialog Box.
Next Result Difference
Locates the next difference between two results files. You can use this command after you click Results > Compare Two Results. This command is available only when a results file produced by running a test plan is the active window.
Next Error Difference
Locates the next difference between two results files that is due to the pass/fail state of a test changing (skipping over differences resulting from the addition or removal of tests). You use this command after you click Results > Compare Two Results. This command is available only when a results file produced by running a test plan is the active window.
Parent topic: Using the Silk Test Classic Menus


Testplan Menu

The Testplan menu is available when you have a test plan open in Silk Test Classic and enables you to perform actions that are specific for test plans.

The Testplan menu contains the following commands:

Command (Shortcut)
Description
Go to Script
Opens the script file that is associated with the current line of the test plan and makes it the active window.
Detail
Opens the Testplan Detail dialog box which you can use to specify valid script, test case, and test data statements, to assign attribute values to your test plan, or to add, edit, or delete a symbol that is associated with the test plan. For additional information, see Testplan Detail Dialog Box.
Insert Template
Opens the Insert Testplan Template dialog box which you can use to create a template, or outline, of your test plan. For additional information, see Inserting a Template.
Completion Report
Opens the Testplan Completion Report dialog box which you can use to generate a report on the number of complete tests. For additional information, see Generating a Testplan Completion Report.
Mark
Marks one or more tests in the test plan, depending upon the position of the cursor.
Mark All
Marks all the tests in the test plan.
Unmark
Unmarks one or more marked tests and their subordinate tests, depending on the position of the cursor.
Unmark All
Unmarks all marked tests in the test plan.
Mark by Query
Opens the Mark by Query dialog box, which enables you to mark a set of tests based on a query. For additional information, seeMark By Query Dialog Box
Mark by Named Query
Opens the Mark by Named Query dialog box, which enables you to create, combine, edit, or delete named queries. For additional information, see Mark By Named Query dialog.
Find Next Mark
Locates the next marked test in the active test plan.
Define Attributes
Opens the Define Attributes dialog box, which allows you to define or rename the Testplan Editor attributes and to add, rename, or remove attribute values. For additional information, see Defining an Attribute and the Values of the Attribute
Run Manual Tests
Runs all manual tests that are included in the test plan. For additional information, see Update Manual Tests Dialog Box.
Parent topic: Using the Silk Test Classic Menus


View Menu

The View menu is only available in debugging mode and contains the following commands.

Command (Shortcut)
Description
Expression
Opens an Expression window in which you can evaluate an expression and check the result. For additional information, see Evaluating Expressions.
Global Variables
Displays the Globals window, which lists all global variables that are in scope (accessible) from the current source line and their current values. For additional information, see Viewing Variables.
Local Variables
Displays the Locals window, which lists all local variables that are in scope (accessible) in the current function declaration and their current values. You can set a new value for the variable in the Set Variable text field. For additional information, see Viewing Variables.
Expand Data
Expands the data about a variable. A minus (-) in front of a variable name indicates that more data is available. A plus (+) in front of a variable name indicates that the data about it is already expanded. A period (.) indicates that all the data about a variable is already displayed. You can also expand the data about a variable by double-clicking on the (+) symbol.
Collapse Data
Collapses the data about a variable. A plus (+) sign in front of a variable name indicates that the data about the variable is already collapsed. A minus sign (-) in front of a variable name indicates that the data can be collapsed. A period (.) indicates that all the data about a variable is already displayed. You can also collapse the data about a variable by double-clicking on the minus (-) symbol.
Module
Opens the View Module dialog box, which lists the modules used by the script being debugged. For additional information, see Viewing a List of Modules.
Breakpoints
Displays the Breakpoints window, which lists the module names and line numbers where breakpoints are set. Double-click an entry to move the focus to that line in the script. For additional information, see Breakpoints.
Call Stack
Displays the current call stack in the Call Stack dialog box. For additional information, see Call Stack Dialog Box.
Transcript
Makes the Transcript dialog box for the current debugging session the active window. Silk Test Classic sends error information and output from print commands to the transcript window. The contents of the transcript window are not written to disk. For additional information, see Viewing the Debugging Transcripts.
Parent topic: Using the Silk Test Classic Menus


Help Menu

The Help menu contains the following commands:

Command (Shortcut)
Description
Help Topics (F1)
Opens the Silk Test Classic Help.
Library Browser
Opens the Library Browser, an online facility for quickly looking up documentation for built-in and user-defined 4Test methods, properties, and functions. For additional information, see
Tutorials
Opens the online tutorials.
Check for Product Update.
Displays available updates for Silk Test Classic.
About Silk Test Classic
Displays information about the installed version of your product, including version and build numbers, copyright date, and customer ID number.
Parent topic: Using the Silk Test Classic Menus


Bitmap Tool Menus

The Bitmap Tool has the following menus:

File

The File menu contains the following standard Windows functions:
  • Open
  • Save
  • Save As
  • Exit

Edit

The Edit menu contains the following items:
Menu Item
Description
Copy
Copies the selected region to the clipboard.
Paste
Inserts the contents of the clipboard into the Bitmap Tool.
New Mask
Creates a child window into which you can place a monochrome mask bitmap.
Apply Mask
Applies the current mask bitmap to the baseline and the result bitmaps in memory. Does not apply the current mask bitmap to the result bitmaps on disk.

Bitmap

The Bitmap menu contains the following items:
Menu Item
Description
Set Baseline
Toggles the bitmap in the active window as the baseline bitmap.
Set Result
Toggles the bitmap in the active window as the results bitmap.
Set Mask
Toggles the bitmap in the active window as the mask bitmap.
Fit to Window
Zooms or stretches the bitmap in the active child window to the exact size of the child window.

Differences Menu

The Differences menu contains the following items:
Menu Item
Description
Show
Creates a Differences window that contains a monochrome bitmap of the differences between the current baseline bitmap and the current result bitmap. Black represents areas with no differences; white represents areas with differences.
Zoom
Available only when the Differences window is open. Fits and stacks the Baseline, Differences, and Result windows, and creates a special, not sizable Zoom window with three panes. When you place the mouse cursor at a given location in the Baseline Bitmap, Differences, or Result Bitmap window:
  • The top pane of the Zoom window shows the same portion of the Baseline Bitmap window.
  • The middle pane shows the same zoomed portion of the Differences window.
  • The bottom pane shows the same zoomed portion of the Result Bitmap window.

Moving the mouse within one of the three windows generates a simultaneous and synchronized real-time display in all three panes of the Zoom window. The zoom ratio is 4 to 1.

Scan

Available only when the Zoom window is open. Starts automated zoom mode, in which the bitmap tool scans for differences from left to right and top to bottom. When the tool finds the first difference, it displays a square in the same relative location of the Baseline Bitmap, Differences, and Result Bitmap windows. In addition, that location is shown in all three panes of the Zoom window.

Selecting Scan while the tool is in scan mode exits Scan and returns to zoom mode.

Next

Jumps to the location of the next difference in scan mode, denoted as a square in the Baseline Bitmap, Differences, and Result Bitmap windows. That location is also shown in all panes of the Zoom window.

In zoom mode, Next starts scan mode.

Previous
Jumps to the location of the previous difference in scan mode, denoted as a square in the Baseline Bitmap, Differences, and Result Bitmap windows. That location is also shown in all panes of the Zoom window.
Comparison Statistics
Displays a Bitmap Comparison Statistics window, which compares baseline and result bitmaps with respect to width, height, color format, number of pixels, and the number and percentage of differences. Comparison takes masks into consideration.
Convert to Mask
Creates a mask bitmap from the Differences window, swapping black and white, and applies the mask to the baseline and the result bitmaps in memory.

Capture

The capture menu contains the following items:
Menu Item
Description
Window
Captures the window that you select.
Client Area
Captures the client area of the window that you select.
Rectangle
Captures a rectangular area of choice. Move the mouse cursor to the desired location to begin capture. Click and drag the mouse to the desired location to end capture and then release the button.
Desktop
Captures the entire desktop.
Hide Window on Capture
Hides the Bitmap Tool temporarily when you select a window or area to be captured. This menu item is checked by default. Use this setting before beginning the capture procedure.

Window

The Window menu contains the following functions:
  • Tile Vertically
  • Tile Horizontally
  • Cascade
  • Arrange Icons
  • Close All

Help

The Help menu enables you to access the help topics and the About information of the Bitmap Tool.

Parent topic: Using the Silk Test Classic Menus
Related concepts
Overview of the Bitmap Tool


Glossary

This section provides an alphabetical list of terms that are related to Silk Test Classic and their descriptions.

  • 4Test Classes
  • 4Test-Compatible Information or Methods
  • Abstract Windowing Toolkit
  • accented character
  • agent
  • applet
  • application state
  • attributes
  • Band (.NET)
  • base state
  • bidirectional text
  • Bytecode
  • call stack
  • child object
  • class
  • class library
  • class mapping
  • Classic 4Test
  • client area
  • custom object
  • data-driven test case
  • data member
  • declarations
  • DefaultBaseState
  • diacritic
  • Difference Viewer
  • double-byte character set (DBCS)
  • dynamic instantiation
  • dynamic link library (DLL)
  • enabling
  • exception
  • frame file
  • fully qualified object name
  • group description
  • handles
  • hierarchy of GUI objects
  • host machine
  • hotkey
  • Hungarian notation
  • identifier
  • include file
  • internationalization or globalization
  • Java Database Connectivity (JDBC)
  • Java Development Kit (JDK)
  • Java Foundation Classes (JFC)
  • Java Runtime Environment (JRE)
  • Java Virtual Machine (JVM)
  • JavaBeans
  • Latin script
  • layout
  • levels of localization
  • load testing
  • localization
  • localize an application
  • locator
  • logical hierarchy
  • manual test
  • mark
  • master plan
  • message box
  • method
  • minus (-) sign
  • modal
  • modeless
  • Multibyte Character Set (MBCS)
  • Multiple Application Domains (.NET)
  • negative testing
  • nested declarations
  • No-Touch (.NET)
  • object
  • outline
  • Overloaded method
  • parent object
  • performance testing
  • physical hierarchy (.NET)
  • plus (+) sign
  • polymorphism
  • project
  • properties
  • query
  • recovery system
  • regression testing
  • results file
  • script
  • script file
  • side-by-side (.NET)
  • Simplified Chinese
  • Single-Byte Character Set (SBCS)
  • smoke test
  • Standard Widget Toolkit (SWT)
  • statement
  • status line
  • stress testing
  • subplan
  • suite
  • Swing
  • symbols
  • tag
  • target machine
  • template
  • test description
  • test frame file
  • test case
  • test plan
  • TotalMemory parameter
  • Traditional Chinese
  • variable
  • verification statement
  • Visual 4Test
  • window declarations
  • window part
  • XPath


4Test Classes

Classes are the core of object-oriented languages such as Visual Basic or 4Test. Each GUI object is an instance of a class of objects. The class defines the actions, or methods, that can be performed on all objects of a given type. For example, in 4Test the PushButton class defines the methods that can be performed on all pushbuttons in your application. The methods defined for pushbuttons work only on pushbuttons, not on radio lists.

The class also defines the data, or properties, of an object. In 4Test and Visual Basic, you can set or retrieve the value of a property directly using the dot operator and a syntax similar to standard Visual Basic.

Parent topic: Glossary


4Test-Compatible Information or Methods

Information or methods that can be passed by value in 4Test prototypes.

Parent topic: Glossary


Abstract Windowing Toolkit

The Abstract Windowing Toolkit (AWT) is a library of Java GUI object classes that is included with the Java Development Kit from Sun Microsystems. The AWT handles common interface elements for windowing environments including Windows.

The AWT contains the following set of GUI components:
  • Button
  • CheckBox
  • CheckBox Group (RadioList)
  • Choice (PopupList)
  • Label (StaticText)
  • List (ListBox)
  • Scroll Bar
  • Text Component (TextField)
  • Menu
Parent topic: Glossary


accented character

A character that has a diacritic attached to it.

Parent topic: Glossary


agent

The agent is the software process that translates the commands in your scripts into GUI-specific commands. It is the agent that actually drives and monitors the application you are testing.

Parent topic: Glossary
Related reference
host machine


applet

A Java program designed to run inside a Java-compatible Web browser, such as Netscape Navigator.

Parent topic: Glossary


application state

The state you expect your application to be in at the beginning of a test case. This is in addition to the conditions required for the base state.

Parent topic: Glossary
Related reference
base state


attributes

In the test plan editor, attributes are site-specific characteristics that you can define for your test plan and assign to test descriptions and group descriptions. Each attribute has a set of values. For example, you define the Developer attribute and assign it the values of Kate, Ned, Paul, and Susan, the names of the QA engineers in your department.

Attributes are useful for grouping tests, in that you can run or report on parts of the test plan that have a given attribute value. For example, all tests that were developed by Bob can be executed as a group.

In Silk Test Classic, an attribute is a characteristic of an application that you verify in a test case. Attributes are used in the Verify Window dialog box, which is available only for projects or scripts that use the Classic Agent.

Parent topic: Glossary
Related reference
test plan
test description
group description
test case


Band (.NET)

Each level in the grid hierarchy has one band object created to represent it.

Parent topic: Glossary
Related reference
No-Touch (.NET)


base state

The known, stable state you expect the application to be in at the start of each test case.

Parent topic: Glossary
Related reference
DefaultBaseState
test case


bidirectional text

A mixture of characters that are read from left to right and characters that are read from right to left. Most Arabic and Hebrew characters, for example, are read from right to left, but numbers and quoted western terms within Arabic or Hebrew text are read from left to right.

Parent topic: Glossary


Bytecode

The form of Java code that the Java Virtual Machine reads. Other compiled languages use compilers to translate their code into native code, also called machine code, that runs on a particular operating system. By contrast, Java compilers translate Java programs into bytecode, an intermediate form of code that is slower than compiled code, but that can theoretically run on any hardware equipped with a Java Virtual Machine.

Parent topic: Glossary


call stack

A call stack is a listing of all the function calls that have been called to reach the current function in the script you are debugging.

In debugging mode, a list of functions and test cases which were executing at the time at which an error occurred in a script. The functions and test cases are listed in reverse order, from the last one executed back to the first.

Parent topic: Glossary


child object

Subordinate object in the GUI hierarchy. A child object is either logically associated with, or physically contained by, its parent object. For example, the File menu, as well as all other menus, are physically contained by the main window.

Parent topic: Glossary
Related concepts
parent object


class

GUI object type. The class determines which methods can operate on an object. Each object in the application is an instance of a GUI class.

Parent topic: Glossary
Related concepts
object
Related reference
method


class library

A collection of related classes that solve specific programming problems. The Java Abstract Windowing Toolkit (AWT) and Java Foundation Class (JFC) are examples of Java class libraries.

Parent topic: Glossary


class mapping

Association of nonstandard custom objects with standard objects understood by Silk Test Classic.

Parent topic: Glossary
Related reference
custom object


Classic 4Test

Classic 4Test is a test scripting language that was supported with Silk Test Classic 16.0 or prior. With Silk Test Classic 16.5 or later, Silk Test Classic supports only Visual 4Test.

Note: With Silk Test Classic 16.0 or prior, you can easily convert your Classic 4Test scripts into Visual 4Test scripts by selecting Edit > Visual 4Test from the Silk Test Classic menu. With Silk Test Classic 16.5 or later, you can no longer convert your Classic 4Test scripts into Visual 4Test scripts. You can use an older version of Silk Test Classic to convert the scripts, or you can contact support.
Parent topic: Glossary
Related tasks
Setting General Options
Related reference
Visual 4Test


client area

The internal area of a window not including scroll bars, title bar, or borders.

Parent topic: Glossary


custom object

Nonstandard object that Silk Test Classic does not know how to interact with.

Parent topic: Glossary


data-driven test case

A special kind of test case that receives many combinations of data from 4Test functions/test plan.

Parent topic: Glossary
Related concepts
Data-Driven Test Cases
Related reference
test case
test plan


data member

Variable defined within a class or window declaration. The value of a data member can be an expression, but it is important to keep in mind that data members are resolved (assigned values) during compilation. If the expression for the data member includes variables that will change at run-time, then you must use a property instead of that data member.

Parent topic: Glossary


declarations

See Window Declarations.

Parent topic: Glossary
Related reference
window declarations


DefaultBaseState

Built-in application state function that returns your application to its base state. By default, the built-in DefaultBaseState ensures that the application is running and is not minimized, the main window of the application is open, and all other windows, for example dialog boxes and message boxes, are closed.

Parent topic: Glossary


diacritic

  1. Any mark placed over, under, or through a Latin-based character, usually to indicate a change in phonetic value from the unmarked state.
  2. A character that is attached to or overlays a preceding base character.
Most diacritics are non-spacing characters that don't increase the width of the base character.
Parent topic: Glossary


Difference Viewer

Dual-paned display-only window that lists every expected value in a test case and its corresponding actual value. Highlights all occurrences where expected and actual values differ. You display the Difference Viewer by selecting the box icon in the results file.

Parent topic: Glossary


double-byte character set (DBCS)

A double-byte character set, which is a specific type of multibyte character set, includes some characters that consist of 1 byte and some characters that consist of 2 bytes.

Parent topic: Glossary


dynamic instantiation

This special syntax is called a dynamic instantiation and is composed of the class and tag or locator of the object. For example, if there is not a declaration for the Find dialog box of the Text Editor application, the syntax required to identify the object looks like the following:
  • Classic Agent:
    MainWin("Text Editor|$D:\PROGRAM FILES
   \<SilkTest install directory>\SILKTEST\TEXTEDIT.EXE").DialogBox("Find")
  • Open Agent:
    /MainWin[@caption='Untitled - Text Editor']//DialogBox[@caption='Find']
The general syntax of this kind of identifier is:
  • Classic Agent:
    class("tag").class("tag"). ...
  • Open Agent:
    class('locator').class('locator'). ...

With the Classic Agent, the recorder uses the multiple-tag settings that are stored in the Record Window Declarations dialog box to create the dynamic tag. In the Classic Agent example shown above, the tag for the Text Editor contains its caption as well as its window ID. For additional information, see About Tags.

Parent topic: Glossary
Related concepts
Recording Without Window Declarations


dynamic link library (DLL)

A library of reusable functions that allow code, data, and resources to be shared among programs using the module. Programs are linked to the module dynamically at runtime.

Parent topic: Glossary


enabling

Altering program code to handle input, display, and editing of bidirectional or double-byte languages, such as Arabic and Japanese.

Parent topic: Glossary


exception

Signal that something did not work as expected in a script. Logs the error in the results file.

Parent topic: Glossary


frame file

See test frame file.

Parent topic: Glossary
Related reference
test frame file


fully qualified object name

Name that uniquely identifies a GUI object. The actual format depends on whether or not a window declaration has been previously recorded for the object and its ancestors.

Parent topic: Glossary
Related reference
dynamic instantiation


group description

In the test plan editor, one or more lines in an outline that describe a group of tests, not a single test. Group descriptions by default are displayed in black.

Parent topic: Glossary
Related reference
test description


handles

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.

Parent topic: Glossary
Related concepts
File Handles and Remote File Input and Output Examples
Related reference
HANDLE Data Type


hierarchy of GUI objects

Parent-child relationships between GUI objects.

Parent topic: Glossary


host machine

A host machine is a system that runs the Silk Test Classic software process in which you develop, edit, compile, run, and debug 4Test scripts and test plans.

Host machines are always Windows systems.

Parent topic: Glossary
Related reference
target machine


hotkey

The following table lists the available hotkeys and accelerator keys for each menu:

Menu Name | Command with Hotkey | Hotkey | Accelerator Key
Breakpoint | Toggle | Alt+B+T | F5
 | Add | Alt+B+A | -
 | Delete | Alt+B+D | -
 | Delete All | Alt+B+E | -
Debug | Abort | Alt+D+A | -
 | Exit | Alt+D+X | -
 | Finish Function | Alt+D+F | -
 | Reset | Alt+D+E | -
 | Run and Debug/Continue | Alt+D+R | F9
 | Run to Cursor | Alt+D+C | Shift+F9
 | Step Into | Alt+D+I | F7
 | Step Over | Alt+D+S | F8
Edit | Undo | Alt+E+U | Ctrl+Z
 | Redo | Alt+E+R | Ctrl+Y
 | Cut | Alt+E+T | Ctrl+X
 | Copy | Alt+E+C | Ctrl+C
 | Paste | Alt+E+P | Ctrl+V
 | Delete | Alt+E+D | Del
 | Find | Alt+E+F | Ctrl+F
 | Find Next | Alt+E+N | F3
 | Replace | Alt+E+E | Ctrl+R
 | GoTo Line | Alt+E+G | Ctrl+G
 | GoTo Definition | Alt+E+O | F12
 | Find Error | Alt+E+I | F4
 | Data Driven | - | -
File | New | Alt+F+N | Ctrl+N
 | Open | Alt+F+O | Ctrl+O
 | Save | Alt+F+S | Ctrl+S
 | Save As | Alt+F+A | -
 | Save All | Alt+F+L | -
 | New Project | Alt+F+W | -
 | Open Project | Alt+F+E | -
 | Close Project | Alt+F+J | -
 | Run | Alt+F+R | -
 | Debug | Alt+F+D | -
 | Check out | Alt+F+T | Ctrl+T
 | Check in | Alt+F+K | Ctrl+K
 | Print | Alt+F+P | Ctrl+P
 | Printer Setup | Alt+F+I | -
 | # operation file-name | Alt+F+# | Alt+F+#
 | Exit | Alt+F+X | Alt+F4
Help | Help Topics | Alt+H+H | -
 | Library Browser | Alt+H+L | -
 | Tutorials | Alt+H+T | -
 | About Silk Test Classic | Alt+H+A | -
Include | Open | Alt+I+O | -
 | Open All | Alt+I+P | -
 | Close | Alt+I+C | -
 | Close All | Alt+I+L | -
 | Save | Alt+I+S | -
 | Acquire Lock | Alt+I+A | -
 | Release Lock | Alt+I+R | -
Options | General | Alt+O+G | -
 | Editor Font | Alt+O+D | -
 | Editor Colors | Alt+O+E | -
 | Runtime | Alt+O+T | -
 | Agent | Alt+O+A | -
 | Extensions | Alt+O+X | -
 | Recorder | Alt+O+R | -
 | Class Map | Alt+O+M | -
 | Property Sets | Alt+O+P | -
 | Silk Central URLs | Alt+O+U | -
 | Open Options Set | Alt+O+O | -
 | Save Options Set | Alt+O+S | -
 | Close Options Set | Alt+O+C | -
 | # option-file-name | Alt+O+# | -
Outline | Move Left | Alt+L+V | Alt+Left Arrow
 | Move Right | Alt+L+R | Alt+Right Arrow
 | Transpose Up | Alt+L+A | Alt+Up Arrow
 | Transpose Down | Alt+L+S | Alt+Down Arrow
 | Expand | Alt+L+E | Ctrl++
 | Expand All | Alt+L+X | Ctrl+*
 | Collapse | Alt+L+O | Ctrl+-
 | Collapse All | Alt+L+L | Ctrl+/
 | Comment | Alt+L+M | Alt+M
 | Uncomment | Alt+L+N | Alt+N
Project | View Explorer | Alt+P+V | -
 | Align | Alt+P+A | -
 | &Left | Alt+P+L | -
 | &Right | Alt+P+R | -
 | Project Description | Alt+P+O | -
 | Add File | Alt+P+D | -
 | Remove File | Alt+P+R | -
Record | Window Declarations | Alt+R+W | Ctrl+W
 | Application State | Alt+R+S | -
 | Testcase | Alt+R+ | Ctrl+E
 | Method | Alt+R+T | -
 | Actions | Alt+R+A | -
 | Class | Alt+R+C | -
 | Window Identifiers | Alt+R+I | Ctrl+I
 | Window Locations | Alt+R+L | -
Results | Select | Alt+T+S | -
 | Merge | Alt+T+M | -
 | Delete | Alt+T+D | -
 | Extract | Alt+T+E | -
 | Export | Alt+T+X | -
 | Convert to Plan | Alt+T+C | -
 | Compact | - | -
 | Show Summary | Alt+T+H | -
 | Hide Summary | Alt+T+I | -
 | View Options | Alt+T+V | -
 | Goto Source | Alt+T+G | -
 | View Differences | Alt+T+W | -
 | Update Expected Value | Alt+T+U | -
 | Mark Failures in Plan | Alt+T+F | -
 | Compare Two Results | Alt+T+O | -
 | Next Result Difference | Alt+T+N | -
 | Next Error Difference | Alt+T+r | -
Run | Compile | Alt+U+C | Alt+F9
 | Compile all | - | -
 | Run All Tests | Alt+U+R | F9
 | Debug | Alt+U+D | Ctrl+F9
 | Application State | Alt+U+A | Alt+A
 | Testcase | Alt+U+T | Alt+T
 | Show Status | Alt+U+S | -
 | Abort | Alt+U+B | LShift+RShift
Testplan | Goto Script | Alt+T+G | -
 | Detail | Alt+T+D | -
 | Insert Template | Alt+T+I | -
 | Completion Report | Alt+T+C | -
 | Mark | Alt+T+M | -
 | Mark All | Alt+T+A | -
 | Unmark | Alt+T+U | -
 | Unmark All | Alt+T+N | -
 | Mark by Query | Alt+T+Q | -
 | Mary by Named Query | Alt+T+R | -
 | Find Next Mark | Alt+T+F | -
 | Define Attributes | Alt+T+E | -
 | Manual tests | Alt+T+T | -
Tools | Link Tester | Alt+S+L | -
 | Start Silk Performer | Alt+S+P | -
 | Data Drive Testcase | Alt+S+D | -
 | Enable Extensions | Alt+S+E | -
 | Silk Central Test Manager | Alt+S+H |
View/Transcript | Expression | Alt+V+E | -
 | Global Variables | Alt+V+G | -
 | Local Variables | Alt+V+L | -
 | Expand Data | Alt+V+X | -
 | Collapse Data | Alt+V+C | -
 | Module | Alt+V+M | -
 | Breakpoints | Alt+V+B | -
 | Call Stack | Alt+V+L | -
 | Transcript | Alt+V+T | -
Window | Tile Vertically | Alt+W+T | -
 | Tile Horizontally | Alt+W+H | -
 | Cascade | Alt+W+C | -
 | Arrange Icons | Alt+W+E | -
 | Close All | Alt+W+L | -
 | Next | Alt+W+N | F6
 | Previous | Alt+W+P | Shift+F6
 | # file-file-name | Alt+W+# | -
Workflows | Basic | Alt+K+B | -
 | Data Driven | Alt+K+D | -
Parent topic: Glossary


Hungarian notation

Naming convention in which a variable’s name begins with one or more lowercase letters indicating its data type. For example, the variable name sCommandLine indicates that the data type of the variable is STRING.

Parent topic: Glossary


identifier

Name used in test scripts to refer to an object in the application. Logical, GUI-independent name. Identifier is mapped to the tag in a window declaration.

Parent topic: Glossary
Related concepts
locator
Related reference
tag


include file

File that contains window declarations and can contain constant, variable, and other declarations.

Parent topic: Glossary


internationalization or globalization

The process of developing a program core whose feature design and code design don't make assumptions based on a single language or locale and whose source code base simplifies the creation of different language editions of a program.

Parent topic: Glossary


Java Database Connectivity (JDBC)

Java API that enables Java programs to execute SQL statements and interact with any SQL-compliant database. Often abbreviated as JDBC.

Parent topic: Glossary


Java Development Kit (JDK)

A free tool for building Java applets and full-scale applications. This is an environment which contains development and debugging tools, and documentation. Often abbreviated as JDK.

Parent topic: Glossary


Java Foundation Classes (JFC)

Sun Microsystem's and Netscape's class library designed for building visual applications in Java. Often abbreviated as JFC.

JFC consists of a set of GUI components named Swing that adopt the native look and feel of the platforms they run on.

Parent topic: Glossary
Related reference
Swing


Java Runtime Environment (JRE)

Sun Microsystem's execution-only subset of its Java Development Kit. The Java Runtime Environment (JRE) consists of the Java Virtual Machine, Java Core Classes, and supporting files, but contains no compiler, no debugger, and no tools.

The JRE provides two virtual machines: JRE.EXE and JREW.EXE. The only difference is that JREW does not have a console window.

Parent topic: Glossary


Java Virtual Machine (JVM)

Software that interprets Java code for a computer’s operating system. A single Java applet or application can run unmodified on any operating system that has a virtual machine, or VM.

Parent topic: Glossary


JavaBeans

Reusable software components written in Java that perform a single function. JavaBeans can be mixed and matched to build complex applications because they can identify each other and exchange information.

JavaBeans are similar to ActiveX controls and can communicate with ActiveX controls. Unlike ActiveX, JavaBeans are platform-independent.

Parent topic: Glossary


Latin script

The set of 26 characters (A through Z) inherited from the Roman Empire that, together with later character additions, is used to write languages throughout Africa, the Americas, parts of Asia, Europe, and Oceania. The Windows 3.1 Latin 1 character set covers Western European languages and languages that use the same alphabet. The Latin 2 character set covers Central and Eastern European languages.

Parent topic: Glossary


layout

The order and spacing of displayed text.

Parent topic: Glossary


levels of localization

The amount of translation and customization necessary to create different language editions. The levels, which are determined by balancing risk and return, range from translating nothing to shipping a completely translated product with customized features.

Parent topic: Glossary


load testing

Testing that determines the actual, which means not simulated, impact of multi-machine operations on an application, the server, the network, and all related elements.

Parent topic: Glossary


localization

The process of adapting a program for a specific international market, which includes translating the user interface, resizing dialog boxes, customizing features if necessary, and testing results to ensure that the program still works.

Parent topic: Glossary


localize an application

To make an application suitable for a specific locale: for example, to include foreign language strings for an international site.

Parent topic: Glossary


locator

This functionality is supported only if you are using the Open Agent.

The locator is the actual name of an object, to which Silk Test Classic maps the identifier for a GUI object. You can use locator keywords to create scripts that use dynamic object recognition and window declarations.

Parent topic: Glossary
Related concepts
XPath
Related reference
tag
identifier


logical hierarchy

The hierarchy that is implied from the visible organization of windows as they display to the user.

Parent topic: Glossary


manual test

In the testplan editor, a manual test is a test that is documented but cannot be automated and, therefore, cannot be run within the test plan. You might chose to include manual tests in your test plan in order to centralize the testing process. To indicate that a test description is implemented manually, you use the keyword value manual in the testcase statement.

Parent topic: Glossary


mark

In the testplan editor, a mark is a technique used to work with one or more tests as a group. A mark is denoted by a black stripe in the margin bar of the test plan. Marks are temporary and last only as long as the current work session. Tests that are marked can be run or reported on independently as a subset of the total plan.

Parent topic: Glossary


master plan

In the testplan editor, that portion of a test plan that contains only the top few levels of group descriptions. You can expand, which means display, the sub-plans of the master plan, which contain the remaining levels of group description and test description. The master plan/sub-plan approach allows multi-user access to a test plan, while at the same time maintaining a single point of control for the entire project. A master plan file has a .pln extension.

Parent topic: Glossary
Related reference
subplan


message box

Dialog box that has only static text and pushbuttons. Typically, message boxes are used to prompt a user to verify an action, such as Save changes before closing?, or to alert a user to an error.

Parent topic: Glossary


method

Operation, or action, to perform on a GUI object. Each class defines its own set of methods. Methods are also inherited from the class’s ancestors.

Parent topic: Glossary


minus (-) sign

In a file, an icon that indicates that all information is displayed. Click on the minus sign to hide the information. The minus sign becomes a plus sign.

Parent topic: Glossary


modal

A dialog box that presents a task that must be completed before continuing with the application. No other part of the application can be accessed until the dialog box is closed. Often used for error messages.

Parent topic: Glossary


modeless

A dialog box that presents a simple or ongoing task. May be left open while accessing other features of the application, for example, a search dialog box.

Parent topic: Glossary


Multibyte Character Set (MBCS)

A mixed-width character set, in which some characters consist of more than 1 byte.

Parent topic: Glossary


Multiple Application Domains (.NET)

The .NET Framework supports multiple application domains. A new application domain loads its own copies of the common language runtime DLLs, data structure, and memory pools. Multiple application domains can exist in one operation system process.

Parent topic: Glossary


negative testing

Tests that deliberately introduce an error to check an application’s behavior and robustness. For example, erroneous data may be entered, or attempts made to force the application to perform an operation that it should not be able to complete. Generally a message box is generated to inform the user of the problem.

Parent topic: Glossary


nested declarations

Indented declarations that denote the hierarchical relationships of GUI objects in an application.

Parent topic: Glossary


No-Touch (.NET)

No-Touch deployment allows Windows Forms applications, which are applications built using Windows Forms classes of the .NET Framework, to be downloaded, installed, and run directly on the machines of the user, without any alteration of the registry or shared system components.

Parent topic: Glossary


object

The principal building block of object-oriented programs. Each object is a programming unit consisting of data and functionality. Objects inherit their methods and properties from the classes to which they belong.

Parent topic: Glossary


outline

In the test plan editor, a structured, usually hierarchical model that describes the requirements of a test plan and contains the statements that implement the requirements. The outline supports automatic, context-sensitive coloring of test plan elements.

In Silk Test Classic, the outline is a 4Test editor mode that supports automatic, context-sensitive coloring and indenting of 4Test elements.

Parent topic: Glossary


Overloaded method

A method that you call with different sets of parameter lists. Overloaded methods cause naming conflicts which must be resolved to avoid runtime errors when testing Java applications.

Example of an overloaded method | How Java support resolves the naming conflict
setBounds( int i1, int i2, int i3, int i4) | setBounds( int i1, int i2, int i3, int i4)
setBounds( RECT r1) | setBounds_2( RECT r1)
Parent topic: Glossary


parent object

Superior object in the GUI hierarchy. A parent object is either logically associated with or physically contains a subordinate object, the child. For example, the main window physically contains the File menu as well as all other menus.

Parent topic: Glossary


performance testing

Testing to verify that an operation in an application performs within a specified, acceptable period of time. Alternately, testing to verify that space consumption of an application stays within specified limits.

Parent topic: Glossary


physical hierarchy (.NET)

The window handle hierarchy as implemented by the application developer.

Parent topic: Glossary


plus (+) sign

In a file, an icon that indicates that there is hidden information. You can show the information by clicking on the plus sign. The plus sign becomes a minus sign.

Parent topic: Glossary


polymorphism

Different classes or objects performing the same named task, but with different execution logic.

Parent topic: Glossary


project

Silk Test Classic projects organize all the resources associated with a test set and present them visually in the Project Explorer, making it easy to see, manage, and work within your test environment.

Silk Test Classic projects store relevant information about your project, including references to all the resources associated with a test set, such as plans, scripts, data, option sets, .ini files, results, and frame/include files, as well as configuration information, Editor settings, and data files for attributes and queries. All of this information is stored at the project level, meaning that once you add the appropriate files to your project and configure it once, you may never need to do it again. Switching among projects is easy - since you need to configure the project only once, you can simply open the project and run your tests.

Parent topic: Glossary
Related concepts
Silk Test Classic Projects
Related reference
Project Explorer


properties

Characteristics, values, or information associated with an object, such as its state or current value.

Parent topic: Glossary


query

User-selected set of characteristics that are compared to the attributes, symbols, or execution characteristics in a test plan. When the set of characteristics matches a test, the test is marked. This is called marking by query. For example, you might run a query in order to mark all tests that are defined in the find.t script and that were created by the developer named Bob.

Parent topic: Glossary
Related reference
mark


recovery system

A built-in, automatic mechanism to ensure the application is in a known state. If the application is not in the expected state, a message is logged to the results file and the problem is corrected. The recovery system is invoked before and after each test case is executed.

Parent topic: Glossary


regression testing

A set of baseline tests that are run against each new build of an application to determine if the current build has regressed in quality from the previous one.

Parent topic: Glossary


results file

A file that lists information about the scripts and test cases that you ran. In the testplan editor, a results file also lists information about the test plan that you ran; the format of a results file mimics the outline format of the test plan it derives from. The name of the results file is script-name.res or testplan-name.res.

Parent topic: Glossary
Related concepts
Overview of the Results File


script

A collection of related 4Test test cases and functions that reside in a script file.

Parent topic: Glossary


script file

A file that contains one or more related test cases. A script file has a .t extension, such as find.t.

Parent topic: Glossary


side-by-side (.NET)

Side-by-side execution is the ability to install multiple versions of code so that an application can choose which version of the common language runtime or of a component it uses.

Parent topic: Glossary


Simplified Chinese

The Chinese alphabet that consists of several thousand ideographic characters that are simplified versions of traditional Chinese characters.

Parent topic: Glossary


Single-Byte Character Set (SBCS)

A character encoding in which each character is represented by 1 byte. Single byte character sets are mathematically limited to 256 characters.

Parent topic: Glossary


smoke test

Tests that constitute a quick set of acceptance tests. They are often used to verify a minimum level of functionality before either accepting a new build into source control or continuing QA with more in-depth, time-consuming testing.

Parent topic: Glossary


Standard Widget Toolkit (SWT)

The Standard Widget Toolkit (SWT) is a graphical widget toolkit for the Java platform. SWT is an alternative to the AWT and Swing Java GUI toolkits provided by Sun Microsystems. SWT was originally developed by IBM and is maintained by the Eclipse Foundation in tandem with the Eclipse IDE.

Parent topic: Glossary


statement

In the testplan editor, lines that implement the requirements of a test plan. The testplan editor has the following statements:
  • testcase
  • script
  • testdata
  • include
  • attribute
Statements consist of one of the preceding keywords followed by a colon and a value.

In Silk Test Classic, a statement is a method or function call or 4Test flow-of control command, such as if..then, that is used within a 4Test test case.

Parent topic: Glossary


status line

Area at the bottom of the window that displays the status of the current script, the line and column of the active window (if any), and the name of the script that is currently running. When the cursor is positioned over the toolbar, it displays a brief description of the item.

Parent topic: Glossary


stress testing

Tests that exercise an application by repeating the same commands or operation a large number of times.

Parent topic: Glossary


subplan

Test plan that is referenced by another test plan, normally the master test plan, by using an include statement. Portion of a test plan that resides in a separate file but can be expanded inline within its master plan. A subplan may contain the levels of group description and test description not covered in the master plan. A subplan can inherit information from its master plan. You add a subplan by inserting an include statement in the master plan. A subplan file has a .pln extension, as in subplan-name.pln.

Parent topic: Glossary
Related reference
master plan


suite

A file that names any number of 4Test test script files. Instead of running each script individually, you run the suite, which executes in turn each of your scripts and all the test cases it contains.

Parent topic: Glossary


Swing

A set of GUI components implemented in Java that are based on the Lightweight UI Framework. Swing components include:

  • Java versions of the existing Abstract Windowing Toolkit (AWT) components, such as Button, Scrollbar, and List.
  • A set of high-level Java components, such as tree-view, list-box, and tabbed-pane components.

The Swing tool set lets you create a set of GUI components that automatically implements the appearance and behavior of components designed for any OS platform, but without requiring window-system-specific code.

Swing components are part of the Java Foundation Class library beginning with version 1.1.

Parent topic: Glossary


symbols

In the testplan editor, used in a test plan to pass data to 4Test test cases. A symbol can be defined at a level in the test plan where it can be shared by a group of tests. Its values are actually assigned at either the group or test description level, depending on whether the values are shared by many tests or are unique to a single test. Similar to a 4Test identifier, except that its name begins with a $ character.

Parent topic: Glossary


tag

This functionality is available only for projects or scripts that use the Classic Agent.

The actual name or index of the object as it is displayed in the GUI. The name by which Silk Test Classic locates and identifies objects in the application.

Parent topic: Glossary
Related concepts
locator
XPath
Related reference
identifier


target machine

A target machine is a system (or systems) that runs the 4Test Agent, which is the software process that translates the commands in your scripts into GUI-specific commands, in essence, driving and monitoring your applications under test.

One Agent process can run locally on the host machine, but in a networked environment, the host machine can connect to any number of remote Agents simultaneously or sequentially.

Target machines can be Windows systems.

Parent topic: Glossary
Related reference
host machine


template

A hierarchical outline in the testplan editor that you can use as a guide when creating a new test plan. Based on the window declarations in the frame file.

Parent topic: Glossary


test description

In the testplan editor, a terminal point in an outline that specifies a test case to be executed. Test descriptions by default are displayed in blue.

Parent topic: Glossary
Related reference
group description


test frame file

Contains all the data structures that support your scripts:
  • window declarations
  • user-defined classes
  • utility functions
  • constants
  • variables
  • other include files
Parent topic: Glossary


test case

In a script file, an automated test that ideally addresses one test requirement. Specifically, a 4Test function that begins with the testcase keyword and contains a sequence of 4Test statements. It drives an application to the state to be tested, verifies that the application works as expected, and returns the application to its base state.

In a test plan, a testcase is a keyword whose value is the name of a test case defined in a script file. Used in an assignment statement to link a test description in a test plan with a 4Test test case defined in a script file.

Test case names can have a maximum of 127 characters. When you create a data driven test case, Silk Test Classic truncates any test case name that is greater than 124 characters.

Parent topic: Glossary
Related reference
data-driven test case


test plan

In general, a document that describes test requirements. In the testplan editor, a test plan is displayed in an easy-to-read outline format, which lists the test requirements in high-level prose descriptions. The structure can be flat or many levels deep. Indentation indicates the level of detail. A test plan also contains statements, which are keywords and values that implement the test descriptions by linking them to 4Test test cases. Large test plans can be divided into a master plan and one or more sub plans. A test plan file has a .pln extension, such as find.pln.

Parent topic: Glossary


TotalMemory parameter

Total amount of memory available to the Java interpreter. This is the value returned from the java.lang.Runtime.totalMemory() method.

Parent topic: Glossary


Traditional Chinese

The set of Chinese characters, used in such countries or regions as Hong Kong SAR, China Singapore, and Taiwan, that is consistent with the original form of Chinese ideographs that are several thousand years old.

Parent topic: Glossary


variable

A named location in which you can store a piece of information. Analogous to a labeled drawer in a file cabinet.

Parent topic: Glossary


verification statement

4Test code that checks that an application is working by comparing an actual result against an expected (baseline) result.

Parent topic: Glossary


Visual 4Test

Visual 4Test is the test scripting language used by Silk Test Classic.

Parent topic: Glossary
Related tasks
Setting General Options
Related reference
Classic 4Test


window declarations

Descriptions of all the objects in the application’s graphical user interface, such as menus and dialog boxes. Declarations are stored in an include file which has a .inc extension, typically the frame.inc file.

Parent topic: Glossary


window part

Predefined identifiers for referring to parts of the window. Associated with common parts of MoveableWin and Control classes, such as LeftEdge, MenuBar, ScrollBar.

Parent topic: Glossary


XPath

The XML Path Language (XPath) models an XML document as a tree of nodes and enables you to address parts of the XML document. XPath uses a path notation to navigate through the hierarchical structure of the XML document. Dynamic object recognition uses a Find or FindAll function and an XPath query to locate the objects that you want to test.

Parent topic: Glossary
Related concepts
locator
tag


The 4Test Language

4Test is an object-oriented fourth-generation language (4GL) designed specifically with the needs of the QA professional in mind. The powerful features of 4Test are organized into the following three basic kinds of functionality:

  • A robust library of object-oriented classes and methods that specify how a test case can interact with the GUI objects of an application.
  • A set of statements, operators, and data types that you use to pass structure and logic to a recorded test case.
  • A library of built-in functions for performing common support tasks.

Before you begin creating and running test scripts, you create a repository of information about your application to be used by Silk Test Classic. This repository includes descriptions of the GUI objects that comprise your application. Based on the properties and methods Silk Test Classic associates with these objects, Silk Test Classic recognizes the actions performed on these objects and records them in your test script using the 4Test language.

  • 4Test Language
    Describes how you can use the 4Test scripting language.
  • Classes
    Includes all classes used by 4Test.
  • Functions
    Lists the functions that are available in 4Test.
  • Keywords
    Lists the keywords.
  • Statements
    Lists the statements.
  • Declarations
    Lists the available 4Test declarations.
  • Web Application Window Declarations
    Lists the Web application window declarations.
  • Data Types
    Lists the data types.
  • Operators
    Lists the operators.


4Test Language

This section describes how you can use the 4Test scripting language.

  • Active and Enabled Statuses
    Describes the options that help you specify whether to raise an exception when particular methods are called on windows.
  • Calling Methods and Functions
    Describes how to call functions and methods.
  • C Compared to 4Test
    Describes the major differences between the 4Test programming language and C.
  • Comments in 4Test Files
    Describes how 4Test processes comments.
  • Built-in Constants
    Describes the predefined constant values in 4Test.
  • Overview of File Handles and Remote File Input and Output
    Describes the functions that work on a local machine versus those that work on a remote machine.
  • Flow-Of-Control Statements
    Shows the flow-of-control statements in the 4Test language.
  • Functions by Programming Task
    Lists 4Test functions organized by programming task.
  • Numeric Representation Conventions
    Silk Test Classic uses the industry-standard conventions for representing numbers of different bases.
  • Properties
    Provides an overview of how properties work in 4Test.
  • Reserved Words
    Lists the words that are reserved by the 4Test compiler.
  • Identifier Naming Rules
    Identifiers are the names you give to user-defined items in 4Test code.
  • Wildcards
    Provides details about when you can specify wildcards.
  • Key Names
    This section contains rules for key names and a list of key names that PressKeys, ReleaseKeys, and TypeKeys accept as arguments.
  • Syntax Conventions
    Summarizes the syntax conventions.
Parent topic: The 4Test Language


Active and Enabled Statuses

Silk Test Classic provides two options to help you specify whether to raise an exception when particular methods are called on windows:
  • OPT_VERIFY_ACTIVE
  • OPT_VERIFY_ENABLED

How to Read the Status Tables

The following table for window settings explains the interaction between these options and Silk Test Classic methods, showing the following information for each method:
  • Whether it requires that a window be active or enabled.
  • Whether it verifies that the window is active or enabled if the options are set to TRUE, raising an exception if the window is not in the correct state.
  • Whether it never checks active or enabled status, regardless of the setting of the options.
Note: You might have to extend your help window so you can see all the columns of the following table.
 | Always requires& |  | If option is TRUE& |  | Never checks that&
Method | Active window | Enabled window | Verifies active | Verifies enabled | Status is active | Status is enabled
Accept | x | x |  |  |  |
CaptureBitmap |  |  |  |  | x | x
Check | x | x |  |  |  |
ClearText | x | x |  |  |  |
ClearTrap |  |  |  |  | x | x
Click (AnyWin) |  |  | x | x |  |
Click (PushButton) | x | x |  |  |  |
ClickCell |  |  |  |  | x | x
Close | x | x |  |  |  |
CloseWindows |  |  |  |  | x | x
Collapse | x | x |  |  |  |
Decrement | x | x |  |  |  |
Dismiss | x | x |  |  |  |
DisplayMessage |  |  |  |  | x | x
DoubleClick |  |  | x | x |  |
DoubleSelect | x | x |  |  |  |
EnterCellText |  |  |  |  | x | x
Exists |  |  |  |  | x | x
Exit |  |  |  |  | x | x
Expand | x | x |  |  |  |
ExposeItem | x | x |  |  |  |
ExtendSelect | x | x |  |  |  |
FindCell |  |  |  |  | x | x
FindColumn |  |  |  |  | x | x
FindItem |  |  | x | x |  |
FindPage |  |  | x | x |  |
FindRow |  |  |  |  | x | x
FlushEvents |  |  |  |  | x | x
GenerateDecl |  |  |  |  | x | x
GetActive |  |  |  |  | x | x
GetAppId |  |  |  |  | x | x
GetArrayProperty |  |  |  |  | x | x
GetBitmapCRC |  |  |  |  | x | x
GetCaption |  |  |  |  | x | x
GetCellRect |  |  |  |  | x | x
GetCellText |  |  |  |  | x | x
GetChildren |  |  |  |  | x | x
GetClass |  |  |  |  | x | x
GetCloseWindows |  |  |  |  | x | x
GetColumnCount (ListView) |  |  | x | x |  |
GetColumnCount (guptaTable) |  |  |  |  | x | x
GetColumnName (ListView) |  |  | x | x |  |
GetColumnName (GuptaTable) |  |  |  |  |  |
GetColumnNames |  |  |  |  | x | x
GetColumnText |  |  |  |  | x | x
GetContents (AnyWin, GuptaTable) |  |  | x | x |  |
GetContents (other classes) |  |  | x | x |  |
GetCurrentCell |  |  |  |  | x | x
GetCurrentColumn |  |  |  |  | x | x
GetCurrentRow |  |  |  |  | x | x
GetDefaultButton |  |  | x | x |  |
GetDimensions |  |  |  |  | x | x
GetEverything |  |  | x | x |  |
GetFocus |  |  |  |  | x | x
GetFontName |  |  | x | x |  |
GetFontSize |  |  | x | x |  |
GetHandle |  |  |  |  | x | x
GetHelpText |  |  |  |  | x | x
GetID |  |  |  |  | x | x
GetIndex |  |  |  |  | x | x
GetItemCount |  |  | x | x |  |
GetItemLevel |  |  | x | x |  |
GetItemRect |  |  | x | x |  |
GetItemText |  |  | x | x |  |
GetMultiSelIndex |  |  | x | x |  |
GetMultiSelText |  |  | x | x |  |
GetMultiText |  |  | x | x |  |
GetName |  |  |  |  | x | x
GetNextCloseWindow |  |  |  |  | x | x
GetOption |  |  |  |  | x | x
GetPageCount |  |  | x | x |  |
GetPageSize |  |  | x | x |  |
GetParent |  |  |  |  | x | x
GetPosition |  |  | x | x |  |
GetPriorStatic |  |  |  |  | x | x
GetProperty |  |  |  |  | x | x
GetPropertyList |  |  |  |  | x | x
GetRange |  |  | x | x |  |
GetRangeText |  |  |  |  | x | x
GetRect |  |  |  |  | x | x
GetResource |  |  |  |  | x | x
GetResourceList |  |  |  |  | x | x
GetRowCount |  |  |  |  | x | x
GetRowText |  |  |  |  | x | x
GetSelIndex |  |  | x | x |  |
GetSelRange |  |  | x | x |  |
GetSelText |  |  | x | x |  |
GetState (CheckBox) |  |  | x | x |  |
GetState (MoveableWin) |  |  |  |  | x | x
GetStatusLine |  |  | x | x |  |
GetSubItemCount |  |  | x | x |  |
GetSubItems |  |  | x | x |  |
GetText |  |  | x | x |  |
GetTitle |  |  | x | x |  |
GetType |  |  |  |  | x | x
GetView |  |  | x | x |  |
HasFocus |  |  |  |  | x | x
HasSubPages |  |  | x | x |  |
Increment | x | x |  |  |  |
Invoke | x | x |  |  |  |
IsActive |  |  |  |  | x | x
IsArrayProperty |  |  |  |  | x | x
IsBold |  |  | x | x |  |
IsChecked |  |  | x | x |  |
IsDefined |  |  |  |  | x | x
IsEmpty |  |  |  |  | x | x
IsEnabled |  |  |  |  | x | x
IsExtendSel |  |  | x | x |  |
IsItalic |  |  | x | x |  |
IsItemEditable |  |  | x | x |  |
IsItemExpandable |  |  | x | x |  |
IsItemExpanded |  |  | x | x |  |
IsMultiSel |  |  | x | x |  |
IsMultiText |  |  | x | x |  |
IsPressed |  |  | x | x |  |
IsRichText |  |  | x | x |  |
IsUnderline |  |  | x | x |  |
Maximize | x | x |  |  |  |
Minimize | x | x |  |  |  |
Move | x | x |  |  |  |
MoveMouse |  |  | x | x |  |
MultiClick |  |  | x | x |  |
MultiSelect | x | x |  |  |  |
MultiUnselect | x | x |  |  |  |
Pick | x | x |  |  |  |
PopupSelect | x | x |  |  |  |
PressItem | x | x |  |  |  |
PressKeys |  |  | x | x |  |
PressMouse |  |  | x | x |  |
PrintCellText |  |  |  |  | x | x
PrintColumnText |  |  |  |  | x | x
PrintContents |  |  |  |  | x | x
PrintRangeText |  |  |  |  | x | x
PrintRowText |  |  |  |  | x | x
ReleaseItem | x | x |  |  |  |
ReleaseKeys |  |  | x | x |  |
ReleaseMouse |  |  | x | x |  |
Restore |  | x |  |  | x |
ScrollByLine | x | x |  |  |  |
ScrollByPage | x | x |  |  |  |
ScrollToMax | x | x |  |  |  |
ScrollToMin | x | x |  |  |  |
Select | x | x |  |  |  |
SelectList | x | x |  |  |  |
SelectRange | x | x |  |  |  |
SelectSubItem | x | x |  |  |  |
SetActive |  | x |  |  | x |
SetArrayProperty |  |  |  |  | x | x
SetCellText |  |  |  |  | x | x
SetColumnName |  |  |  |  | x | x
SetColumnText |  |  |  |  | x | x
SetContents |  |  |  |  | x | x
SetCurrentCell |  |  |  |  | x | x
SetCurrentColumn |  |  |  |  | x | x
SetCurrentRow |  |  |  |  | x | x
SetFocus |  | x |  |  | x |
SetMultiText | x | x |  |  |  |
SetOption |  |  |  |  | x | x
SetPosition | x | x |  |  |  |
SetProperty |  |  |  |  | x | x
SetRangeText |  |  |  |  | x | x
SetRowText |  |  |  |  | x | x
SetSelRange | x | x |  |  |  |
SetState | x | x |  |  |  |
SetText | x | x |  |  |  |
SetToMax | x | x |  |  |  |
SetToMin | x | x |  |  |  |
SetTrap |  |  |  |  | x | x
Size | x | x |  |  |  |
Start |  |  |  |  | x | x
TearOff | x | x |  |  |  |
TimeAutoScroll | x | x |  |  |  |
Toggle | x | x |  |  |  |
TypeKeys |  |  | x | x |  |
Uncheck | x | x |  |  |  |
VerifyActive |  |  |  |  | x | x
VerifyBitmap |  |  |  |  | x | x
VerifyCaption |  |  |  |  | x | x
VerifyCellText |  |  |  |  | x | x
VerifyColumnText |  |  |  |  | x | x
VerifyContents (GuptaTable) |  |  |  |  | x | x
VerifyContents |  |  |  |  | x | x
VerifyDefaultButton |  |  |  |  | x | x
VerifyEnabled |  |  |  |  | x | x
VerifyEverything |  |  |  |  | x | x
VerifyFocus |  |  |  |  | x | x
VerifyPosition |  |  |  |  | x | x
VerifyRange |  |  |  |  | x | x
VerifyRangeText |  |  |  |  | x | x
VerifyRowText |  |  |  |  | x | x
VerifySelRange |  |  |  |  | x | x
VerifySelText |  |  |  |  | x | x
VerifyValue |  |  |  |  | x | x
Wait |  |  |  |  | x | x
WaitBitmap |  |  |  |  | x | x
WaitCellText |  |  |  |  | x | x
Parent topic: 4Test Language


Calling Methods and Functions

Method Calls

A method is a routine that applies to a particular class of objects. Once an object is declared, you can refer to it by its identifier when calling methods.

The following example calls the SetActive method on the Find dialog box:
Find.SetActive ()

You can call methods for a window that has not previously been declared using a special identifier for dynamic instantiation. The syntax varies depending on whether you use INC files. When you record a test case with the Open Agent, Silk Test Classic creates locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations. You can also manually create test cases that use dynamic object recognition without an INC file. Dynamic object recognition uses a Find or FindAll function and an XPath query to locate the objects that you want to test. No INC file, window declarations, or tags are required.

Use the following syntax with INC files:
class("tag").class("tag"). ...
The following example calls a method on a dynamic instantiation of Find:
MainWin("Text Editor -*").DialogBox("Find").SetActive ()
Use the following syntax without INC files:
Findclass name(locator). ...
The following example calls a method on a dynamic instantiation of Find:
FindMainWin("@caption=’Text Editor -*’").FindDialogBox("Login").
   FindTextField("@priorlabel=’password’").TypeKeys("top secret")

Function Calls

A function is a routine that does not pertain to any particular object. Silk Test Classic provides some functions that are available in most other programming languages, such as functions for manipulating strings and numbers, and some functions that are unique to testing requirements.

To call a function, you do not refer to any objects. Instead, you just call the function directly. The following example calls the Abs function, which calculates the absolute value of a number:
First = Abs (iFirst)

Specifying Arguments

Consider the SetMultiText method, which can accept three arguments:

textfield.SetMultiText(lsText [, iStartLine, iNumLines])

The first argument, lsText, is required; you must include it when calling SetMultiText. The two arguments shown inside of brackets are optional. However, if you use the first one, you must also use the second because iNumLines counts lines of text starting from iStartLine.

The AddDateTime function, can accept six arguments:
newDT = AddDateTime(Datetime[, iDays, iHours, iMins, iSecs, iMsecs])

The first argument, Datetime, is required; the five arguments shown inside of brackets are optional. However, if you specify one, you must also specify any of the optional arguments that precede that one.

Use NULL for arguments that need no value specified. For example, the following code adds one hour to the Datetime value in newDateTime.
newDateTime = AddDateTime (datetime, NULL,1)

Out and Inout Arguments

Some functions and methods have arguments specified as inout or out. These specifications indicate that the function or method can change the value of the argument. For more information, see Function Declaration.

Return Values

Some methods and functions return values. You can provide a variable to hold the returned value, as in the first example below, or use the function or method call in another expression, so that the returned value becomes the value passed to the expression.

// return GUITYPE to variable gtype
GUITYPE gtype = GetGuiType ()
// pass font size to Verify function
Verify (MyDialog.RichEdit1.GetFontSize (4, 1), 12)

The second example passes the font size of the character in the first column of the fourth row to the Verify function, which verifies that the size is 12.

Passing the Name of the Function or Method to a Test

You can use the ArgListCall keyword to pass the name of the function or method, along with its arguments, at runtime in data-driven tests.

Parent topic: 4Test Language
Related reference
Function Declaration
ArgListCall Keyword


C Compared to 4Test

This topic describes the major differences between the 4Test programming language and C. C programmers should read this section for a quick overview of 4Test.

Data Types

C data types for DLL callouts

In addition to the 4Test data types, Silk Test Classic supports certain C data types for use in calling out to functions in DLLs.

4Test and C Keywords Compared

4Test supports most of the data types available in C; 4Test also has a type ANYTYPE that can hold any base type. The keywords that 4Test uses for its base types are slightly different, as illustrated in the following table.

Data Type/Difference | C Declaration | 4Test Declaration
Any type: Stores data of any type. | anytype a
Array: Arrays in 4Test can be dynamically resized. int ai[10]; array [10] of integer ai

or integer ai[10]

Boolean: Stores either TRUE or FALSE. int b; boolean b

or

int b

Character: 4Test has no data type for single characters. | char c; | string c

Enumerated: To declare a 4Test variable of type COLOR:

  • COLOR Color

enum COLOR
{red, white, blue};

type COLOR is enum
  red
  white
  blue
Floating-point: Real numbers in 4Test are double-precision float f;

double d;

real f

real d

Integer: 4Test integers are long (4 bytes) and signed | int i; long, short, unsigned | integer i
List: 4Test has dynamic lists | list of integer li
Numeric: 4Test NUMBER type stores either integers or floating point numbers. | number n
Pointer: 4Test does not have pointers; however, data can be indirectly referenced using the @ operator, as described below. | char *p;
Pointer to function: 4Test does not have pointers; however, data can be indirectly referenced using the @ operator, as described below. | int (*func) ();
String: 4Test strings are dynamically allocated; you do not need to declare their lengths. | char s[5]; | string s
Structure: 4Test user-defined types take the place of structure types.
struct Person
{
  char name[8]
  int age;
}

type Person is record
  string name
  integer age
Union: 4Test does not have unions. Use a variable of any type.
User-defined type
typedef struct Person
  PERSON_INFO;
 type PERSON_INFO is Person

Operators

Type Cast Operator Differences

4Test and C use different formats for type casting:

4Test format | [typename] expression
C format | (typename) expression

Reference (@) Operator Differences

4Test does not have pointers. Use the reference @ operator to reference variables and functions, as shown in this example:

TestFunc ()
  Print ("In TestFunc")

main ()

  STRING s = "foo"
  STRING sVariable = "s"
  STRING sFunc = "TestFunc"

  Print (s)            // Prints: foo
  Print (sVariable)    // Prints: s
  Print (@sVariable)   // Prints: foo

  //Calls TestFunc, prints: In TestFunc
  @(sFunc) ()

Equality (==) operator differences

The following code compiles in C, but not in 4Test:

if ((i=5) == TRUE)

This difference is intentional. Because this construct can lead to unreadable code, 4Test does not allow it.

Flow of Control

Looping and Iteration Differences

In addition to a C-style for loop, 4Test also has a for loop of this form:

for i = 1 to n step 5

4Test has a for each statement , for iterating over a list:

for each PartNum in PartNumList

4Test does not have a do while loop.

Conditional Differences

The 4Test switch statement can be used on any expression; the case statement that goes with switch can contain a list of values, as well as a single value. In 4Test, control automatically breaks out of a switch when the end of the case is reached (as opposed to C, where you must explicitly break out of the switch at the end of each case).

The 4Test select statement provides an alternative to a series of if statements; the case statement that goes with select contains a boolean expression that, if true, causes 4Test to execute the statements in the case. As with switch/case, 4Test automatically breaks out of the select at the end of the case.

4Test Controls Not in C

4Test has the following flow of control statements that do not correspond to C statements:
exit
Halts execution of a script.
raise and reraise
Raise and re-raise exceptions, respectively.
parallel, spawn, and rendezvous
Support concurrent programming.

Argument Passing Modes

Passing by Value

To pass by value, make a function parameter an in (input) parameter (the default). Use an in parameter when you only want to use only the parameter’s value within the function.

Passing by Reference

To pass by reference, make a function parameter an inout or out parameter.

  • Use an out parameter if you only want to set the parameter’s value.
  • Use an inout parameter if you want to get the parameter’s value and you want the function to change the value and pass the new value out.

Preprocessor Directives

4Test does not have a preprocessor. To include a file, use the use statement.

Parent topic: 4Test Language
Related reference
DLL Declaration
Type Cast Operator
Reference Operator
Relational Operators
switch Statement
Select Statement


Comments in 4Test Files

You can embed single-line comments in all 4Test files: Any characters following // in a line are considered comments.

Note: Shift+Enter, which wraps lines of code, is not available for comments. You must insert double-slashes on the next line for run-over comments.

4Test ignores comments when compiling, with the exception of functions and test cases. Comments within functions and test cases must be within the scope of the function or test case. If a comment is outdented beyond the scope of the function or test case, the compiler assumes that the function or test case has ended. As long as comments do not violate the function or test case scope, they can be placed anywhere on a line.

Note: Comments beyond the scope can also impact expand and collapse functionality and may prevent a function or test case from being fully expanded or collapsed.

We recommend that you keep comments within scope.

Example

// iSeed is a random number generation seed
INTEGER iSeed = 10
RandSeed (iSeed)
Print (RandInt (0, 100)) // prints: 75
Print (RandInt (0, 100)) // prints: 79
Print (RandInt (0, 100)) // prints: 3
Parent topic: 4Test Language


Built-in Constants

The following constants are built into the 4Test language:

  • TRUE
  • FALSE

In addition to these built-in constants, 4Test predefines two other kinds of constant values:

  • Exception values
  • Agent options
Parent topic: 4Test Language
Related reference
Exception Values
AGENTOPTION Data Type
Declarations
Data Types


Overview of File Handles and Remote File Input and Output

Silk Test Classic has several functions such as FileOpen and SYS_FileOpen whose only difference is whether the function works on a local machine or on a remote machine. Since these functions are so closely related, it’s important to understand their similarities and differences. This section describes file handles and their relationship to remote file input and output.

Note: SYS_ functions are not designed for local access. Non SYS_ functions are not designed for remote access.
  • Introduction to File Handles
    Describes the differences between FileOpen and SYS_FileOpen.
  • Introduction to Remote File Input and Output
    Provides an introduction to file functionality to allow users to read/write data to or from files.
  • File Handles and Remote File Input and Output Examples
    Provides examples of a correctly set up test case, test cases with local handles and invalid handles, and a test case with double close.
  • Reading from a File
    Describes how File functions recognize the end of a file.
  • Tips for Using the Remote File Functions
    Provides tips for using remote file functions.
  • Writing to a File
    Describes how File functions interact with file permissions.
Parent topic: 4Test Language


Introduction to File Handles

When you use FileOpen() it returns the HANDLE data type which you can use in other local functions to read, write, and update the file. SYS_FileOpen() also returns a HANDLE data type which you can use with remote file handles. The only difference between FileOpen() and SYS_FileOpen() is where the file that is opened resides. FileOpen() opens a file locally on the "host" (partner.exe). If you are using distributed testing, you may want to open a file on the "target" or remote machine. In that case, you must use SYS_FileOpen() to open the remote file and then use the appropriate SYS_ file manipulation function to complete the task.

If you open a file locally with FileOpen(), you must use local file functions (such as FileReadLine and FileWriteLine). You cannot use remote functions, such as SYS_FileReadValue. If you open a file on a target machine with SYS_FileOpen(), you must use SYS_ functions (such as SYS_FileReadLine and SYS_FileWriteLine) to edit it.

Parent topic: Overview of File Handles and Remote File Input and Output


Introduction to Remote File Input and Output

Silk Test Classic provides file functionality to allow users to read/write data to or from files. The data can be used to drive testing of the application, to control the application as in the INI file, and to store testing data or results that do not fit in the result file.

A file is a resource that is controlled and referenced by file handle variables. This resource has a scope (life), it is local or remote, and it has attributes or modes. A file can be opened as read only, write only, or update (read/write). The file can have attributes like shared or not shared.

Parent topic: Overview of File Handles and Remote File Input and Output


File Handles and Remote File Input and Output Examples

This section contains the following examples:

  • A correctly set up test case.
  • Test cases with local handles and invalid handles.
  • Test case with double close.

Correctly set up test case

The file handle is a user defined variable whose scope is defined by the location of the variable declaration. You must be sure that the file is not closed before the variable goes out of scope. If the variable does goes out of scope, the file is lost until it is closed by the resource going out of scope.

On the remote files, you must also keep track as to which file handle belongs to which remote agent. The file handle itself has no information as to what remote host it belongs to. It is possible that a file handle for one remote host matches another host file handle. The file handle only know that it is local or remote and whether it is a generic file, INI file, or another file type.

The following test case is correctly set up for remote file handling:

    [-] TestCase FileCreate ()
        [ ] HANDLE hFile
        [ ]
        [ ] hFile = FileOpen ("c:\myfile.txt", FM_WRITE, NULL)
        [ ] FileWriteLine (hFile, "This is a Test File line one.")
        [ ] FileWriteLine(hFile, "This is line two.")
        [ ] FileClose (hFile)
        [ ] // end of TestCase
    [ ]
    [-] TestCase FileRead ()
        [ ] HANDLE hFile
        [ ] STRING sMyData
        [ ] BOOLEAN bDidRead
        [ ]
        [ ] hFile = FileOpen ("c:\myfile.txt", FM_READ)
        [ ] bDidRead = FileReadLine (hFile, sMyData)
        [ ]
        [ ] Print (sMyData)
        [ ]
        [ ] FileClose (hFile)
        [ ]
        [ ] // end of TestCase

Test cases with local handles and invalid handles

Here are two examples of test cases that have not been set up correctly. In the first test case, the file is not closed, and the handle is not saved because it is only local to the LocalFile test case. The second test case raises an exception due to the invalid handle.

    [-] TestCase LocalFile()
        [ ] HANDLE hLocalHandle
        [ ]
        [ ] hLocalHandle = FileOpen ("c:myfile.txt",FM_WRITE)
        [ ] FileWriteLine (hLocalHandle, "test line")
        [ ]
    [-] TestCase LostHandlfile()
        [ ] HANDLE hLocalHandle
        [ ]
        [ ] FileWriteLine (hLocalHandle, "Test Line")
        [ ] FileClose (hLocalHandle)

The file operation is not restricted to other type of files, which means it uses FileOpen for INI file creation or modification and IniFileOpen to read the file. It is possible to create an INI file by using a generic file function such as FileWriteLine() or even to read the INI file through FileReadLine(). You can create a list file and later read it back by using the ListRead() function.

Note: Once the file is closed, its handles become invalid. If you close a file twice, the second attempt raises an exception. The same is true for the other file functions. With this in mind, be careful when you process a file with functions containing do..except and exception handling. A mistake can cause another exception to generate or a loss of file handles.

Test case with double close

In the following test case, the second FileClose causes an INVALID_FILE_HANDLE exception.

[-] TestCase DoubleClose ()
    [ ] Handle hFile
    [ ]
    [ ] hFile = FileOpen ("c:\myfile.txt", FM_WRITE)
    [-] do
        [ ] SYS_FileWriteLine (hFile, "This will except because of local vs remote mismatch")
    [-] except
        [ ] Print ("Some error statement")
        [ ] FileClose (hFile)
    [ ] FileClose (hFile)

To fix the preceding test case, do one of the following:

  • Remove the FileClose (hFile) in the exception block.
  • Add either the ReRaise or the Raise function to continue the exception processing without returning to the main line.
Parent topic: Overview of File Handles and Remote File Input and Output


Reading from a File

4Test recognizes that it has reached the end of a file (EOF) by no longer reading that file – in other words, by receiving a null string. It does not read any special character at the EOF.

For Silk Test Classic, EOF is indicated by a FALSE bDidRead return and a null string is indicated by a TRUE bDidRead return and a null string.

This applies to FileReadLine, FileReadValue, SYS_FileReadLine, and SYS_FileReadValue.

Parent topic: Overview of File Handles and Remote File Input and Output
Related reference
FileReadLine Function
FileReadValue Function
SYS_FileReadLine Function
SYS_FileReadValue Function


Tips for Using the Remote File Functions

When executing a remote file function, a file is opened on the host system and a handle is returned to the caller. It is the responsibility of the caller to ensure the proper operation of the file and that the file is closed correctly. The scope of the local files, which are opened with the FileOpen function or the IniFileOpen function, is from the start of a script to the end of the script. A script can either be an individual test case in a test plan or an implicit or explicit driver script, which calls multiple test cases. The scope of the remote files, which are opened with the SYS_FileOpen function or SYS_IniFileOpen function, is from AGENT connect to AGENT disconnect. Most of the time, the default scope of the remote files is from the start of a test case to the end of the test case. The default scope can be overwritten by using the Connect function and the Disconnect function.

Parent topic: Overview of File Handles and Remote File Input and Output
Related reference
FileOpen Function
IniFileOpen Function
SYS_FileOpen Function
SYS_IniFileOpen Function
Connect Function
Disconnect Function


Writing to a File

The File functions that control writing to a file do not test your accessibility to a file. This means that you cannot write information to a file that has been opened in read only mode with FileOpen(). The function will successfully return, but no information is actually written to the file. No error message indicates this.

This applies to FileWriteLine, FileWriteValue, SYS_FileWriteLine, and SYS_FileWriteValue.

Parent topic: Overview of File Handles and Remote File Input and Output
Related reference
FileWriteLine Function
FileWriteValue Function
SYS_FileWriteLine Function
SYS_FileWriteValue Function


Flow-Of-Control Statements

The following table summarizes the flow-of-control statements in the 4Test language.

To Use One of these 4Test Statements
Repeat commands in a loop
for each
Executes a statement or group of statements once for each element in a list.
for
Executes a loop once for each increment of a counter.
while
Executes a loop until a test condition (boolean expression) is false.
Conditionally execute a command
if
Executes a statement block based on the value of a boolean expression.
select
Executes one case from a group of cases.
switch
Executes one of the statements that follow, depending on the value of an expression.
Handle or raise exceptions
do...except
Handles an exception rather than having it halt the test case.
raise
Raises a user-defined exception.
reraise
Re-raises an exception you are handling yourself within a do...except statement.
Transfer flow of control
break
Transfers control of the script out of the innermost nested for, for each, while, switch, or select statement.
continue
Begins the next iteration of a for, for each, or while statement without completing the current iteration.
exit
Ends execution of the current script.
goto
Transfers control to the statement prefixed with the specified label.
return
Returns control back to the calling function, optionally passing back a return value.
Parent topic: 4Test Language
Related reference
Statements


Functions by Programming Task

The 4Test functions in the following table are organized by programming task.

Note: Functions may be listed under more than one programming task.
Task | Functions
Agent information | GetAgentType
Application state control | GetAppState GetAppStateList SetAppState SetBaseState SetBrowserType SetDefaultBrowserType SetGuiType
Array manipulation | ArrayFind ArrayResize ArraySize ArraySort
Character and string conversions | Asc Chr Lower PrintfToString Str Upper Val
Data type manipulation | FieldsOfRecord IsArray IsList IsNull IsSet TypeOf ValuesOfEnum
Database | DB_ColumnPrivileges DB_Columns DB_Connect DB_Disconnect DB_ExecuteSql DB_FetchNext DB_FetchPrev DB_FinishSql DB_ForeignKeys DB_GetConnectAttr DB_PrimaryKeys DB_ProcedureColumns DB_Procedures DB_SetConnectAttr DB_SpecialColumns DB_Statistics DB_TablePrivileges DB_Tables
Data driven | DefaultRunDataDrivenTestCase
Date and time manipulation | AddDateTime DateStr DiffDateTime ElapsedStr FormatDateTime GetDateTime GetDateTimePart MakeDateTime MakeTime Sleep TimeStr TransformDate UseY2KRules
Distributed processing | Connect Disconnect DisconnectAll GetConnected GetMachine GetMachineData GetMachineName IsConnected SetMachine SetMachineData SetMultiAppStates SetMultiBaseStates SetUpMachine
Distributed Results Logging | GetTestsFailedCount GetTestsPassedCount GetTotalElapsedStr GetTestPlanName GetTotalWarningCount GetTotalErrorCount IsTestPlan
Exception handling | ExceptCalls ExceptClear ExceptData ExceptLog ExceptNum ExceptPrint
File manipulation | The File functions listed in the left hand column have equivalent SYS_functions listed to the right that work with files on a target machine: FileClose SYS_FileClose FileOpen SYS_FileOpen FileReadLine SYS_FileReadLine FileReadValue SYS_FileReadValue FileSetPointer SYS_FileSetPointer FileWriteLine SYS_FileWriteLine FileWriteValue SYS_FileWriteValue IniFileClose SYS_IniFileClose IniFileGetValue SYS_IniFileGetValue IniFileOpen SYS_IniFileOpen IniFileSetValue SYS_IniFileSetValue IsFileRemote
Java functions | CaptureAllClasses CaptureObjectClass
List manipulation | ListAppend ListCount ListDelete ListFind ListInsert ListMerge ListPrint ListRead ListSort ListWrite SYS_ListRead SYS_ListWrite
Locale functions | GetLocale SetLocale SYS_GetLocale
Numeric operations | Abs Max Min SetPrecision Sqrt
Operating system calls | HOST_GetEnv SYS_CompareBinary SYS_CompareBitmap SYS_CompareText SYS_CopyFile SYS_DirExists SYS_Execute SYS_FileExists SYS_GetBitmapCRC SYS_GetDir SYS_GetDirContents SYS_GetDrive SYS_GetEnv SYS_GetExecutableDir SYS_GetFileContents SYS_GetFreeDiskSpace SYS_GetFreeMemory SYS_GetMemoryInfo SYS_GetName SYS_GetRegistryValue SYS_GetVersion SYS_MakeDir SYS_MoveFile SYS_RemoveDir SYS_RemoveFile SYS_SetDir SYS_SetDrive SYS_SetEnv SYS_SetRegistry SYS_SetRegistryValue SYS_VerifyText
Password encryption | Decrypt Encrypt
Product version | GetPartnerBuildNum GetPartnerVersion SYS_GetAgentVersion
Random value operations | RandInt RandPick RandReal RandSeed RandStr
Registry operations | Reg_CreateKey Reg_CreateValue Reg_DeleteKey Reg_DeleteKeysAll Reg_DeleteValue Reg_EnumKeys Reg_EnumKeysAll Reg_EnumValues Reg_EnumValuesAll SYS_GetRegistryKeyNames SYS_GetRegistryValue SYS_SetRegistryValue
Results file operations | AppError FuzzyVerify LogError LogVerifyError LogWarning Print Printf PrintfToString RaiseError ResCloseList ResExport ResExportOnClose ResExtract ResOpenList ResPrintList SetAgentTrace Verify
Runtime Status messages | PushTestInfo PopTestInfo SetTestStatus
Script information | GetArgs GetBrowserType GetDefaultBrowserType GetExecutableDir GetGuiName GetGuiType GetGuiVersion GetProgramDir GetProgramName GetRel1ClassLibrary GetStartupDir GetTestCaseArg GetTestCaseErrorCount GetTestCaseName GetTestCaseState GetTestCaseWarningCount
Semaphores | Acquire GetThreadData GetThreadId Release SetThreadData
Set manipulation | IsInSet SetAddMember SetComplement SetCount SetDomain SetExclude SetIntersection SetRemoveMember SetUnion
Status | PopTestInfo PushTestInfo SetTestStatus
String manipulation | GetField IsAlpha IsDigit IsSpace Left Len Ltrim MatchStr Replicate Right Rtrim Space StrPos StrTran Stuff SubStr Tabs Trim
Timers, time/date information | TimerCreate TimerDestroy TimerGetHandle TimerGetName TimerPause TimerResume TimerStart TimerState TimerStop TimerStr TimerValue
Web browser | GetBrowserType GetBrowserTypeName GetDefaultBrowserType RunLinkTester SetBrowserType SetDefaultBrowserType
Window information | ClassOf FindWinClass FindWindow WindowChildren WindowGetAttrList WindowIsDefined WindowIsOfClass WindowName WindowParent WindowTag
Year 2000 date transformations | ParseDateFormat TransformDate UseY2KRules
  • Variable Number of Arguments
    Describes how to specify a variable number of function arguments.
Parent topic: 4Test Language
Related concepts
Functions


Variable Number of Arguments

You specify a variable number of function arguments as follows:

varargs [of data-type] list-id
Variable | Description
data-type | The data type of the variable arguments.
list-id | An identifier specifying the name of the list variable that holds the variable arguments.

Notes

Regardless of how many arguments are passed to a function, each argument is stored in a list named list-id that is accessible to the function.

Examples

Following are several examples of functions.

Example 1

The ProcName function declaration below specifies that the second argument can be NULL and that the third argument is optional. The test case that follows calls ProcName.

Note: Test cases are also functions.
[-] ProcName(BOOLEAN b, STRING sName NULL, INTEGER iStart optional)
    [-] if(sName == NULL)
        [ ] sName = "Smith"
    [-] if(iStart == NULL)
        [ ] iStart = 0
    [ ] Print(b, sName, iStart)
    [ ]
[-] testcase null_and_optional_example()
    [ ] BOOLEAN b = TRUE
    [ ] INTEGER i
    [ ] STRING s
    [ ] i = 1
    [ ] s = "foo"
    [ ] ProcName(b, s, i) // Prints: TRUE foo 1
    [ ] s = NULL
    [ ] ProcName(b, s) // Prints: TRUE Smith 0
    [ ] b = NULL
    [ ] ProcName (b, s, i) // This statement causes an exception because
    [ ] // the first arg to ProcName cannot be NULL

Example 2

The function MyFunc1 uses different argument pass modes. The test case calls MyFunc1.

    [-] BOOLEAN MyFunc1(STRING s, out INTEGER iNew, inout INTEGER iChange)
        [ ] s = "bar"
        [ ] iNew = 1234
        [ ] iChange = iChange + 1
        [ ] return TRUE
    [ ]
    [-] testcase pass_modes_example()
        [ ] STRING sIn = "foo"
        [ ] INTEGER iOut
        [ ] INTEGER iInOut = 1
        [ ] BOOLEAN bReturnValue
        [ ] bReturnValue = MyFunc1(sIn, iOut, iInOut)
        [ ] // prints: foo 1234 2 TRUE
        [ ] Print(sIn, iOut, iInOut, bReturnValue)

Example 3

The function MyFunc2 is declared to take a variable number of arguments.

    [-] MyFunc2(INTEGER iTestNum, varargs OF STRING lsArg)
        [ ] Print(iTestNum, lsArg)
Parent topic: Functions by Programming Task


Numeric Representation Conventions

Silk Test Classic uses the industry-standard conventions for representing numbers of different bases:
Binary
Each number has a prefix of 0b (zero, lowercase B), for example 0b10110111.
Decimal
A number without a prefix, for example, 1776.
Hexadecimal
Each number has a prefix of 0x (zero, lowercase letter X), with the letters A through F representing the numbers above 9, for example 0x03CF 07FFF and 0x0010.

Embedded spaces in long numbers are for ease of reading and are ignored.

Parent topic: 4Test Language


Properties

Each 4Test class has properties, which are characteristics of that class. The properties are listed with the description of each class in the help. The descriptions use the internal names, that is, the names that begin with the $ character. For example, $Location is a property of the HtmlLink class.

The internal names are provided in the class descriptions because they are the names that are used by the verification system. When you verify a property while recording a test case, the internal names are displayed in the Verify Window window.

But there are also 4Test names for each of these properties. These names use Hungarian notation, that is, they are prefixed with an abbreviation for the data type. The 4Test names are shown for the classes in the Library browser.

Determining the 4Test Name of a Property

In addition to looking up the 4Test names of the properties in the Library browser, you can determine the 4Test name of an internal property as follows:

  1. Remove the leading $ character from the name.
  2. Preface the name with the data type, for example s for STRING, ls for LIST OF STRING, and so on. If the data type is an enumerated or set data type, such as FONTSTYLE, do not use a data-type prefix.

Examples

The 4Test name for the $Location property is sLocation, because $Location is a string, whose abbreviation is s.

Some other examples:

Internal Name | 4Test Name | Data Type
$TextColor | sTextColor | STRING
$FontSize | iFontSize | INTEGER
$FontStyle | FontStyle | FONTSTYLE
$Contents | lsContents | LIST OF STRING

Using the Properties

You can retrieve the values of all properties directly in a script using dot notation as long as you use the 4Test name, not the internal name. Using the GMO Web application’s home page, for example:

INTEGER iSize
iSize = GMO.WelcomeText.iFontSize
Print (iSize)

// Result:
// 18

When using the internal name, use the GetProperty, GetTextProp, or GetItemProp method, whichever is appropriate. For example:

INTEGER iSize
iSize = GMO.WelcomeText.GetProperty("$FontSize")
Print (iSize)

// Result:
// 18
Parent topic: 4Test Language
Related reference
Syntax Conventions


Reserved Words

What Kinds of Words are Reserved

Keywords are special identifiers that are reserved by the 4Test compiler. You can use a keyword only as a keyword, not as an identifier name or function name. Case is significant in keywords, so "exit" is a reserved word, but "EXIT" and "Exit" are not.

Type names, shown in CAPITALS below, are also reserved by the compiler. You can use a type name only as a type name, not as an identifier name or function name. Unlike keywords, type names are not case-sensitive, so "CHAR" and "char" are both reserved words.

The boolean constants TRUE and FALSE are also reserved by the compiler and are case insensitive.

For a list of additional keywords that you use when creating test plans, see Testplan Editor Keywords.

List of Reserved Words

The following are reserved words in the 4Test language:

access | default | in | property | switch
alias | derived | inout | public | tag
ANYTYPE | dll | INT | raise | testcase
appstate | do | INTEGER | REAL | this
ARRAY | DOUBLE | is | record | to
attribute | each | LIST | rendezvous | TRUE
basedon | else | locator | reraise | type
BOOLEAN | enum | LONG | return | UNSIGNED
break | except | none | select | unsupported
builtin | exit | null | SEMAPHORE | use
case | extern | NUMBER | SET | varargs
CHAR | FALSE | OBJ | share | void
const | FLOAT | obsolete | SHORT | while
continue | for | OF | size | winclass
currentfile | goto | optional | spawn | WINDOW
currentpath | GUITYPE | out | step |
critical | HANDLE | parallel | STRING |
DATACLASS | hidecalls | parent | supported_ca |
DATATYPE | if | private | supported_oa |
Parent topic: 4Test Language


Identifier Naming Rules

Identifiers are the names you give to user-defined items in 4Test code. These items include constants, variables, functions, methods, properties, windows, window classes, and data types.

Identifiers conform to these naming rules:

  • They are case-sensitive. That is, "myvar" and "MyVar" are not the same.
  • They begin with an alphabetic character or an underscore (_).
  • They include any combination of alphabetic characters, numerals, and underscore characters. They can contain single-byte international characters, such as é and ñ.
  • All characters are significant.
Parent topic: 4Test Language
Related reference
Data Type Ranges


Wildcards

You can specify wildcards wherever you provide strings that Silk Test Classic will search for:

  • The * character matches zero or more characters.
  • The ? character matches exactly one character.

For example, "David H?ll" matches "David Hill" and "David Hall", but not "David Hiller". "David H*" matches " David Hill", " David Hall", " David Hiller", and " David Hayes".

Examples of Where You Can Use Wildcards

Some of the situations where you can specify wildcards include:

  • Tags.
  • Search text in the FindCell method.
  • Identifier for items in combo boxes, list boxes, radio lists, and so on.
  • In the entries in the [ClassList] section of javaex.ini. Wildcards are useful for exposing (or ignoring) all classes in a package.
  • When ignoring or exposing Java classes in a package.
Parent topic: 4Test Language
Related reference
Tag Statement
ComboBox Class
ListBox Class
RadioList Class


Key Names

This section contains rules for key names and a list of key names that PressKeys, ReleaseKeys, and TypeKeys accept as arguments.

Rules for Key Names

These rules apply when you specify key names in scripts.

Tip: This is a wide table; you may need to enlarge your help window to see all three columns.
Rule | Description | Example
Angle brackets in names | If a key name is more than one character in length, enclose it in angle brackets. | "<Enter>"
If it is only one character long, you can specify it with or without angle brackets. | "z"
Case sensitivity Case is significant only in one-character key names.
The following are equivalent:
  • "<Enter>"
  • "<ENTER>"
The following are not equivalent:
  • "A"
  • "a"
Combining keystrokes | You can combine any number of keystrokes in a single string. | "<Alt-F>S<Enter>"
Groups of keys Include groups of keys that you want pressed simultaneously in the same set of angle brackets, and separate the keys with minus signs (-) or plus signs (+) depending on the Agent that you are using.
Note: The Classic Agent only supports minus signs (-) as a delimiter between key names while the Open Agent supports plus and minus signs.
"<Ctrl-Shift-F10>"
Partial key names | Partial key names are invalid.
Repeated keys Specify repeat counts by following the key name with the integer repeat count.

"<Tab 2>"

"<X 15>"

Using Shift and Option keys

The Shift key is not necessary when you are specifying a single alphabetic character.

On Windows you must specify the full compose sequences for accented characters.

The following are equivalent:
  • "G"
  • "<Shift-G>"

List of Key Names

The following table lists the key names that PressKeys, ReleaseKeys, and TypeKeys accept as arguments.

Platform-specific keys are labeled.

Keystroke | Description
#0 | Numeric keypad 0 with Num Lock on
#1 | Numeric keypad 1 with Num Lock on
#2 | Numeric keypad 2 with Num Lock on
#3 | Numeric keypad 3 with Num Lock on
#4 | Numeric keypad 4 with Num Lock on
#5 | Numeric keypad 5 with Num Lock on
#6 | Numeric keypad 6 with Num Lock on
#7 | Numeric keypad 7 with Num Lock on
#8 | Numeric keypad 8 with Num Lock on
#9 | Numeric keypad 9 with Num Lock on
#Add | Numeric keypad "+"
#Clear | Numeric keypad 5 with Num Lock off. Not supported on the X Window System.
#Decimal

For the Open Agent, this key represents the key for the decimal separator on the numeric keypad of most keyboards. When recording, the Open Agent records the actual character that results from pressing that key. For example, if you record using an English keyboard, Silk Test Classic records a TypeKeys("."). For a German keyboard, Silk Test Classic records a TypeKeys(",").

For replaying, use #Decimal. Depending on the currently selected keyboard layout, Windows decides what character to create. For example, on an English keyboard, Silk Test Classic records '.' for TypeKeys("<#Decimal>") and on a German keyboard, Silk Test Classic records ','.

#Delete | Numeric keypad "." with Num Lock off. Not supported on the X Window System.
#Divide | Numeric keypad ""
#Down | Numeric keypad 2 with Num Lock off
#End | Numeric keypad 1 with Num Lock off
#Enter | Numeric keypad Enter
#Equal | Numeric keypad equals sign. Not supported on Windows.
#Home | Numeric keypad 7 with Num Lock off
#Insert | Numeric keypad 0 with Num Lock off
#Left | Numeric keypad 4 with Num Lock off. Not supported on the X Window System.
#Period

Numeric keypad "." with Num Lock on. This key represents the key for the decimal separator on the numeric keypad of most keyboard layouts. However, for some non-English languages, such as German, the decimal separator is a comma ',' and therefore the name period is unclear. For example, with the Classic Agent, Silk Test Classic records a <#Period> on an English keyboard and an ',' on a German keyboard.

#Period is deprecated for use with the Open Agent. Using #Decimal rather than #Period is recommended on the Open Agent.

#PgDn | Numeric keypad 3 with Num Lock off
#PgUp | Numeric keypad 9 with Num Lock off
#Right | Numeric keypad 6 with Num Lock off. Not supported on the X Window System.
#Separator | Numeric keypad Separator key. Supported on the X Window System only.
#Space | Numeric keypad Space key. Supported on the X Window System only.
#Subtract | Numeric keypad "-"
#Tab | Numeric keypad Tab key. Supported on the X Window System only.
#Times | Numeric keypad "*"
#Up | Numeric keypad 8 with Num Lock off
Alt | Left-side Alt key
Application | Opens a context menu on the last active control.
Backspace | Backspace key
Break | Ctrl-Break. Supported on Windows only.
Cancel | Break
CapsLock | Caps Lock (toggle whether it is currently on or off)
CapsLockOff | Caps Lock Off (typed only if it is currently on). Not supported on the Open Agent.
CapsLockOn | Caps Lock On (typed only if it is currently off). Not supported on the Open Agent.
Clear | Clear key. Supported on the X Window System only.
Ctrl | Left-side Ctrl key
Delete | Delete key
Down | Down arrow
End | End key
Enter | Enter key
Esc | Esc (Escape)
Execute | Execute key. Supported on X Window System only.
F1 | F1 function key
F2 | F2 function key
F3 | F3 function key
F4 | F4 function key
F5 | F5 function key
F6 | F6 function key
F7 | F7 function key
F8 | F8 function key
F9 | F9 function key
F10 | F10 function key
F11 | F11 function key
F12 | F12 function key
F13 | F13 function key. Supported on the X Window System only.
F14 | F14 function key. Supported on the X Window System only.
F15 | F15 function key. Supported on the X Window System only.
F16 | F16 function key. Supported on the X Window System only.
F17 | F17 function key. Supported on the X Window System only.
F18 | F18 function key. Supported on the X Window System only.
F19 | F19 function key. Supported on the X Window System only.
F20 | F20 function key. Supported on the X Window System only.
F21 | F21 function key. Supported on the X Window System only.
F22 | F22 function key. Supported on the X Window System only.
F23 | F23 function key. Supported on the X Window System only.
F24 | F24 function key. Supported on the X Window System only.
F25 | F25 function key. Supported on the X Window System only.
F26 | F26 function key. Supported on the X Window System only.
F27 | F27 function key. Supported on the X Window System only.
F28 | F28 function key. Supported on the X Window System only.
F29 | F29 function key. Supported on the X Window System only.
F30 | F30 function key. Supported on the X Window System only.
F31 | F31 function key. Supported on the X Window System only.
F32 | F32 function key. Supported on the X Window System only.
F33 | F33 function key. Supported on the X Window System only.
F34 | F34 function key. Supported on the X Window System only.
F35 | F35 function key. Supported on the X Window System only.
Find | Find key. Supported on the X Window System only.
Greater | ">" key (which the agent would otherwise interpret as a right angle bracket)
Help | The Help key. Supported on the X Window System only.
Home | Home key
Insert | Insert key
Left | Left arrow
LeftAlt | Alt key
LeftCtrl | Ctrl key
LeftShift | Shift key
LeftWin | Windows Start menu key
Less | "<" key (which the agent would otherwise interpret as left angle bracket)
Menu | Menu key. Supported on the X Window System only.
Minus | "-" key. Not supported on the Open Agent. Use #Subtract or '-' with the Open Agent.
Mode | Mode key. Supported on the X Window System only.
NumLock | Num Lock (typed whether it is currently on or off). Not supported on the Open Agent.
NumLockOff | Num Lock Off (typed only if it is currently on). Not supported on the X Window System or the Open Agent.
NumLockOn | Num Lock On (typed only if it is currently off). Not supported on the X Window System or the Open Agent.
Pause | Pause
PgDn | PgDn or Page Down
PgUp | PgUp or Page Up
PrtScr | Print Scrn
Redo | Redo key. Supported on the X Window System only.
Right | Right arrow
RightAlt | Alt key
RightCtrl | Ctrl key
RightOption | Option key. Not supported on the X Window System.
RightShift | Shift key
RightWin | Windows Start menu key
ScrollLock | Scroll Lock (typed whether it is currently on or off).
ScrollLockOff | Scroll Lock (typed only if it is currently on). Not supported on the X Window System or the Open Agent.
ScrollLockOn | Scroll Lock (typed only if it is currently off). Not supported on the X Window System or the Open Agent.
Shift | Left-side Shift key
Space | Space bar
Tab | Tab
Undo | Undo key. Supported on the X Window System only.
Up | Up arrow
Parent topic: 4Test Language
Related reference
PressKeys Method
ReleaseKeys Method
TypeKeys Method (AnyWin)


Syntax Conventions

The following table summarizes the syntax conventions.

Convention | Example | Description
Bold | ExceptPrint ( ) | Keywords or required punctuation. Leave exactly as shown.
Italic | FileCode (hFile) | Arguments to be replaced with an expression that represents an actual value.
Bold italic | window.Invoke() | Windows (object) of the specified class. Replace with a window identifier.
Parentheses ( ) | Printf (sFormat, VaArgs) | Arguments for function or method.
Brackets [ ] | SYS_Kill (iPid [, isignal]) | Optional arguments.
Ellipses ( ... ) | access share-var [, share-var]... statements | Follows an element that can optionally be repeated.
Indentation | access share-var [, share-var]... statements | Indicates continuation of the statement on multiple lines indented another level.
= | iCode = Asc ( sString) | Items on the left of the = hold the return value of the method, function, or property.
Variable prefixes (I, b, n,w , ...) | iCode = Asc ( sString) | Indicates the data type of an argument or return value; for example, iCode is an INTEGER, sString is a STRING, bResult is a BOOLEAN, and wDialogBox is a WINDOW. For more information, see "Variable prefixes" next.

Variable Prefixes

Variables are specified in Hungarian notation, that is, prefixed with an abbreviation for the data type. The data types and abbreviations are as follows: anytype (a), agentoption (ao), boolean (b), dataclass (dc), datatype (dt), guitype (gt), handle (h), integer (I), number (n), point (p), real ®), rect (re), semaphore (se), string (s), string or integer (si), sbrange (sr), textpos (tp), textrange (tr), window (w), winclass (wc), winstate (ws) and wndtag (wt). Any of these types can be a list, such as list of string (ls) or list of window (lw). Any of these types can also be an array, such as array of anytype (aa) or array of string or integer (asi).

Parent topic: 4Test Language


Classes

This section includes all classes used by 4Test.
  • General Core Classes
    Lists the core classes.
  • Flex Class Reference
    Lists the classes for Flex support.
  • Java Classes
    Lists the classes that are available for testing Java applications.
  • Mobile Class Reference
    Lists the classes for Mobile support.
  • Windows Forms Classes Used by the Open Agent
    Lists the 4Test classes that are used by the Open Agent to support Windows Forms.
  • Rumba Class Reference
    Lists the classes for Rumba support.
  • SAP Class Reference
    Lists the classes for SAP support.
  • Silverlight Class Reference
    Lists the classes for Silverlight support.
  • Java AWT and Swing Class Reference
    Lists the classes for Java AWT and Swing support.
  • Win32 Classes
    Lists the available classes for testing Win32 controls.
  • WPF Class Reference
    Lists the classes for WPF support.
  • xBrowser Classes
    Lists the classes that are used for xBrowser.
Parent topic: The 4Test Language


General Core Classes

This section lists the core classes of the 4Test language.
  • AccessibleControl Class
    The class for any control that is identified by the Accessibility extension.
  • AgentClass Class
    AgentClass is the class for the 4Test agent, the component of Silk Test Classic that interacts with the graphical user interface.
  • AnyWin Class
    The class for any window.
  • CheckBox Class
    The class for check box controls.
  • CheckBoxToolItem Class
    The class for a check box element in a toolbar control.
  • ClipboardClass Class
    The class for the clipboard.
  • ComboBox Class
    The class for controls that have both a popup list and a text field.
  • ConsoleClass Class
    The class for consoles.
  • Control Class
    The class for any control in a window.
  • CursorClass Class
    The class for the cursor.
  • CustomWin Class
    The class for objects that do not map to or derive from any built-in classes.
  • DefinedWin Class
    The class for windows that map to or derive from manually created windows.
  • DesktopWin Class
    The class for the entire screen.
  • DialogBox Class
    The class for dialog boxes.
  • DropDownToolItem Class
    The class for drop-down element in a toolbar control.
  • DynamicText Class
    The class for dynamic text controls.
  • HorizontalScrollBar Class
    The class for horizontal scroll bars.
  • ListBox Class
    The class for list boxes.
  • MainWin Class
    The class for an application’s main window.
  • Menu Class
    The class for menus.
  • MenuItem Class
    MenuItem is the class for items on a menu.
  • MoveableWin Class
    The class for windows that typically can move.
  • PageList Class
    The class for tabbed, multi-page dialog boxes, and for button bars.
  • PushButton Class
    The class for pushbuttons.
  • RadioList Class
    The class for a group of radio buttons, such as the two radio buttons used to specify direction in the Find dialog box of the Text Editor application.
  • Scale Class
    The class for scales.
  • ScrollBar Class
    The class for scroll bars, including the scroll bars that are parts of controls, such as the scroll bar on a list box.
  • StaticText Class
    The class for static text strings (that is, text that the user cannot change, such as a label).
  • StatusBar Class
    The class for status bar controls.
  • TableColumn Class
    A column in a table.
  • TableEx Class
    A series of two or more columns in an application.
  • TableRow Class
    A row in a table.
  • TextField Class
    The class for single-line and multi-line fields whose text can be modified by the user.
  • ToolBar Class
    The class for tool bar controls.
  • TreeView Class
    The class for items which are organized into graphical hierarchies.
  • VerticalScrollBar Class
    The class for vertical scroll bars.
Parent topic: Classes


AccessibleControl Class

Description

AccessibleControl is the class for any control that is identified by the Accessibility extension.

Inheritance

AccessibleControl is derived from the AnyWin class; several classes derive from this class.

Methods and Properties

In addition to the methods and controls it inherits from the AnyWin class, AccessibleControl has the following methods and properties:

  • DoDefaultAction Method
    If there is a default action for an accessible control, the DoDefaultAction method performs it.
  • Description Property
    The description of the accessible control.
  • Role Property (AccessibleControl)
    The role of the accessible control.
  • State Property (AccessibleControl)
    The state of the accessible control.
Parent topic: General Core Classes
Related concepts
Using Accessibility with the Open Agent
Related reference
AnyWin Class


DoDefaultAction Method

Class

AccessibleControl.

Action

If there is a default action for an accessible control, the DoDefaultAction method performs it.

Availability

This functionality is supported only if you are using the Open Agent.

Windows operating systems.

Syntax

accessibleControl.DoDefaultAction()

Example

For a button, the default action would be a Click.

Parent topic: AccessibleControl Class


Description Property

Class

AccessibleControl.

Description

The description of the accessible control.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

STRING.

Access

Read only.

Parent topic: AccessibleControl Class


Role Property (AccessibleControl)

Class

AccessibleControl.

Description

Indicates the role of the accessible control. The role is based on the type of the accessible control.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

STRING.

Access

Read only.

Parent topic: AccessibleControl Class


State Property (AccessibleControl)

Class

AccessibleControl.

Description

Describes the status of the accessible control at a moment in time. An accessible control is associated with one or more of these state values at any time.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

STRING.

Access

Read only.

Parent topic: AccessibleControl Class


AgentClass Class

Description

AgentClass is the class for the 4Test agent, the component of Silk Test Classic that interacts with the graphical user interface.

AgentClass has a predefined identifier, Agent. To call a method of the AgentClass, use this syntax:

Agent.method()

Inheritance

AgentClass does not derive from any class, and no classes derive from it.

Methods and Properties

AgentClass has the following methods and properties:

  • Attach Method (AgentClass)
    Attaches to the given application.
  • DetachAll Method (AgentClass)
    Detaches all currently attached applications.
  • DisplayMessage Method
    Displays a message box and halts script execution until the user manually dismisses the message box.
  • FlushEvents Method
    Causes queued keyboard and mouse events to be sent as they are generated.
  • GetDllCallPrecedence Function (AgentClass)
    Returns whether the DLL is a 32bit DLL or a 64bit DLL.
  • GetOption Function
    Returns the value of the specified Silk Test Classic Agent option.
  • IsOptionValid Function
    Tests whether or not the Agent recognizes the specified option.
  • SetDllCallPrecedence Method (AgentClass)
    Sets whether the called DLL is a 32bit DLL or a 64bit DLL.
  • SetOption Method
    Sets an Agent option to the specified value.
  • Shutdown Method (AgentClass)
    Enables you to shut down the Open Agent after a test run.
  • UnloadAllDlls Method (AgentClass)
    Unloads all DLLs from the Agent.
  • UnloadDll Method (AgentClass)
    Unloads the specified DLL from the Agent.
Parent topic: General Core Classes


Attach Method (AgentClass)

Class

AgentClass.

Action

Attaches to the given application. Enables you to specify an additional command-line pattern and tech domain.

Syntax

Attach (executablePattern [, commandLinePattern, techDomains])
Variable | Description
executablePattern | The executable name of the application. The pattern may include the wildcards '?' and '*' which match one or none to many characters respectively. Examples: myApplication.exe, myApplica?ion.exemyApp*.exe. STRING.
commandLinePattern | Optional: This pattern is matched against the command line arguments of the application. This is useful when multiple instances of an application, for example javaw.exe, are running, but only some of them should be tested. For Java applications, the command line pattern could include the name of a characteristic JAR or the main class, for example *org.MyMainClass. You can use null to specify no command line pattern when you want to load specific tech domains. STRING.
techDomains
Optional: The tech domains to load in the application. Typically, this parameter is only used by technical support. As a best practice, do not specify a tech domain. If you do not specify a tech domain, all available tech domains are loaded. The available values are:
  • Flex
  • Java
  • Rumba
  • SAP
  • Silverlight
  • Swing
  • JavaSWT
  • WIN32
  • Windows Forms
  • WPF
  • xBrowser

LIST OF STRING.

Examples

The following example attaches to the Notepad application:
Agent.Attach("*\notepad.exe")
The following example shows how to use the command-line pattern to attach to a specific instance of a process when multiple instances of the application are running:
Agent.Attach("javaw.exe", “*org.MyMainClass”)
The following example shows how to attach to Internet Explorer and load the Win32 tech domain:
Agent.Attach("iexplore.exe", null, {"WIN32"})
Parent topic: AgentClass Class


DetachAll Method (AgentClass)

Class

AgentClass.

Action

Detaches all currently attached applications.

Syntax

DetachAll ()

Example

The following example detaches all currently attached applications.
Agent.DetachAll()
Parent topic: AgentClass Class


DisplayMessage Method

Class

AgentClass class.

Action

Displays a message box and halts script execution until the user manually dismisses the message box.

Syntax

Agent.DisplayMessage (sTitle, sMessage)
Variable | Description
sTitle | The text for the message box caption. STRING.
sMessage | The text for the contents of the message box. STRING.

Notes

DisplayMessage displays a message box with the specified caption and message, along with OK and Cancel pushbuttons. Script execution pauses until one of the pushbuttons is manually pushed. If the user pushes OK, execution resumes. Pressing Cancel is equivalent to aborting script execution.

DisplayMessage is useful for stopping a test during a demonstration, or prompting the user to perform manual verification. It is not recommended for unattended testing.

Pushbuttons cannot be clicked by a script that contains the call to DisplayMessage; they must be clicked manually by the user.

Example

Halt ()
STRING sTitle = "Verification Message"
STRING sMessage =  "Press OK to continue, or Cancel to halt execution."
Agent.DisplayMessage (sTitle, sMessage)
Parent topic: AgentClass Class


FlushEvents Method

Class

AgentClass class.

Action

Causes queued keyboard and mouse events to be sent as they are generated.

Syntax

Agent.FlushEvents()

Notes

By default, Silk Test Classic sends events when all keys or mouse buttons that were pressed have been released. Calling FlushEvents is the way to override this optimization, because FlushEvents sends each event as it is generated.

This method is also useful when you need to query the state of an application when keyboard and mouse events are queued (using calls to PressMouse or PressKeys) pending release by calls to ReleaseMouse or ReleaseKeys.

Example

MainWin.PressMouse(1, 100, 100)
Agent.FlushEvents()
Parent topic: AgentClass Class


GetDllCallPrecedence Function (AgentClass)

Class

AgentClass.

Availability

This functionality is supported only if you are using the Open Agent.

Action

Returns whether the DLL is a 32bit DLL or a 64bit DLL.

Syntax

DLLCallType = Agent.GetDllCallPrecedence()
Variable Description
DLLCallType The type of the DLL.
  • DCP_32BIT if the DLL is a 32bit DLL.
  • DCP_64BIT if the DLL is a 64bit DLL.
DLL_CALL_PRECEDENCE_TYPE.
Parent topic: AgentClass Class
Related concepts
Calling a DLL from within a 4Test Script
Related reference
SetDllCallPrecedence Method (AgentClass)
DLL_CALL_PRECEDENCE_TYPE Data Type


GetOption Function

Class

AgentClass class.

Action

Returns the value of the specified Silk Test Classic Agent option.

Syntax

aValue = Agent.GetOption (Option)
Variable | Description
aValue | The value of the option. The type depends on the option.
Option | An agent option specified with one of the constants defined for the AGENTOPTION enumerated data type. For a list, see Agent Options.

Notes

GetOption returns the value of the Agent option you specify. The type of the return value varies depending on the option you specify. You can set the options interactively through the Agent Options dialog box. The value returned with GetOption overrides the value set in the Agent Options dialog box.

Example

INTEGER iCount
iCount = Agent.GetOption(OPT_BITMAP_MATCH_COUNT)
Parent topic: AgentClass Class
Related reference
AGENTOPTION Data Type
Agent Options


IsOptionValid Function

Class

AgentClass class.

Action

Tests whether or not the Agent recognizes the specified option.

Syntax

bTest = Agent.IsOptionValid(aoOptionName)
Variable | Description
bTest | TRUE if the Agent recognizes aoOptionName as a valid option. BOOLEAN.
aoOptionName | The name of the option to test for. AGENTOPTION.

IsOptionValid is useful when your Agent is older than the current release.

Example

[-] if(Agent.IsOptionValid(OPT_SHOW_INVIS_OBJS))
    [ ] Agent.SetOption("OPT_ SHOW_INVIS_OBJS", TRUE)
Parent topic: AgentClass Class


SetDllCallPrecedence Method (AgentClass)

Class

AgentClass.

Availability

This functionality is supported only if you are using the Open Agent.

Action

Sets whether the called DLL is a 32bit DLL or a 64bit DLL.

Syntax

Agent.SetDllCallPrecedence(registry)
Variable Description
registry The type of the DLL.
  • DCP_32BIT if the DLL is a 32bit DLL.
  • DCP_64BIT if the DLL is a 64bit DLL.
DLL_CALL_PRECEDENCE_TYPE.
Parent topic: AgentClass Class
Related concepts
Calling a DLL from within a 4Test Script
Related reference
GetDllCallPrecedence Function (AgentClass)
DLL_CALL_PRECEDENCE_TYPE Data Type


SetOption Method

Class

AgentClass class.

Action

Sets an Agent option to the specified value.

Syntax

aPrevious = Agent.SetOption (Option, aValue)
Variable | Description
aPrevious | The previous value of the option. The data type depends on the option. ANYTYPE.
Option | Any agent option as specified by one of the constants defined for the AGENTOPTION enumerated data type. For a list, see Agent options.
aValue | The value to which to set the specified option. The data type depends on the type expected by the option. ANYTYPE.

Notes

SetOption sets an agent option to the specified value. The value returned is the previous value of the option; the type of the return value varies depending on the option you specify.

The values you specify with SetOption override the values specified with the Agent Options dialog box. If you do not set an option with SetOption, the value specified in the Agent Options dialog box is the default.

Example

Agent.SetOption (OPT_MOUSE_DELAY, .5)
Parent topic: AgentClass Class
Related reference
Agent Options
AGENTOPTION Data Type


Shutdown Method (AgentClass)

Class

AgentClass.

Action

Call this method to ensure that the Open Agent stops after a test run, for example after a nightly test execution. You should only call this method at the end of a test execution, and not before all actions of the test are executed. If any actions would follow the Shutdown, the agent would be restarted.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Shutdown()

Example

The following example shows how you can use the TestPlanExit method in a test plan to close the agent:
    [-] TestCaseExit (BOOLEAN bException)
        [ ] Agent.Shutdown()
Parent topic: AgentClass Class


UnloadAllDlls Method (AgentClass)

Class

AgentClass.

Action

Unloads all DLLs from the Agent.

Syntax

Agent.UnloadAllDlls ()
Parent topic: AgentClass Class
Related reference
UnloadDll Method (AgentClass)


UnloadDll Method (AgentClass)

Class

AgentClass.

Action

Unloads the specified DLL from the Agent.

Syntax

bSuccessful = Agent.UnloadDll (sDllName)
Variable | Description
bSuccessful | True if the DLL was successfully unloaded, false if not. BOOLEAN.
sDllName | The name of the DLL file. STRING.

Notes

You can use UnloadDll only to unload normal DLLs, not mixed assemblies. To unload mixed assemblies, use UnloadAllDlls.

Parent topic: AgentClass Class
Related reference
UnloadAllDlls Method (AgentClass)


AnyWin Class

Description

AnyWin is the class for any window.

In Silk Test Classic the word window is used generally to refer to any object or widget in a GUI. Therefore, a pushbutton, scroll bar, and check box are all considered windows, as are dialogs, menus, and menu items.

Inheritance

AnyWin does not derive from any class; several classes derive from it.

Functions, Methods, and Properties

AnyWin has the following functions, methods, and properties:

  • CaptureBitmap Method
    Saves a bitmap image to a file and returns the absolute or relative path of the captured bitmap.
  • Click Method (AnyWin PushButton)
    Clicks either a window or a pushbutton.
  • DoubleClick Method
    Double-clicks a mouse button on the window.
  • DynamicInvoke Method (AnyWin)
    Dynamically invokes a method.
  • DynamicInvokeMethods Method (AnyWin)
    Dynamically invokes a sequence of nested methods starting at this window.
  • Exists Method
    Tests whether a window exists.
  • ExtendedClick Method
    Performs a click with one or more key modifiers.
  • ExtendedDoubleClick Method
    Performs a double-click with one or more key modifiers.
  • ExtendedPressMouse Method
    Presses the mouse with one or more key modifiers.
  • ExtendedReleaseMouse Method
    Releases the mouse with one or more key modifiers.
  • Find Method
    Finds an object specified by an XPath locator or an object map identifier.
  • FindAll Function
    Finds all objects specified by an XPath locator.
  • GenerateLocator Function
    Returns a list of locators for the control on which the method is called.
  • GetAgentType Function
    Returns the Silk Test agent type, Classic Agent or Open Agent, for the specified window declaration.
  • GetAppId Function
    Returns the identifier of the application displaying the window.
  • GetBitmapCRC Function
    Returns the CRC value of a bitmap captured from the screen.
  • GetCaption Function
    Returns the caption form of the tag for HTML objects, or the text associated with the object for non-HTML objects.
  • GetChildren Function
    Returns the names of the children of the window declaration for the Classic Agent or the handles of the children of the window in the UI for the Open Agent.
  • GetClass Function
    Returns the class of the window.
  • GetContents Function (AnyWin)
    Returns the contents of the window.
  • GetDynamicMethodList Function (AnyWin)
    Returns a list of methods (including their signature) that can be dynamically invoked on this object.
  • GetHandle Function
    Returns the internal handle of the window.
  • GetID Function
    Returns the identifier of the window.
  • GetIndex Function
    Returns the index of the window.
  • GetLocators Function
    Returns a list of locator strings for the window.
  • GetManyProperties Function
    Returns the values for a list of properties or returns all the properties for the specified window.
  • GetName Function
    Returns the name of the window declaration or XML object for the Classic Agent or the handle of the window in the UI for the Open Agent.
  • GetParent Function
    Returns the parent of the window.
  • GetProperty Function (AnyWin)
    Returns the value of a property of an object.
  • GetPropertyList Function (AnyWin)
    Returns the list of properties for an object.
  • GetRect Function (AnyWin)
    Returns the size and position of the window.
  • GetTag Function
    Returns the fully qualified tag for a window, where the tag is the one actually used to identify the window.
  • HighlightObject Method
    Highlights an object when a script is replayed.
  • IsActive Function
    Tests whether the window is the active window.
  • IsDefined Function
    Tests whether or not a specified definition exists.
  • IsEnabled Function
    Tests whether the window is enabled.
  • IsOfClass Function
    Tests whether an object is of the specified class.
  • IsVisible Function
    Tests whether an object is visible—that is, it has not been designated as a hidden object.
  • MoveMouse Method
    Moves the pointer to the specified location in the window.
  • MultiClick Method
    Generates multiple mouse clicks on the window.
  • OpenContextMenu Method
    Opens a context menu at the specified position.
  • OpenContextSelect Method
    Opens a context menu at the specified position and selects the specified menu item.
  • PressKeys Method
    Presses (but does not release) a set of keys or mouse buttons.
  • PressMouse Method
    Presses (but does not release) a mouse button in the window.
  • ReleaseKeys Method
    Releases a set of keys or mouse buttons.
  • ReleaseMouse Method
    Releases a mouse button in the window.
  • Resolve Function
    Finds an object using the locator in the window declaration.
  • ResolveAll Function
    Finds all objects specified by the locator or tag in the window declaration.
  • SetEnabled Method
    Enables or disables a control.
  • SetParentActive Method
    Sets the parent application active.
  • SetProperty Method
    Sets the value of a property of an object.
  • SetVisible Method
    Makes a control visible or invisible.
  • TextCapture Method (AnyWin)
    Returns the text in the client area of the window.
  • TextClick Method (AnyWin)
    Clicks on the specified text string within this window.
  • TextExists Method (AnyWin)
    Returns whether the specified text exists.
  • TextRectangle Method (AnyWin)
    Returns the object-relative rectangle of the specified text or an empty rectangle if the specified text does not exist.
  • TypeKeys Method (AnyWin)
    Sends a set of keystrokes to the window when used with the Open Agent or a set of keystrokes or mouse button presses to the window when used with the Classic Agent.
  • TypePasswordKeys Method
    Sends an encrypted password to a control.
  • VerifyActive Method
    Verifies that the window is active.
  • VerifyBitmap Method
    Verifies that the screen image matches a saved bitmap of the image.
  • VerifyEnabled Method
    Verifies that a window is enabled or disabled.
  • VerifyProperties Method
    Verifies that the properties of the specified window and its child windows are as expected.
  • VerifyText Method (AnyWin)
    The VerifyText method for the AnyWin class is obsolete.
  • WaitBitmap Method
    Waits for a screen image to match a saved bitmap within a timeout interval, and returns the time it took for the bitmap to appear.
  • WaitForChildDisappearance Method
    Waits until the child object specified by the locator parameter no longer exists or the timeout value is reached.
  • WaitForDisappearance Method
    Waits until an object no longer exists or the timeout value is reached.
  • WaitForObject Method
    Waits for an object that matches the specified XPath locator.
  • WaitForProperty Method
    Waits until the property specified by the propertyName parameter returns the value specified by the propertyValue parameter or until the timeout value is reached.
  • AppId Property
    The identification number of the application containing the window.
  • Background Property
    Reads the background color of a control.
  • bActive Property
    Whether the window is active.
  • bApiClick Property
    Whether Silk Test Classic issues API-based clicks or Agent-based clicks to improve the reliability of recorded and scripted clicks in HTML applications.
  • bEnabled Property
    Enables or disables a window or control.
  • bExists Property
    States whether or not a window exists.
  • Class Property
    The class of the window.
  • Foreground Property
    Reads the foreground color of a control.
  • hWnd Property
    The internal handle of a window.
  • iIndex Property
    The index of the window.
  • lwChildren Property
    The child windows of the window, not including window parts.
  • Rect Property
    The size and position of the window (relative to the parent window).
  • sCaption Property
    The caption (title) of the window.
  • sFont Property
    Reads or writes the font name of a control.
  • sID Property
    The GUI identifier of the window (used internally).
  • sName Property
    The 4Test identifier for the window (assigned in the declaration).
  • WndTag Property
    The window tag of a window.
  • wParent Property
    The parent of the window.
Parent topic: General Core Classes


CaptureBitmap Method

Class

AnyWin.

Action

Saves a bitmap image to a file and returns the absolute or relative path of the captured bitmap.

Syntax

sBitmapDir = window.CaptureBitmap (sBitmapFile[, Rect])
Variable | Description
sBitmapDir | The relative or absolute path for the bitmap file location. If you use the default bitmap location when you capture a bitmap (you did not specify a file location), the bitmap is saved in the working directory for the Agent on the machine that runs the Agent. In this case, you do not need to specify the file path, just the filename when you verify the bitmap. If you use a relative path or absolute path when you capture the bitmap, you must specify the full path for the bitmap to verify it. STRING. Returns the absolute or relative path of the captured bitmap.
sBitmapFile | The name of the file to save the bitmap to. STRING. Append .png to the filename to save the bitmap as a PNG. Returns the filename.
Rect | Optional: The coordinates for the capture region, relative to the window. If you omit Rect, CaptureBitmap captures the entire window. RECT.

Notes

CaptureBitmap captures the contents (and any color table information) of the window as a 32-bit bitmap, without an alpha channel, and saves it in the file sBitmapFile. The bitmap is saved in the working directory of the Silk Test agent on the machine that runs the agent. Silk Test Classic then waits the time interval specified with the OPT_BITMAP_MATCH_INTERVAL option, and then recaptures the window, comparing the result against the first capture to ensure that the image is stable.

You set the number of consecutive bitmaps that must match with the OPT_BITMAP_MATCH_COUNT option. If the image is not stable after the time specified with the OPT_BITMAP_MATCH_TIMEOUT option, Silk Test Classic raises the exception E_BITMAP_NOT_STABLE. You set these options with the SetOption method.

If you use CaptureBitmap with the SYS_CompareBitmap method on the Open Agent, Silk Test Classic automatically switches to the Classic Agent when it runs the SYS_CompareBitmap method. Because multiple calls are performed, you might notice a slight change in performance.

Platform Differences

The bitmap’s format is standard for the system on which you are running Silk Test Classic, and the files are not portable to different platforms. On Windows, the bitmap is a device independent bitmap file. On VMS, the bitmap is a .xpm file.

You specify the coordinates to capture with the argument Rect, which is of the RECT data type. CaptureBitmap interprets the coordinate (0,0) as the top-left corner of the window’s frame. To capture a bitmap of a window’s client area only, specify window.ClientArea as the window to capture, if window is a MoveableWin. For other classes, such as a Control or Menu, just provide the window specifier.

A blinking insertion point can cause the exception E_BITMAP_NOT_STABLE. If this situation occurs, pre-select a range of text to eliminate the insertion point.

Instead of manually capturing baseline bitmaps for your test cases, you can use CaptureBitmap in an automated process to capture baseline bitmaps. When your test case finds an error, you might want to capture a bitmap of the erroneous screen image for subsequent visual analysis or to present to a developer as visual evidence of the error.

Example

[-] testcase capturebitmap_example ()
    [ ] TextEditor.Help.About.Pick ()
    [ ] About.CaptureBitmap ("window.bmp")
    [ ] SYS_CompareBitmap ("window.bmp","refwin.bmp")
Note: The CaptureBitmap and SYS_CompareBitmap calls can be collapsed into the following VerifyBitmap call:
About.VerifyBitmap ("refwin.bmp")
Parent topic: AnyWin Class


Click Method (AnyWin PushButton)

Class

AnyWin and PushButton.

Action

Clicks either a window or a pushbutton.

Syntax

anyWin.Click ([iButton, iXpos, iYpos, bRawEvent])
Variable | Description
iButton

Optional: The mouse button to press. On a Windows operating system, use 1 for left, 2 for right, and 3 for center. INTEGER.

You can also use the following mouse button identifiers:
  • MB_LEFT
  • MB_RIGHT
  • MB_MIDDLE
iXpos | Optional: The horizontal coordinate (relative to the window) at which to click. If you specify iXpos, you must also specify iYpos. When you are working with the Classic Agent, the default coordinate is 0 for a window and the button center for a pushbutton. When you are working with the Open Agent, the default coordinate is the center of the window or the pushbutton. INTEGER.
iYpos | Optional: The vertical coordinate (relative to the window) at which to click. When you are working with the Classic Agent, the default coordinate is 0 for a window, or the button center for a pushbutton. When you are working with the Open Agent, the default coordinate is the center of the window or the pushbutton. INTEGER.
bRawEvent | 32-bit Windows only. Optional: Used to specify playback method. The Open Agent ignores this value regardless of what is specified in the script. BOOLEAN.

Notes

Click moves the mouse to the window or pushbutton and clicks the specified mouse button. The mouse is moved to the coordinates specified by iXpos and iYpos before performing the click. These coordinates are relative to the client area of the window or pushbutton (that is, the window’s internal area, excluding any caption, menubar, or border).

When you are working with the Classic Agent, and you do not specify coordinates, the click occurs in the upper-left corner (0, 0) of the client area of the window or in the center of the pushbutton.

When you are working with the Open Agent, and you do not specify coordinates, the click occurs in the center of the client area of the window or in the center of the pushbutton.

By default, Silk Test Classic verifies that the coordinates fall within the current window and generates the exception E_COORD_OUTSIDE_WINDOW if they do not. You can override this default by setting the OPT_VERIFY_COORD option to FALSE with the SetOption method.

Click cannot be used with a Menu or MenuItem.

Setting Focus on a Text Field in a Table

When using the Click method on a text field in a table you must use the coordinates 1,1—that is, specify Click(MB_LEFT,1,1)—in order to properly click within the text field and give it focus. As an alternative, you can use the SetFocus method on the text field to give it the input focus.

Example

// Restore Program Manager
ProgramManager.Restore ()
// Click on icon in top-left corner of Main group
ProgramManager.Main.Click (MB_LEFT, 35, 20)
Parent topic: AnyWin Class
Parent topic: PushButton Class


DoubleClick Method

Class

AnyWin class.

Action

Double-clicks a mouse button on the window.

Syntax

window.DoubleClick ([iButton, iXpos, iYpos, bRawEvent])
Variable | Description
iButton Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center. INTEGER.
You can also use the following mouse button identifiers:
  • MB_LEFT
  • MB_RIGHT
  • MB_MIDDLE
iXpos | Optional: The horizontal coordinate (relative to the window) to click. If you specify iXpos, you must also specify iYpos. The default is 0. When you are working with the Classic Agent, the default coordinate is 0 for a window and the button center for a pushbutton. When you are working with the Open Agent, the default coordinate is the center of the window or the pushbutton. INTEGER.
iYpos | Optional: The vertical coordinate (relative to the window) to click. The default is 0. When you are working with the Classic Agent, the default coordinate is 0 for a window, or the button center for a pushbutton. When you are working with the Open Agent, the default coordinate is the center of the window or the pushbutton. INTEGER.
bRawEvent | 32-bit Windows only. Optional. Used to specify playback method. The Open Agent ignores this value regardless of what is specified in the script. BOOLEAN.

Notes

DoubleClick moves the mouse to the window and double-clicks the specified mouse button. DoubleClick moves the mouse to the coordinates specified by iXpos and iYpos before performing the double-click. These coordinates are relative to the client area of the window (that is, the window's internal area, excluding its caption, menu bar, and border). If you do not specify coordinates, the double-click occurs in the upper-left corner (0, 0) of the client area of the window.

When you are working with the Classic Agent, and you do not specify coordinates, the doubleclick occurs in the upper-left corner (0, 0) of the client area of the window or in the center of the pushbutton.

When you are working with the Open Agent, and you do not specify coordinates, the doubleclick occurs in the center of the client area of the window or in the center of the pushbutton.

By default, Silk Test Classic verifies that the coordinates fall within the current window and generates the exception E_COORD_OUTSIDE_WINDOW if they do not. You can override this default by setting the OPT_VERIFY_COORD option to FALSE with the SetOption method.

Example

 // Open the File Open dialog

TextEditor.File.Open.Pick ()
// Double-click root directory in Directories list box
//(works even if list box is a custom list box)
Open.Directories.DoubleClick (1, 10, 10)
Parent topic: AnyWin Class


DynamicInvoke Method (AnyWin)

Class

AnyWin class.

Action

Dynamically invokes a method. This method is implemented for all technology domains that support dynamic invoke.

DynamicInvoke can dynamically invoke all public methods that 4Test defines for the test object. For test objects in a Windows Forms application or a WPF application, DynamicInvoke can additionally invoke public static methods that the MSDN defines and user-defined public static methods of any type.

Syntax

result = anyWin.DynamicInvoke(methodName, parameters)

Variable | Description
result | The result of the invoked method. Object.
methodName | The name of the method. String.
parameters | A list of arguments. List Of Object.
Parent topic: AnyWin Class
Related concepts
Dynamic Invoke
Related reference
DynamicInvokeMethods Method (AnyWin)


DynamicInvokeMethods Method (AnyWin)

Class

AnyWin class.

Action

Dynamically invokes a sequence of nested methods starting at this window. Each method call except the last one must have a return object. Each return object becomes the target for calling the next method in the list of method names with the next argument list in the list of parameters until the last method call. If the method names, argument lists, or returned objects do not match, a runtime error is generated.

This method is implemented for all technology domains that support dynamic invoke. For test objects in a Windows Forms application or a WPF application, DynamicInvokeMethods can additionally invoke a sequence of public static methods that the MSDN defines and user-defined public static methods of any type.

Syntax

result = anyWin.DynamicInvokeMethods(names, parameters)
Variable | Description
result | The result of the last method that was invoked. Object.
names | A list of method names in the order that they are to be called. List Of String.
parameters | A list of argument lists, to be matched with the method names. Trailing empty argument lists may be omitted. List Of List Of Object.
Parent topic: AnyWin Class
Related concepts
Dynamic Invoke
Related reference
DynamicInvoke Method (AnyWin)


Exists Method

Class

AnyWin class.

Action

Tests whether a window exists.

Syntax

bDoesExist = window.Exists ([nTimeout])
Variable | Description
bDoesExist | Whether the window exists. BOOLEAN.
nTimeout | Optional: The seconds for Silk Test Classic to wait for the window to exist (the default is 0). NUMBER.

Notes

  • Exists returns TRUE if the window exists before the nTimeout seconds elapse, or FALSE if the window does not exist. The window does not have to be active, enabled, or exposed for it to exist. If you specify nTimeout, Exists waits up to the specified number of seconds for the window to exist.

  • Exists does not raise an error if the window does not exist. To check whether or not a window exists and to raise an error if it does not, use Exists with the Verify function, as shown below:
    Verify (SaveMessage.Exists (5), TRUE)

  • Exists should always be part of another statement, so that the value returned by Exists is used.

  • If the window is not unique, Silk Test Classic raises the E_WINDOW_NOT_UNIQUE exception, unless the OPT_VERIFY_UNIQUE option is set to FALSE.

  • If you set the OPT_MENU_PICK_BEFORE_GET option to TRUE, you may see menus pop up on the screen when calling Exists on a menu item, even though your code does not explicitly call Pick.

Example

    [ ] TextEditor.File.New.Pick ()
    [-] if (SaveMessage.Exists (5))
        [ ] SaveMessage.Dismiss ()
Parent topic: AnyWin Class


ExtendedClick Method

Class

AnyWin class.

Action

Performs a click with one or more key modifiers.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

ExtendedClick (keyModifiers, iButton, x, y)
Variable | Description
keyModifiers | Defines which additional keys should be pressed while performing the click. MODIFIERKEYSTATE.
iButton | Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center. INTEGER.
x | Optional: The horizontal coordinate (relative to the window) at which to click. If you specify x, you must also specify y. The default is 0 for a window, or the button center for a pushbutton. INTEGER.
y | Optional: The vertical coordinate (relative to the window) at which to click. The default is 0 for a window, or the button center, for a pushbutton. INTEGER.

Example

The following example presses the "Ctrl" and the "Alt" key while performing a click.

MainWin.ExtendedClick(MOD_CTRL_ALT)
Parent topic: AnyWin Class


ExtendedDoubleClick Method

Class

AnyWin class.

Action

Performs a double-click with one or more key modifiers.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

ExtendedDoubleClick (keyModifiers, iButton, x, y)
Variable | Description
keyModifiers | Defines which additional keys should be pressed while performing the double-click. MODIFIERKEYSTATE.
iButton | Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center INTEGER.
x | Optional: The horizontal coordinate (relative to the window) at which to double-click. If you specify x, you must also specify y. The default is 0 for a window, or the button center for a pushbutton. INTEGER.
y | Optional: The vertical coordinate (relative to the window) at which to double-click. The default is 0 for a window, or the button center, for a pushbutton. INTEGER.

Notes

ExtendedDoubleClick moves the mouse to the window and double-clicks the specified mouse button. ExtendedDoubleClick moves the mouse to the coordinates specified by x and y before performing the double-click. These coordinates are relative to the client area of the window (that is, the window's internal area, excluding its caption, menu bar, and border). If you do not specify coordinates, the double-click occurs in the upper-left corner (0, 0) of the client area of the window.

Example

The following example presses the "Ctrl" and the "Alt" key while performing a double-click.

MainWin.ExtendedDoubleClick(MOD_CTRL_ALT)
Parent topic: AnyWin Class


ExtendedPressMouse Method

Class

AnyWin class.

Action

Presses the mouse with one or more key modifiers.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

ExtendedPressMouse (keyModifiers, iButton, x, y)
Variable | Description
keyModifiers | Defines which additional keys should be pressed while pressing the mouse. MODIFIERKEYSTATE.
iButton | Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center INTEGER.
x | Optional: The horizontal coordinate (relative to the window) at which to press the mouse. If you specify x, you must also specify y. The default is 0 for a window, or the button center for a pushbutton. INTEGER.
y | Optional: The vertical coordinate (relative to the window) at which to press the mouse. The default is 0 for a window, or the button center, for a pushbutton. INTEGER.

Notes

ExtendedPressMouse is a low-level method that most scripts do not have to call. In general, when interacting with an application, you use the ExtendedClick function to click the mouse, or a method designed to perform the action desired, such as Pick to pick a menu item.

ExtendedPressMouse moves the mouse to the object and presses the specified mouse button (if it is not already pressed). The mouse is moved to the x and y coordinates before pressing. These coordinates are relative to the client area of the window (that is, the window's internal area, excluding its caption, menu bar, and border). If you do not specify coordinates, the press occurs in the upper left corner (0, 0) of the client area of the window.

ExtendedPressMouse does not actually generate mouse events when called. Instead, the events are queued until all keyboard and mouse events have been released. Events are not released until the call to ExtendedReleaseMouse.

You can call the AgentClass method FlushEvents if you want to do anything between pressing and releasing the mouse. Explicitly flushing events with FlushEvents is necessary if you want the mouse presses to happen now.

Parent topic: AnyWin Class


ExtendedReleaseMouse Method

Class

AnyWin class.

Action

Releases the mouse with one or more key modifiers.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

ExtendedReleaseMouse (keyModifiers, iButton, x, y)
Variable | Description
keyModifiers | Defines which additional keys should be pressed while releasing the mouse. MODIFIERKEYSTATE.
iButton | Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center. INTEGER.
x | Optional: The horizontal coordinate (relative to the window) at which to release the mouse. If you specify x, you must also specify y. The default is 0 for a window, or the button center for a pushbutton. INTEGER.
y | Optional: The vertical coordinate (relative to the window) at which to release the mouse. The default is 0 for a window, or the button center, for a pushbutton. INTEGER.

Notes

ExtendedReleaseMouse moves the mouse to the windowand releases the specified mouse button (if it is not already released).

ExtendedReleaseMouse is a low-level method that most scripts do not have to call. In general, when interacting with an application, you use the ExtendedClick method to click the mouse, or a method designed to perform the action desired, such as Pick to pick a menu item.

The mouse is moved to the coordinates specified by x and y before performing the release. These coordinates are relative to the client area of the window (that is, the window's internal area, excluding its caption, menu bar, and border). If you do not specify the coordinates of the release point, the release occurs in the upper left corner (0, 0) of the client area of the window.

To specify to ignore coordinates outside of the window, set the OPT_VERIFY_COORD option, using the SetOption method or the Verify that Coordinates Passed to a Method Are Inside the Window option on the Verification panel of the Agent Options dialog box.

Parent topic: AnyWin Class


Find Method

Class

AnyWin class.

Action

Finds an object specified by an XPath locator.

Availability

This function is supported only in scripts that use the Open Agent and dynamic object recognition.

Syntax

window.Find(locator [, options])
Variable | Description
locator | The XPath locator or object map identifier. Defines which object to find. STRING.
options | Optional: Specifies options for the Find operation. Use to override the default timeout value or to specify whether a E_WINDOW_NOT_FOUND exception is thrown if no object is found (default) or if NULL is returned if no object is found. FINDOPTIONS.

Notes

Returns the first object that matches the locator. As long as no object matches the locator, the agent tries to find an object until the default timeout, which is specified by the option OPT_WINDOW_TIMEOUT, expires. If no object is found an E_WINDOW_NOT_FOUND exception is thrown. In the UI, you can set the OPT_WINDOW_TIMEOUT option in the Timing tab of the Agent Options dialog box. The option is called Window timeout (seconds). The default value for the option is 5 seconds.

An E_INVALID_XPATH exception is thrown if the XPath locator is syntactically incorrect. You can record the XPath query string if necessary.

The Find method returns a handle for each matching object, which is only valid as long as the object in the application exists. For example, a handle to a button in a dialog box is invalid once the dialog box is closed. Any attempts to execute functions on this handle after the dialog box closes will throw an E_WINDOW_INVALIDATED exception. Since it is a common practice to design test cases to be independent of each other and of order of execution, get new handles for the objects in each test case. In order not to duplicate the XPath query, helper functions can be created. For example:
[-] WINDOW getOkButton(WINDOW dialog)
    [ ] return dialog.find(".//PushButton[@caption = 'Ok']")
When using object maps, the corresponding object map identifier is ok, and the previous code samples look like the following:
[-] WINDOW getOkButton(WINDOW dialog)
    [ ] return dialog.Find("Ok")

Example 1

WINDOW informationDialog = Desktop.Find("//Dialog[@caption=’Information’]")
WINDOW okButton = informationDialog.Find("//PushButton[@caption='ok']")
okButton.Click()
When using object maps, the corresponding object map identifiers are Information and ok, and the previous code samples look like the following:
WINDOW informationDialog = Desktop.Find("Information")
WINDOW okButton = informationDialog.Find("ok")
okButton.Click()

Example 2

To find the dialog Information with a timeout of three seconds, and to return NULL if the dialog is not found, instead of throwing an E_WINDOW_NOT_FOUND exception, you can use code that is similar to the following:
WINDOW informationDialog = Desktop.Find("//Dialog[@caption=’Information’]", {3,FALSE})
When using object maps, if the corresponding object map identifier is Information, the previous code samples look like the following:
WINDOW informationDialog = Desktop.Find("Information", {3,FALSE})
Parent topic: AnyWin Class
Related reference
Timing Tab
FINDOPTIONS Data Type


FindAll Function

Class

AnyWin class.

Action

Finds all objects specified by an XPath locator.

Availability

This function is supported only in scripts that use the Open Agent and dynamic object recognition.

Syntax

window.FindAll(locator [, options])
Variable | Description
locator | The XPath locator. Defines which objects to find. STRING.
options | Optional: Specifies options for the FindAll operation. Use to override the default timeout value or to specify whether a E_WINDOW_NOT_FOUND exception is thrown if no object is found (default) or if NULL is returned if no object is found. FINDOPTIONS.

Notes

Returns all objects that match the locator. As long as no object matches the locator, the agent tries to find an object until the default timeout, specified by the option OPT_WINDOW_TIMEOUT, expires.

An E_INVALID_XPATH exception is thrown if the XPath locator is syntactically incorrect. You can record the XPath query string if necessary.

The FindAll function returns a handle for each matching object, which is only valid as long as the object in the application exists. For example, a handle to a button in a dialog box is invalid once the dialog box is closed. Any attempts to execute functions on this handle after the dialog box closes will throw an E_WINDOW_INVALIDATED exception. Since it is a common practice to design test cases to be independent of each other and of order of execution, get new handles for the objects in each test case. In order not to duplicate the XPath query, helper functions can be created.

Example

LIST OF WINDOW textFields = myWindow.FindAll(".//TextField”)
Parent topic: AnyWin Class
Related reference
Timing Tab


GenerateLocator Function

Class

AnyWin class.

Action

Returns a list of locators for the control on which the method is called.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

lsLocators = window.GenerateLocator()
Variable | Description
lsLocators | The list of locators. LIST OF STRING.
Parent topic: AnyWin Class


GetAgentType Function

Class

AnyWin.

Action

Returns the Silk Test agent type, Classic Agent or Open Agent, for the specified window declaration.

Syntax

sAgentType = window.GetAgentType()
Variable | Description
sAgentType | The type of agent, Classic_Agent or Open_Agent, that the window declaration uses. STRING.

Notes

Silk Test Classic determines which Silk Test agent to use by detecting whether a locator or Find or FindAll command is used. If no locator or Find or FindAll command is present, Silk Test Classic uses the Classic Agent.

In earlier releases, the TAG_IS_OPEN_AGENT tag was defined on the root window declaration of a control hierarchy to identify that the Open Agent should be used. This is no longer necessary. When Silk Test Classic detects a locator on the top-most window or detects a Find or FindAll command, the Open Agent is automatically used.

Example

In the following script, the Notepad application (notepad.exe) has been set up to use the Open Agent and extensions have been enabled.

[-] testcase TestGetAgentType()
    [ ] // OPEN_AGENT, CLASSIC_AGENT are constants defined in 4test.inc
    [ ] Verify(NotepadOA.GetAgentType(), OPEN_AGENT)
    [ ] Verify(NotepadCA.GetAgentType(), CLASSIC_AGENT)
Parent topic: AnyWin Class
Parent topic: Agent Information
Related reference
AnyWin Class


GetAppId Function

Class

AnyWin class.

Action

Returns the identifier of the application displaying the window.

Syntax

iID = window.GetAppId()
Variable | Description
iID | The application identifier. APPID.

Notes

GetAppID returns an APPID that is the integer identifier of the application that displays the window.

Example

INTEGER idNum = TextEditor.GetAppID()
Parent topic: AnyWin Class


GetBitmapCRC Function

Class

AnyWin class.

Action

Returns the CRC value of a bitmap captured from the screen.

Syntax

iCRC = window.GetBitmapCRC ([Rect, sMaskFile])
Variable | Description
iCRC | The CRC value of the bitmap. INTEGER.
Rect | Optional: The coordinates of the region to capture, relative to the window. If Rect is omitted, the entire window is captured. RECT.
sMaskFile | Optional: The name of the file that contains the mask for the bitmap. STRING.

Notes

GetBitmapCRC captures the contents of the window, performs a cyclic redundancy check on the resulting bitmap, and returns the CRC value. The CRC value is a 32-bit integer that is a reduction of the bitmap, which you can use for fast comparisons. The CRC value includes all of the bytes in the image, including the color table.

You can compare the value returned by GetBitmapCRC against the CRC value for a baseline bitmap, which you can obtain with SYS_GetBitmapCRC or a prior call to GetBitmapCRC, to see if two bitmaps are identical. This method is faster than comparing two bitmap images with SYS_CompareBitmap, and less memory consuming.

You specify the coordinates to capture with the argument Rect. Rect is a record of the RECT data type.

You can generate the file containing the mask with the Silk Test Bitmap Tool, or with any standard bitmap editing tool.

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap Tool that comes with Silk Test Classic, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, the bitmaps must have the same color depth.

GetBitmapCRC interprets the coordinates (0,0) as the top-left corner of the window’s frame. To capture a bitmap of a window’s client area only, specify window.ClientArea as the window to capture.

You can generate the file containing the mask with any standard bitmap editing tool.

After capturing the contents of the window, GetBitmapCRC waits the time interval specified with the OPT_BITMAP_MATCH_INTERVAL option, and then recaptures the window, comparing the result against the first capture to ensure that the image is stable. You set the number of times the comparisons are made with the OPT_BITMAP_MATCH_COUNT option. If the image is not stable after the time specified with the OPT_BITMAP_MATCH_TIMEOUT option, Silk Test Classic raises the exception E_BITMAP_NOT_STABLE.

The CRC values that GetBitmapCRC returns are not only GUI-specific, but device-specific as well. For example, the same application state displayed on VGA and Super VGA monitors will most likely result in different bitmap images, and therefore in different CRC values.

Example

Verify(SYS_GetBitmapCRC("base.bmp"), Foo.GetBitmapCRC())
Parent topic: AnyWin Class


GetCaption Function

Class

AnyWin class.

Action

  • For non-HTML objects, GetCaption returns the text (up to a maximum of 255 characters) associated with the object.
  • For HTML objects, GetCaption returns the caption form of the tag (up to a maximum of 255 characters). For more information, refer to the Silk Test Classic Agent Rules for Object Recognition document. To open the document, navigate to (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Documentation > Silk Test Classic or (in Microsoft Windows 10) Start > Silk.

Syntax

sCaption = object.GetCaption ([bRawMode, bNoStaticText])
Variable | Description
sCaption | The object's caption. STRING.
bRawMode

Optional: BOOLEAN.

  • If TRUE, GetCaption returns platform-specific information in the caption.
  • If FALSE (the default), platform-specific information is removed from the return value.

The Open Agent always uses FALSE for this value regardless of what is specified in the script. The returned strings include trailing and leading spaces but ellipses, accelerators, and hot keys are removed.

bNoStaticText

Optional: BOOLEAN.

  • If TRUE, GetCaption returns the object's caption if there is one or the empty string if the object does not have a caption.
  • If FALSE (the default), GetCaption returns the object's caption if there is one or the prior static text if the object does not have a caption.

The Open Agent always uses FALSE for this value regardless of what is specified in the script.

Note: This argument is not supported with Version 4.0 Agents.

Notes for Non-HTML Objects

If the application does not explicitly associate a label with the object, GetCaption returns the closest static text above or to the left of the object unless bNoStaticText is TRUE, in which case GetCaption returns the empty string. For example, the caption could be the title of a dialog box, the text on a pushbutton, or the static text closest to a text box. If there is no static text, the function returns an empty string ("").

When bRawMode is TRUE, the returned string includes any trailing and leading spaces, trailing ellipses, and embedded accelerator characters. These additional characters make the strings platform-specific. When bRawMode is FALSE, the output of GetCaption does not include any special characters.

Example

STRING sTitle
sTitle = PushButton.GetCaption()
Parent topic: AnyWin Class


GetChildren Function

Class

AnyWin.

Action

Returns the names of the children of the window declaration for the Classic Agent or the handles of the children of the window in the UI for the Open Agent.

Syntax

lwChildWins = window.GetChildren ([bInvisible, bNoTopLevel])
Variable | Description
lwChildWins
Classic Agent
The names of the children of the window declaration.
Open Agent
The handles of the children of the window in the UI.
LIST OF WINDOW.
bInvisible | Optional: If TRUE, also returns invisible windows. For the Classic Agent, this is set to FALSE by default. The Open Agent always uses FALSE for this value regardless of what is specified in the script. BOOLEAN.
bNoTopLevel | Optional:If TRUE, does not return windows of class MainWin, ChildWin, or BrowserChild. This is set to FALSE by default. The Open Agent always uses FALSE for this value regardless of what is specified in the script. BOOLEAN.

Notes

  • GetChildren() does not return body text objects. Body text objects are those that are not contained within an HTML tag.
  • GetChildren returns a list of windows that correspond to the children of the current window.
  • GetChildren includes only those windows that are open at the time of the call. Child windows that are not visible or are off the screen at the time of the call to GetChildren are not included in the list unless you set bInvisible to TRUE.
  • GetChildren does not return window parts.
  • The returned windows are the actual children at runtime, not the children declared in the declarations file. Windows that are declared are returned first, in the order in which they are declared.
  • For the Classic Agent, if a declaration exists for a window, Silk Test Classic returns the identifier of the window; if there is no declaration for the window, Silk Test Classic returns a dynamic instantiation of the window.
  • For the Open Agent, Silk Test Classic returns only the handle of the window.

Open Agent Example

To quickly detect any unwanted structural changes in your application under test (AUT), you can use Silk Test Classic to verify that your AUT correctly displays all included controls. This example describes how you can use the WindowChildren with the GetChildren function of the AnyWin class to compare the actual windows in your AUT with the expected windows. The following code defines a set of windows that are expected to be child windows of Notepad.
        [-] TextField TextField
            [ ] locator "//TextField"
        [-] MenuItem AboutNotepad
            [ ] locator "About Notepad"
        [-]  DialogBox AboutNotepadDialog // This window is only found if the About dialog box is open.
            [ ] locator "About Notepad"
            [-] PushButton OK
                [ ] locator "OK"
The sample script uses the WindowChildren function to retrieve the defined child windows of Notepad, and the GetChildren function to retrieve the actual windows of Notepad. Then the script compares the defined windows with the actual windows and returns the following three lists:
  • Windows that are expected and actually included in Notepad.
  • Windows that were unexpectedly added to Notepad.
  • Windows that are expected but missing from Notepad.
For your application under test, only the first list should include windows.

The entire script looks like the following:

[ ] const wDynamicMainWindow = UntitledNotepad
[ ]
[-] window MainWin UntitledNotepad
    [ ] locator "/MainWin[@caption='Untitled - Notepad']"
    [ ]
    [ ] // The working directory of the application when it is invoked
    [ ] const sDir = "C:\"
    [ ]
    [ ] // The command line used to invoke the application
    [ ] const sCmdLine = "C:\Windows\system32\notepad.exe"
    [ ]
    [ ] // The list of windows the recovery system is to leave open
    [ ] // const lwLeaveOpenWindows = {?}
    [ ] // const lsLeaveOpenLocators = {?}
    [-] TextField TextField
        [ ] locator "//TextField"
    [-] MenuItem AboutNotepad
        [ ] locator "About Notepad"
    [-]  DialogBox AboutNotepadDialog // this won't be found
        [ ] locator "About Notepad"
        [-] PushButton OK
            [ ] locator "OK"
[ ]
[ ]
[-] type WindowVerificationResult is record
    [ ] LIST OF WINDOW verifiedWindows
    [ ] LIST OF STRING newWindows
    [ ] LIST OF WINDOW missingWindows
[ ]
[ ]
[-] WindowVerificationResult VerifyWindowChildren(WINDOW windowToVerify)
    [ ] WindowVerificationResult result
    [ ] LIST OF WINDOW childrenDecls = WindowChildren(windowToVerify)
    [ ] LIST OF WINDOW resolved
    [ ] WINDOW w
    [ ] LIST OF WINDOW missingControls
    [-] for each w in childrenDecls
        [-] do
            [ ] ListAppend(resolved, w.resolve({0, true}))
            [ ] ListAppend(result.verifiedWindows, w)
        [-] except
            [ ] ListAppend(result.missingWindows, w)
    [ ]
    [ ] LIST OF WINDOW actualChildren = windowToVerify.GetChildren()
    [-] for each w in actualChildren
        [ ] INTEGER foundIndex = ListFind(resolved, w)
        [-] if(foundIndex == 0)
            [ ] LIST OF STRING locatorParts = w.GenerateLocator()
            [ ] STRING part
            [ ] STRING combinedLocator = ""
            [-] for each part in locatorParts
                [ ] combinedLocator += part
            [ ] ListAppend(result.newWindows, combinedLocator)
    [ ]
    [ ] return result
    [ ]
[ ]
[-] testcase VerifyNotepad()
    [ ] WindowVerificationResult result = VerifyWindowChildren(UntitledNotepad)
    [ ] Print("Verified Windows: {result.verifiedWindows}")
    [ ] Print("New Windows:      {result.newWindows}")
    [ ] Print("Missing Windows:  {result.missingWindows}")
When replayed, this script returns the following:
[ ] Script windowChildren.t - Passed
[ ] Machine: (local)
[ ] Started: 09:48:37AM on 15-Jul-2015
[ ] Elapsed: 0:00:08
[ ] Passed:  1 test (100%)
[ ] Failed:  0 tests (0%)
[ ] Totals:  1 test, 0 errors, 0 warnings
[ ]
[-] Testcase VerifyNotepad - Passed
    [ ] Verified Windows: {UntitledNotepad.TextField, UntitledNotepad.AboutNotepad}
    [ ] New Windows:      {/MainWin[@caption='Untitled - Notepad']//Menu[@caption='File'],
    [ ]  /MainWin[@caption='Untitled - Notepad']//Menu[@caption='Edit'],
    [ ]  /MainWin[@caption='Untitled - Notepad']//Menu[@caption='Format'],
    [ ]  /MainWin[@caption='Untitled - Notepad']//Menu[@caption='View'],
    [ ]  /MainWin[@caption='Untitled - Notepad']//Menu[@caption='Help']}
    [ ] Missing Windows:  {UntitledNotepad.AboutNotepadDialog}
This result shows that five windows are included in Notepad, which are not included in the expected set. For future testing, we should include these windows in the expected set. The result also shows that one window, which is included in the expected set, is not included in Notepad. This could have two reasons.
  1. Notepad should include this window, but wrongly does not. In this case, we have found an error in the AUT, and we need to take the appropriate actions.
  2. The window has been deliberately removed from the AUT by an application developer. In this case, we need remove the window from the expected window set.
Parent topic: AnyWin Class
Related reference
WindowChildren Function


GetClass Function

Class

AnyWin class.

Action

Returns the class of the window.

Syntax

dWinClass = window.GetClass()
Variable | Description
dWinClass | The class of the window. DATACLASS.

Notes

GetClass returns a DATACLASS that is the class of the window. The class can be either a built-in class, such as the DialogBox or PushButton class, or a user-defined class.

Backward Compatibility

In Release 1, GetClass returned a string containing the name of the platform-specific internal class of the window instead of the 4Test window class. Set the OPT_REL1_CLASS_LIBRARY option to TRUE to use the pre-Release 2 version of this method.

Example

WINDOW Wnd
DATACLASS Class
Wnd = TextEditor.GetActive()
Class = Wnd.GetClass()
Parent topic: AnyWin Class
Related reference
GetParentClass Function
GetBaseClass Function
GetSubClasses Function


GetContents Function (AnyWin)

Class

AnyWin class.

Action

Returns the contents of the window.

Syntax

lsContents = window.GetContents ([bRawMode])
Variable | Description
lsContents | The window contents. LIST OF STRING.
bRawMode | Optional:TRUE to leave platform-specific information in the strings, or FALSE (default) to remove that information. BOOLEAN.

Notes

GetContents returns text identifying each of the items in the window, preceding the text with the class of the item. Each item in the list corresponds to one window. For example, for the Find dialog box of the Text Editor, GetContents returns the following:

[StaticText]Find What:
[TextField]Find What:
[CheckBox]Case Sensitive
[StaticText]Direction
[PushButton]Find Next
[PushButton]Cancel
[RadioList]Direction

The contents of the list are not affected by any declarations you may have saved for the window.

For objects with no caption, GetContents returns either the prior static text string or an index number for the object.

When bRawMode is TRUE, the returned strings include trailing and leading spaces, ellipses, accelerators, and hot keys. These additional characters make the strings platform-specific. When bRawMode is FALSE, the output of GetContents does not include any special characters.

Example

LIST OF STRING lsItems
WINDOW w
TextEditor.Search.Find.Pick()
w = Desktop.GetActive()
lsItems = w.GetContents()
Parent topic: AnyWin Class


GetDynamicMethodList Function (AnyWin)

Class

AnyWin class.

Action

Returns a list of methods (including their signature) that can be dynamically invoked on this object. Use the GetDynamicMethodList method to determine which method can be dynamically invoked with the DynamicInvoke method.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

liDynamicMethodList = object.GetDynamicMethodList()

Variable | Description
liDynamicMethodList | All dynamic methods for this object. LIST OF STRING.
Parent topic: AnyWin Class


GetHandle Function

Class

AnyWin class.

Action

Returns the internal handle of the window.

Syntax

iHandle = window.GetHandle()
Variable | Description
iHandle | The window’s internal handle. INTEGER.

Example

use "msw32.inc"
int hWnd
hWnd = MyDialog.GetHandle()
SendMessage(hWnd, WM_USER + 10, 0, 0)
Parent topic: AnyWin Class


GetID Function

Class

AnyWin class.

Action

Returns the identifier of the window.

Syntax

sWinID = window.GetID()
Variable | Description
sWinID | The identifier of the window. STRING.

Notes

GetID returns the window’s GUI-specific internal identifier as a string.

For Windows, the ID of the main window is a string containing the full path of the EXE file that invoked it. For other windows, GetID returns a string containing an integer, the control ID.

For more information, refer to Silk Test Classic Agent Rules for Object Recognition. This document is located in (in Microsoft Windows 7) Start > Programs > Silk > Silk Test > Documentation > Silk Test Classic or (in Microsoft Windows 10) Start > Silk.

Example

STRING sWindowID = TextEditor.GetID()
Parent topic: AnyWin Class


GetIndex Function

Class

AnyWin class.

Action

Returns the index of the window.

Syntax

iWinIndex = window.GetIndex()
Variable | Description
iWinIndex | The index of the window. INTEGER.

Note

GetIndex returns the index number of the window, without the leading pound sign (#). The index of the window is equal to the number of similar windows that precede it in a set of windows, plus one.

Example

sIndex = TextEditor.Find.GetIndex()
Parent topic: AnyWin Class


GetLocators Function

Class

AnyWin class.

Action

Returns a list of locator strings for the window.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

lsLocators = GetLocators()
Variable | Description
lsLocators | The locator strings for the window. LIST OF STRING.

Notes

  • GetLocators returns complete locator strings even when shortened locators are specified in the window declaration.

  • Each entry in the list represents the locator of one hierarchy in the hierarchy of the window.

  • GetLocators is similar to the GetTag function, which returns the complete tag for a window.

Example

[-] window MainWin TestApplication
    [ ] locator "Test Application"
    [-] DialogBox CheckBox
        [-] locator "Check Box"
            [-] PushButton Exit
                [ ] locator "Exit"
[ ]
[ ] ListPrint(TestApplication.CheckBox.Exit.GetLocators())
[ ] //Window[@caption='Test Application']
[ ] //Dialog[@caption='Check Box']
[ ] //PushButton[@caption='Exit']
Parent topic: AnyWin Class


GetManyProperties Function

Class

AnyWin.

Action

Returns the values for a list of properties or returns all the properties for the specified window.

Syntax

lpPropInfo = window.GetManyProperties ([lsProperties])
Variable | Description
lpPropInfo | The property values returned for this window. LIST OF PROPINFO.
lsProperties | Optional: When specified, limits the values returned to those for the particular properties listed in lsProperties. LIST OF STRING.

Notes

Use GetManyProperties to get the current values for all the properties of the window object, or specify a subset of those properties in the lsProperties argument to get just those values. The available properties include all those inherited from parent classes.

Example

In the following example, the variable TextProps specifies several properties which are associated with the TextField FindWhat and its parents, Control and AnyWin. The values of the properties are returned in TextPropVals.

[-] LIST OF STRING TextProps {...}
    [ ] bEnabled
    [ ] bHasFocus
    [ ] sValue
[ ] LIST OF PROPINFO TextPropVals = TextEditor.Search.Find.FindWhat.GetManyProperties(TextProps)
4Test defines the PROPINFO data type as follows:
[-] type PROPINFO is record
    [ ] STRING sName // name of property
    [ ] ANYTYPE aValue // value of property
Parent topic: AnyWin Class


GetName Function

Class

AnyWin class, XmlNode class.

Action

Returns the name of the window declaration or XML object for the Classic Agent or the handle of the window in the UI for the Open Agent.

Syntax

sWinName = window.GetName()
Variable Description
sWinName
Classic Agent
The name of the window declaration or XML object.
Open Agent
The handle of the window in the UI.
STRING.

Notes

GetName returns the name or handle of the last window or object that is specified in a method call. For example, the name of the window with the path TextEditor.File.Open is Open. The name returned when you are using the Classic Agent is the one declared in the declarations file, not the actual name of the window at runtime.

Example

STRING sWinName
sWinName = MessageBox.GetName()
Parent topic: AnyWin Class


GetParent Function

Class

AnyWin class.

Action

Returns the parent of the window.

Syntax

wParentWin = window.GetParent()
Variable | Description
wParentWin | The parent of the window. WINDOW.

Example

The following code sample gets the parent window of a message box:
WINDOW wParent = MessageBox.GetParent()

To get the caption and the window class name of the parent window, you can use the following code:

STRING sParentCaption = wParent.GetProperty("caption").ToString()
STRING sParentClassName = wParent.GetProperty("windowClassName").ToString()

Notes

  • If you call this function on the DesktopWin class, Silk Test Classic raises an exception.
  • Backward compatibility: In previous releases, GetParent returned a window tag instead of an object-oriented identifier. Use the OPT_REL1_CLASS_LIBRARY option to specify use of the pre-Release 2 version of this method.
Parent topic: AnyWin Class


GetProperty Function (AnyWin)

Class

AnyWin.

Action

Returns the value for a given property of the test object.

Syntax

aValue = object.GetProperty (sName)
Variable | Description
aValue | The value of the sName property. ANYTYPE.
sName | The case-sensitive name of the property. To access a CSS style, set sName to currentStyle:<style name>. For example, to access the CSS style 'font-size', set sName to currentStyle:font-size.STRING.

Notes

An image link consists of an image and an associated anchor link. The target URL is the HREF attribute of the anchor link, not of the image itself. To get the URL, call GetLocation() for either the image or the anchor link, or call GetProperty("$Location") for the anchor link. To get the image file name, call GetFileName() or GetProperty("$Href") for the image.

Both the image and the anchor link have the same rectangle, so when you do Verify Properties and point at the image, you usually will verify the image rather than the anchor link.

If an object is defined by multiple HTML tags, then GetProperty() returns style properties based on the value of only the outermost tag's style elements. For example:

If your Html page contains | Silk Test Classic returns
<i><p>text<p><i> | $FontStyle=FS_ITALIC
but: <p><i>text<i><p> | $FontStyle=normal
<span style="font-style: italic"><p>text</p></span> | $FontStyle=FS_ITALIC
but: <p><span style="font-style: italic">text</span></p> | $FontStyle: normal

Silk Test Classic does not consider the <i> or <span> tags when they lie inside the <p> tag, only when they lie outside the paragraph tag.

GetProperty() and GetPropertyList() on ActiveX controls in a browser return the properties of the parent BrowserChild, rather than the ActiveX controls themselves.

Example

ANYTYPE aProp
// return the caption of the Open dialog
aProp = Open.GetProperty ("Caption")
Parent topic: AnyWin Class
Related reference
Foreground Property


GetPropertyList Function (AnyWin)

Class

AnyWin.

Action

Returns the list of properties for an object.

Syntax

lsNames = object.GetPropertyList()
Variable | Description
lsNames | The names of the properties. LIST OF STRING.

Example

LIST OF STRING lsPropertyNames
lsPropertyNames = MyOutLine.GetPropertyList()

Notes

GetPropertyList returns the names of all properties, both those containing individual values and those containing one-dimensional arrays.

GetProperty() and GetPropertyList() on ActiveX controls in a browser return the properties of the parent BrowserChild, rather than the ActiveX controls themselves.

Parent topic: AnyWin Class


GetRect Function (AnyWin)

Class

AnyWin class.

Action

Returns the size and position of the window.

Syntax

SizeRect = window.GetRect ([bGlobal])
Variable | Description
SizeRect | The size and position of the window. The size is the size of the whole window, not the client area. RECT.
bGlobal | Optional. TRUE to return global coordinates (relative to the entire screen), or FALSE (default) to return coordinates relative to the parent window only. BOOLEAN.

Notes

GetRect returns a record of the RECT data type, which contains the size and position of the window.

You can use GetRect to calculate coordinates for custom windows, such as icon bars. Scripts that calculate coordinates in this way will be more portable than scripts with hard-coded coordinates, because coordinates themselves are not portable.

To click on a location in a tool bar or icon bar, use coordinate syntax to specify where to click. For example, to select a tool from a pop-up tool bar with 2 columns and 12 rows, use a call like the following:
PopList.Select("(2:2,5:12)")

When used with the DesktopWin class, GetRect does not have the optional bGlobal argument. Coordinates for DesktopWin are always global.

GetRect cannot be used with a menu or menu-item.

Example

RECT WindowShape
WindowShape = Find.GetRect()
Parent topic: AnyWin Class


GetTag Function

Class

AnyWin.

Action

Returns the fully qualified tag for a window, where the tag is the one actually used to identify the window. If the window is not found, then GetTag returns an exception. If the window declaration, or the dynamically instantiated identifier, includes a multitag, GetTag returns only the portion of the multitag that first matched the window. Unlike the WindowTag function, GetTag executes on the agent machine.

Syntax

sTag = window.GetTag()
Variable | Description
sTag | The tag for window. STRING.

Example

[-] testcase GetTagTest()
    [ ] TextEditor.Search.Find.Pick()
    [ ] Print(Find.CaseSensitive.GetTag())
    [ ] Find.Cancel.Click()
    [ ]
    [ ] // Result:
    [ ] // /[MainWin]Text Editor/[DialogBox]Find/[CheckBox]Case sensitive
Parent topic: AnyWin Class


HighlightObject Method

Class

AnyWin class.

Action

Highlights an object when a script is replayed.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

object.HighlightObject([timeout, color])
Variable | Description
timeout | Optional: Number of seconds that Silk Test Classic highlights the object. If no value is specified, the object remains highlighted until a different object is highlighted. NUMBER.
color | Optional: Specifies the color to use for highlighting the object. If no color is specified, the default highlight color, green, is used. COLOR.

Notes

If no timeout value is specified, the object remains highlighted until a different object is highlighted.

Use the option OPT_REPLAY_HIGHLIGHT_TIME to specify that before each invoke command the object is highlighted. By default this value is set to 0, which means that objects are not highlighted by default.

Example

Desktop.HighlightObject(1.0, yellow)
Parent topic: AnyWin Class


IsActive Function

Class

AnyWin class.

Action

Tests whether the window is the active window.

Syntax

bActiveStatus = window.IsActive( )
Variable | Description
bActiveStatus | TRUE if the window is active. BOOLEAN.

Notes

  • IsActive returns TRUE if the window is the active window or is contained in the active window, or FALSE if it is not the active window. When a window is active, methods that affect the window, such as setting the text in a text box in that window, will work as expected.

  • To specify that Silk Test Classic should automatically verify that windows are active before interacting with them, set the OPT_VERIFY_ACTIVE option to TRUE, using the SetOption method.

  • The Open Agent supports the function AnyWin::IsActive for the MoveableWin class and its derived classes only. For instance, calling IsActive on a MainWin or MoveableWin is supported, but calling it on a PushButton raises an error.

Example

[-] if(!TextEditor.IsActive()
    [ ] TextEditor.SetActive()
Parent topic: AnyWin Class


IsDefined Function

Class

AnyWin class.

Action

Tests whether or not a specified definition exists.

Syntax

bDefined = window.IsDefined(sName, [Class, wdhDefinedHow])
Variable | Description
bDefined | TRUE if the definition exists. BOOLEAN.
sName | The name of the definition to look for. STRING.
wcClass | Optional: The window class of sName if it is defined by the window’s class. NULL if sName is defined by the window or not defined. out DATACLASS.
wdhDefinedHow | Optional: Specify DEFINED_METHOD to have IsDefined look for a method, DEFINED_NOT_METHOD to look for another type of definition, for example a property or member, or DEFINED_ANY to look for any definition. See WINDOWDEFINEDHOW Data Type.

Notes

IsDefined returns TRUE if the specified definition exists in the declaration for the window, or FALSE if it is not defined. IsDefined is useful when you want to check that a method that you would like to call explicitly is actually defined. At other times, you might want to pass sName, if it exists, as an argument to a function or method. Use a NULL argument to omit the first optional parameter.

Example

Print(TextEditor.IsDefined("File")) //prints TRUE for File menu
Print("Defined as Method: ", TestApp.IsDefined("Close", NULL, DEFINED_METHOD)) //prints Defined as Method: TRUE
Print("Not Defined as Method: ", TestApp.IsDefined("Close", NULL, DEFINED_NOT_METHOD)) //prints Not Defined as Method: FALSE
Print("Is It Defined: ", TestApp.IsDefined("Close", NULL, DEFINED_ANY)) //prints Is It Defined: TRUE
Parent topic: AnyWin Class
Related reference
WINDOWDEFINEDHOW Data Type


IsEnabled Function

Class

AnyWin class.

Action

Tests whether the window is enabled.

Syntax

bEnableStatus = window.IsEnabled()
Variable | Description
bEnableStatus | TRUE if the window is enabled. BOOLEAN.

Notes

IsEnabled returns TRUE if the window is enabled, or FALSE if it is disabled. When a window is enabled, it is capable of receiving input.

If the OPT_MENU_PICK_BEFORE_GET option is TRUE, you may see menus pop up on the screen when calling IsEnabled on a menu item, even though your code does not explicitly call Pick.

Example

Print(TextEditor.Document.IsEnabled())
Parent topic: AnyWin Class


IsOfClass Function

Class

  • AnyWin
  • AgentClass
  • ClipboardClass
  • CursorClass

Action

Tests whether an object is of the specified class.

Syntax

bTest = object.IsOfClass(dClass,[bExact])
Variable | Description
bTest | TRUE if the object is of the specified class. BOOLEAN.
dClass | The class to test for. DATACLASS.
bExact | Optional: If set to TRUE, IsOfClass returns TRUE when dClass is exactly the same as the object’s class. If set to FALSE or omitted, IsOfClass returns TRUE when dClass is either a parent of the object’s class or matches exactly.

Use IsOfClass to test whether a variable of type WINDOW holds a window of a particular class. In the example below, if the active window returned to wWin is of MessageBoxClass, IsOfClass will return TRUE. IsOfClass is the method equivalent of the function WindowIsOfClass.

Example

[ ] // in declarations
[-] window MessageBoxClass MessageBox
    [ ] tag "~ActiveApp/[DialogBox]$MessageBox"
    [ ] ...
[-] window DialogBox Find
    [ ] tag "Find"
    [ ] parent NotePad
    [ ] ...
[ ]
[ ] // in testcase script
[-] WINDOW wWin = NotePad.GetActive()
    [ ] ...
[ ] BOOLEAN bTest = wWin.IsOfClass(MessageBoxClass, TRUE)
Parent topic: AnyWin Class
Parent topic: CursorClass Class


IsVisible Function

Class

AnyWin. IsVisible() also applies to all HTML classes except for the following:
  • HtmlForm
  • HtmlCombobox
  • HtmlHidden
  • HtmlMarquee
  • HtmlMeta
  • HtmlRadioList

Action

Tests whether an object is visible—that is, it has not been designated as a hidden object.

Note: With the Open Agent you can only locate visible objects, so by default IsVisible always returns TRUE. However, you might need this function when an already located object in the application under test gets invisible during replay.

Syntax

bTest = window.IsVisible()
Variable | Description
bTest | TRUE if the object is visible, FALSE if it is hidden. BOOLEAN.
Parent topic: AnyWin Class


MoveMouse Method

Class

AnyWin class.

Action

Moves the pointer to the specified location in the window.

Syntax

window.MoveMouse ([iXpos, iYpos, bRawEvent])
Variable | Description
iXpos | Optional: The horizontal coordinate (relative to the current window) of the new location. You must also specify iYpos if you specify iXpos. The default is 0. INTEGER.
iYpos | Optional: The vertical coordinate (relative to the current window) of the new location. The default is 0. INTEGER.
bRawEvent | Optional: 32-bit Windows only. Used to specify playback method. The Open Agent ignores this value regardless of what is specified in the script. BOOLEAN.

Notes

MoveMouse is a low-level method that most scripts do not have to call. In general, when interacting with an application, you use the Click method to move and click the mouse, or a method designed to perform the action desired, such as Pick to pick a menu item.

You can use MoveMouse to test Web applications, Win32 applications, and Windows Forms applications that use mouse move events, but not to test child domains of the xBrowser technology domain, for example Apache Flex and Swing.

If coordinates are specified, the mouse pointer is moved to those coordinates relative to the client area of the window (that is, the window’s internal area, excluding its caption, menu bar, and border). If you do not specify the coordinates, the mouse pointer is moved to the top-left corner (0, 0) of the client area of the window.

MoveMouse() is not available for the Menu and MenuItem classes.

Example

DialogBox.DrawingArea.MoveMouse (10, 30)
Parent topic: AnyWin Class


MultiClick Method

Class

AnyWin class.

Action

Generates multiple mouse clicks on the window.

Syntax

window.MultiClick (iCount [,iButton,iXpos,iYpos,bRawEvent])
Variable | Description
iCount | The number of clicks to generate (1, 2, or 3). INTEGER.
iButton | Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center. INTEGER.
iXpos | Optional: The horizontal coordinate (relative to the window) at which to click. If not specified, the click will occur on the far left side of the window’s area (iXpos = 0). INTEGER.
iYpos | Optional: The vertical coordinate (relative to the window) at which to click. If not specified, the click will occur on the top of the window (iYpos = 0). Specify iYpos if you specify iXpos, otherwise omit it. INTEGER.
bRawEvent | 32-bit Windows only. Optional. Used to specify playback method. The Open Agent ignores this value regardless of what is specified in the script. BOOLEAN.

Notes

MultiClick performs iCount mouse clicks in the client area of the window (that is, the window’s internal area, excluding its caption, menu bar, and border). The click speed is automatically adjusted so that the application can recognize the click events, no matter what the mouse delay is set to.

If you do not specify iXpos and iYpos, the clicks occur in the top-left corner of the window’s client area (0,0).

By default, Silk Test Classic verifies that the coordinates fall within the window, and raises the exception E_COORD_OUTSIDE_WINDOW if they are not. You can override this default with the OPT_VERIFY_COORD option, which you set with SetOption.

Example

DialogBox.Elements.MultiClick (2, 1, 10, 30)
Parent topic: AnyWin Class


OpenContextMenu Method

Class

AnyWin class.

Action

Opens a context menu at the position specified by the parameters. If no parameter is defined, then a right-click at the center of the control is replayed. If only one parameter is specified, a right-click at the given horizontal position, and at the middle of the height of the control, is replayed.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

OpenContextMenu ([x, y])
Variable | Description
x | Optional: The horizontal coordinate to open the context menu relative to the control on which this function is called. INTEGER.
y | Optional: The vertical coordinate to open the context menu relative to the control on which this function is called. INTEGER.
Parent topic: AnyWin Class


OpenContextSelect Method

Class

AnyWin class.

Action

Opens a context menu at the specified position and selects the specified menu item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

OpenContextSelect (x, y, item)
Variable | Description
x | The horizontal coordinate to open the context menu relative to the control on which this function is called. INTEGER.
y | The vertical coordinate to open the context menu relative to the control on which this function is called. INTEGER.
item | The menu item to select, such as "Paste" or "#3". LISTITEM.

Notes

If the specified item cannot be found, Silk Test raises the exception E_WINDOW_NOT_FOUND.

This function will not find the correct menu item if the menu item is not a direct child of the control on which this function is called.

Example

OpenContextSelect( 5, 5, "Paste")
Parent topic: AnyWin Class


PressKeys Method

Class

AnyWin class.

Action

Presses (but does not release) a set of keys or mouse buttons.

Syntax

window.PressKeys (sKeys [, nDelay, ensureFocus])
Variable | Description
sKeys The keys to type or mouse buttons to press. To use mouse buttons, use <Button1>, <Button2>, or <Button3>. For the Classic Agent, more than one key is supported. For the Open Agent, only one key is supported. The first key is used and the remaining keys are ignored. For example:
MainWin.PressKeys("<Shift><Left>")
will only press the Shift key. To press both keys, specify:
MainWin.PressKeys("<Shift>")
MainWin.PressKeys("<Left >")
STRING.
nDelay | Optional: The delay, in seconds, between events. The Open Agent always uses 0 for this value regardless of what is specified in the script. NUMBER.
ensureFocus

Optional: Whether the agent brings the application to the foreground and then sets the keyboard focus to the control on which the method is executed. This is executed before the first key is pressed, which means it is not rechecked for each keystroke when you specify multiple keys to be pressed.

This variable is supported only in scripts that use the Open Agent.

By default, this variable is set to TRUE. BOOLEAN.

Notes

PressKeys is a low-level function that most scripts do not have to call. In general, when interacting with an application, you use the TypeKeys function to enter text.

PressKeys is not supported for native mobile applications.

Valid keystrokes for all browsers except Internet Explorer include:
  • <Alt> (left-side Alt key)
  • <Ctrl> (Left-side Ctrl key)
  • <Shift> (Left-side Shift key)

For all other applications, including web applications on Internet Explorer, see Key names for a list of valid key names.

If you specify nDelay, the value specified there temporarily overrides the global delay set with the OPT_KEYBOARD_DELAY option or set in the Agent Options dialog box.

A key can be followed by a counter, which defines how often the keys should be typed. The counter can be combined with the delay.

During the delay time, the screen is locked and interaction with the mouse and keyboard is no longer possible.

PressKeys does not actually generate keyboard events when called. Instead, the events are queued until all keyboard and mouse events have been released.

You can call the AgentClass method FlushEvents if you want to do anything between pressing and releasing the keys. Explicitly flushing events with FlushEvents is necessary if you want the key presses to happen now.

Windows

PressKeys first gives the current window the input focus.

Examples

Find.PressKeys ("<Enter>")
Find.ReleaseKeys ("<Enter>")

The following code will not generate events until the call to ReleaseKeys:

MainWin.PressKeys ("<Shift>")
MainWin.TypeKeys ("<Left>", 5)
MainWin.ReleaseKeys ("<Shift>") // events released

Because the Open Agent always uses the value 0 for the delay argument, the following code will yield the same results if replayed against the Open Agent:

MyAnyWin::PressKeys(“<Left>”)
MyAnyWin::PressKeys(“<Left>”, 0)
MyAnyWin::PressKeys(“<Left>”, 5)
Parent topic: AnyWin Class
Related reference
ReleaseKeys Method
TypeKeys Method (AnyWin)
Key Names


PressMouse Method

Class

AnyWin class.

Action

Presses (but does not release) a mouse button in the window.

Syntax

window.PressMouse ([iButton, iXpos, iYpos, bRawEvent])
Variable | Description
iButton | Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center. NUMBER.
iXpos | Optional: The horizontal coordinate (relative to the current window) at which to press the mouse. You must also specify iYpos if you specify iXpos. The default is 0. INTEGER.
iYpos | Optional: The vertical coordinate (relative to the current window) at which to press the mouse. The default is 0. INTEGER.
bRawEvent | 32-bit Windows only. Optional. Used to specify playback method. The Open Agent ignores this value regardless of what is specified in the script. BOOLEAN.

Notes

PressMouse is a low-level method that most scripts do not have to call. In general, when interacting with an application, you use the Click function to click the mouse, or a method designed to perform the action desired, such as Pick to pick a menu item.

PressMouse moves the mouse to the object and presses the specified mouse button (if it is not already pressed). The mouse is moved to the iXpos and iYpos coordinates before pressing. These coordinates are relative to the client area of the window (that is, the window’s internal area, excluding its caption, menu bar, and border). If you do not specify coordinates, the press occurs in the upper left corner (0, 0) of the client area of the window.

If the coordinates fall outside of the window, Silk Test Classic raises the exception E_COORD_OUTSIDE_WINDOW unless the OPT_VERIFY_COORD option is set to FALSE.

PressMouse does not actually generate mouse events when called. Instead, the events are queued until all keyboard and mouse events have been released. For example, the code shown below does not release events until the call to ReleaseMouse.

You can call the AgentClass method FlushEvents if you want to do anything between pressing and releasing the mouse. Explicitly flushing events with FlushEvents is necessary if you want the mouse presses to happen now.

Example

MainWin.PressMouse (1, 100, 100)
MainWin.MoveMouse (100, 101)
MainWin.MoveMouse (100, 102)
MainWin.ReleaseMouse (1, 100, 103)// events released
Parent topic: AnyWin Class


ReleaseKeys Method

Class

AnyWin class.

Action

Releases a set of keys or mouse buttons.

Syntax

window.ReleaseKeys (sKeys [, nDelay])
Variable | Description
sKeys | The keys or mouse buttons to release. To refer to mouse buttons, use <Button1>, <Button2>, or <Button3> in the string. For the Classic Agent, more than one key is supported. For the Open Agent, only one key is supported. The first key is used and the remaining keys are ignored. STRING.
nDelay | Optional: The delay, in seconds, between events. The Open Agent always uses 0 for this value regardless of what is specified in the script. NUMBER.

Notes

ReleaseKeys is a low-level function that most scripts will not call. Instead, scripts generally use the TypeKeys function to enter text.

If you specify nDelay, the value specified there temporarily overrides the global delay set with the OPT_KEYBOARD_DELAY option or set by the Keyboard Event Delay option in the Agent Options dialog.

ReleaseKeys is not supported for native mobile applications.

Valid keystrokes for all browsers except Internet Explorer include:
  • <Alt> (left-side Alt key)
  • <Ctrl> (Left-side Ctrl key)
  • <Shift> (Left-side Shift key)

For all other applications, including web applications on Internet Explorer, see Key names for a list of valid key names.

Example

TextEditor.Document.PressKeys ("<Shift>")
TextEditor.Document.TypeKeys ("abc")
TextEditor.Document.ReleaseKeys ("<Shift>")
Parent topic: AnyWin Class
Related reference
PressKeys Method
TypeKeys Method (AnyWin)
Key Names


ReleaseMouse Method

Class

AnyWin class.

Action

Releases a mouse button in the window.

Syntax

window.ReleaseMouse ([iButton, iXpos, iYpos, bRawEvent])
Variable | Description
iButton | Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center. INTEGER.
iXpos | Optional: The horizontal coordinate (relative to the current window) at which to release the mouse. You must also specify iYpos if you specify iXpos. The default is 0. INTEGER.
iYpos | Optional: The vertical coordinate (relative to the current window) at which to release the mouse. The default is 0. INTEGER.
bRawEvent | Optional: 32-bit Windows only. Used to specify playback method. The Open Agent ignores this value regardless of what is specified in the script. BOOLEAN.

Notes

ReleaseMouse moves the mouse to the window and releases the specified mouse button (if it is not already released).

ReleaseMouse is a low-level method that most scripts do not have to call. In general, when interacting with an application, you use the Click method to click the mouse, or a method designed to perform the action desired, such as Pick to pick a menu item.

The mouse is moved to the coordinates specified by iXpos and iYpos before performing the release. These coordinates are relative to the client area of the window (that is, the window’s internal area, excluding its caption, menu bar, and border). If you do not specify the coordinates of the release point, the release occurs in the upper left corner (0, 0) of the client area of the window.

To specify to ignore coordinates outside of the window, set the OPT_VERIFY_COORD option, using the SetOption method or the Verify that Coordinates Passed to a Method Are Inside the Window option on the Verification panel of the Agent Options dialog.

Example

MainWin.PressMouse (1, 100, 100)
MainWin.MoveMouse (100, 101)
MainWin.MoveMouse (100, 102)
MainWin.ReleaseMouse (1, 100, 103)
Parent topic: AnyWin Class


Resolve Function

Class

AnyWin.

Action

Finds an object using the locator in the window declaration.

Availability

This function is supported only in scripts that use the Open Agent and dynamic object recognition.

Syntax

WINDOW result = window.Resolve ([options])
Variable | Description
options | Optional: Specifies options for the Resolve operation. Use to override the default timeout value or to specify whether an E_WINDOW_NOT_FOUND exception is thrown if no object is found (default) or if NULL is returned if no object is found.

Notes

  • Returns the first object that matches the locator. As long as no object matches the locator, the agent tries to find an object until the default timeout, which is specified by the option OPT_WINDOW_TIMEOUT, expires. If no object is found an E_WINDOW_NOT_FOUND exception is thrown.

  • The Resolve function returns a handle for the first matching object, which is only valid as long as the object in the application exists. For example, a handle to a button on a dialog is invalid once the dialog is closed. Any attempts to execute functions on this handle after the dialog closes will throw an E_WINDOW_INVALIDATED exception. Since it is a common practice to design test cases to be independent of each other and of the order of execution, get new handles for the objects in each test case.

  • Resolve is similar to the Find function. Resolve uses the locator from the window declaration rather than using an XPath locator as a parameter.

Example

[-] testcase ResolveExamples()
    [ ] WINDOW checkBoxMenu = TestApplication.Control.CheckBox.Resolve()
    [ ] checkBoxMenu.Pick()
    [ ] Verify(checkBoxMenu.GetCaption(), "Check box")
    [ ] TestApplication.Find("//DialogBox").Close()
    [ ]
    [ ]  // finds the first menuitem
    [ ]  WINDOW firstMenuItem = TestApplication.AllMenuItems.Resolve()
    [ ]  Verify(firstMenuItem.GetCaption(), "New")
Parent topic: AnyWin Class
Related concepts
Dynamic Object Recognition
Overview of the Locator Keyword


ResolveAll Function

Class

AnyWin.

Action

Finds all objects specified by the locator or tag in the window declaration.

Availability

This function is supported only in scripts that use the Open Agent and dynamic object recognition.

Syntax

LIST OF WINDOW result = window.ResolveAll ()

Notes

  • Returns all objects that match the locator or tag. As long as no object matches the locator or tag, the agent tries to find an object until the default timeout, which is specified by the option OPT_WINDOW_TIMEOUT, expires. If no object is found an E_WINDOW_NOT_FOUND exception is thrown.

  • The ResolveAll function returns a handle for each matching object, which is only valid as long as the object in the application exists. For example, a handle to a button on a dialog box is invalid once the dialog box is closed. Any attempts to execute functions on this handle after the dialog box closes will throw an E_WINDOW_INVALIDATED exception. Since it is a common practice to design test cases to be independent of each other and of the order of execution, get new handles for the objects in each test case.

  • ResolveAll is similar to the FindAll function. ResolveAll uses the locator or tag from the window declaration rather than using an XPath locator as a parameter.

Example

[-] testcase ResolveExamples()
    [ ] // finds all menuItems
    [ ] LIST OF WINDOW menuItems = TestApplication.AllMenuItems.ResolveAll()
    [ ] WINDOW menuItem
    [-] for each menuItem in menuItems
        [ ] Print("{menuItem.GetParent().GetCaption()} -> {menuItem.GetCaption()}")
Parent topic: AnyWin Class


SetEnabled Method

Class

AnyWin class.

Action

Enables or disables a control.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SetEnabled (enabled)
Variable | Description
enabled | If TRUE the control is enabled. If FALSE the control is disabled. BOOLEAN.
Parent topic: AnyWin Class


SetParentActive Method

Class

AnyWin class.

Action

Sets the parent application active.

Syntax

window.SetParentActive ( )

Notes

SetParentActive goes up the window hierarchy until it finds the application parented to the Desktop, and then makes that application active.

Parent topic: AnyWin Class


SetProperty Method

Class

AnyWin class.

Action

Sets the value of a property of an object.

Syntax

object.SetProperty (sName, aValue)
Variable | Description
sName | The name of the property to set. STRING.
aValue | The value to assign to the sName property. ANYTYPE.

Example

// set the current column to 4
MySpreadsheet.SetProperty ("Col", 4)
Parent topic: AnyWin Class
Related reference
SetBrowserType Function


SetVisible Method

Class

AnyWin class.

Action

Makes a control visible or invisible.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SetVisible (visible)
Variable | Description
visible | If TRUE the control is visible. If FALSE the control is invisible. BOOLEAN.
Parent topic: AnyWin Class


TextCapture Method (AnyWin)

Class

AnyWin class.

Action

Returns the text in the client area of the window.

The TextCapture() method captures text properly against applications that implement GDI+ or glyphs.

Capturing text in combo boxes may append the text character "6". This is because the drop-down arrow for a combo box is the Marlett font drop-down arrow text symbol, which is the number "6" for most other fonts.

Syntax

result = anyWin.TextCapture([captureRectangle])
Variable | Description
result | String.
captureRectangle | Optional: the defined rectangular region where the text will be captured, relative to the window's coordinates. Rectangle.

Examples

RECT captureRect = {0, 20, 300, 200}
print(TestApplication.TextCapture(captureRect))
print(TestApplication.TextCapture())
Parent topic: AnyWin Class
Related concepts
Text Recognition Support


TextClick Method (AnyWin)

Class

AnyWin class.

Action

Clicks on the specified text string within this object.

Syntax

        anyWin.TextClick(text, [occurrence, clickType, modifiers, position, exactMatch])

Variable | Description
text | The text string to be clicked. STRING.
occurrence | Optional: Which occurrence of the text should be clicked, if there are multiple results. The first occurrence is 1. Integer.
clickType | Optional: The desired mouse action. Default: left click. CLICKTYPE.
modifiers | Optional: The modifier keys (Alt, Shift, Ctrl) to press while clicking. Default: Don't use modifier keys. MODIFIERKEYSTATE.
position | Optional: The coordinates at which to click. The coordinates are relative to the upper-left corner of the text. If no coordinates are specified, or if NULL is specified, the click is performed on the center of the text. POINT.
exactMatch | Optional: If true the text must completely match the captured text, otherwise a partial match is allowed. BOOLEAN
Parent topic: AnyWin Class
Related concepts
Text Recognition Support
Related reference
CLICKTYPE Data Type
MODIFIERKEYSTATE Data Type


TextExists Method (AnyWin)

Class

AnyWin class.

Action

Returns whether the specified text exists.

Syntax

result = anyWin.TextExists(text, [occurrence, searchRectangle, timeout, exactMatch])
Variable | Description
result | Boolean.
text | The text to be searched. String.
occurrence | Optional: For which occurrence of the text the existence should be checked, if there are multiple results. The first occurrence is 1. Integer.
searchRectangle | Optional: The object-relative rectangle in which to search the text. RECT.
timeout | Optional: Specifies the timeout before which the rectangle should be found.
exactMatch | Optional: If true the text must completely match the captured text, otherwise a partial match is allowed.
Parent topic: AnyWin Class
Related concepts
Text Recognition Support


TextRectangle Method (AnyWin)

Class

AnyWin.

Action

Returns the object-relative rectangle of the specified text or an empty rectangle if the specified text does not exist.

Syntax

result = anyWin.TextRectangle(text, [occurrence, searchRectangle, timeout, exactMatch])

Variable | Description
result | RECT.
text | The text to be searched. String.
occurrence | Optional: For which occurrence of the text the existence should be checked, if there are multiple results. The first occurrence is 1. Integer.
searchRectangle | Optional: The object-relative rectangle in which to search the text. RECT.
timeout | Optional: Specifies the timeout before which the rectangle should be found.
exactMatch | Optional: If true the text must completely match the captured text, otherwise a partial match is allowed.
Parent topic: AnyWin Class
Related concepts
Text Recognition Support


TypeKeys Method (AnyWin)

Class

AnyWin.

Action

  • Classic Agent: Sends a set of keystrokes or mouse button presses to the window.
  • Open Agent: Sends a set of keystrokes to the window.

Syntax

window.TypeKeys (sEvents [, nDelay, ensureFocus])
Variable | Description
sEvents | The keystrokes to type or mouse buttons to press. Mouse buttons are supported on the Classic Agent only. To specify mouse buttons, use <Button1>, <Button2>, or <Button3> in the string. STRING.
nDelay | Optional: The delay between keystrokes (in seconds and fractions of seconds). NUMBER.
ensureFocus | Optional: Whether the agent brings the application to the foreground and then sets the keyboard focus to the control on which the method is executed. This is executed before the first key is typed, which means it is not rechecked for each keystroke when you specify multiple keys to be typed. This variable is supported only in scripts that use the Open Agent. By default, this variable is set to TRUE. BOOLEAN.

Notes

  • On Windows, TypeKeys first gives the window input focus before typing into it.
  • If you specify nDelay, that value overrides the value set with the OPT_KEYBOARD_DELAY option, which you set with SetOption.
  • Some keystrokes are not supported on mobile devices.
  • See Key Names for a list of key names.
  • A key can be followed by a counter, which defines how often the keys should be typed. The counter can be combined with the delay.
  • During the delay time, the screen is locked and interaction with the mouse and keyboard is no longer possible.
  • When recording with the DOM extension, TypeKeys ("<Tab>") will not be captured. Since the script refers to object to type in directly, it is not necessary to record this manual Tab. You can manually enter a TypeKeys ("<Tab>") into your script if you want to; it will just not be recorded.
  • When specifying groups of keys, such as Ctrl+Shift, the Classic Agent only supports minus signs (-) as a delimiter between key names while the Open Agent supports plus and minus signs.
  • If the TypeKeys method does not work as expected, you can try the SetText method.

Example

//shift-right will be executed 6 times
TextEditor.Document.TypeKeys ("<Shift-Right 6>")
//Shift-Right will be executed 6 times with a delay of 3 seconds before each execution
TextEditor.Document.TypeKeys ("<Shift-Right 6>", 3)
Parent topic: AnyWin Class
Related reference
PressKeys Method
ReleaseKeys Method
Key Names
Encrypt Function
TypePasswordKeys Method


TypePasswordKeys Method

Class

AnyWin.

Action

Sends an encrypted password to a control. TypePasswordKeys is supported for the following technology domains:
  • Win32: You can use the TypePasswordKeys method on password fields, which are text fields with the boolean property IsPassword set to "true".
  • Windows Forms: You can use the TypePasswordKeys method on password fields, which are text fields with the boolean property IsPassword set to "true".
  • Java SWT: You can use the TypePasswordKeys method on password fields, which are text fields with the boolean property IsPassword set to "true".
  • WPF: You can use the TypePasswordKeys method on controls of the type WPFPasswordBox.
  • Swing: You can use the TypePasswordKeys method on controls of the type JPasswordField and on AWTTextField controls that have the boolean property IsPassword set to "true".
  • xBrowser: You can use the TypePasswordKeys method on on controls of the type DomTextField that have the boolean property IsPassword set to "true".
  • SAP: You can use the TypePasswordKeys method on on controls of the type SAPTextField that have the boolean property IsPassword set to "true".

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

window.TypePasswordKeys (sEncrypted [, nDelay, ensureFocus])
Variable | Description
sEncrypted | The encrypted password. STRING.
nDelay | Optional: The delay between keystrokes (in seconds and fractions of seconds). NUMBER.
ensureFocus | Optional: Whether the agent brings the application to the foreground and then sets the keyboard focus to the control on which the method is executed. This is executed before the first key is typed, which means it is not rechecked for each keystroke when you specify multiple keys to be typed. By default, this variable is set to TRUE. BOOLEAN.

Notes

  • Calling TypePasswordKeys on an encrypted text has the same effect as calling the Encrypt method on the plain text and then calling the TypeKeys on the outcome.
  • When the password changes you can call the Encrypt method to encrypt the new password and then replace the encrypted text in the TypePasswordKeys statement.
  • On Windows, TypePasswordKeys first gives the window input focus before typing into it.
  • If you specify nDelay, that value overrides the value set with the OPT_KEYBOARD_DELAY option, which you set with SetOption.
  • A key can be followed by a counter, which defines how often the keys should be typed. The counter can be combined with the delay.
  • During the delay time, the screen is locked and interaction with the mouse and keyboard is no longer possible.
  • When recording with the DOM extension TypeKeys ("<Tab>") will not be captured. Since the script refers to object to type in directly, it is not necessary to record this manual Tab. You can manually enter a TypeKeys ("<Tab>") into your script if you want to; it just will not be recorded.
  • When specifying groups of keys, such as Ctrl-Shift, the Classic Agent only supports minus signs (-) as a delimiter between key names while the Open Agent supports plus and minus signs.

Example

The following code encrypts a string and prints it to the console:
STRING encryptedPassword = Encrypt("my password")
Print(encryptedPassword)
You can then copy the encrypted password from the console, in this case 6Fk+Bcm+GoXe3X0=, and use it as follows:
textField.TypePasswordKeys("6Fk+Bcm+GoXe3X0=")
Parent topic: AnyWin Class
Related reference
Encrypt Function
TypeKeys Method (AnyWin)


VerifyActive Method

Class

AnyWin class.

Action

Verifies that the window is active.

Syntax

window.VerifyActive([bActive][, nTimeout])
Variable | Description
bActive | Optional: TRUE (the default) verifies that the window is active. FALSE verifies that the window is inactive. BOOLEAN.
nTimeout | Optional: The number of seconds to wait for the window to become active or inactive, depending on the value of bActive. NUMBER.

Notes

VerifyActive verifies that the window is active. Calling this method is the same as calling the Verify function in the following manner:
Verify(window.IsActive(), expected_state)

VerifyActive raises the exception E_WINDOW_NOT_ACTIVE if the window is not active.

Some other methods will verify that the window they are operating on is active if active window verification is enabled (specified with the OPT_VERIFY_ACTIVE option, which you set with SetOption).

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyActive() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option (OPT_WINDOW_RETRY). If the verification fails, an exception is thrown.

Example

// choose the Find command
TextEditor.Search.Find.Pick()
// check whether the Find dialog box appears
Find.VerifyActive()
// close the Find dialog box
Find.Close()
Parent topic: AnyWin Class


VerifyBitmap Method

Class

AnyWin.

Action

Verifies that the screen image matches a saved bitmap of the image.

Syntax

window.VerifyBitmap(sBitmapFile[, Rect] [, sMaskFile])
Variable | Description
sBitmapFile | The name of the file to compare against the current state of the screen (typically a baseline). If you use the default bitmap location when you capture a bitmap (you did not specify a file location, only the name), the bitmap is saved in the working directory for the Agent on the machine that runs the Agent. In this case, you do not need to specify the file path, just the filename when you verify the bitmap. If you use a relative path or absolute path when you capture the bitmap, you must specify the full path for the bitmap to verify it. Append .png to the filename to save the bitmap as a PNG. STRING.
Rect | Optional: The area to capture, relative to the window. If you omit Rect, Silk Test Classic captures the entire window. RECT.
sMaskFile | Optional: The name of the file containing a mask for the comparison. STRING.

Notes

VerifyBitmap compares the specified window or screen region against the bitmap in sBitmapFile. Note that if you are doing distributed testing, sBitmapFile resides on the target machine, not on the host.

Before comparing the image on the screen against the bitmap in the file, VerifyBitmap attempts to get a stable copy of the bitmap. Silk Test Classic captures a stable copy by capturing the bitmap multiple times, waiting the interval specified with the OPT_BITMAP_MATCH_INTERVAL option between snapshots. You specify the number of images that must match for the bitmap to be considered stable with the OPT_BITMAP_MATCH_COUNT option. Silk Test Classic attempts to capture a stable bitmap up until the time limit set with the OPT_BITMAP_MATCH_TIMEOUT option. If the application does not generate a stable version of the bitmap, Silk Test Classic raises the exception E_BITMAP_NOT_STABLE.

If sBitmapFile and the current state of the specified window or screen region do not compare as equal, VerifyBitmap saves a representation of how they differ in sBitmapFile.rmp and raises the exception E_BITMAPS_DIFFERENT. You can specify a pixel tolerance below which differences between bitmaps are ignored, using the OPT_BITMAP_PIXEL_TOLERANCE option.

You specify the coordinates to capture with the argument Rect, which is a record of the RECT data type:

VerifyBitmap interprets the coordinates (0,0) as the top-left corner of the window’s frame. To capture a bitmap of a window’s client area only, specify window.ClientArea as the window to capture.

If the screen image and the saved bitmap file use different color tables, Silk Test Classic prints the warning E_BITMAPS_DIFF_COLORTABLE. If the screen image and the saved bitmap file have different dimensions, Silk Test Classic prints the warning E_BITMAPS_DIFF_SIZE. If the bitmaps are not exactly the same but their differences are below the allowable tolerance level (set with the OPT_BITMAP_PIXEL_TOLERANCE option), Silk Test Classic prints the warning E_BITMAPS_ALMOST_MATCH.

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap tool that comes with Silk Test Classic, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

To view, capture, and compare bitmaps, and to create monochrome mask files, use the Silk Test Bitmap Tool.

If VerifyBitmap returns an error, Silk Test Classic creates a link that opens the Silk Test Bitmap Tool to show the differences. However, if VerifyBitmap was called with a relative pathname, the Silk Test Bitmap Tool cannot open the file. Therefore, it is recommended that you use absolute paths with VerifyBitmap.

You must specify a value for the Rect argument if you specify the sMaskFile argument. If there is no actual value for Rect, specify the constant NULL.

Example

Elements.VerifyBitmap ("C:\Program Files\Silk\Silk Test\Projects\texteditor\bitmap.bmp")
Parent topic: AnyWin Class
Related tasks
Verifying Appearance Using a Bitmap


VerifyEnabled Method

Class

AnyWin class.

Action

Verifies that a window is enabled or disabled.

Syntax

window.VerifyEnabled([bEnabled][, nTimeout])
Variable | Description
bEnabled | Optional: TRUE (the default) verifies that the window is enabled. FALSE verifies that the window is disabled. BOOLEAN.
nTimeout | Optional: The number of seconds to wait for the window to become enabled or disabled, depending on the value of bEnabled. NUMBER.

Notes

VerifyEnabled verifies that the specified window is enabled, or verifies that it is disabled, and raises the exception E_VERIFY if it is not.

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyEnabled() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option (OPT_WINDOW_RETRY). If the verification fails, an exception is thrown.

Parent topic: AnyWin Class


VerifyProperties Method

Class

AnyWin class.

Action

Verifies that the properties of the specified window and its child windows are as expected.

Syntax

window.VerifyProperties(WinPropTree,[FuzzyVerifyWhich][, nTimeout])
Variable | Description
WinPropTree | The 4Test record that lists the expected values for window and window’s children. WINPROPTREE.
FuzzyVerifyWhich | Optional: Used with fuzzy verification. Default is FALSE. FUZZYVERIFY.
nTimeout | Optional: The number of seconds to wait for the expected value of the specified property or properties to be achieved. NUMBER.

Notes

A WINPROPTREE is a hierarchical data structure with the top level consisting of a window and its properties, plus a WINPROPTREE for each child of that window. See WINPROPTREE Data Type and PROPINFO Data Type for details. If you only want to verify a few properties, you can code the WinPropTree argument by hand. However, it is normally easier to let Silk Test Classic do the work. Record the action that you will be testing, then select a property set and initiate a verification operation; Silk Test Classic builds WinPropTree and codes the call to VerifyProperties.

Each time VerifyProperties is called, Silk Test Classic traverses the entire property tree, the WinPropTree argument to the function, and converts all the expected values using the defined date transformation rules. The transformed dates are used as the true expected values in the verifications.

If a timeout is specified with the nTimeout parameter, Silk Test Classic checks for the expected values until the timeout is reached. If the values are not found, a final verification is performed. If a timeout is not specified, only the final verification is performed. The time between checks is the value of the window retry interval Agent option, OPT_WINDOW_RETRY. If the verification fails, an exception is thrown.

Example

TextEditor.MessageBox.VerifyProperties(GoodPropTreeMB)
Parent topic: AnyWin Class
Related concepts
Verifying Object Properties


VerifyText Method (AnyWin)

The VerifyText method for the AnyWin class is obsolete. It has been replaced by the VerifyEverything method.

Parent topic: AnyWin Class


WaitBitmap Method

Class

AnyWin class.

Action

Waits for a screen image to match a saved bitmap within a timeout interval, and returns the time it took for the bitmap to appear.

Syntax

nSeconds = window.WaitBitmap (sBitmapFile, nTimeout [, Rect] [, sMaskFile])
Variable | Description
nSeconds | The seconds it took for the bitmap to appear. NUMBER.
sBitmapFile | The name of the file to compare against the current state of the screen. The filename can include a relative or absolute path. If you use the default bitmap location when you capture a bitmap (you did not specify a file location, only the name), the bitmap is saved in the working directory for the Agent on the machine that runs the Agent. In this case, you do not need to specify the file path, just the filename when you verify the bitmap. If you use a relative path or absolute path when you capture the bitmap, you must specify the full path for the bitmap to verify it. STRING.
nTimeout | The length of time in seconds (or fractions of seconds) for WaitBitmap to wait before raising an exception. NUMBER.
Rect | Optional: The area to capture, relative to the window. If Rect is omitted, Silk Test Classic captures the entire window. RECT.
sMaskFile | Optional: The name of the file containing the bitmap mask to apply to the comparison. STRING.

Notes

WaitBitmap compares the current window or screen region against the stored sBitmapFile during the time-out interval nTimeout. Calling WaitBitmap is equivalent to calling VerifyBitmap repeatedly until it succeeds or until nTimeout expires.

You specify a record of the RECT data type.

WaitBitmap returns the number of seconds that it took for the bitmap to appear and remain stable, as determined by the interval from the time the method was called to the time the first snapshot of a group of identical snapshots was taken. Snapshots are taken at the interval specified by the OPT_BITMAP_MATCH_INTERVAL option. The number of snapshots required to consider the bitmap stable is specified with the OPT_BITMAP_MATCH_COUNT option.

If the bitmap does not become stable within the timeout period, Silk Test Classic raises the exception E_BITMAP_NOT_STABLE.

If sBitmapFile and the current state of the window or screen region do not compare equal by the end of the time-out interval, WaitBitmap saves the two bitmaps in sBitmapFile.rmp and raises the exception E_BITMAPS_DIFFERENT. You can use the Silk Test Bitmap Tool to view the differences between them.

The number WaitBitmap returns, which tells you how long it took the image to stabilize, is a useful performance measurement. You can also use WaitBitmap instead of VerifyBitmap in instances where you need to synchronize the speed of a 4Test script with the speed of an application, for example, by waiting for the application to redraw a screen.

WaitBitmap interprets the coordinates (0,0) as the top-left corner of the window’s frame. To capture a bitmap of a window’s client area only, specify window.ClientArea as the window to capture.

If the screen image and the saved bitmap file use different color tables, Silk Test Classic prints the warning E_BITMAPS_DIFF_COLORTABLE. If the bitmaps are not exactly the same but their differences are below the allowable tolerance level (set with the OPT_BITMAP_PIXEL_TOLERANCE option), Silk Test Classic prints the warning E_BITMAPS_ALMOST_MATCH.

The Open Agent and Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap Tool that comes with Silk Test, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

To view, capture, and compare bitmaps, and to create monochrome mask files, use the Silk Test Bitmap Tool.

Windows

WaitBitmap can only monitor the screen if an application relinquishes control in a specific situation. Therefore, WaitBitmap is not useful for performance testing on Microsoft Windows in all situations. If WaitBitmap always seems to return zero, then it cannot run until the task you want to time has completed.

Example

Elements.WaitBitmap ("sbitfile.bmp", 20)
Parent topic: AnyWin Class


WaitForChildDisappearance Method

Class

AnyWin class.

Action

Waits until the child object specified by the locator parameter no longer exists or the timeout value is reached.

Availability

This method is supported only in scripts that use the Open Agent and dynamic object recognition.

Syntax

WaitForChildDisappearance (locator, [timeout])
Variable | Description
locator | The XPath locator. Defines which object to find. STRING.
timeout | Optional: Number of seconds that Silk Test Classic waits for the object to disappear. The agent waits for the object until the timeout value expires. NUMBER.

Notes

If the object does not disappear before the timeout occurs, an E_WINDOW_NOT_FOUND exception is thrown. The default timeout value is the value of the option OPT_WINDOW_TIMEOUT.

Example

Desktop.WaitForChildDisappearance(“.//Dialog[@caption=’Information’]”, 1.0)
Parent topic: AnyWin Class


WaitForDisappearance Method

Class

AnyWin class.

Action

Waits until an object no longer exists or the timeout value is reached.

Availability

This method is supported only in scripts that use the Open Agent and dynamic object recognition.

Syntax

WaitForDisappearance ([timeout])
Variable | Description
timeout | Optional: Number of seconds that Silk Test Classic waits for the object to disappear. The agent waits for the object until the timeout value expires. NUMBER.

Notes

If the object does not disappear before the timeout occurs, an E_WINDOW_NOT_FOUND exception is thrown. The default timeout value is the value of the option OPT_WINDOW_TIMEOUT.

Example

Desktop.WaitForDisappearance(1.0)
Parent topic: AnyWin Class


WaitForObject Method

Class

AnyWin class.

Action

Waits for an object that matches the specified XPath locator.

Availability

This method is supported only in scripts that use the Open Agent and dynamic object recognition.

Syntax

WaitForObject (locator, [timeout])
Variable | Description
locator | The XPath locator. Defines which object to find. STRING.
timeout | Optional: Number of seconds that Silk Test Classic waits for the XPath locator string to appear. If the initial Find operation does not locate an object, the agent tries to find an object until the timeout expires. NUMBER.

Notes

If no object is found before the timeout occurs, an E_WINDOW_NOT_FOUND exception is thrown. The default timeout value is the value of the option OPT_WINDOW_TIMEOUT.

An E_INVALID_XPATH exception is thrown if the XPath locator is syntactically incorrect. You can record the XPath query string if necessary.

Example

Desktop.WaitForObject(“.//Dialog[@caption=’Information’]”)
Parent topic: AnyWin Class


WaitForProperty Method

Class

AnyWin class.

Action

Waits until the property specified by the propertyName parameter returns the value specified by the propertyValue parameter or until the timeout value is reached.

Availability

This method is supported only in scripts that use the Open Agent and dynamic object recognition.

Syntax

WaitForProperty (propertyName, propertyValue, [timeout])
Variable | Description
propertyName | Defines which property to find. STRING.
propertyValue | Defines which value of the specified property to find. ANYTYPE.
timeout | Optional: Number of seconds that Silk Test Classic waits for the property to appear. The agent waits for the property value until the timeout value expires. NUMBER.

Notes

If the property value is not returned before the timeout occurs, an E_WINDOW_NOT_FOUND exception is thrown.

If you do not specify the timeout value, the default timeout value defined by the option OPT_WINDOW_TIMEOUT is used.

Example

Desktop.WaitForProperty("caption", "Desktop", 1.0)
Parent topic: AnyWin Class
Related concepts
Why Do I Get an Invalidated-Handle Error?


AppId Property

Class

AnyWin class.

Description

The identification number of the application containing the window.

Data Type

APPID.

Access

Read only.

Parent topic: AnyWin Class


Background Property

Class

AnyWin class.

Description

Reads the background color of a control.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

COLOR.

Access

Read only.

Parent topic: AnyWin Class


bActive Property

Class

AnyWin class.

Description

Whether the window is active.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: AnyWin Class


bApiClick Property

Class

AnyWin class.

Description

Whether Silk Test Classic issues API-based clicks or Agent-based clicks to improve the reliability of recorded and scripted clicks in HTML applications. An API click is generated internally by the browser, instead of by the Silk Test Classic Agent. API clicks are more reliable than Agent clicks, which can click the wrong location of an object.

Notes

This property is reserved for internal use only and should only be used with declared objects.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: AnyWin Class


bEnabled Property

Class

AnyWin class.

Description

Enables or disables a window or control.

Data Type

BOOLEAN.

Access

Read-only for the Classic Agent.

Read and write for the Open Agent.

Parent topic: AnyWin Class


bExists Property

Class

AnyWin class.

Description

States whether or not a window exists.

You can use this property in a script, for example, if myWindow.bExists, or it can be set on the Verify Window dialog box. Go to the Property tab and check the Exists check box.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: AnyWin Class


Class Property

Class

AnyWin class.

Description

The class of the window.

Data Type

DATACLASS.

Access

Read only.

Parent topic: AnyWin Class


Foreground Property

Class

AnyWin.

Description

Reads the foreground color of a control.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

COLOR.

Access

Read only.

Example

This example uses the GetProperty function to get the value of the foreground color.
Desktop.Find("//BrowserWindow//DIV[@textContents='Example Text']").GetProperty("currentStyle:color")
Parent topic: AnyWin Class
Related reference
GetProperty Function (AnyWin)


hWnd Property

Class

AnyWin class.

Description

The internal handle of a window.

Data Type

INTEGER.

Access

Read only.

Parent topic: AnyWin Class


iIndex Property

Class

AnyWin class.

Description

The index of the window.

Data Type

INTEGER.

Access

Read only.

Parent topic: AnyWin Class


lwChildren Property

Class

AnyWin class.

Description

The child windows of the window, not including window parts.

Data Type

LIST OF WINDOW.

Access

Read only.

Parent topic: AnyWin Class


Rect Property

Class

AnyWin class.

Description

The size and position of the window (relative to the parent window).

Data Type

RECT.

Access

Read only.

Parent topic: AnyWin Class


sCaption Property

Class

AnyWin class.

Description

The caption (title) of the window.

Data Type

STRING.

Access

Read only.

Parent topic: AnyWin Class


sFont Property

Class

AnyWin class.

Description

Reads or writes the font name of a control.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

STRING.

Access

Read only.

Parent topic: AnyWin Class


sID Property

Class

AnyWin class.

Description

The GUI identifier of the window (used internally).

Data Type

STRING.

Access

Read only.

Parent topic: AnyWin Class


sName Property

Class

AnyWin class, SwfToolStripMenuItem class, XmlNode class.

Description

The 4Test identifier for the window (assigned in the declaration).

Data Type

STRING.

Access

Read only.

Parent topic: AnyWin Class


WndTag Property

Class

AnyWin class.

Description

The window tag of a window.

Data Type

WNDTAG.

Access

Read only.

Parent topic: AnyWin Class
Parent topic: Core Data Types


wParent Property

Class

AnyWin class.

Description

The parent of the window.

Data Type

WINDOW.

Access

Read only.

Parent topic: AnyWin Class


CheckBox Class

Description

CheckBox is the class for check box controls.

Inheritance

CheckBox is derived from the Control class; no classes derive from this class.

Methods, Functions, and properties

In addition to the methods, functions, and properties it inherits from the AnyWin class and Control class, CheckBox has the following methods, functions, and properties:

  • Check Method (CheckBox MenuItem)
    Checks the check box or menu item.
  • GetState Function (CheckBox)
    Returns the state of the check box.
  • SetState Method (CheckBox)
    Sets the state of the check box.
  • SetUndecided Method
    Sets the undecided state for the check box.
  • Toggle Method (CheckBox)
    Toggles the state of the check box.
  • Uncheck Method (CheckBox MenuItem)
    Unchecks the check box or menu item.
  • VerifyValue Method (CheckBox Class)
    Verifies the state of the check box.
  • bChecked Property
    Whether the check box is checked or the menu item is selected.
  • bValue Property
    The state of the checkbox.
  • State Property (CheckBox CheckBoxToolItem RadioListToolItem)
    Reads or writes the state of a check box.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


Check Method (CheckBox MenuItem)

Class

CheckBox and MenuItem.

Action

Checks the check box or menu item.

Syntax

object.Check ( )

Notes

This method checks the check box or menu item, regardless of its current state.

Example

Find.CaseSensitive.Check()
Parent topic: CheckBox Class
Parent topic: MenuItem Class


GetState Function (CheckBox)

Class

CheckBox class.

Action

Returns the state of the check box.

Syntax

bState = checkbox.GetState()
Variable | Description
bState | The selection state of the check box. BOOLEAN.

Notes

The returned value is TRUE if the check box is selected or FALSE if it is not.

Example

BOOLEAN bIsChecked
bIsChecked = Find.CaseSensitive.GetState()
Print(bIsChecked)
Parent topic: CheckBox Class


SetState Method (CheckBox)

Class

CheckBox class.

Action

Sets the state of the check box.

Syntax

checkbox.SetState (bState)
Variable | Description
bState | TRUE to check the check box, FALSE to not check the check box. BOOLEAN.

Notes

SetState sets the selection state of the specified check box by generating a mouse click on the box if it is not already in the appropriate state.

After setting the state, Silk Test Classic checks to see that the state was actually reached, and raises the exception E_CONTROL_NOT_RESPONDING if it was not.

Example

Find.CaseSensitive.SetState (TRUE)
Parent topic: CheckBox Class


SetUndecided Method

Class

CheckBox class.

Action

Sets the undecided state for the check box.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SetUndecided ()

Example

DialogBox.TotalWeight.SetUndecided ()
Parent topic: CheckBox Class


Toggle Method (CheckBox)

Class

CheckBox class.

Action

Toggles the state of the check box.

Syntax

checkbox.Toggle ( )

Notes

Toggle toggles the selection state of the check box by generating a mouse click on the box, regardless of its present state.

After toggling the selection state, Silk Test Classic checks that the check box changed state, and raises the exception E_CONTROL_NOT_RESPONDING if it did not.

Example

Find.CaseSensitive.Toggle ()
Parent topic: CheckBox Class


Uncheck Method (CheckBox MenuItem)

Class

CheckBox and MenuItem.

Action

Unchecks the check box or menu item.

Syntax

object.Uncheck()

Notes

Uncheck unchecks the check box or menu item, regardless of its current state.

Example

Find.CaseSensitive.Uncheck()
Parent topic: CheckBox Class
Parent topic: MenuItem Class


VerifyValue Method (CheckBox Class)

Class

CheckBox class.

Action

Verifies the state of the check box.

Syntax

checkbox.VerifyValue(bExpected[, nTimeout])
Variable | Description
bExpected | TRUE to specify that the check box should be checked, or FALSE to specify that the check box should be unchecked. BOOLEAN.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

You use the VerifyValue method to check whether a check box has the expected selection state. If the check box does not have the expected selection state, Silk Test Classic raises the exception E_VERIFY.

Calling this method is the same as calling the Verify function in the following manner:
Verify (window.IsChecked (), expected_value)

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyValue() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option, OPT_WINDOW_RETRY. If the verification fails, an exception is thrown.

Example

Find.CaseSensitive.VerifyValue(TRUE)
Parent topic: CheckBox Class


bChecked Property

Class

CheckBox, MenuItem, and SwfToolStripButton.

Description

Whether the check box is checked or the menu item is selected.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: CheckBox Class
Parent topic: MenuItem Class


bValue Property

Class

CheckBox class.

Description

The state of the checkbox.

Data Type

BOOLEAN.

Access

Read and write.

Parent topic: CheckBox Class


State Property (CheckBox CheckBoxToolItem RadioListToolItem)

Class

CheckBox, CheckBoxToolItem, and RadioListToolItem.

Description

Reads or writes the state of a check box. Values include:
  • 1=checked
  • 2=unchecked
  • 3=undecided

The Open Agent supports the state "undecided". A check box is often undecided in its initial state. It is neither checked nor unchecked, but is light gray.

Data Type

INTEGER.

Access

Read and write.

Parent topic: CheckBox Class
Parent topic: CheckBoxToolItem Class
Parent topic: RadioListToolItem Class


CheckBoxToolItem Class

Description

CheckBoxToolItem is the class for a check box element in a toolbar control.

Availability

This class is supported only on the Open Agent, and only for the following technology domains:
  • Java SWT
  • Windows Forms
  • Win32

Inheritance

CheckBoxToolItem is derived from the ToolItem class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class, CheckBoxToolItem has the following methods and properties:

  • Select Method (CheckBoxToolItem DomCheckBox ToggleButton)
    Selects an item.
  • State Property (CheckBox CheckBoxToolItem RadioListToolItem)
    Reads or writes the state of a check box.
Parent topic: General Core Classes
Parent topic: Java SWT Classes for the Open Agent
Parent topic: Windows Forms Classes Used by the Open Agent
Parent topic: Win32 Classes


Select Method (CheckBoxToolItem DomCheckBox ToggleButton)

Class

CheckBoxToolItem, DomCheckBox, and ToggleButton.

Action

Selects an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Select(state)
Variable | Description
state | An INTEGER that represents the desired state. Valid values include: 1=checked, 2=unchecked, 3=undecided. INTEGER.
Parent topic: CheckBoxToolItem Class
Parent topic: ToggleButton Class
Parent topic: DomCheckBox Class


ClipboardClass Class

Description

ClipboardClass is the class for the clipboard. ClipboardClass has a predefined identifier, Clipboard. To call a method of the ClipboardClass, use this syntax:

Clipboard.method()

To refer to a property, use this syntax:

Clipboard.property

Inheritance

ClipboardClass does not derive from any class and no classes derive from it.

Methods and Properties

ClipboardClass has the following methods and properties:

  • GetText Function (ClipboardClass)
    Returns the text on the clipboard.
  • SetText Method (ClipboardClass)
    Replaces the text in the clipboard.
  • lsValue Property
    The text of the selected items.
Parent topic: General Core Classes


GetText Function (ClipboardClass)

Class

ClipboardClass class.

Action

Returns the text on the clipboard.

Syntax

lsText = Clipboard.GetText()
Variable | Description
lsText | The clipboard text. LIST OF STRING.

Notes

Each line of text on the clipboard is an item in the returned list. If the clipboard’s contents are graphical or are text that is not plain, which means the text cannot be interpreted as ASCII, GetText returns an empty list ({}).

X Window System

On X platforms, GetText returns the primary selection, which is the middle mouse-button paste. To enable GetText to return the clipboard selection, set the OPT_PRIMARY_SELECTION environment variable to FALSE.

Example

LIST OF STRING lsClipContents
lsClipContents = Clipboard.GetText()
Parent topic: ClipboardClass Class


SetText Method (ClipboardClass)

Class

ClipboardClass class.

Action

Replaces the text in the clipboard.

Syntax

Clipboard.SetText ([lsText])
Variable | Description
lsText | Optional: The text to write to the clipboard. LIST OF STRING.

Notes

SetText writes the specified text to the clipboard, with each element in lsText becoming a line of text in the clipboard. If you omit lsText, or if lsText is an empty list, SetText clears the clipboard.

On Windows platforms, SetText sets the primary selection (middle mouse button paste). To enable SetText to set the clipboard selection, set the OPT_PRIMARY_SELECTION Agent option to FALSE as follows:

Agent.SetOption (OPT_PRIMARY_SELECTION, FALSE)

Example

Clipboard.SetText (TextEditor.Document.GetText())
Parent topic: ClipboardClass Class


lsValue Property

Class

ClipboardClass, ListBox, ListView, and TextField.

Description

  • For ClipboardClass, the text in the clipboard.
  • For ListBox, the text of all selected items in the multiple-selection or extend-selection listbox.
  • For ListView, the text of all selected list box controls in the listview.
  • For TextField, the text of the multi-line text box.

Data Type

LIST OF STRING.

Access

For ListBox, ListView, and UpDown, read only.

For all others, read and write.

Parent topic: ClipboardClass Class
Parent topic: ListBox Class
Parent topic: TextField Class


ComboBox Class

Description

ComboBox is the class for controls that have both a popup list and a text field. If the user selects an item from the list, the text field is filled with that string. Alternatively, the user can type the string into the text field.

Availability

Combo boxes are available on Windows.

Inheritance

ComboBox is derived from the Control class; no classes derive from this class.

Identification of ComboBox items

Some ComboBox methods let you specify items as either INTEGERs or STRINGs, in one of these ways:

  • A STRING, which can contain the wildcard characters question mark (?), to match any single character, and asterisk (*), to match zero or more characters
  • An INTEGER that represents the numerical index (1-based) of an item in the list
  • A STRING of the form "#n", where n is the numerical index into the list

Methods and Properties

In addition to the methods and properties it inherits from AnyWin class and Control class, ComboBox has the following methods and properties:

  • ClearText Method (ComboBox DomTextField TextField)
    Removes all text from the text field or the text field of the combo box.
  • GetContents Function (ComboBox ListBox PopupListRadioList)
    Returns the contents of the combo box, list box, popup list, or radio list.
  • GetItemCount Function (ComboBox ListBox ListView Menu PopupList RadioList)
    Returns the number of items in the list, list box, listview, menu, popup list, radio list, or combo box list box.
  • GetItems Function (ComboBox ListBox RadioList )
    Returns all items in the combo box, listbox, or radiolist.
  • GetItemText Function (ComboBox ListBox PopupList RadioList)
    Returns the text of an item in the list box, popup list, radio list, or combo box.
  • GetSelectedItem Function
    Returns the currently selected item in the combo box.
  • GetText Function (ComboBox)
    Returns the text in the combo-box text box.
  • Select Method (ComboBox ListBox ListView PopupList RadioList)
    Selects an item from the combo box, list, list box, listview, popup list, or radiolist.
  • SetSelIndex Method
    Selects the item with the specified index.
  • SetText Method (ComboBox)
    Replaces the text in the text field of the combo box.
  • VerifyText Method (ComboBox)
    Verifies the text in the text field in a combo box.
  • iItemCount property
    The number of items in the combo box list, list box, menu, popup list, radio list, or tree view.
  • iValue Property
    The index of the selected item or integer position of the control.
  • lsContents Property
    The contents of the combo box list, list box, list view, page list, popup list, radio list, or tree view.
  • sValue Property
    The text in the selected text box.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


ClearText Method (ComboBox DomTextField TextField)

Class

  • ComboBox
  • DomTextField
  • TextField

Action

Removes all text from the text field or the text field of the combo box.

Syntax

object.ClearText ( )

Notes

ClearText clears all text from the text field.

Example

TextEditor.Document.ClearText ()
Parent topic: ComboBox Class
Parent topic: TextField Class
Parent topic: DomTextField Class


GetContents Function (ComboBox ListBox PopupListRadioList)

Class

  • ComboBox
  • ListBox
  • PopupList
  • RadioList

Action

Returns the contents of the combo box, list box, popup list, or radio list.

Syntax

lsContents = list.GetContents ([bRawMode])
Variable | Description
lsContents | The list contents. LIST OF STRING.
bRawMode | Optional: TRUE to leave platform-specific information in the strings, or FALSE (default) to remove that information. BOOLEAN.

Notes

GetContents returns a list of strings identifying each of the items in the combo box, list box, popup list, or radio list. For text items, GetContents returns the string of the item. For graphical items and items not containing text, GetContents returns a pound sign (#) followed by the index number of the item.

When bRawMode is TRUE, the returned strings include trailing and leading spaces and accelerators. These additional characters make the strings platform-specific. When FALSE, the returned strings do not include special characters.

For each item in the list of strings, GetContents returns only the first 255 characters, although the item might contain more characters than that.

Example

LIST OF STRING lsItems
lsItems = Open.Files.GetContents()
Parent topic: ComboBox Class
Parent topic: ListBox Class
Parent topic: Menu Class
Parent topic: RadioList Class


GetItemCount Function (ComboBox ListBox ListView Menu PopupList RadioList)

Class

  • ComboBox
  • ListBox
  • ListView
  • Menu
  • PopupList
  • RadioList

Action

Returns the number of items in the list, list box, listview, menu, popup list, radio list, or combo box list box.

Availability

For the ListView class, this method is supported only in scripts that use the Classic Agent.

Syntax

iCount = list.GetItemCount()
Variable | Description
iCount | The number of items in the object. INTEGER.

Notes

  • With the Classic Agent, GetItemCount returns the number of items in the menu or list, not including separators.
  • With the Open Agent, GetItemCount returns the number of items in the menu or list, including separators.
  • The GetItemCount method is not available in the ListViewEx class, which is the equivalent of the ListView class on the Open Agent. To achieve the same functionality for a listview with the Open Agent, use the ItemCount property of the ListViewEx class.

Example

INTEGER iNumberOfItems
iNumberOfItems = TextEditor.File.GetItemCount()
Parent topic: ComboBox Class
Parent topic: ListBox Class
Parent topic: Menu Class
Parent topic: RadioList Class
Related reference
ItemCount Property


GetItems Function (ComboBox ListBox RadioList )

Class

ComboBox class, ListBox class, and RadioList class.

Action

Returns all items in the combo box, listbox, or radiolist.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

list = GetItems()
Variable | Description
list | The list containing all items of the list box, combo box, or radio list. LIST OF LISTITEM.
Parent topic: ComboBox Class
Parent topic: ListBox Class
Parent topic: RadioList Class


GetItemText Function (ComboBox ListBox PopupList RadioList)

Class

ComboBox class, ListBox class, PopupList class, and RadioList class.

Action

Returns the text of an item in the list box, popup list, radio list, or combo box.

Syntax

sText = object.GetItemText (iIndex[, bRawMode])
Variable | Description
sText | The text of the item. STRING.
iIndex | The item to find, specified as the index number (1-based) of the item in the list. INTEGER.
bRawMode | Optional. TRUE to leave platform-specific information in the string, or FALSE (default) to remove that information. BOOLEAN.

Notes

GetItemText returns the text string associated with the specified index. If the item is graphical or does not contain text, GetItemText returns a pound sign (#) followed by the index number.

When bRawMode is TRUE, the returned string includes separator lines, trailing and leading spaces, ellipses, accelerators, and hot keys. These additional characters make the string platform-specific. When bRawMode is FALSE, the output of GetItemText does not include any special characters.

Example

STRING s1Text, s2Text;
s1Text = Open.Files.GetItemText (1)
s2Text = Open.Files.GetItemText (2)
Parent topic: ComboBox Class
Parent topic: ListBox Class
Parent topic: RadioList Class


GetSelectedItem Function

Class

ComboBox class.

Action

Returns the currently selected item in the combo box.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

item = combobox.GetSelectedItem()
Variable | Description
item | The currently selected combo box item or 0 if nothing is selected. LISTITEM.

Example

Verify(ComboBox1.GetSelectedItem(), "Line 5")
Parent topic: ComboBox Class


GetText Function (ComboBox)

Class

ComboBox.

Action

Returns the text in the combo-box text box.

Syntax

sText = combobox.GetText()
Variable | Description
sText | The combo-box text. STRING.

Example

Verify(Dialog1.ComboBoxText.GetText(), "two")
Parent topic: ComboBox Class


Select Method (ComboBox ListBox ListView PopupList RadioList)

Class

  • ComboBox
  • ListBox
  • ListView
  • PopupList
  • RadioList

Action

Selects an item from the combo box, list, list box, listview, popup list, or radiolist.

Syntax

list.Select (Item)
Variable | Description
Item | The item to select. LISTITEM.

Notes

Select selects an item by scrolling the item into view (where applicable) and clicking it with the mouse, if it is not already selected. After selecting the item, Silk Test Classic verifies that the item was selected, and raises the exception E_CONTROL_NOT_RESPONDING if it was not. For more information about specifying Item, see the documentation for the appropriate class.

If an invalid Item is passed as a parameter, Select() raises the exception E_ITEM_NOT_FOUND.

When recording Select() against a JavaJFCComboBox in an applet, dragging the mouse to the item will be more reliable than clicking on the combobox drop-down arrow and then clicking on the item.

Example

STRING sItem = "Up"
Find.Direction.Select (sItem)
Parent topic: ComboBox Class
Related reference
JavaJFCComboBox Class


SetSelIndex Method

Class

ComboBox.

Action

Selects the item with the specified index.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SetSelIndex (index)
Variable | Description
index | The index of the item. INTEGER.
Parent topic: ComboBox Class


SetText Method (ComboBox)

Class

ComboBox.

Action

Replaces the text in the text field of the combo box.

Syntax

window.SetText (sText)
Variable | Description
sText | The text to substitute for the contents of the text field. STRING.

Notes

SetText changes the text of the text field of the combo box by giving the field the input focus and then generating the appropriate keystrokes.

Example

Dialog1.ComboText.SetText ("two")
Parent topic: ComboBox Class


VerifyText Method (ComboBox)

Class

ComboBox class.

Action

Verifies the text in the text field in a combo box.

Syntax

combobox.VerifyText(sText[, nTimeout])
Variable | Description
sText | The text expected in the combo box. STRING.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

You use the VerifyText method to check whether a combo box has the expected text. If the combo box does not have the expected text, Silk Test Classic raises the exception E_VERIFY.

Calling this method is the same as calling the Verify function in the following manner:
Verify(window.GetText(), expected_value)

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyText() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option, OPT_WINDOW_RETRY. If the verification fails, an exception is thrown.

Example

MyDialog.ComboBox1.VerifyText("expected text")
Parent topic: ComboBox Class


iItemCount property

Class

  • ComboBox
  • ListBox
  • Menu
  • PopupList
  • RadioList
  • SwfToolStripComboBox
  • TreeView

Description

The number of items in the combo box list, list box, menu, popup list, radio list, or tree view.

Data Type

INTEGER.

Access

Read only.

Parent topic: ComboBox Class
Parent topic: ListBox Class
Parent topic: Menu Class
Parent topic: RadioList Class
Parent topic: TreeView Class
Parent topic: SWTTableRow Class


iValue Property

Class

  • ComboBox
  • ListBox
  • ListView
  • PopupList
  • RadioList
  • Scale
  • ScrollBar
  • SwfToolStripProgressBar
  • TreeView
  • UpDown

Description

For ComboBox, ListBox, ListView, PopupList, RadioList, SwfToolStripProgressBar, or TreeView, the index of the selected item.

For Scale, ScrollBar, or UpDown, the integer position of the control.

Data Type

INTEGER.

Access

Read and write.

Parent topic: ComboBox Class
Parent topic: ListBox Class
Parent topic: PageList Class
Parent topic: RadioList Class
Parent topic: Scale Class
Parent topic: ScrollBar Class
Parent topic: TreeView Class


lsContents Property

Class

  • ComboBox
  • ListBox
  • ListView
  • PageList
  • PopupList
  • RadioList
  • TreeView

Description

The contents of the combo box list, list box, list view, page list, popup list, radio list, or tree view.

Data Type

LIST OF STRING.

Access

Read only.

Parent topic: ComboBox Class
Parent topic: ListBox Class
Parent topic: PageList Class
Parent topic: RadioList Class
Parent topic: TreeView Class


sValue Property

Class

  • ComboBox
  • DynamicText
  • ListBox
  • ListView
  • PopupList
  • RadioList
  • StaticText
  • TextField
  • TreeView
  • XmlNode

Description

  • For ComboBox, the text in the combo box text box.
  • For DynamicText, the text in the dynamic text box.
  • For ListBox, the text of the selected item in a single-selection listbox.
  • For ListView, the text of the selected list box control.
  • For PopupList or RadioList, the text of the selected item.
  • For StaticText, the text in the static text box.
  • For TextField, the text in the single-line text box.
  • For TreeView, the text of the selected tree.
  • For XmlNode, the text associated with the xml object.

Data Type

STRING.

Access

For StaticText, read only. For all others, read and write.

Parent topic: ComboBox Class
Parent topic: DynamicText Class
Parent topic: ListBox Class
Parent topic: PageList Class
Parent topic: RadioList Class
Parent topic: StaticText Class
Parent topic: TextField Class
Parent topic: TreeView Class


ConsoleClass Class

Description

ConsoleClass is the class for consoles. ConsoleClass has a predefined identifier, Console.

To call a method of the ConsoleClass, use the following syntax:

Console.method()

To refer to a property of the ConsoleClass, use the following syntax:

Console.property

A hooking configuration is not required to use the ConsoleClass class. You can manually add calls and references to the ConsoleClass class to a script. The class is not recorded during the recording of a test.

Availability

This functionality is supported only if you are using the Open Agent.

Inheritance

ConsoleClass does not derive from any class; no classes derive from this class.

Methods, Functions, and properties

ConsoleClass has the following methods, functions, and properties:

  • Close Method (ConsoleClass)
    Closes the console.
  • CloseAll Method (ConsoleClass)
    Closes all open consoles or all consoles with a specific caption.
  • CloseWindow Method (ConsoleClass)
    Closes the console.
  • GetContents Function (ConsoleClass)
    Returns the contents of the console.
  • GetContentsOfWindow Function (ConsoleClass)
    Returns the contents of the console.
  • Open Method (ConsoleClass)
    Opens a new console.
  • OpenWithCaption Method (ConsoleClass)
    Opens a new console with a specified caption.
  • TypeKeys Method (ConsoleClass)
    Sends a set of keystrokes to the console.
  • TypeKeysInWindow Method (ConsoleClass)
    Sends a set of keystrokes to the console.
Parent topic: General Core Classes
Related reference
Key Names


Close Method (ConsoleClass)

Class

ConsoleClass.

Action

Closes the console.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Console.Close ()

Example

The following sample shows how you can close the console window:
Console.Close()
Parent topic: ConsoleClass Class


CloseAll Method (ConsoleClass)

Class

ConsoleClass.

Action

Closes all open consoles or all consoles with a specific caption.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Console.CloseAll ([sCaption])
Variable | Description
sCaption | Set this parameter to close only the consoles with this caption. STRING

Example

The following sample shows how you close all console windows with the caption MyCommandWindow:
Console.CloseAll("MyCommandWindow")
Parent topic: ConsoleClass Class


CloseWindow Method (ConsoleClass)

Class

ConsoleClass.

Action

Closes the console.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Console.CloseWindow (sItemIdentifier)
Variable | Description
sItemIdentifier | The index of the console window or the caption of the window. If this parameter is left blank, Silk Test Classic closes the first found console window. STRING.

Example 1

The following sample shows how you can use the index to close the second console window:
Console.CloseWindow(2)

Example 2

The following sample shows how you can use the full identifier of a console window to close the second console window:
Console.CloseWindow("C:\\Windows\\system32\\cmd.exe[1]")
Parent topic: ConsoleClass Class


GetContents Function (ConsoleClass)

Class

ConsoleClass.

Action

Returns the contents of the console.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

lsContents = Console.GetContents ()
Variable | Description
lsContents | The console contents. LIST OF STRING.

Notes

  • Each string in the returned list of strings corresponds to one row in the console.

Example 1

The following sample shows how you can use the index to define that you want to get the contents of the console window:
lsContents = Console.GetContents()
Parent topic: ConsoleClass Class


GetContentsOfWindow Function (ConsoleClass)

Class

ConsoleClass.

Action

Returns the contents of the console.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

lsContents = Console.GetContentsOfWindow (sItemIdentifier)
Variable | Description
lsContents | The console contents. LIST OF STRING.
sItemIdentifier | The index of the console window or the caption of the window. If this parameter is left blank, Silk Test Classic returns the contents of the first found console window. STRING

Notes

  • Each string in the returned list of strings corresponds to one row in the console.

Example 1

The following sample shows how you can use the index to define that you want to get the contents of the second console window:
lsContents = Console.GetContentsOfWindow(2)

Example 2

The following sample shows how you can use the full identifier of a console window to get the contents of the console window:
lsContents = Console.GetContentsOfWindow("C:\\Windows\\system32\\cmd.exe[1]")
Parent topic: ConsoleClass Class


Open Method (ConsoleClass)

Class

ConsoleClass.

Action

Opens a new console.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Console.Open ()

Example

The following sample shows how you can open a new console:
Console.Open()
Parent topic: ConsoleClass Class


OpenWithCaption Method (ConsoleClass)

Class

ConsoleClass.

Action

Opens a new console with a specified caption.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Console.OpenWithCaption (consoleWindowCaption)
Variable | Description
consoleWindowCaption | The caption for the new console. If this parameter is left blank, Silk Test Classic opens a new console with the default caption. STRING.

Example

The following sample shows how you can open a new console with the caption "My Console".
Console.OpenWithCaption("My Console")
Parent topic: ConsoleClass Class


TypeKeys Method (ConsoleClass)

Class

ConsoleClass.

Action

Sends a set of keystrokes to the console.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Console.TypeKeys (sEvents)
Variable | Description
sEvents | The keystrokes to type. STRING.

Notes

  • If no console is open, TypeKeys opens a console.
  • On Windows, TypeKeys first gives the console input focus before typing into it.
  • You can use SetOption to set a delay between keystrokes with the OPT_KEYBOARD_DELAY option. If keystrokes are not recognized, you can try to use a higher value for the delay.
  • A key can be followed by a counter, which defines how often the keys should be typed.
  • During the delay time, the screen is locked and interaction with the mouse and keyboard is no longer possible.

Examples

The following code executes the dir command in a console window to list all the files and directories in the current directory:

//dir is executed
Console.TypeKeys ("dir<Enter>")
Parent topic: ConsoleClass Class
Related concepts
TypeKeysInWindow Method (ConsoleClass)


TypeKeysInWindow Method (ConsoleClass)

Class

ConsoleClass.

Action

Sends a set of keystrokes to the specified console.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Console.TypeKeysInWindow (sEvents, sItemIdentifier)
Variable | Description
sEvents | The keystrokes to type. STRING.
sItemIdentifier | The index of the console window or the caption of the window. If this parameter is left blank, Silk Test Classic sends the keystrokes to the first found console window. STRING.

Notes

  • On Windows, TypeKeysInWindow first gives the specified console input focus before typing into it.
  • You can use SetOption to set a delay between keystrokes with the OPT_KEYBOARD_DELAY option. If keystrokes are not recognized, you can try to use a higher value for the delay.
  • A key can be followed by a counter, which defines how often the keys should be typed.
  • During the delay time, the screen is locked and interaction with the mouse and keyboard is no longer possible.

Examples

The following code samples execute the dir command on the specified console window to list all the files and directories in the current directory:

//dir is executed on the second console window
Console.TypeKeysInWindow ("dir<Enter>", 2)
//dir is executed on the specified console window
Console.TypeKeysInWindow ("dir<Enter>", "C:\\Windows\\system32\\cmd.exe[1]")
Parent topic: ConsoleClass Class
Related reference
TypeKeys Method (ConsoleClass)


Control Class

Description

Control is the class for any control in a window.

Inheritance

Control is derived from the AnyWin class; several classes derive from this class.

Identification of Control Parts

The Control class comes with two predefined parts: VScrollBar and HScrollBar. These two parts represent the vertical and horizontal scroll bars that sometimes appear in a control such as a list box or text field.

To refer to these parts, you specify the control and then the part, separated by the dot operator, and then call the method on the part. For example:

TextEditor.Document.VScrollBar.ScrollByLine (10)

The methods and properties for these parts are the same as the methods and properties for the ScrollBar class.

Methods and Properties

In addition to the methods and controls it inherits from the AnyWin class, Control has the following methods and properties:

  • GetPriorStatic Function
    Returns the static-text label associated with the control.
  • HasFocus Method (Control)
    Tests whether the control has input focus.
  • SetFocus Method (Control)
    Gives focus to the control.
  • VerifyFocus Method (Control)
    Verifies that the control has input focus.
  • bHasFocus Property
    Whether the control has input focus.
Parent topic: General Core Classes
Related reference
AnyWin Class


GetPriorStatic Function

Class

Control.

Action

Returns the static-text label associated with the control.

Syntax

sLabel = control.GetPriorStatic ([bRawMode])
Variable | Description
sLabel | The label associated with the control. STRING.
bRawMode

Optional: TRUE to leave platform-specific information in the strings, or FALSE (default) to remove that information. BOOLEAN.

The Open Agent always uses FALSE for this value regardless of what is specified in the script. The returned strings include trailing and leading spaces but ellipses, accelerators, and hot keys are removed.

Notes

GetPriorStatic looks for the closest static text above or to the left of the control. If it cannot associate any static text with the control, GetPriorStatic returns an empty string ("").

When bRawMode is TRUE, the returned string includes trailing and leading spaces, ellipses, accelerators, and hot keys. These additional characters make the string platform-specific. When bRawMode is FALSE, the output of GetPriorStatic does not include any special characters.

Example

STRING sLabel
sLabel = GotoLine.LineNumber.GetPriorStatic()
Parent topic: Control Class


HasFocus Method (Control)

Class

Control.

Action

Tests whether the control has input focus.

Syntax

bHasFocus = control.HasFocus()
Variable | Description
bHasFocus | The focus state of the control. BOOLEAN.

Notes

HasFocus returns TRUE if the control has focus, or FALSE if it does not.

Example

[ ] TextEditor.Search.GotoLine.Pick()
[-] if(!GotoLine.Line.HasFocus())
    [ ] GotoLine.Line.SetFocus()
Parent topic: Control Class


SetFocus Method (Control)

Class

Control.

Action

Gives focus to the control.

Syntax

control.SetFocus ( )

Notes

SetFocus gives the input focus to the specified control (that is, makes it the control to which the GUI directs keystrokes).

It is not necessary to call SetFocus prior to using any of the functions that operate on controls. Call it in cases where you plan to use TypeKeys to pass keystrokes to a pop-up window, and you need to display the window first.

Example

TextEditor.Document.SetFocus ()
Parent topic: Control Class


VerifyFocus Method (Control)

Class

Control.

Action

Verifies that the control has input focus.

Syntax

control.VerifyFocus([nTimeout])
Variable | Description
nTimeout | Optional: The number of seconds to wait for the control to gain input focus. NUMBER.

Notes

VerifyFocus determines whether the control has input focus, and raises the exception E_VERIFY if it does not.

Calling this method is the same as calling the Verify function in the following manner:
Verify(window.HasFocus(), expected_state)

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyFocus() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option (OPT_WINDOW_RETRY). If the verification fails, an exception is thrown.

Example

TextEditor.Search.GotoLine.Pick()
GotoLine.Line.VerifyFocus()
Parent topic: Control Class


bHasFocus Property

Class

Control.

Description

Whether the control has input focus.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: Control Class


CursorClass Class

Description

CursorClass is the class for the cursor.

CursorClass has a predefined identifier, Cursor. To call a method of the CursorClass, use this syntax:

Cursor.method ( )

Inheritance

CursorClass does not derive from any class, and no classes derive from it.

Methods and Properties

CursorClass has the following methods and properties:

  • GetPosition Function (CursorClass)
    Returns the screen position of the pointer.
  • GetType Function
    Returns the type of the current cursor or XML object.
  • IsOfClass Function
    Tests whether an object is of the specified class.
  • Wait Method
    Waits for the specified cursor to appear and returns the elapsed time.
Parent topic: General Core Classes


GetPosition Function (CursorClass)

Class

CursorClass.

Action

Returns the screen position of the pointer. Therefore you should use the results of Cursor.GetPosition() as arguments to MoveMouse() or Click() only for Desktop, not for individual windows.

Syntax

point = Cursor.GetPosition()
Variable | Description
point | The current mouse pointer position. POINT.

Notes

GetPosition returns a record of type POINT, which has two fields:

Field | Description
x | The x-coordinate. INTEGER.
y | The y- coordinate. INTEGER.

The position returned is relative to the entire screen.

Example

POINT pCursor
pCursor = Cursor.GetPosition()
Parent topic: CursorClass Class


GetType Function

Class

CursorClass and XmlNode.

Action

Returns the type of the current cursor or XML object.

Syntax

object.GetType()

Notes

Names for the common cursor-shapes are POINTER, INSERT, and DELAY. The following cursor shapes are also supported:

For All Windows platforms:
  • ARROW
  • CROSS
  • IBEAM
  • ICON
  • SIZE
  • SIZENESW
  • SIZENS
  • SIZENWSE
  • SIZEWE
  • UPARROW
  • WAIT

For 32-bit Windows platforms only:

  • APPSTARTING
  • HELP
  • NO
  • SIZEALL

Windows Platforms

In 32-bit Windows, when an application asks for the cursor, it sees its most recent setting, which does not necessarily match what is currently displayed. It does agree with what would be displayed if the cursor were over a window owned by the application. The GetType function asks the application, over whose window the cursor is resting, what type the cursor is. This will match visual reality, but might cause some tests to fail. If you verify the cursor type when the cursor is not over a window owned by the application under test, you might get the wrong value, so the verification fails even if the application under test sets the cursor correctly and users see the correct cursor when they move over one of the application's windows.

Examples

CURSOR CurType
CurType = Cursor.GetType()
Verify (CurType, "POINTER", "Check cursor type")

STRING sXmlType
SxmlType= Browserchild.XmlNode.GetType()
Print("XML object type: {sXmlType}")
Parent topic: CursorClass Class


Wait Method

Class

CursorClass.

Action

Waits for the specified cursor to appear and returns the elapsed time.

Syntax

nSeconds = Cursor.Wait (Cursor, nTimeout [, nNoChange])
Variable | Description
nSeconds | The length of time (in seconds) it took for the cursor to become the current cursor. NUMBER.
Cursor | The name of the cursor to wait for. CURSOR.
nTimeout | The interval to wait for the cursor to change before raising an exception. NUMBER.
nNoChange | Optional. The number of seconds that the cursor must remain unchanged. NUMBER.

Notes

You use Wait to synchronize a script on the current cursor or to measure performance.

Wait returns the length of time that it took for the cursor to become the current cursor. If Cursor is an empty string (""), Wait returns the time it took the current cursor to change to any other cursor.

nTimeout is the length of time (in seconds or fractions of seconds) to wait for Cursor to become the specified cursor before raising an exception. You must specify a value for nTimeout.

If you specify nNoChange, Wait will raise an exception if Cursor does not remain the current cursor for at least nNoChange seconds within the total time-out period specified by nTimeout. This behavior is useful if the cursor keeps changing and you want to make sure it has stabilized. nNoChange should always be smaller than nTimeout.

You can call GetType to get the cursor name that Wait requires as an input argument, or to wait for one of the standard cursors, you can specify the name yourself. Valid cursor names are "POINTER," "INSERT," "DELAY," or any other identifier (an INTEGER encoded as a string) returned by GetType.

If the timeout period expires before the cursor reaches the appropriate state, Silk Test Classic raises the exception E_CURSOR_TIMEOUT.

Example

TextEditor.Start ()
// wait up to 3 seconds for the pointer cursor
Cursor.Wait ("POINTER", 3)
Parent topic: CursorClass Class


CustomWin Class

Description

CustomWin is the class for objects that do not map to or derive from any built-in classes.

Inheritance

CustomWin is derived from the AnyWin class; no classes derive from this class.

Methods

CustomWin inherits all its methods from the AnyWin class.

Properties

CustomWin inherits all its properties from the AnyWin class.

Parent topic: General Core Classes
Related reference
AnyWin Class


DefinedWin Class

Description

DefinedWin is the class for windows that map to or derive from manually created windows.

Availability

This class is supported only on the Classic Agent.

Inheritance

DefinedWin is derived from the AnyWin class; no classes derive from this class.

Methods

DefinedWin inherits all its methods from the AnyWin class.

Properties

DefinedWin inherits all its properties from the AnyWin class.

Parent topic: General Core Classes
Related reference
AnyWin Class
Differences in the Classes Supported by the Silk Test Agents


DesktopWin Class

Description

DesktopWin is the class for the entire screen.

DesktopWin has a predefined identifier, Desktop. To call a method of the DesktopWin class, use this syntax:
Desktop.method()

Inheritance

DesktopWin derives from the AnyWin class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class, DesktopWin has the following methods and properties:

Parent topic: General Core Classes
Related reference
AnyWin Class


DialogBox Class

Description

DialogBox is the class for dialog boxes.

In the declaration for a dialog box, you can specify the following variables to affect how certain methods work:

Variable | Description | Used by
wAcceptButton | A non-standard button to use to close the dialog and accept the values specified there; the default is OK. | Accept method
wDismissButton | A non-standard button to use to close the dialog and not accept the values specified there; the default is Cancel. | Dismiss method

Inheritance

DialogBox derives from the MoveableWin class; one class derives from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and MoveableWin class, DialogBox has the following methods and properties:

  • Accept Method
    Closes the dialog box and accepts the values specified there.
  • Dismiss Method (DialogBox)
    Closes the dialog without accepting the values specified there.
  • GetCloseWindows Method (DialogBox)
    Returns the windows that must close to return the application to base state.
  • GetNextCloseWindow Method (Dialog Box)
    Returns the next window that the Close method will close.
  • Invoke Method (ChildWin DialogBox MainWin)
    Invokes the dialog or window, using the menu, menu item, pushbutton, or command line provided in the declaration.
Parent topic: General Core Classes
Related reference
AnyWin Class
MoveableWin Class


Accept Method

Class

DialogBox.

Action

Closes the dialog box and accepts the values specified there.

Syntax

dialogbox.Accept( )

Notes

Accept closes a dialog by clicking the OK button, thus accepting the values specified in the dialog box. To use a different button for a particular dialog box, define a variable named wAcceptButton (of type WINDOW) in the dialog declaration, and set it to the name of the button to click.

Example

MessageBox.Message.Verify (sMessage)
MessageBox.Accept ()
Parent topic: DialogBox Class


Dismiss Method (DialogBox)

Class

DialogBox.

Action

Closes the dialog without accepting the values specified there.

Syntax

dialogbox. Dismiss ( )

Notes

Dismiss closes a dialog by clicking the Cancel button, thus not accepting the values specified in the dialog. To use a different button for a particular dialog, define a variable named wDismissButton (of type WINDOW) in the dialog declaration, and set it to the name of the button to click.

Example

    [ ] ClearFile ()
    [ ] TextEditor.File.New.Pick ()
    [-] if (SaveMessage.Exists (5))
        [ ] SaveMessage.Dismiss ()
Parent topic: DialogBox Class


GetCloseWindows Method (DialogBox)

Class

DialogBox.

Action

Returns the windows that must close to return the application to base state.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

lwWindows = dialog.GetCloseWindows()
Variable | Description
lwWindows | The windows to close. LIST OF WINDOW.
Parent topic: DialogBox Class


GetNextCloseWindow Method (Dialog Box)

Class

DialogBox.

Action

Returns the next window that the Close method will close.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

wNext = dialog.GetNextCloseWindow()
Variable | Description
wNext | The top-most window in the application. WINDOW.

Notes

This function returns the application window that the Close method will close, if called.

Parent topic: DialogBox Class


Invoke Method (ChildWin DialogBox MainWin)

Class

ChildWin, DialogBox, and MainWin.

Action

Invokes the dialog or window, using the menu, menu item, pushbutton, or command line provided in the declaration.

Syntax

window.Invoke()

Notes

  • The Invoke method invokes the current dialog or window, using information specified in the declaration to determine how to invoke the object. For a dialog box, the declaration must contain the wInvoke variable, which defines the menu, menu item, or pushbutton that invokes the dialog box. For a ChildWin, wInvoke can be either a menu or a menu item.

  • When you use the Invoke method for a MainWin, Invoke calls the Start method and passes to it parameters specified in the declaration for the MainWin:
    Parameter
    Description
    sCmdLine
    Variable, a string that defines the command line used to invoke the application. The MainWin declaration must contain a definition for this variable in order to use the Invoke method to invoke the main window.
    sdir
    Optional: Variable, a string that defines the working directory of the application when it is invoked.
    bextensionReady
    Optional: A Boolean that, if set to TRUE, indicates that Silk Test Classic should wait until the application’s extension has finished registering.
    nInvokeTimeout
    Optional: An integer that specifies the number of seconds that Silk Test Classic waits fo the main window of the application to appear.

  • For more information about how the Start method uses these parameters when they are passed to it by Invoke, see Start Method (MainWin).

Example

[ ] // in declarations
[-] window DialogBox Find
    [ ] tag "Find"
    [ ] parent TextEditor
    [ ] // ...
[ ] WINDOW wInvoke = TextEditor.Search.Find
[ ]
[ ] // in script
[ ] TextEditor.Invoke()
[ ] Find.Invoke()
Parent topic: DialogBox Class
Parent topic: MainWin Class
Related reference
Start Method


DropDownToolItem Class

Description

DropDownToolItem is the class for drop-down element in a toolbar control.

Availability

This class is supported only on the Open Agent, and only for the following technology domains:
  • Java SWT
  • Windows Forms
  • Win32

Inheritance

DropDownToolItem is derived from the ToolItem class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class, DropDownToolItem has the following methods and properties:

  • Open Method (DropDownToolItem)
    Opens an item.
  • Select Method (DropDownToolItem PushToolItem)
    Selects an item.
Parent topic: General Core Classes
Parent topic: Java SWT Classes for the Open Agent
Parent topic: Windows Forms Classes Used by the Open Agent
Parent topic: Win32 Classes


Open Method (DropDownToolItem)

Class

DropDownToolItem.

Action

Opens an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

dropDownToolItem.Open ()

Notes

Opens an item, if it is not already open.

Parent topic: DropDownToolItem Class


Select Method (DropDownToolItem PushToolItem)

Class

DropDownToolItem and PushToolItem.

Action

Selects an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

toolItem.Select ()

Notes

Selects the item as it would select a pushbutton.

Parent topic: DropDownToolItem Class
Parent topic: PushToolItem Class


DynamicText Class

Description

DynamicText is the class for dynamic text controls. In contrast to static text:

  • Dynamic text is not used as a label for adjacent controls.
  • Silk Test Classic does not use the text to generate its tag during recording.

Availability

This class is supported only on the Classic Agent. DynamicText is used for the objects contained in a status bar under Windows operating systems.

Inheritance

DynamicText derives from the Control class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, DynamicText has the following methods and properties:

  • GetText Function (DynamicText StaticText TextField)
    Returns the text of the text field.
  • VerifyValue Method (DynamicText StaticText TextField)
    Verifies the text of the text field.
  • sValue Property
    The text in the selected text box.
Parent topic: General Core Classes
Related reference
AnyWin Class
Differences in the Classes Supported by the Silk Test Agents


GetText Function (DynamicText StaticText TextField)

Class

DynamicText, StaticText, and TextField.

Action

Returns the text of the text field.

Syntax

sText = object.GetText ([iStartChar, iNumChars])
Variable | Description
sText | The returned text. STRING.
iStartChar | Optional. The position in the string (starting from 1) of the first character to return. INTEGER.
iNumChars | Optional. The number of characters to return. INTEGER.

Notes

GetText returns the text from the dynamic text, static text, or single-line text field. It returns only the first line of a multi-line text field.

  • If you include iStartChar but not iNumChars, GetText returns the text from the iStartChar character to the end of the text.

  • If you include both arguments, GetText returns iNumChars characters, starting with the iStartChar character.

Example

STRING sAllText
sAllText = GotoLine.Line.GetText()
Parent topic: DynamicText Class
Parent topic: StaticText Class
Parent topic: TextField Class


VerifyValue Method (DynamicText StaticText TextField)

Class

DynamicText, StaticText, and TextField.

Action

Verifies the text of the text field.

Syntax

object.VerifyValue(sExpected[, nTimeout])
Variable | Description
sExpected | The text you expect the static text or text box to contain. STRING or LIST OF STRING.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

Use the VerifyValue method to check whether a text box has the text string you expect it to have. For a dynamic text, static text, or single-line text box, sExpected should be a STRING. For a multi-line text box, sExpected should be a LIST OF STRING.

Calling this method is the same as calling the Verify function in the following manner:
Verify(window.GetText(), expected_text)

If the text in the static text or text box does not match the expected value, Silk Test Classic raises the exception E_VERIFY.

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyValue() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option, OPT_WINDOW_RETRY. If the verification fails, an exception is thrown.

Example

MessageBox.Message.VerifyValue("Line Number out of range")
Parent topic: DynamicText Class
Parent topic: StaticText Class
Parent topic: TextField Class


HorizontalScrollBar Class

Description

HorizontalScrollBar is the class for horizontal scroll bars.

Inheritance

HorizontalScrollBar derives from the ScrollBar class; no classes derive from this class.

Methods

HorizontalScrollBar inherits all its methods from the AnyWin class, Control class, and ScrollBar class.

Properties

HorizontalScrollBar inherits all its methods from the AnyWin class, Control class, and ScrollBar class.

Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class
ScrollBar Class


ListBox Class

Description

ListBox is the class for list boxes.

Note: Silk Test Classic does not fully support list boxes that have items of varying heights.

Inheritance

ListBox derives from the class Control; CheckedListBox derives from the ListBox class.

Identification of ListBox Items

Some ListBox methods let you specify items as either INTEGERs or STRINGs in one of the following ways:

  • A STRING, which can contain the wildcard characters question mark (?) to match any single character, and asterisk (*) to match zero or more characters.
  • An INTEGER that represents the numerical index (1-based) of the item.
  • A STRING of the form "#n", where n is the numerical index of the item

Methods and Properties

In addition to the methods and properties inherited from class AnyWin and class Control, the following methods and properties are also available to ListBox objects:

  • ExtendedDoubleSelect Method
    Double-clicks an item in the list box or treeview with one or more key modifiers.
  • GetContents Function (ComboBox ListBox PopupListRadioList)
    Returns the contents of the combo box, list box, popup list, or radio list.
  • GetItemCount Function (ComboBox ListBox ListView Menu PopupList RadioList)
    Returns the number of items in the list, list box, listview, menu, popup list, radio list, or combo box list box.
  • GetItems Function (ComboBox ListBox RadioList )
    Returns all items in the combo box, listbox, or radiolist.
  • GetItemText Function (ComboBox ListBox PopupList RadioList)
    Returns the text of an item in the list box, popup list, radio list, or combo box.
  • GetSelItems Function (ListBox TreeView)
    Returns all selected items in the list box or tree.
  • MultiSelect Method (ListBox)
    Selects an item in the multi- or extend-selection list box.
  • SetMultiSelIndex Method
    Selects the specified indices in the list.
  • bIsMulti Property
    For ListBox, whether it is a multi-selection list box. For TextField, whether it is a multi-line text field.
  • iItemCount property
    The number of items in the combo box list, list box, menu, popup list, radio list, or tree view.
  • iValue Property
    The index of the selected item or integer position of the control.
  • lsContents Property
    The contents of the combo box list, list box, list view, page list, popup list, radio list, or tree view.
  • lsValue Property
    The text of the selected items.
  • sValue Property
    The text in the selected text box.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


ExtendedDoubleSelect Method

Class

ListBox and TreeView.

Action

Double-clicks an item in the list box or treeview with one or more key modifiers.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

ExtendedDoubleSelect (keyModifiers, Item)
Variable | Description
keyModifiers | Defines which additional keys should be pressed while performing the double-click. MODIFIERKEYSTATE.
Item | The item to click. LISTITEM.

Notes

ExtendedDoubleSelect double-clicks an item in the list by scrolling the item into view and clicking it with the mouse. ExtendedDoubleSelect is useful with lists that assign special meaning to a double-click event. For example, most File Open list boxes open the file whose name is double-clicked in the list box.

We do not recommend trying to record a ExtendedDoubleSelect action. Due to varying machine speeds and operating systems, the timing may be such that Silk Test Classic cannot successfully record ExtendedDoubleSelect. Instead, we recommend recording Select, then manually changing the Select statement to ExtendedDoubleSelect.

ExtendedDoubleSelect() does not work properly with Internet Explorer 7.

Parent topic: ListBox Class
Parent topic: TreeView Class


GetSelItems Function (ListBox TreeView)

Class

ListBox and TreeView.

Action

Returns all selected items in the list box or tree.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

list = listbox.GetSelItems()
Variable | Description
list | The list of the selected contents of the current listbox or treeview. LIST OF LISTITEM.

Notes

If no item is selected, GetSelItems returns an empty list.

Example 1

This example verifies a listbox element.

Verify(DialogBox1.Elements.GetSelItems(), {“item1”, “item3”})

Example 2

This example shows a sample return value for the tree view.

    [-] MyDialog.MyTreeView.GetSelItems()
        [ ] {"/root/child1/grandchild", "/root/child2”}
Parent topic: ListBox Class
Parent topic: TreeView Class


MultiSelect Method (ListBox)

Class

ListBox class.

Action

Selects an item in the multi- or extend-selection list box.

Syntax

listbox.MultiSelect (Item)
Variable | Description
Item | The item to select. LISTITEM.

Notes

If the item is not selected, MultiSelect selects the item by scrolling it into view and clicking it with the mouse. If the item is already selected, MultiSelect does nothing.

For information on specifying Item, see the ListBox class.

After calling MultiSelect, Silk Test Classic checks whether the item was selected, and raises the exception E_CONTROL_NOT_RESPONDING if it was not.

You cannot use this method with single-selection lists.

Example

DialogBox1.Elements.MultiSelect ("water")
DialogBox1.Elements.MultiSelect (5)
Parent topic: ListBox Class


SetMultiSelIndex Method

Class

ListBox class.

Action

Selects the specified indices in the list.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SetMultiSelIndex (liIndices)
Variable | Description
liIndices | The indices of each selected item in the list box. LIST OF INTEGER.
Parent topic: ListBox Class


bIsMulti Property

Class

ListBox and TextField.

Description

For ListBox, whether it is a multi-selection list box.

For TextField, whether it is a multi-line text field.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: ListBox Class
Parent topic: TextField Class


MainWin Class

Description

MainWin is the class for an application’s main window.

In the declaration for a MainWin, you can specify the sCmdLine variable, to provide the command line used to invoke the window (used by the Invoke method).

Notes

Silk Test Classic assumes that a MainWin, that has a menu (menubar) and whose parent is the desktop, is the main window of an application. One of the primary differences between MainWin and DialogBox is that MainWin usually has a menubar.

Inheritance

MainWin derives from the MoveableWin class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and MoveableWin class, MainWin has the following methods and properties:

  • CloseWindows Method
    Closes all windows of the application except the main window.
  • Exit Method
    Terminates the application by closing all open windows, including the main window.
  • GetCloseWindows Function
    Returns the windows that must close to return the application to base state.
  • GetNextCloseWindow Function
    Returns the next window that the Close method will close.
  • Invoke Method (ChildWin DialogBox MainWin)
    Invokes the dialog or window, using the menu, menu item, pushbutton, or command line provided in the declaration.
  • Start Method
    Invokes the application, using the specified command line, and waits for the main window to appear.
Parent topic: General Core Classes
Related reference
DialogBox Class
MoveableWin Class
AnyWin Class
GetState Function (MoveableWin)


CloseWindows Method

Class

MainWin.

Action

Closes all windows of the application except the main window.

Syntax

mainwin.CloseWindows ([bTrace])
Variable | Description
bTrace | Optional: TRUE to print a log in the results file of all windows closed; FALSE (default) not to print the log. BOOLEAN.

Notes

CloseWindows starts with the current active window and attempts to close it using the following sequence, stopping when the window closes:

  1. If a Close method is defined for the window, call it . Even if this method does not close the window, none of the following steps are executed.

  2. Call window.CloseBox.Click()(for Windows).

  3. Call window.SysMenu.Close.Pick() (on platforms and windows that have system menus).

  4. If the window is a dialog, type the keys specified in OPT_CLOSE_DIALOG_KEYS and wait one second for the dialog to close.

  5. If there is a single button in the window, click that button.

  6. Click the list of buttons specified with OPT_CLOSE_WINDOW_BUTTONS.

  7. Select the menus specified with OPT_CLOSE_WINDOW_MENUS.

Once one window closes, CloseWindows follow the sequence with the next window, until all windows are closed.

If closing any window causes the application to display a confirmation dialog, CloseWindows attempts to close the dialog using the list of buttons specified with the OPT_CLOSE_CONFIRM_BUTTONS option.

This method supports several specifications you can make to help Silk Test Classic close a window:

To specify | Set this option | Or set this variable
Non-standard buttons to use to close confirmation dialog | OPT_CLOSE_CONFIRM_BUTTONS | lsCloseConfirmButtons
If the UI of the application is in English, you only need to specify non-standard buttons that are used to close the window. If the UI of the application is not in English, you need to replace all strings, which correspond to buttons that are used to close a window, with the localized strings. | OPT_CLOSE_WINDOW_BUTTONS | lsCloseWindowButtons
If the UI of the application is in English, you only need to specify non-standard menu items that are used to close the window. If the UI of the application is not in English, you need to replace all strings, which correspond to menu items that are used to close a window, with the localized strings. | OPT_CLOSE_WINDOW_MENUS | lsCloseWindowMenus
Non-standard keys to type to close the window, if it is a dialog. | OPT_CLOSE_DIALOG_KEYS | lsCloseDialogKeys

You can make these specification by using the SetOption method, by defining the specified variable, or using the settings in the Close tab of the Agent Options dialog box.

Example

    [ ] RecoverBaseState ()
    [ ] TextEditor.CloseWindows ()
    [ ] ClearFile ()
    [-] do
        [ ] VerifyBaseState ()
    [-] except
        [ ] LogError ("Error: Can’t return to base state")
    [ ] TextEditor.Exit ()
    [ ] TextEditor.Invoke ()
Parent topic: MainWin Class


Exit Method

Class

MainWin.

Action

Terminates the application by closing all open windows, including the main window.

Syntax

mainwin.Exit ( )

Notes

Exit terminates the application containing the main window. It first closes all open application windows and then closes the application itself.

Exit starts with the current active window and attempts to close it using the following sequence, stopping when the window closes:

  1. If a Close method is defined for a window, call it. If that does not close the window, none of the following steps will be executed.
  2. Call window.CloseBox.Click() (on Windows).
  3. Call window.SysMenu.Close.Pick() (on platforms and windows that have system menus).
  4. If the window is a dialog, type the keys specified in OPT_CLOSE_DIALOG_KEYS and wait one second for the dialog to close.
  5. If there is a single button on the window, click the button.
  6. Click the list of buttons specified in OPT_CLOSE_WINDOW_BUTTONS.
  7. Select the menus specified in OPT_CLOSE_WINDOW_MENUS.

Once one window closes, Exit follows the sequence with the next active window, until all windows are closed.

When closing any window causes the application to display a confirmation dialog, Exit attempts to close the dialog using the list of buttons specified in the OPT_CLOSE_CONFIRM_BUTTONS option.

If the windows cannot be closed (for example, because the application displays a message box that cannot be closed with the buttons specified in OPT_CLOSE_CONFIRM_BUTTONS), Exit unconditionally terminates the application and issues a warning.

If the application does not terminate normally, Exit prints the following message to the Results file:

*** Warning: Application not terminated cleanly

This method supports several options for specifying how a window should be closed:

To specify | Set this option | Or set this variable
To use non-standard buttons to close a confirmation dialog | OPT_CLOSE_CONFIRM_BUTTONS | lsCloseConfirmButtons
To use non-standard buttons to close a window | OPT_CLOSE_WINDOW_BUTTONS | lsCloseWindowButtons
To use non-standard menu items to close a window | OPT_CLOSE_WINDOW_MENUS | lsCloseWindowMenus
To use non-standard keyboard input to close a dialog | OPT_CLOSE_DIALOG_KEYS | lsCloseDialogKeys

You can make these specifications using either the SetOption method, by defining the specified variable, or by using the settings in the Close panel on the Agent Options dialog.

Example

    [-] if (TextEditor.Exists ())
        [ ] TextEditor.SetActive ()
    [ ] TextEditor.Exit ()
Parent topic: MainWin Class


GetCloseWindows Function

Class

MainWin.

Action

Returns the windows that must close to return the application to base state.

Availability

This functionality is supported on both the Classic Agent and the Open Agent.

Syntax

lwWindows = mainwin.GetCloseWindows()
Variable | Description
lwWindows | The windows to close. LIST OF WINDOW.

Notes

GetCloseWindows returns the list of windows, in order, that CloseWindows must close to return the application to base state, with just the MainWin open. If only the MainWin is open, GetCloseWindows returns an empty list, {}.

Example

    [-] if (TextEditor.GetCloseWindows != {})
        [ ] TextEditor.CloseWindows()
Parent topic: MainWin Class


GetNextCloseWindow Function

Class

MainWin.

Action

Returns the next window that the Close method will close.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

wNext = mainwin.GetNextCloseWindow()
Variable | Description
wNext | The top-most window in the application. WINDOW.

Notes

This function returns the application window that the Close method will close, if called. If only the MainWin is open, GetNextCloseWindow returns NULL.

Example

    [-] testcase GetNextCloseWindowExample()
        [ ] WINDOW w
        [ ] w = TextEditor.GetNextCloseWindow()
        [-] while(w != NULL)
            [ ] Print("Active window is", w)
            [ ] w.Close()
            [ ] w = TextEditor.GetNextCloseWindow()
Parent topic: MainWin Class


Start Method

Class

MainWin.

Action

Invokes the application, using the specified command line, and waits for the main window to appear.

Syntax

MainWin.Start (sCmdLine, sDir, sExtensionReady, nInvokeTimeout)
Variable | Description
sCmdLine | The command line used to run the application. STRING.
sDir | The working directory of the application when it is invoked, as specified by the sDir member of the MainWin declaration. STRING.
sExtensionReady

If the bExtensionReady member of the MainWin declaration is defined and not false, the Invoke method passes "~ExtensionReady" to the Start method as its third argument. STRING.

When this argument is "~ExtensionReady", Silk Test Classic stops waiting when the timeout expires or when the application’s extension has finished registering.

If bExtensionReady is not defined in the MainWin declaration and if the wStartup member of the MainWin declaration is defined and not null, Silk Test Classic interprets the wStartup value as a window and specifies its tag for sExtensionReady. Silk Test Classic looks for the specified window until the timeout expires.

nInvokeTimeout

Number of seconds that Silk Test Classic waits for the main window of the application to appear. INTEGER.

The Invoke method passes the value of nInvokeTimeout to the Start method as its fourth argument.

If sExtensionReady is "~ExtensionReady", Silk Test Classic waits until the timeout expires or until the application’s extension tag (if it has one) has finished registering.

If sExtensionReady is not "~ExtensionReady" but not null, Silk Test Classic interprets it as the tag for the window specified by the wStartup member of the declaration. Silk Test Classic looks for the specified window until the timeout expires.

If the bExtensionReady and wStartup members are not defined in the MainWin declaration, Silk Test Classic looks for the MainWin itself.

Notes

Start runs the application specified in sCmdLine, and waits for the application window to exist before returning.

The first part of the command line specifies the name of the executable file. Since all platforms support a search path, Silk Test Classic uses the search path to locate the specified executable file. The rest of the command line is passed as arguments to the specified executable file.

If Silk Test Classic cannot start the application (for example, if it cannot find the file or there is not enough memory), the exception E_CANT_START_APP is raised.

As an alternative to Start, you can use the Shell32.dll from Microsoft Windows with the ShellExecuteW() command. ShellExecuteW() returns control to the application after it starts the executable. Or, use APP_Start() from bwcompat.inc, which is provided with Silk Test Classic. For details about APP_Start(), refer to the bwcompat.inc file. For details about ShellExecuteW(), refer to the Windows help.

Example

    [-] if (!TextEditor.Exists ())
        [ ] TextEditor.Start ("textedit.exe")
Parent topic: MainWin Class


Menu Class

Description

Menu is the class for menus.

Inheritance

Menu derives from the AnyWin class; several classes derive from this class.

Methods and Properties

AnyWin.MoveMouse() is not available for the Menu class.

In addition to the methods and properties it inherits from the AnyWin class, Menu has the following methods and properties:

  • GetContents Function (ComboBox ListBox PopupListRadioList)
    Returns the contents of the combo box, list box, popup list, or radio list.
  • GetItemCount Function (ComboBox ListBox ListView Menu PopupList RadioList)
    Returns the number of items in the list, list box, listview, menu, popup list, radio list, or combo box list box.
  • Pick Method
    Selects the menu or menu item.
  • iItemCount property
    The number of items in the combo box list, list box, menu, popup list, radio list, or tree view.
Parent topic: General Core Classes
Related reference
AnyWin Class


Pick Method

Class

Menu and MenuItem.

Action

Selects the menu or menu item.

Syntax

object.Pick ( )

Notes

Pick selects the menu or menu items by simulating mouse moves and clicks on the menu bar and menus. If the menu item does not exist or is disabled, Pick waits for the window time-out period (set with the OPT_WINDOW_TIMEOUT option) before raising an exception.

Pick() has a default minimum keyboard delay of 1 millisecond. This is designed to eliminate timing errors and to improve recognition of client server application’s windows (childwin, dialogbox, for example) after picking a menu item. This also means that you do not need to set keyboard or mouse delays in scripts, option sets, or under Agent Options to try to prevent some of these timing errors.

Example

TextEditor.Search.Find.Pick ()
Parent topic: Menu Class
Parent topic: MenuItem Class


MenuItem Class

Description

MenuItem is the class for items on a menu.

Inheritance

MenuItem derives from the Menu class; no classes derive from this class.

Using a Data Member in the Tag for a MenuItem

If you want to use a data member in the tag for a MenuItem, be sure to use the entire hierarchy of the data member in the tag. Otherwise, calling methods involving GetChildren() (including VerifyProperties() using the property "Children") on the menu containing the menu item will not work properly. Either the menu item will be recognized as dynamically instantiated rather than declared, or the method will raise a Member is not defined in window exception. For example, consider the following window declaration for a menu item (and its ancestors):

    [ ] window MainWin MyWin
    [-] Menu File
        [ ] tag "File"
    [-] MenuItem New
        [ ] STRING sLocString ="New"
        [ ] tag MyWin.File.New.sLocString

Notice that the tag expression contains the complete window identifier. That tag expression, or even "{MyWin.File.New.sLocString}", is preferable to sLocString or "{sLocString}".

Methods and Properties

AnyWin.MoveMouse() is not available for the MenuItem class.

In addition to the methods and properties it inherits from the AnyWin class and Menu class, MenuItem has these methods and properties:

  • Check Method (CheckBox MenuItem)
    Checks the check box or menu item.
  • Pick Method
    Selects the menu or menu item.
  • Uncheck Method (CheckBox MenuItem)
    Unchecks the check box or menu item.
  • VerifyChecked Method
    Verifies that a menu item is checked or unchecked.
  • bChecked Property
    Whether the check box is checked or the menu item is selected.
Parent topic: General Core Classes
Related reference
Menu Class
AnyWin Class


VerifyChecked Method

Class

MenuItem.

Action

Verifies that a menu item is checked or unchecked.

Syntax

menuitem.VerifyChecked([bChecked]
[, nTimeout])
Variable | Description
bChecked | Optional: Verifies if the menu item is checked (TRUE) or unchecked (FALSE). The default value is TRUE. BOOLEAN.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

VerifyChecked verifies whether the menu item’s checked state matches the desired state. The desired state is checked unless bChecked is FALSE.

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyChecked() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option (OPT_WINDOW_RETRY). If the verification fails, an exception is thrown.

Example

MyApp.Menu("Edit").MenuItem("WordWrap").VerifyChecked()
Parent topic: MenuItem Class


MoveableWin Class

Description

MoveableWin is the class for windows that typically can move.

Inheritance

MoveableWin derives from the AnyWin class. The following classes derive from the MoveableWin class:

  • ChildWin
  • DialogBox
  • MainWin

Identification of MoveableWin Parts

Any MoveableWin has the following predefined identifiers for referring to parts of the window:

Part | Definition
BottomEdge | The bottom edge of the window (Windows only)
BottomLeftCorner | The bottom-left corner of the window (Windows only)
BottomRightCorner | The bottom-right corner of the window (Windows only)
Caption | The caption of the window
ClientArea | The inner portion of the window, excluding any caption, menubar, or border
CloseBox | The box used to close the window (Windows only)
LeftEdge | The left edge of the window (Windows only)
MaximizeBox | The box used to maximize the window
MenuBar | The menu bar on the window
MinimizeBox | The box used to reduce the window to an icon
RightEdge | The right edge of the window (Windows only)
RestoreBox | The box used to restore the window’s previous size
TopEdge | The top edge of the window (Windows only)
TopLeftCorner | The top-left corner of the window (Windows only)
TopRightCorner | The top-right corner of the window (Windows only)

To refer to these parts, you specify the window and then the part, separated by the dot operator, and then call the method. For example:

Print (TextEditor.MenuBar.GetContents ())

In general, you do not need to refer to the window parts; Silk Test Classic provides methods that access them directly. For example, calling the Click method on the Maximize box is the same as calling the Maximize method.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class, MoveableWin has the following methods and properties:

  • Close Method (MoveableWin)
    Closes the window.
  • GetState Function (MoveableWin)
    Returns the state of the window.
  • Maximize Method (MoveableWin)
    Maximizes the window.
  • Minimize Method (MoveableWin)
    Reduces the window to an icon.
  • Move Method (MoveableWin)
    Moves the window.
  • Restore Method (MoveableWin)
    Restores the window to its previous size.
  • SetActive Method (MoveableWin)
    Makes the window active.
  • Size Method
    Resizes the window.
  • VerifyCaption Method
    Verifies the caption of the window.
Parent topic: General Core Classes
Related reference
AnyWin Class
DialogBox Class
MainWin Class


Close Method (MoveableWin)

Class

MoveableWin.

Action

Closes the window.

Syntax

window.Close ([bConfirm, bSetActive])
Variable | Description
bConfirm | Optional: TRUE to close confirmation dialogs that may pop up when closing the window; FALSE (default) to raise an exception if a confirmation dialog pops up. BOOLEAN.
bSetActive | Optional: TRUE to issue window.SetActive before attempting to close window. FALSE (default) to close without attempting to set window active. BOOLEAN.

Notes

The Close method attempts to close the window by trying the following events, in this sequence, stopping when the window closes:

  1. If a Close method is defined for the window, call it. Even if this method does not close the window, none of the following steps are executed.
  2. Call window.SysMenu.Close.Pick( ) (on platforms and windows that have system menus).
  3. If the window is a dialog box, type the keys specified in OPT_CLOSE_DIALOG_KEYS and wait one second for the dialog box to close.
  4. If there is a single button in the window, click that button.
  5. Click the list of buttons specified with OPT_CLOSE_WINDOW_BUTTONS.
  6. Select the menus specified with OPT_CLOSE_WINDOW_MENUS.
  7. Close() will use Alt+F4 if there is no File menu.

Close may fail. For example, if closing a window causes the application to display a message box and bCloseConfirm is set to FALSE, or if the buttons used to close the message box are not covered under the OPT_CLOSE_CONFIRM_BUTTONS option, the call will fail and raise the exception E_CANT_CLOSE_WINDOW.

This method supports several specifications you can make to help Silk Test Classic close a window:

To specify | Set this option | Or set this variable
Non-standard buttons to use to close confirmation dialog boxes | OPT_CLOSE_CONFIRM_BUTTONS | lsCloseConfirmButtons
Non-standard buttons to use to close the window | OPT_CLOSE_WINDOW_BUTTONS | lsCloseWindowButtons
Non-standard menu items to use to close the window | OPT_CLOSE_WINDOW_MENUS | lsCloseWindowMenus
Non-standard keys to type to close the window, if it is a dialog box | OPT_CLOSE_DIALOG_KEYS | lsCloseDialogKeys

You can make these specification, either by using the SetOption method, by defining the specified variable, or using the settings in the Close tab of the Agent Options dialog box.

Example

// Set the line number in GotoLine dialog to a string
GotoLine.LineNumber.SetText ("A")
GotoLine.Accept ()
// TextEditor displays a message box
MessageBox.Message.Verify ("Must enter a number.")
// close the message box
MessageBox.Close ()
Parent topic: MoveableWin Class


GetState Function (MoveableWin)

Class

MoveableWin.

Action

Returns the state of the window.

Syntax

wState = window.GetState( )
Variable | Description
wState | The state of the window. WINSTATE.

Notes

GetState returns a WINSTATE specifying the state of the pagelist, which can have the following values:
  • WS_NORMAL
  • WS_MAXIMIZED
  • WS_MINIMIZED

Example

WINSTATE wState
TextEditor.Restore()
wState = TextEditor.GetState()
Parent topic: MoveableWin Class


Maximize Method (MoveableWin)

Class

MoveableWin.

Action

Maximizes the window.

Syntax

window.Maximize ( )

Notes

Maximize resizes the window to its full (maximized) size. If the window is already maximized, Maximize does nothing.

Example

TextEditor.Maximize ()
Print (TextEditor.GetState ()) // prints WS_MAXIMIZED
TextEditor.Restore ()
Print (TextEditor.GetState ()) // prints WS_NORMAL
Parent topic: MoveableWin Class


Minimize Method (MoveableWin)

Class

MoveableWin.

Action

Reduces the window to an icon.

Syntax

window.Minimize ( )

Notes

Minimize does nothing if the window is already an icon.

Example

TextEditor.Minimize ()
TextEditor.Restore ()
Parent topic: MoveableWin Class


Move Method (MoveableWin)

Class

MoveableWin.

Action

Moves the window.

Syntax

window.Move (iXpos, iYpos)
Variable | Description
iXpos | The new horizontal position of the top-left corner of the window. INTEGER.
iYpos | The new vertical position of the top-left corner of the window. INTEGER.

Notes

The Move method moves the window so that its top-left corner is at location (iXpos, iYpos). After moving the window, Silk Test Classic verifies that it moved to the correct location, and raises the exception E_CANT_MOVE_WINDOW if it is not.

Set the OPT_WINDOW_MOVE_TOLERANCE option to specify the number of pixels allowed for a tolerance when a moved window does not end up at the specified position.

For some windows and GUIs, you can’t always move the window to the particular pixel specified. If the ending position is not exactly what was specified and the difference between the expected and actual positions is greater than the tolerance, Silk Test Classic raises an exception.

Example

RECT myRect
myRect = TextEditor.GetRect ()
// moves the window 8 pixels right and 8 pixels down
TextEditor.Move (myRect.xPos + 8, myRect.yPos + 8)
Parent topic: MoveableWin Class


Restore Method (MoveableWin)

Class

MoveableWin.

Action

Restores the window to its previous size.

Syntax

window.Restore ( )

Notes

Restore restores the window to the width and height it had before it was reduced to an icon (with the Minimize method) or maximized (with the Maximize method). Restore does nothing if the window is neither reduced to an icon nor maximized. If the window is not exposed, Restore generates the error message Window is not exposed unless you have turned off the option that verifies that the window is exposed. To do this, execute the following statement before executing the Restore method:

SetOption(OPT_VERIFY_EXPOSED, FALSE)

Example

TextEditor.Document.Maximize ()
TextEditor.Document.Restore ()
Parent topic: MoveableWin Class


SetActive Method (MoveableWin)

Class

MoveableWin.

Action

Makes the window active.

Syntax

window.SetActive ( )

Notes

SetActive makes the window active, if it is not already. Only top-level windows (such as main windows) and windows that can be moved or resized (such as dialogs) can be made active.

For windows, the window to be activated can also be an MDI child window.

Example

    [-] if (TextEditor.Exists ())
        [ ] TextEditor.SetActive ()
    [-] else
        [ ] TextEditor.Invoke ()
Parent topic: MoveableWin Class


Size Method

Class

MoveableWin.

Action

Resizes the window.

Syntax

window.Size (iWidth, iHeight)
Variable | Description
iWidth | The new width of the window, in pixels. INTEGER.
iHeight | The new height of the window, in pixels. INTEGER.

Notes

The Size method resizes the window. After resizing the window, Silk Test Classic checks that the new size is correct, and raises the exception E_CANT_SIZE_WINDOW if it is not.

You can set the option OPT_WINDOW_SIZE_TOLERANCE to specify the number of pixels allowed for a tolerance when a resized window does not end at the specified size.

For some windows and GUIs, you cannot always resize the window to the particular size specified. If the ending size is not exactly what was specified and the difference between the expected and actual sizes is greater than the tolerance, Silk Test Classic raises an exception.

Windows

Windows cannot be sized smaller than will fit comfortably with the menubar.

Example

TextEditor.Size (300, 100)
Parent topic: MoveableWin Class


VerifyCaption Method

Class

MoveableWin.

Action

Verifies the caption of the window.

Syntax

window.VerifyCaption(sCaption[, nTimeout])
Variable | Description
sCaption | The caption you expect the window to have. STRING.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

VerifyCaption checks whether the caption of a window has the expected value.

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyCaption() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option (OPT_WINDOW_RETRY). If the verification fails, an exception is thrown.

Example

MyDialog.VerifyCaption("Options")
Parent topic: MoveableWin Class


PageList Class

Description

PageList is the class for tabbed, multi-page dialog boxes, and for button bars.

On Windows, this class corresponds to the TabControl control.

On Windows, Silk Test Classic only supports major tabs; it does not support minor tabs (also called "subpages" or "child pages").

Inheritance

PageList derives from the Control class. The following class derives from the PageList class:

  • SWTTabControl

Identification of PageList Pages

In PageList methods, you identify a specific page by its tab name or its index value relative to the other pages in the pagelist.

Examples of Identifying Pages

The following examples show how you can identify pages within a PageList by tab name or by index.

This Specification... | Identifies This Page...
5 | 5th page
"#5" | 5th page
"Runtime" | Page with major or minor tab "Runtime".
"/Runtime" | Page with major tab "Runtime". The slash is optional for Windows.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, PageList has the following methods and properties:

  • FindPage Function
    Returns the number of the specified page.
  • GetContents Function (PageList)
    Returns a list of all the pages in the pagelist.
  • GetPageCount Function
    Returns the number of pages in the pagelist.
  • GetPageName Function
    Returns the page name of the specified page.
  • GetSelIndex Function (TreeView)
    Returns the index of the selected item, relative to all visible items.
  • GetSelText Function (PageList)
    Returns the text identifying the current page in the page-list.
  • HasSubPages Method
    Returns TRUE if the pagelist supports sub-pages.
  • Select Method (PageList)
    Sets the current page to the specified page.
  • bHasSubPages Property
    Whether the page list has sub pages.
  • iPageCount Property
    The number of pages in the Page List object.
  • iValue Property
    The index of the selected item or integer position of the control.
  • lsContents Property
    The contents of the combo box list, list box, list view, page list, popup list, radio list, or tree view.
  • sValue Property
    The text in the selected text box.
Parent topic: General Core Classes
Related reference
Control Class
AnyWin Class


FindPage Function

Class

PageList.

Action

Returns the number of the specified page.

Syntax

iPage = pagelist.FindPage(sPage)
Variable | Description
iPage | The index of the page if found, or 0 if not found. The index is relative to all pages in the pagelist. INTEGER.
sPage | The page to find. STRING. A forward slash is optional before the sPage when you are working with Windows, for example FindPage("/Begin").

Notes

FindPage returns the index of a page, given its text. The text of a page is the label that appears on the page’s folder tab, if any. The returned index is one-based.

For more information about specifying sPage, see the PageList class.

Example

Verify(MyDialog.MyPageList.FindPage("foo"), 4)
Parent topic: PageList Class


GetContents Function (PageList)

Class

PageList.

Action

Returns a list of all the pages in the pagelist.

Syntax

lsPages = pagelist.GetContents ([bRawMode])
Variable | Description
lsPages | The list of all pages in the pagelist. LIST OF STRING.
bRawMode

Optional: TRUE to leave platform-specific information in the strings, or FALSE (default) to remove that information. BOOLEAN.

The Open Agent always uses FALSE for this value regardless of what is specified in the script. The returned strings include trailing and leading spaces but ellipses, accelerators, and hot keys are removed.

Notes

GetContents returns a list of strings, with one list element for each page in the pagelist.

For pages with tabs, the returned list element is the label of the tab.

For pages without tabs, the returned list element is an empty list.

When bRawMode is TRUE, the returned strings include trailing and leading spaces, ellipses, accelerators, and hot keys. These additional characters make the strings platform-specific. When bRawMode is FALSE, the output of GetContents does not include any special characters.

Example

Verify(MyDg.MyPageList.GetContents(),lsExpectedContents)
Parent topic: PageList Class


GetPageCount Function

Class

PageList.

Action

Returns the number of pages in the pagelist.

Syntax

iCount = pagelist.GetPageCount ( )
Variable | Description
iCount | The number of pages in the pagelist. INTEGER.

Notes

GetPageCount returns the number of pages in the pagelist.

Example

for iPage = 1 to MyDialog.MyPageList.GetPageCount()
// ...
Parent topic: PageList Class


GetPageName Function

Class

PageList class

Action

Returns the page name of the specified page.

Syntax

sName = pagelist.GetPageName (iIndex, [bRawMode])
Variable | Description
sName | Name of the tab of the specified page. STRING.
iIndex | Page number. INTEGER.
bRawMode

Optional. TRUE to leave the platform-specific information in the string or FALSE (the default) to remove the information. BOOLEAN.

The Open Agent always uses FALSE for this value regardless of what is specified in the script. The returned strings include trailing and leading spaces but ellipses, accelerators, and hot keys are removed.

Example

// Prints the name of the tab on page 1.
Print (MyDialog.MyPageList.GetPageName(1))
Parent topic: PageList Class


GetSelIndex Function (TreeView)

Class

TreeView.

Action

Returns the index of the selected item, relative to all visible items.

Syntax

iIndex = treeview.GetSelIndex()
Variable | Description
iIndex | The index of the selected item in the control. INTEGER.

Notes

GetSelIndex returns the global index of the selected item in the treeview. If no item is selected, the return value is zero (0). The value of the returned index for an item depends on how many collapsed items are above it in the treeview.

Example

Verify(MyDialog.MyTreeView.GetSelIndex(), 4)
Parent topic: PageList Class
Parent topic: TreeView Class


GetSelText Function (PageList)

Class

PageList class

Action

Returns the text identifying the current page in the page-list.

Syntax

sPage = pagelist.GetSelText( )
Variable | Description
sPage | The name of the currently active page. STRING.

Notes

The text of a page is the label that appears on the page’s folder tab.

Example

Verify(MyDialog.MyPageList.GetSelText(), "Tab 2")
Parent topic: PageList Class


HasSubPages Method

Class

PageList class

Action

Returns TRUE if the pagelist supports sub-pages.

Syntax

bHasThem = pagelist.HasSubPages( )
Variable | Description
bHasThem | TRUE if the pagelist supports sub-pages. BOOLEAN.

Notes

This method always returns FALSE in Windows.

HasSubPages indicates whether a pagelist supports sub-pages, which are pages with minor tabs or with no tabs. You can use this function to determine whether to use "/major/minor" notation when specifying pages or examining pagelist contents. For more information about major and minor tabs, see PageList Class.

Example

if (MyDialog.MyPageList.HasSubPages())
//...
Parent topic: PageList Class


Select Method (PageList)

Class

PageList class

Action

Sets the current page to the specified page.

Syntax

pagelist.Select (sPage)
Variable | Description
sPage | The page to select. LISTITEM

Notes

Select causes the specified page to become the current (active) page in the pagelist.

For information on specifying sPage, see the PageList class.

Windows Platforms

For TabList controls, Select generates a click on the specified tab.

Example

MyDialog.MyPageList.Select ("/Options/Agent")
Parent topic: PageList Class


bHasSubPages Property

Class

PageList.

Description

Whether the page list has sub pages.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: PageList Class


iPageCount Property

Class

PageList.

Description

The number of pages in the Page List object.

Data Type

INTEGER.

Access

Read only.

Parent topic: PageList Class


PushButton Class

Description

PushButton is the class for pushbuttons.

Inheritance

PushButton derives from the Control class; no classes derive from this class.

Notes

If you use SetActive() on a PushButton in a .NET 1.1 application, the method will work on a local drive, but not on a shared drive. This is due to a security issue that can happen on network drives.

Methods and Properrties

In addition to the methods and properties it inherits from the AnyWin class and Control class, PushButton has the following methods and properties:

  • Click Method (AnyWin PushButton)
    Clicks either a window or a pushbutton.
  • IsIndeterminate Function
    Determines whether a button on a tool bar is in a state that is neither pressed nor not pressed.
  • IsPressed Function
    Tests whether a pushbutton on a toolbar is pressed.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


IsIndeterminate Function

Class

PushButton.

Action

Determines whether a button on a tool bar is in a state that is neither pressed nor not pressed.

Availability

This method is available only for tool bar pushbuttons in Windows.

Syntax

bTest = pushbutton.IsIndeterminate()
Variable | Description
bTest | TRUE if the push button is neither pressed nor not pressed. BOOLEAN.
Parent topic: PushButton Class


IsPressed Function

Class

PushButton.

Action

Tests whether a pushbutton on a toolbar is pressed.

Availability

This method is available only for tool bar pushbuttons in a 32-bit Windows application.

Syntax

bTest = pushbutton.IsPressed()
Variable | Description
bTest | TRUE if the pushbutton is pressed. BOOLEAN.

IsPressed must be preceded by the PressMouse method (with bRawEvent set to TRUE).

Unlike other pushbuttons, certain pushbuttons on a tool bar can remain pressed. IsPressed tests for this state. The pressed state is not the same as the checked state. ToolBar controls that support the checked state are associated with the CheckBox class, not the PushButton class.

Parent topic: PushButton Class


RadioList Class

Description

RadioList is the class for a group of radio buttons, such as the two radio buttons used to specify direction in the Find dialog box of the Text Editor application. Only one button in a radio list can be selected at a single time.

Inheritance

RadioList derives from the Control class; no classes derive from this class.

Identification of RadioList items

Some RadioList methods let you specify items as either INTEGERs or STRINGs, in one of these ways:

  • A STRING, which can contain the wildcard characters question mark (?), to match any single character, and asterisk (*), to match zero or more characters

  • An INTEGER that represents the numerical index (1-based) of the item

  • A STRING of the form "#n", where n is the numerical index

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, RadioList has the following methods and properties:

  • GetContents Function (ComboBox ListBox PopupListRadioList)
    Returns the contents of the combo box, list box, popup list, or radio list.
  • GetItemCount Function (ComboBox ListBox ListView Menu PopupList RadioList)
    Returns the number of items in the list, list box, listview, menu, popup list, radio list, or combo box list box.
  • GetItems Function (ComboBox ListBox RadioList )
    Returns all items in the combo box, listbox, or radiolist.
  • GetItemText Function (ComboBox ListBox PopupList RadioList)
    Returns the text of an item in the list box, popup list, radio list, or combo box.
  • GetSelItem Method (RadioList)
    Returns the currently selected item in the radio list.
  • iItemCount property
    The number of items in the combo box list, list box, menu, popup list, radio list, or tree view.
  • iValue Property
    The index of the selected item or integer position of the control.
  • lsContents Property
    The contents of the combo box list, list box, list view, page list, popup list, radio list, or tree view.
  • sValue Property
    The text in the selected text box.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


GetSelItem Method (RadioList)

Class

RadioList.

Action

Returns the currently selected item in the radio list.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

GetSelItem()

Notes

If no item is selected, GetSelItem returns an empty list.

Example

Verify(DialogBox1.Elements.GetSelItem())
Parent topic: RadioList Class


Scale Class

Description

Scale is the class for scales.

In Windows, the Scale class corresponds to the TrackBar control.

Inheritance

Scale derives from the Control class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, Scale has the following methods and properties:

  • GetPosition Function (Scale ScrollBar)
    Returns the position of the scroll bar or scale.
  • GetRange Function (Scale ScrollBar)
    Returns the minimum and maximum positions to which the scroll bar or scale can be set.
  • SetPosition Method (Scale ScrollBar)
    Sets the position of the scroll bar or scale.
  • SetToMax Method (Scale)
    Sets the scale to its maximum position.
  • SetToMin Method (Scale)
    Sets the scale to its minimum position.
  • iValue Property
    The index of the selected item or integer position of the control.
  • Range Property
    The range of the scale, scroll bar, spinner control, or up/down control.
  • rValue Property
    The real position of the scale.
Parent topic: General Core Classes


GetPosition Function (Scale ScrollBar)

Class

Scale and ScrollBar.

Action

Returns the position of the scroll bar or scale.

Syntax

nPos = object.GetPosition()
Variable | Description
nPos | The current position of the scale or scroll bar. INTEGER or NUMBER.

Notes

GetPosition returns the internal numeric value of the current position of the scroll bar or scale. For scales, the number returned is an INTEGER or a NUMBER. For scroll bars, the number returned is an INTEGER.

Example

INTEGER iPos
iPos = Open.FilesSB.GetPosition()
Parent topic: Scale Class
Parent topic: ScrollBar Class


GetRange Function (Scale ScrollBar)

Class

Scale and ScrollBar.

Action

Returns the minimum and maximum positions to which the scroll bar or scale can be set.

Syntax

rMinMax = object.GetRange()
Variable | Description
rMinMax | The range of the object. SBRANGE or SCLRANGE.

Notes

GetRange returns the internal numeric values of the minimum and maximum positions. The return value is a record of type SBRANGE for scroll bars or SCLRANGE for scales.

The record has these two fields:

Field | Description
Min | The minimum position. INTEGER for scroll bars, NUMBER for scales.
Max | The maximum position. INTEGER for scroll bars, NUMBER for scales.

Example

SBRANGE sbRange
sbRange = Open.FilesSB.GetRange()
Open.Files.Select(sbRange.iMin)
Open.Files.Select(sbRange.iMax)
Parent topic: Scale Class
Parent topic: ScrollBar Class


SetPosition Method (Scale ScrollBar)

Class

Scale and ScrollBar.

Action

Sets the position of the scroll bar or scale.

Syntax

object.SetPosition (nPosition)
Variable | Description
nPosition | The internal numeric value of the position to move to. INTEGER or REAL.

Notes

SetPosition sets the position of the scroll bar to the internal value nPosition. If the scroll bar or scale cannot be set to that position, Silk Test Classic raises the exception E_POS_NOT_REACHABLE.

For scroll bars, the position must be an INTEGER. For scales, the position can be an INTEGER or a REAL.

For scroll bars, the horizontal and vertical amount is linked to the scrollbar step size. When you click the scrollbar arrows, the scrollbar is incremented or decremented by the step size. If the horizontal or vertical amount that you specify is not divisible by the step size, the closest step value is used. For example, if the step size is 5 and you specify 9, the scrollbar goes to 10. If you specify 6, the scrollbar goes to 5.

Example

Open.Files.VScrollBar.SetPosition (5)
Parent topic: Scale Class
Parent topic: ScrollBar Class


SetToMax Method (Scale)

Class

Scale.

Action

Sets the scale to its maximum position.

Syntax

scale.SetToMax ( )

Notes

SetToMax sets a scale to its maximum position. It then checks the internal position of the scale to ensure that it is at the maximum position, and moves it if it is not.

Example

DialogBox.TotalWeight.SetToMax ()
Parent topic: Scale Class


SetToMin Method (Scale)

Class

Scale.

Action

Sets the scale to its minimum position.

Syntax

scale.SetToMin ( )

Notes

SetToMin sets a scale to its minimum position. It then checks the internal position of the scale to ensure that it is at the minimum position, and moves it if it is not.

Example

DialogBox.TotalWeight.SetToMin ()
Parent topic: Scale Class


Range Property

Class

  • Scale
  • ScrollBar
  • Spinner
  • UpDownEx

Description

The range of the scale, scroll bar, spinner control, or up/down control.

Data Type

SCLRANGE or SBRANGE.

Access

Read and write.

Parent topic: Scale Class
Parent topic: ScrollBar Class
Parent topic: Spinner Class
Parent topic: UpDownEx Class


rValue Property

Class

Scale.

Description

The real position of the scale.

Data Type

REAL.

Access

Read and write.

Parent topic: Scale Class


ScrollBar Class

Description

ScrollBar is the class for scroll bars, including the scroll bars that are parts of controls, such as the scroll bar on a list box.

Inheritance

ScrollBar derives from the Control class; two classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, ScrollBar has the following methods and properties:

  • GetPageSize Function
    Returns the internal page size of a scroll bar.
  • GetPosition Function (Scale ScrollBar)
    Returns the position of the scroll bar or scale.
  • GetRange Function (Scale ScrollBar)
    Returns the minimum and maximum positions to which the scroll bar or scale can be set.
  • ScrollByLine Method
    Scrolls the scroll bar line by line.
  • ScrollByPage Method
    Scrolls the scroll bar page by page.
  • ScrollToMax Method
    Scrolls the scroll bar to its maximum position.
  • ScrollToMin Method
    Scrolls the scroll bar to its minimum position.
  • SetPageSize Method
    Sets the internal page size of a scroll bar.
  • SetPosition Method (Scale ScrollBar)
    Sets the position of the scroll bar or scale.
  • VerifyPageSize Method
    Determines whether the page size is as expected.
  • iPageSize Property
    The internal page size of the scroll bar.
  • iValue Property
    The index of the selected item or integer position of the control.
  • Range Property
    The range of the scale, scroll bar, spinner control, or up/down control.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


GetPageSize Function

Class

ScrollBar.

Action

Returns the internal page size of a scroll bar.

Syntax

iPageSize = GetPageSize()
Variable | Description
iPageSize | The internal page size of the scroll bar. INTEGER.

Notes

The page size is the number of internal units that the scroll bar's position changes by during a ScrollByPage operation.

Availability

This method is available in Windows only.

Parent topic: ScrollBar Class


ScrollByLine Method

Class

ScrollBar.

Action

Scrolls the scroll bar line by line.

Syntax

bTest = scrollbar.ScrollByLine (iAmount)
Variable | Description
bTest | TRUE if the scroll operation changes the scroll bar’s position. FALSE if the operation doesn’t change the scroll bar’s position. BOOLEAN.
iAmount | The direction and number of lines to scroll. If positive, ScrollByLine scrolls the specified number of lines down or to the right. If negative, ScrollByLine scrolls the specified number of lines up or to the left. INTEGER.

Notes

iAmount represents the number of times Silk Test Classic should click on one of the arrows in the scroll bar. iAmount does not necessarily correspond to the internal position or range of the scroll bar, because one click on an arrow does not necessarily result in a change of one internal unit. However, if iAmount does change the scroll bar’s position, the method returns TRUE.

Example

    [ ] INTEGER i
    [ ] SBRANGE Range
    [ ] Range = Open.Files.GetRange ()
    [ ] Open.Files.VScrollBar.ScrollToMin ()
    [-] for i = Range.iMin to Range.iMax
        [ ] Open.Files.VScrollBar.ScrollByLine (1)
Parent topic: ScrollBar Class


ScrollByPage Method

Class

ScrollBar.

Action

Scrolls the scroll bar page by page.

Syntax

bTest = scrollbar.ScrollByPage (iAmount)
Variable | Description
bTest | TRUE if the scroll operation changes the scroll bar’s position. FALSE if the operation does not change the scroll bar’s position. BOOLEAN.
iAmount | The direction and number of pages to scroll. If positive, scrolling is down or to the right. If negative, scrolling is up or to the left. INTEGER.

Notes

ScrollByPage scrolls a scroll bar iAmount pages by clicking the mouse on the appropriate area between the arrow and the thumb.

iAmount represents the number of times Silk Test Classic should click on the scroll bar page up or down region. iAmount does not necessarily correspond to the internal position or range of the scroll bar, because one click on the page up or down region does not necessarily result in a change of one internal unit. However, if iAmount does change the scroll bar’s position, the method returns TRUE.

Example

    [-] While (Open.Files.VScrollBar.ScrollByPage (1))
        [ ] i++
        [ ] CaptureBitmap ("w{i}.bmp")
Parent topic: ScrollBar Class


ScrollToMax Method

Class

ScrollBar.

Action

Scrolls the scroll bar to its maximum position.

Syntax

scrollbar.ScrollToMax ( )

Notes

ScrollToMax scrolls a scroll bar to its maximum position. It then checks the internal position of the scroll bar to ensure that it is at the maximum position, and moves it if it is not. This verification step is required because some applications move the thumb back one or two lines after it is dragged all the way down or over.

It is possible for the scroll bar to have an end range that can’t be reached by clicking the arrows. In this case, Silk Test Classic generates the exception E_POS_NOT_REACHABLE.

Example

Open.Files.VScrollBar.ScrollToMax ()
Parent topic: ScrollBar Class


ScrollToMin Method

Class

ScrollBar.

Action

Scrolls the scroll bar to its minimum position.

Syntax

scrollbar.ScrollToMin ( )

Notes

ScrollToMin scrolls a scroll bar to its minimum position. It then checks the internal position of the scroll bar to ensure that it is at the minimum position, and moves it if it is not. This verification step is required because some applications move the thumb back one or two lines after it is dragged all the way up or over.

It is possible for the scroll bar to have a start range that cannot be reached by clicking the arrows. In this case, Silk Test Classic generates the exception E_SBAR_POS_NOT_REACHABLE.

Example

Open.Files.VScrollBar.ScrollToMin ()
Parent topic: ScrollBar Class


SetPageSize Method

Class

ScrollBar.

Action

Sets the internal page size of a scroll bar.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SetPageSize (iPageSize)
Variable | Description
iPageSize | The internal page size of the scroll bar. INTEGER.

Notes

The page size is the number of internal units that the scroll bar's position changes by during a ScrollByPage operation.

Availability

This method is available in Windows only.

Parent topic: ScrollBar Class


VerifyPageSize Method

Class

ScrollBar.

Action

Determines whether the page size is as expected.

Syntax

scrollbar.VerifyPageSize(iExpPageSz[, nTimeout])
Variable | Description
iExpPageSz | The expected page size. INTEGER.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

If the verify fails, this function logs the following message to the results file: VerifyPageSize failed — expected iExpPageSz, got sActual. This method is not useful for Windows GUIs.

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyPageSize() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option, OPT_WINDOW_RETRY. If the verification fails, an exception is thrown.

Example

scrollbar.VerifyPageSize(12)
Parent topic: ScrollBar Class


iPageSize Property

Class

ScrollBar.

Description

The internal page size of the scroll bar.

Data Type

INTEGER.

Access

Read only.

Parent topic: ScrollBar Class


StaticText Class

Description

StaticText is the class for static text strings (that is, text that the user cannot change, such as a label).

Inheritance

StaticText derives from the Control class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, StaticText has the following methods and properties:

  • GetText Function (DynamicText StaticText TextField)
    Returns the text of the text field.
  • VerifyValue Method (DynamicText StaticText TextField)
    Verifies the text of the text field.
  • sValue Property
    The text in the selected text box.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


StatusBar Class

Description

StatusBar is the class for status bar controls. A status bar is a container for a set of text labels that change dynamically.

Availability

The StatusBar class is available only in Windows and in Web browsers.

Inheritance

StatusBar derives from the Control class; no classes derive from this class.

Identification of StatusBar Items

Each text item within a status bar is a child control, represented in Silk Test Classic with the DynamicText class.

Methods

StatusBar inherits all its methods from the AnyWin class and Control class.

Properties

StatusBar inherits all its properties from the AnyWin class and Control class.

Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class
DynamicText Class


TableColumn Class

Description

A column in a table.

Availability

This functionality is supported only if you are using the Open Agent.

Inheritance

The TableColumn class is derived from the Item class.

Methods and Properties

In addition to the methods and properties it inherits from the Item class, TableColumn has the following methods and properties:

  • Resize Method (DataGridColumn SWTTableColumn SWTTreeColumn TableColumn)
    Resizes a column of the table or tree.
  • Select Method (CTabItem SWTTabItem SWTTableColumn SWTTreeColumn TableColumn)
    Selects a tab or column.
  • Width Property
    The width of the column.
Parent topic: General Core Classes


Resize Method (DataGridColumn SWTTableColumn SWTTreeColumn TableColumn)

Class

DataGridColumn, SWTTableColumn, SWTTreeColumn, and TableColumn.

Action

Resizes a column of the table or tree.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Resize (width)
Variable | Description
width | The new width of the column, in pixels. INTEGER.

Example

Resize (50)
Parent topic: TableColumn Class
Parent topic: SWTTableColumn Class
Parent topic: SWTTreeColumn Class
Parent topic: DataGridColumn Class


Select Method (CTabItem SWTTabItem SWTTableColumn SWTTreeColumn TableColumn)

Class

  • CTabItem
  • SWTTabItem
  • SWTTableColumn
  • SWTTreeColumn
  • TableColumn

Action

Selects a tab or column.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Select ()
Parent topic: TableColumn Class
Parent topic: CTabItem Class
Parent topic: SWTTabItem Class
Parent topic: SWTTableColumn Class
Parent topic: SWTTreeColumn Class


Width Property

Class

DataGridColumn, SWTTableColumn, SWTTreeColumn, and TableColumn.

Description

The width of the column.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: TableColumn Class
Parent topic: SWTTableColumn Class
Parent topic: SWTTreeColumn Class
Parent topic: DataGridColumn Class


TableEx Class

Description

A series of two or more columns in an application.

Availability

This functionality is supported only if you are using the Open Agent.

Inheritance

The TableEx class is derived from the Control class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, TableEx has the following methods and properties:

  • Check Method (TableEx)
    Checks the check box in the defined row of a table.
  • DoubleSelect Method (TableEx)
    Double-clicks an item.
  • ExtendSelectRow Method (TableEx)
    Selects a range of rows.
  • FocusRow Method (TableEx)
    Focuses on a row in the table.
  • MultiSelectRow Method (TableEx)
    Adds a row from the table to the set of selected rows.
  • MultiUnselectRow Method (TableEx)
    Removes a row from the set of selected rows.
  • SelectRow Method (TableEx)
    Selects the specified row in a table.
  • Uncheck Method (TableEx)
    Unchecks the check box in the defined row of a table.
  • AllowsCheck Property
    Whether the tree or table can display a checkmark.
  • AllowsMultiSelect Property
    Whether the list view or table supports selecting multiple items.
  • ColumnCount Property
    Returns the number of columns per item in the grid, header, table, or tree.
  • ColumnItems Property
    A list containing all items in the column.
  • RowCount Property
    Number of rows within a grid or table.
  • RowItems Property
    A list containing all rows in the table or grid.
  • SelectedIndices Property
    A list containing the indices of the selected items.
  • SelectedItems Property (SWTTable TableEx WinFormsDataGrid)
    The selected items within a table or data grid.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


Check Method (TableEx)

Class

TableEx.

Availability

This functionality is supported only if you are using the Open Agent.

Action

Checks the check box in the defined row of the table.

Syntax

Check (item)
Variable | Description
item | The row in which to check the check box. ITEM.

Notes

This method checks the check box in the selected row in the table, regardless of its current state. The method can only be used in tables that have a check box in each row.

Parent topic: TableEx Class


DoubleSelect Method (TableEx)

Class

TableEx.

Action

Double-clicks an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.DoubleSelect (row, [column], modifiers)
Variable | Description
row | The row to double-click. LISTITEM.
column | Optional: The column to double-click. LISTITEM.
modifiers | The modifier to double-click. MODIFIERKEYSTATE.

Notes

DoubleSelect scrolls the specified item into view and then double-clicks it.

Parent topic: TableEx Class


ExtendSelectRow Method (TableEx)

Class

TableEx.

Action

Selects a range of rows.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.ExtendSelectRow (row, [column])
Variable | Description
row | The row to which to extend the selection. LISTITEM.
column | Optional: The column to which to extend the selection. LISTITEM.

Notes

ExtendSelectRow requires that the table already has a selected row. Precede the call with a call to SelectRow to select the first row.

Parent topic: TableEx Class


FocusRow Method (TableEx)

Class

TableEx.

Action

Focuses on a row in the table.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.FocusRow (row)
Variable | Description
row | The row on which to focus. LISTITEM.
Parent topic: TableEx Class


MultiSelectRow Method (TableEx)

Class

TableEx.

Action

Adds a row from the table to the set of selected rows.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.MultiSelectRow (row, [column])
Variable | Description
row | The row to select. LISTITEM.
column | Optional: The column to select. LISTITEM.

Notes

MultiSelectRow Ctrl+clicks on the item if the table supports multiple selections and the item is selected.

Parent topic: TableEx Class


MultiUnselectRow Method (TableEx)

Class

TableEx.

Action

Removes a row from the set of selected rows.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.MultiUnselectRow (row, [column])
Variable | Description
row | The row to remove from the selection. LISTITEM.
column | Optional: The column to remove from the selection. LISTITEM.

Notes

MultiUnselect Ctrl+clicks on the item if the table supports multiple selections and the item is selected.

Parent topic: TableEx Class


SelectRow Method (TableEx)

Class

TableEx.

Action

Selects the specified row in a table.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.SelectRow (Row, Column)
Variable | Description
Row | The row to select. INTEGER.
Column | Optional: The column to select. INTEGER.
Parent topic: TableEx Class


Uncheck Method (TableEx)

Class

TableEx.

Availability

This functionality is supported only if you are using the Open Agent.

Action

Unchecks the check box in the defined row of the table.

Syntax

Uncheck (item)
Variable | Description
item | The row in which to uncheck the check box. ITEM.

Notes

This method unchecks the check box in the selected row in the table, regardless of its current state. The method can only be used in tables that have a check box in each row.

Parent topic: TableEx Class


AllowsCheck Property

Class

TableEx, TreeView, and SWTTable.

Description

Whether the tree or table can display a checkmark.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

Boolean.

Access

Read only.

Parent topic: TableEx Class
Parent topic: TreeView Class
Parent topic: SWTTable Class


AllowsMultiSelect Property

Class

  • DomListBox
  • ListViewEx
  • SWTTable
  • TableEx
  • WinFormsDataGrid

Description

Whether the list view or table supports selecting multiple items.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

Boolean.

Access

Read only for WinFormsDataGrid, ListViewEx, SWTTable, and TableEx.

Read and write for DomListBox.

Parent topic: TableEx Class
Parent topic: SWTTable Class
Parent topic: WinFormsDataGrid Class
Parent topic: ListViewEx Class
Parent topic: DomListBox Class


ColumnCount Property

Class

  • HeaderEx
  • ListViewEx
  • MsuiaCalendar
  • MsuiaCustom
  • MsuiaDataGrid
  • MsuiaList
  • MsuiaStatusBar
  • MsuiaTable
  • SWTTable
  • SWTTree
  • TableEx
  • WinFormsDataGrid

Description

Returns the number of columns per item in the grid, header, table, or tree.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read only.

Parent topic: TableEx Class
Parent topic: SWTTable Class
Parent topic: SWTTree Class
Parent topic: WinFormsDataGrid Class
Parent topic: HeaderEx Class
Parent topic: ListViewEx Class


ColumnItems Property

Class

SWTTable, TableEx, and WinFormsDataGrid.

Description

A list containing all items in the column.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF WINDOW.

Access

Read only.

Parent topic: TableEx Class
Parent topic: SWTTable Class
Parent topic: WinFormsDataGrid Class


RowCount Property

Class

  • MsuiaCalendar
  • MsuiaCustom
  • MsuiaDataGrid
  • MsuiaList
  • MsuiaStatusBar
  • MsuiaTable
  • SWTTable
  • TableEx
  • WinFormsDataGrid

Description

Number of rows within a grid or table.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read only.

Parent topic: TableEx Class
Parent topic: SWTTable Class
Parent topic: WinFormsDataGrid Class


RowItems Property

Class

SWTTable, WinFormsDataGrid, and TableEx.

Description

A list containing all rows in the table or grid.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF WINDOW.

Access

Read only.

Parent topic: TableEx Class
Parent topic: SWTTable Class
Parent topic: WinFormsDataGrid Class


SelectedIndices Property

Class

  • DomListBox
  • ListViewEx
  • SWTTable
  • TableEx

Description

A list containing the indices of the selected items.

Notes

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF INTEGER.

Access

Read only for ListViewEx class.

Read and write for DomListBox class and SWTTable class.

Parent topic: TableEx Class
Parent topic: SWTTable Class
Parent topic: ListViewEx Class
Parent topic: DomListBox Class


SelectedItems Property (SWTTable TableEx WinFormsDataGrid)

Class

SWTTable, TableEx, and WinFormsDataGrid.

Description

The selected items within a table or data grid.

Notes

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF WINDOW.

Access

Read only for the WinFormsDataGrid class.

Read and write for the SWTTable class.

Parent topic: TableEx Class
Parent topic: SWTTable Class
Parent topic: WinFormsDataGrid Class


TableRow Class

Description

A row in a table.

Availability

This functionality is supported only if you are using the Open Agent.

Inheritance

The TableRow class is derived from the Item class.

Methods

TableRow inherits all methods from the Item class.

Properties

In addition to the properties it inherits from the Item class, TableRow has the following properties:

  • Checked Property
    Whether the check box in the row is checked.
  • ItemCount Property
    The number of items contained in the listbox, list view, coolbar, tab folder, row, or expandbar, or the number of rows in a table.
  • Items Property
    A list containing all items for the coolbar, CTabFolder, column, data grid, row, or expandbar.
Parent topic: General Core Classes


Checked Property

Class

SWTTableRow.

Description

Whether the check box in the row is checked.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

BOOLEAN.

Access

Read and write.

Parent topic: TableRow Class
Parent topic: SWTTableRow Class


ItemCount Property

Class

  • CoolBar
  • CTabFolder
  • DataGridRow
  • DomainUpDown
  • DomListBox
  • ExpandBar
  • ListViewEx
  • SWTTableRow
  • TableRow

Description

The number of items contained in the listbox, list view, coolbar, tab folder, row, or expandbar, or the number of rows in a table.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read only.

Parent topic: TableRow Class
Parent topic: CoolBar Class
Parent topic: CTabFolder Class
Parent topic: ExpandBar Class
Parent topic: DataGridRow Class
Parent topic: DomainUpDown Class
Parent topic: ListViewEx Class
Parent topic: DomListBox Class
Related reference
GetItemCount Function (ComboBox ListBox ListView Menu PopupList RadioList)


Items Property

Class

  • CoolBar
  • CTabFolder
  • DataGridRow
  • ExpandBar
  • WinFormsDataGrid

Description

A list containing all items for the coolbar, CTabFolder, column, data grid, row, or expandbar.

Notes

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF WINDOW.

Access

Read only.

Parent topic: TableRow Class
Parent topic: CoolBar Class
Parent topic: CTabFolder Class
Parent topic: ExpandBar Class
Parent topic: WinFormsDataGrid Class


TextField Class

Description

TextField is the class for single-line and multi-line fields whose text can be modified by the user. The class also supports the Windows RichEdit control.

Inheritance

TextField derives from the Control class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, TextField has the following methods and properties:

  • ClearText Method (ComboBox DomTextField TextField)
    Removes all text from the text field or the text field of the combo box.
  • GetBackgroundColor Function
    Returns the background color of a text box in terms of RGB values.
  • GetContents Function (TextField)
    Returns the contents of a text field control.
  • GetFontName Function
    Gets the name of a font being used in a rich edit control.
  • GetFontSize Function
    Gets the point size of a font being used in a rich edit control.
  • GetMultiSelText Function (TextField)
    Returns the selected text in the multi-line text box.
  • GetMultiText Function (TextField)
    Returns the specified lines of text in the multi-line text box.
  • GetPosition Function (TextField)
    Returns the line and column position of the insertion point.
  • GetSelRange Function (TextField)
    Returns the selected range in the text field.
  • GetSelText Function (TextField)
    Returns the selected text in the text field.
  • GetText Function (DynamicText StaticText TextField)
    Returns the text of the text field.
  • SetMultiText Method (TextField)
    Substitutes all or part of the lines in the multi-line text field.
  • SetPosition Method (TextField)
    Sets the insertion point in the text field.
  • SetSelRange Method (TextField)
    Selects the specified range of the single-line or multi-line text field.
  • SetText Method (TextField)
    Substitutes new text for all or part of the text in the text field.
  • VerifyPosition Method
    Verifies the line and column position of the insertion point.
  • VerifySelRange Method
    Verifies the selected range of the text box.
  • VerifySelText Method (TextField)
    Verifies the selected text in the text box.
  • VerifyValue Method (DynamicText StaticText TextField)
    Verifies the text of the text field.
  • bIsMulti Property
    For ListBox, whether it is a multi-selection list box. For TextField, whether it is a multi-line text field.
  • IsPassword Property (TextField)
    Gets whether the control is a password text field.
  • lsValue Property
    The text of the selected items.
  • sValue Property
    The text in the selected text box.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


GetBackgroundColor Function

Class

TextField.

Action

Returns the background color of a text box in terms of RGB values.

Syntax

cColor = GetBackgroundColor()
Variable | Description
cColor | A record with fields for RGB values. COLOR.

Notes

In some applications the background color of a required text box remains red if a user leaves the text box empty. Being able to detect the background color helps you determine whether or not the application under test is enforcing required text boxes.

Examples

If the background color of the text box is white, the following test case returns {255, 255, 255}, the RGB values for white.

testcase GetColor () appstate none
Print(xTextField.TheSingleLineTextField.GetBackgroundColor())

testcase TestBackgroundColor()
// a variable cColor is declared of the predefined type COLOR
COLOR cColor
// the expected result, cColor, is white
cColor = {255,255,255}
Verify
(Window.TxtFd.GetBackgroundColor(), cColor, "background color")
Parent topic: TextField Class


GetContents Function (TextField)

Class

TextField.

Action

Returns the contents of a text field control.

Syntax

lsContents = textfield.GetContents ([bRawMode])
Variable | Description
lsContents | List of items in the text field. LIST OF STRING.
bRawMode | Optional. Prevents spaces from being trimmed from items. BOOLEAN.

Notes

GetContents returns a list of strings, with one list element for each text line.

GetContents removes any blank lines within the text. This differs from earlier versions of Silk Test Classic, where blank lines were preserved when getting the contents of a text field.

Example

Verify(MyDg.MyTextField.GetContents(),lsExpectedContents)
Parent topic: TextField Class


GetFontName Function

Class

TextField.

Action

Gets the name of a font being used in a rich edit control.

Syntax

sFont = textfield.GetFontName ([iLine, iCol])
Variable | Description
sFont | The name of the font. STRING.
iLine | Optional: The line number of the character whose font name is being retrieved. The Open Agent always ignores this value regardless of what is specified in the script. INTEGER.
iCol | Optional: The column number of the character whose font name is being retrieved. INTEGER.

Notes

GetFontName returns the name of a font being used in a rich edit control.

If the optional iLine and iCol arguments are not specified, then GetFontName returns the name of the font being used for newly inserted characters.

If iLine and iCol are supplied, then GetFontName returns the name of the font in which the specified character is displayed.

Example

Verify(MyDialog.RichEdit1.GetFontName(4, 1), "Arial")

Availability

This function is available only in Windows, providing support for the RichEdit control.

Parent topic: TextField Class


GetFontSize Function

Class

TextField.

Action

Gets the point size of a font being used in a rich edit control.

Availability

This function is available only in Windows, providing support for the RichEdit control, and only in scripts that use the Classic Agent.

Syntax

iSize = textfield.GetFontSize ([iLine, iCol])
Variable | Description
iSize | The point size of the font. INTEGER.
iLine | Optional: The line number of the character whose font size is being retrieved. INTEGER.
iCol | Optional: The column number of the character whose font size is being retrieved. INTEGER.

Notes

GetFontSize returns the point size of a font being used in a rich edit control.

If the optional iLine and iCol arguments are not specified, then GetFontSize returns the point size of the font being used for newly inserted characters.

If iLine and iCol are supplied, then GetFontSize returns the point size of the font in which the specified character is displayed.

Example

Verify(MyDialog.RichEdit1.GetFontSize(4, 1), 12)
Parent topic: TextField Class


GetMultiSelText Function (TextField)

Class

TextField.

Action

Returns the selected text in the multi-line text box.

Syntax

lsText = textfield.GetMultiSelText()
Variable | Description
lsText | The selected text of each selected line. LIST OF STRING.

Notes

GetMultiSelText does not remove any blank lines within the selected text. If no text is selected, the function returns an empty list. You can set the OPT_GET_MULTITEXT_KEEP_EMPTY_LINES agent option to FALSE to remove empty lines within the selected text.

Example

LIST OF STRING lsSelText
lsSelText = TextEditor.Document.GetMultiSelText()
Parent topic: TextField Class


GetMultiText Function (TextField)

Class

TextField.

Action

Returns the specified lines of text in the multi-line text box.

Syntax

lsText = textfield.GetMultiText([iStartLine, iNumLines])
Variable | Description
lsText | The text in the specified portion of the text field. LIST OF STRING.
iStartLine | Optional: The number of the first line to return. INTEGER.
iNumLines | Optional: The number of lines to return. INTEGER.

Notes

If no optional arguments are specified, GetMultiText returns all of the lines of text in the text box as a list of strings. If you include iStartLine and not iNumLines, GetMultiText returns lines starting with the iStartLine line and ending with the last line of the text box. If you include both iStartLine and iNumLines, it returns iNumLines lines starting with the iStartLine line.

GetMultiText does not remove any blank lines within the selected text. If no text is selected, the function returns an empty list. You can set the OPT_GET_MULTITEXT_KEEP_EMPTY_LINES agent option to FALSE to remove empty lines within the selected text.

Example

LIST OF STRING lsSomeStrings
lsSomeStrings = TextEditor.Document.GetMultiText(2, 1)
Parent topic: TextField Class


GetPosition Function (TextField)

Class

TextField.

Action

Returns the line and column position of the insertion point.

Syntax

tPosition = textfield.GetPosition()
Variable | Description
tPosition | The position of the insertion point. TEXTPOS.

Notes

GetPosition returns a record of type TEXTPOS, which has two fields:

Field | Description
iLine | The current line. INTEGER.
iCol | The current column. INTEGER.

Example

TEXTPOS Position;
Position = TextEditor.Document.GetPosition()
Verify(Position.iLine, 1, "Check current position")
Verify (Position.iCol, 1, "Check current position")
Parent topic: TextField Class


GetSelRange Function (TextField)

Class

TextField.

Action

Returns the selected range in the text field.

Syntax

trSelection = textfield.GetSelRange()
Variable | Description
trSelection | The current selection. TEXTRANGE.

Notes

GetSelRange returns a TEXTRANGE record containing the start line, end line, start column, and end column values of the current selection range of the text field.

The TEXTRANGE data type contains four fields:
Field | Description
iStartLine | The first line in the range. INTEGER.
iStartCol | The first column in the range. INTEGER.
iEndLine | The last line in the range. INTEGER.
iEndCol | The last column in the range. INTEGER.

If nothing is selected, the start and end are equal, and the position is that of the insertion point. A GetSelRange against a 0-character wide sel range for an HtmlTextField returns the end of the line.

The values in the column fields point to just before the columns themselves. Therefore, position 1 is the position just before the first character. The position at the end of the line is one more than the last character.

Example

TEXTRANGE trRange;
trRange = TextEditor.Document.GetSelRange()
Verify(trRange.iStartLine, 1, "Check starting line")
Verify(trRange.iStartCol, 1, "Check starting column")
Parent topic: TextField Class


GetSelText Function (TextField)

Class

TextField.

Action

Returns the selected text in the text field.

Syntax

sText = textfield.GetSelText()
Variable | Description
sText | The selected text. STRING.

Notes

If nothing is selected, GetSelText returns an empty string (""). For multi-line text fields, GetSelText returns only on the first line of the selection.

Example

    [ ] sMatch = DocumentWindow.Document.GetSelText()
    [-] if(sMatch != "")
        [ ] Print("Found this false match: " + sMatch)
Parent topic: TextField Class


SetMultiText Method (TextField)

Class

TextField.

Action

Substitutes all or part of the lines in the multi-line text field.

Syntax

textfield.SetMultiText (lsText [, iStartLine, iNumLines])
Variable | Description
lsText | The text to substitute. LIST OF STRING.
iStartLine | Optional: The line in the text field (starting from 1) to begin the substitution. INTEGER.
iNumLines | Optional: The number of lines to substitute. INTEGER.

Notes

SetMultiText substitutes lsText for the lines of text in the multi-line text field.

If you specify iStartLine, SetMultiText substitutes the lines starting with the iStartLine line. If you specify both iStartLine and iNumLines, it substitutes iNumLines lines starting with the iStartLine line.

If iStartLine is omitted, SetMultiText replaces all the lines in the text field with lsText.

SetMultiText sets up to 1024 characters.

Example

    [-] LIST OF STRING lsToSet = {...}
        [ ] "Line 1"
        [ ] "Line 2"
        [ ] "Line 3"
        [ ] "Line 4"
    [ ] TextEditor.Document.SetMultiText (lsToSet, 1, 4)
Parent topic: TextField Class


SetPosition Method (TextField)

Class

TextField.

Action

Sets the insertion point in the text field.

Syntax

texfield.SetPosition (iLine, iCol)
Variable | Description
iLine | The line to move to. INTEGER.
iCol | The column to move to. INTEGER.

Notes

SetPosition sets the insertion point in the text field at the specified location.

Example

    [ ] INTEGER x
    [-] for x = 1 to 4
        [ ] TextEditor.Document.SetPosition (x, 1)
        [ ] TextEditor.Document.TypeKeys ("<Shift-End>")
        [ ] Verify (TextEditor.Document.GetSelText (), "Line {x}")
Parent topic: TextField Class


SetSelRange Method (TextField)

Class

TextField.

Action

Selects the specified range of the single-line or multi-line text field.

Syntax

textfield.SetSelRange (iStartLine, iStartCol, iEndLine, iEndCol)
Variable | Description
iStartLine | The line at which to start the selection. INTEGER.
iStartCol | The column at which to start the selection. iStarCol includes the given parameter value. INTEGER.
iEndLine | The line at which to end the selection. INTEGER.
iEndCol | The column at which to end the selection. iEndCol excludes the given parameter value. INTEGER.

Notes

SetSelRange selects the specified area, starting at the position specified by iStartLine and iStartCol, and ending with the position specified by iEndLine and iEndCol. The area is selected as if you interactively placed the cursor at the beginning position, held down the Shift key, and clicked the cursor at the end position.

The values of the column arguments point to just before the columns themselves. Therefore, position 1 is the position just before the first character. The position at the end of the line is one less than the last character.

For a single-line text field, iStartLine and iEndLine are ignored.

Example

TextEditor.Document.SetSelRange (1, 1, 4, 6)
Parent topic: TextField Class


SetText Method (TextField)

Class

TextField.

Action

Substitutes new text for all or part of the text in the text field.

Syntax

textfield.SetText (sText [, iStartChar, iNumChars])
Variable | Description
sText | The text to substitute. STRING.
iStartChar | Optional: The character position in the text field (starting from 1) at which to begin the substitution. INTEGER.
iNumChars | Optional: The number of characters in the text field to substitute with sText. INTEGER.

Notes

  • SetText substitutes the characters sText for the text in the text field. This method works only with the first line of multi-line text fields.
  • If iStartChar is specified, SetText substitutes sText for the characters starting with the iStartChar character, and continuing to the end of the line. If both iStartChar and iNumChars are specified, it substitutes sText for iNumChars characters starting with the iStartChar character.
  • If iStartChar is omitted, SetText substitutes sText for the entire contents of the text field.
  • SetText sets up to 1024 characters.
  • If the SetText method does not work as expected, you can try the TypeKeys method.

Example 1

STRING sHello = "Hello, world"
Find.FindWhat.SetText (sHello)

Example 2

The following example illustrates date transformation using the Text Field window in the test application shipped with Silk Test Classic.

testcase GetandSetText1 ()

STRING sReturnedText
TextFieldWindow.Invoke ()
Print ("Entering the value '9/18/02'")
TextFieldWindow.TheTextField.SetText ("9/18/02")
Print ("Getting...")
sReturnedText = TextFieldWindow.TheTextField.GetText ()
Print (sReturnedText)
TextFieldWindow.Close ()

// Result:
// Entering the value '9/18/02'
// *** Y2K Notification: date value '9/18/02' has been
   changed to '09/18/2003' in TextFieldWindow.TheTextField.SetText
// Getting ...
// 09/18/2003

Note the following about this test:

  • The argument to SetText is "9/18/02". That date is of the input form m/dd/yy so it matches the rule. Therefore, the date is transformed to the form mm/dd/yyyy. In this case, the date is set to 09/18/2003, as shown in the return from GetText.
  • Silk Test Classic includes a notification message that the date has been transformed.

Example 3

This example illustrates date transformation using the Text Field window in the test application shipped with Silk Test Classic.

testcase GetandSetText2 ()

STRING sReturnedText
TextFieldWindow.Invoke ()
Print ("Entering the value '9/18/20'")
TextFieldWindow.TheTextField.SetText ("9/18/20")
Print ("Getting...")
sReturnedText = TextFieldWindow.TheTextField.GetText ()
Print (sReturnedText)
TextFieldWindow.Close ()

// Result:
// Entering the value '9/18/20'
// *** Y2K Notification: date value '9/18/20' has been
   changed to '09/18/2020' in TextFieldWindow.TheTextField.SetText
// Getting ...
// 09/18/2020

Note the following about this test:

  • The argument to SetText is "9/18/20", also of the input form m/dd/yy, so it matches the rule.
  • In this case, the year (20) is below the threshold in the rule (30), so the date is converted to 2020, instead of 1920.
Parent topic: TextField Class


VerifyPosition Method

Class

TextField.

Action

Verifies the line and column position of the insertion point.

Syntax

textfield.VerifyPosition(ExpectedPos[, nTimeout])
Variable | Description
ExpectedPos | The expected caret position. TEXTPOS.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyPosition() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option, OPT_WINDOW_RETRY. If the verification fails, an exception is thrown.

Example

MyDialog.TextField1.VerifyPosition({10, 1})
Parent topic: TextField Class


VerifySelRange Method

Class

TextField.

Action

Verifies the selected range of the text box.

Syntax

textfield.VerifySelRange(trExpected [, nTimeout])
Variable | Description
trExpected | The range you expect to be selected. TEXTRANGE.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

VerifySelRange verifies that the selected range in the text box matches the range you expected to be selected. You specify the expected selection with a TEXTRANGE record.

A TEXTRANGE record includes the following fields:
Field
Description
iStartLine
The first line you expect to be selected. INTEGER.
iStartCol
The first column you expect to be selected. INTEGER.
iEndLine
The last line you expect to be selected. INTEGER.
iEndCol
The last column you expect to be selected. INTEGER.

The values of the column fields point to just before the columns themselves. Therefore, position 1 is the position just before the first character. The position at the end of the line is the one more than the last character.

For a single-line text box, iStartLine and iEndLine are ignored.

Calling this method is the same as calling the Verify function in the following manner:
Verify(window.GetSelRange(), expected_range)

If the ranges do not match, Silk Test Classic raises the exception E_VERIFY.

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifySelRange() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option, OPT_WINDOW_RETRY. If the verification fails, an exception is thrown.

Example

TEXTRANGE trRange
trRange.iStartLine = 1
trRange.iStartCol = 1
trRange.iEndLine = 1
trRange.iEndCol = 6
TextEditor.Document.VerifySelRange(trRange)
Parent topic: TextField Class


VerifySelText Method (TextField)

Class

TextField.

Action

Verifies the selected text in the text box.

Syntax

textfield.VerifySelText(aExpected[, nTimeout])
Variable | Description
aExpected | The string or list of string you expect to be selected in the text box. STRING or LIST OF STRING.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

VerifySelText checks that the selected text in the text box matches the text you supply. The data type of aExpected should be a STRING to verify a single-line text box or a LIST OF STRING to verify a multi-line text box.

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifySelText() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option, OPT_WINDOW_RETRY. If the verification fails, an exception is thrown.

Example

MyDialog.TextField1.VerifySelText ("selected text")
Parent topic: TextField Class


IsPassword Property (TextField)

Class

TextField.

Action

Gets whether the control is a password text field.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: TextField Class


ToolBar Class

Description

ToolBar is the class for tool bar controls. A tool bar is a container for a set of buttons and other standard controls.

Availability

The ToolBar class is available only in Windows.

Inheritance

ToolBar derives from the Control class; no classes derive from this class.

Identification of ToolBar Items

Each text item within a tool bar is a child control, represented in Silk Test Classic with an appropriate control class, such as the PushButton class or RadioList class. The IsPressed method in the PushButton class supports the use of pushbuttons in a tool bar.

Methods

ToolBar inherits all its methods from the AnyWin class and Control class.

Properties

ToolBar inherits all its properties from the AnyWin class and Control class.

Parent topic: General Core Classes
Related reference
PushButton Class
RadioList Class
AnyWin Class
Control Class


TreeView Class

Description

TreeView is the class for items which are organized into graphical hierarchies.

TreeView supports hierarchical views. For non-hierarchical views, see the ListView class. In Windows, the class corresponds to the TreeView control.

Inheritance

TreeView derives from the Control class; no classes derive from this class.

Identification of TreeView Items

In TreeView methods, you can identify items in a TreeView control by path, by index, or by a combination of both path and index.

Identification of Items by Path

An item path represents the hierarchical path from the root of the TreeView to a specific item. You can uniquely identify each item in the hierarchical path by specifying one or more of its attributes.

Items in a TreeView have the following attributes:

  • The hierarchical relationship between the item and other items.
  • The title or caption of the item.
  • The ordinal number of the item in relation to its siblings.
  • The ordinal number of the item in a flat view of the TreeView.

Identification of Items by Index

An item index is the ordinal number of the item relative to the other currently viewable (non-hidden) items in the entire TreeView list. A flat item index is useful for writing non-recursive functions that traverse the TreeView. You can specify an index either as an INTEGER or as a STRING of the form "#n" where n is the numerical index of the item.

Note: Do not use '/n#' where n is a number as part of a TreeView item name. This is the separator used to find each of the TreeView segments.

Operation on Hidden Items

As with other windows and controls, a TreeView item is defined only if it is visible (that is, it is not hidden by a collapsed ancestor). Silk Test Classic does not operate on hidden items. Since applications often maintain only viewable items, the contents of hidden branches of a TreeView may be undefined.

The contents returned for a TreeView, and the ability to select an item in the TreeView, depends on the current expand/collapse state of the items.

Examples of Identifying Items

The following examples show how you can identify unique items within a TreeView by path, index, or a combination of both.

This Specification... | Identifies This Item...
"Games" | An item "Games" that exists at any level, but which is unique among all currently viewable items in the entire TreeView. Supported on the Classic Agent only.
"#23" | The 23rd currently viewable item in the entire TreeView.
24 | The 24th currently viewable item in the entire TreeView.
"Games/Sub1/Sub2" | An item "Sub2" under an item "Sub1" under an item "Games" with unspecified ancestry. Supported on the Classic Agent only.
"/Desktop/Applications/Games" | A unique item "Games" under a unique item "Applications" under a unique item "Desktop" at the outer level of the TreeView.
"/Desktop/#2/#4" | The fourth item under the second item under a unique item "Desktop" at the outer level of the TreeView.
"/Desktop/Applications#2/Games" | A unique item "Games" under the second item with the text "Applications" under a unique item "Desktop" at the outer level of the TreeView. Supported on the Open Agent only.

Notes

You can manipulate Java tree view items containing a forward slash by substituting the ? wildcard for the forward slash when you call tree view item methods such as GetSelText(), Select (), and FindItem().

Window does not support extended-selection and multiple-selection TreeView.

Methods and Properties

For information about a particular property, prefix the property name by "Get" and look in the list of "Methods". For example, if you are looking for information about SelIndex, look under GetSelIndex.

In addition to the methods and properties it inherits from the AnyWin class and Control class, TreeView has the following methods and properties:

  • Check Method (TreeView)
    Checks the check box on the tree widget, if the widget has the check box style set.
  • Collapse Method (TreeView)
    Collapse an item in a treeview control.
  • DoubleSelect Method (TreeView)
    Double-clicks an item.
  • Expand Method (TreeView)
    Expands an object in a treeview control.
  • ExtendedDoubleSelect Method
    Double-clicks an item in the list box or treeview with one or more key modifiers.
  • FindItem Function (TreeView)
    Returns the index of a named item.
  • GetItemCount Function (TreeView)
    Returns the number of currently viewable items in a treeview control.
  • GetItemRect Function (TreeView)
    Returns the size and position of an item relative to the treeview control.
  • GetItems Function (TreeView)
    Returns all elements in a TREE data structure.
  • GetSelIndex Function (TreeView)
    Returns the index of the selected item, relative to all visible items.
  • GetSelItemIndices Method (TreeView)
    Returns all selected items in the tree that have an index notation.
  • GetSelItems Function (ListBox TreeView)
    Returns all selected items in the list box or tree.
  • GetSelText Function (TreeView)
    Returns the full path text of the selected item.
  • Select Method (TreeView)
    Selects an item from the treeview.
  • Uncheck Method (TreeView)
    Unchecks the check box on the tree widget.
  • VerifyValue Method (TreeView)
    Verifies the values in a TreeView object.
  • AllowsCheck Property
    Whether the tree or table can display a checkmark.
  • iItemCount property
    The number of items in the combo box list, list box, menu, popup list, radio list, or tree view.
  • ItemPaths Property (TreeView)
    Returns all elements of the TreeView as a LIST OF LISTITEM.
  • iValue Property
    The index of the selected item or integer position of the control.
  • lsContents Property
    The contents of the combo box list, list box, list view, page list, popup list, radio list, or tree view.
  • sValue Property
    The text in the selected text box.
  • VisibleItemPaths Property (TreeView)
    Returns all visible elements in a TreeView as a LIST OF LISTITEM.
Parent topic: General Core Classes
Related reference
AnyWin Class
Control Class


Check Method (TreeView)

Class

TreeView.

Action

Checks the check box on the tree widget, if the widget has the check box style set.

Syntax

tree.Check(Itemli)
Variable | Description
Itemli | The item to check. LISTITEM.

Notes

If the widget does not have check boxes, an E_WINDOW_TYPE_MISMATCH exception is thrown.

Parent topic: TreeView Class


Collapse Method (TreeView)

Class

TreeView.

Action

Collapse an item in a treeview control.

Syntax

treeview.Collapse(Item)
Variable | Description
Item | The item to collapse. STRING or INTEGER.

Notes

Collapse collapses the specified treeview item if it is currently expanded (that is, has visible children).

  • If the item has an expand/collapse box (typically a + or - sign), Silk Test Classic collapses the item by clicking on this box.
  • Otherwise, if the treeview supports the use of double-click to expand and collapse items, Silk Test Classic double-clicks on the item.
  • If neither approach is supported by the control, or if the specified item is not collapsible (that is, has no children), an error is raised.

For information on specifying Item, see the TreeView class.

See the UseExpandButton option for more information about how Silk Test Classic expands and collapses nodes in a JavaJFCTreeView in the Java extension.

Example

MyDialog.MyTreeView.Collapse("/root/child/grandchild")
Parent topic: TreeView Class


DoubleSelect Method (TreeView)

Class

TreeView.

Action

Double-clicks an item.

Syntax

treeview.DoubleSelect (Item)
Variable | Description
Item | The item to click. STRING or INTEGER.

Notes

DoubleSelect scrolls the specified item into view and then double-clicks it. The meaning of a double-clicking a treeview item is application-defined. In some cases, it toggles the expand/collapse state of the item.

For information on specifying Item, see the TreeView class.

DoubleSelect() does not work properly with Internet Explorer 7.

Example

MyDialog.MyTreeView.DoubleSelect("/root/child/grandchild")
Parent topic: TreeView Class


Expand Method (TreeView)

Class

TreeView.

Action

Expands an object in a treeview control.

Syntax

treeview.Expand (item)
Variable | Description
item | The item to expand. STRING or INTEGER.

Example

MyDialog.MyTreeView.Expand ("/root/child/grandchild")

Notes

Expand expands the specified treeview item if it is currently collapsed (has hidden children).

  • If the item offers an expand/collapse control (typically a + or - sign), Silk Test Classic will collapse the item when this control is clicked.

  • Otherwise, if the treeview supports the use of double-clicks for expanding and collapsing items, Silk Test Classic double-clicks items.

  • When neither of these approaches is supported by the control, or if the specified item is not expandable (has no children), an error is raised

For information on specifying item, see the TreeView class.

See the UseExpandButton option for more information about how Silk Test Classic expands and collapses nodes in a JavaJFCTreeView in the Java extension.

Parent topic: TreeView Class


FindItem Function (TreeView)

Class

TreeView.

Action

Returns the index of a named item.

Syntax

iIndex = treeview.FindItem(sItem)
Variable | Description
iIndex | The index (relative to all viewable items) of the item, or 0 if not found. INTEGER.
sItem | The item to find. STRING.

Notes

FindItem returns the global index of a treeview item specified by path. The returned index is the flat index of the item, as if the treeview were a simple list box. As with all treeview functions, the index is relative to the items which are currently viewable (that is, those that have no collapsed ancestors).

For information on specifying sItem, see the TreeView class.

Example

index = MyDialog.MyTreeView.FindItem("/root/child/grandchild")
Parent topic: TreeView Class


GetItemCount Function (TreeView)

Class

TreeView.

Action

Returns the number of currently viewable items in a treeview control.

Syntax

iCount = treeview.GetItemCount ([bAllItems])
Variable | Description
iCount | Count of currently viewable items in the treeview. INTEGER.
bAllItems | Optional: TRUE if count should include nonviewable items (children of non-expanded items). BOOLEAN.

Notes

GetItemCount returns the number of currently viewable items (that is, the items with no collapsed ancestors) in the treeview, or optionally the count of all items, including those with collapsed ancestors. This is the only treeview function that can return information about nonviewable items.

Example

Verify(MyDialog.MyTreeView.GetItemCount(), iExpectedCount)
Parent topic: TreeView Class


GetItemRect Function (TreeView)

Class

TreeView.

Action

Returns the size and position of an item relative to the treeview control.

Availability

This function is supported in scripts that use both the Classic Agent and the Open Agent.

Syntax

SizeRect = treeview.GetItemRect(Item[, bIconRect])
Variable | Description
SizeRect | The item’s rectangle. RECT.
Item | The item to find. STRING or INTEGER.
bIconRect | Optional: TRUE to return the size and position of the icon. Default returns the rectangle of the text. BOOLEAN.

Notes

By default, GetItemRect returns the rectangle for the text of the item. The rectangle returned includes the item’s X and Y position, relative to the treeview control, its width, and its height.

Optional: use bIconRect to have the return value specify the location and size of the item’s icon instead. If the item is currently scrolled out of view, the returned coordinates reflects this. For example, if item 1 is specified, and the top item currently visible is item 10, then the Y coordinate returned is a negative number.

Note: The optional parameter bIconRect is not useful when Item is a JavaJFCTreeView.

For information on specifying Item, see the TreeView class.

Example

RECT rect
MyDialog.MyTreeView.ExposeItem("/root/child/grandchild")
rect = MyDialog.MyTreeView.GetItemRect("/root/child/grandchild", TRUE)
MyDialog.CaptureBitmap(rect.xPos, rect.yPos, rect.xSize, rect.ySize)
Parent topic: TreeView Class


GetItems Function (TreeView)

Class

TreeView.

Action

Returns all elements in a TREE data structure.

Deprecated: Use ItemPaths property to get all elements in the TREE data structure or VisibleItemPaths property to get only the visible items in the tree.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

GetItems (bAllItems)
Variable | Description
bAllItems | Optional: TRUE if the result should include non-viewable items (children of non-expanded items). Default is FALSE. BOOLEAN.
Parent topic: TreeView Class


GetSelItemIndices Method (TreeView)

Class

TreeView.

Action

Returns all selected items in the tree that have an index notation.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

GetSelItemIndices()

Example

This example shows a sample return value for the tree view.

    [-] MyDialog.MyTreeView.GetSelItemIndices()
        [ ] {“/#1/#1/#1”, “/#1/#2”}
Parent topic: TreeView Class


GetSelText Function (TreeView)

Class

TreeView.

Action

Returns the full path text of the selected item.

Syntax

sText = treeview.GetSelText()
Variable | Description
sText | The text of the selected item in the control. STRING.

Notes

GetSelText returns the full path of the currently selected item in the treeview. If no item is selected, the return value is an empty string.

Example

Verify(MyDialog.MyTreeView.GetSelText(), "foo")
Parent topic: TreeView Class


Select Method (TreeView)

Class

TreeView.

Action

Selects an item from the treeview.

Syntax

treeview.Select (Item)
Variable | Description
Item | The path or index of the item to select. LISTITEM.

Notes

Select scrolls the treeview item into view and clicks it if it is not selected.

If the text of your treeview item contains a "", Silk Test Classic records a "?" wildcard.

Example

MyDialog.MyTreeView.Select ("/root/child/grandchild")
Parent topic: TreeView Class


Uncheck Method (TreeView)

Class

TreeView.

Action

Unchecks the check box on the tree widget.

Syntax

tree.Uncheck(Itemli)
Variable | Description
Itemli | The item to uncheck. LISTITEM.

Notes

If the widget does not have check boxes, an E_WINDOW_TYPE_MISMATCH exception is thrown.

Parent topic: TreeView Class


VerifyValue Method (TreeView)

Class

TreeView.

Action

Verifies the value(s) in a TreeView object.

Syntax

treeview.VerifyValue(aExpected[, nTimeout])
Variable | Description
aExpected | The expected value, which can be an array of string or integer (an index of the expected selection), an integer, a string, a list of integers, or a list of strings. Any other data type raises the error E_TYPE_MISMATCH. ANYTYPE.
nTimeout | Optional: The number of seconds to wait for the expected value to be achieved. NUMBER.

Notes

You use the VerifyValue method to check whether a TreeView object has the expected values. If not, Silk Test Classic raises the exception E_VERIFY. The following table explains the verification performed for each valid form of aExpected:

Variable Type | The Verification Performed
INTEGER | That the item indexed by this integer is selected
STRING | That the selected item matches this string
LIST OF INTEGER | That the items indexed by these integers are selected
LIST OF STRING | That the selected items match these strings
ARRAY OF INTEGER or ARRAY OF STRING | An array is cast to a list and then processed as above.

If a timeout is specified with the nTimeout parameter, Silk Test Classic calls VerifyValue() until the condition is verified or the timeout is reached. The time between checks is the value of the window retry interval Agent option, OPT_WINDOW_RETRY. If the verification fails, an exception is thrown.

Example

// Is "4Test" selected?
MyTree.VerifyValue("4Test")

LIST OF INTEGER liIndexes = {2, 7, 9}
// Are indexed items selected?
MyTree.VerifyValue(liIndexes)
Parent topic: TreeView Class


ItemPaths Property (TreeView)

Class

TreeView.

Action

Returns all elements of the TreeView as a LIST OF LISTITEM.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

List of listitem.

Access

Read only.

Parent topic: TreeView Class


VisibleItemPaths Property (TreeView)

Class

TreeView.

Action

Returns all visible elements in a TreeView as a LIST OF LISTITEM.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

List of listitem.

Access

Read only.

Parent topic: TreeView Class


VerticalScrollBar Class

Description

VerticalScrollBar is the class for vertical scroll bars.

Inheritance

VerticalScrollBar derives from the ScrollBar class; no classes derive from this class.

Methods

VerticalScrollBar inherits all its methods from the AnyWin class, Control class, and ScrollBar class.

Properties

VerticalScrollBar inherits all its properties from the AnyWin class, Control class, and ScrollBar class.

Parent topic: General Core Classes
Related reference
ScrollBar Class
AnyWin Class
Control Class


Flex Class Reference

Lists the available classes for testing Flex controls. You can also customize Silk Test to test custom controls.

For additional information about the classes, see the Apache Flex Developer's Guide.
Note: Any known problems with Flex and Flex classes can be reproduced in Silk Test. For instance, dragging and dropping an element that uses the FlexChart class may not work if a chart element is clicked near its edges before you start dragging the element. This results in a failed replay because the drag start coordinates can be incorrect. This is a known issue with dragging and dropping in Flex. For details about known issues with Flex, see the Apache Flex Release Notes.
Note: The FlexTitleWindow class is recorded and recognized by Silk Test as a FlexPanel (although it is defined as a separate class). This is a known issue in Flex. For details about known issues with Flex, see the Apache Flex Release Notes.
  • FlexAccordion Class
    An Accordion navigator container has a collection of child containers, but only one of them at a time is visible. It creates and manages navigator buttons (accordion headers), which you use to navigate between the children.
  • FlexAdvancedDataGrid Class
    Expands on the functionality of the standard DataGrid control to add data visualization features to your Apache Flex application. These features provide greater control of data display, data aggregation, and data formatting.
  • FlexAlert Class
    A pop-up dialog box that can contain a message, a title, buttons (any combination of OK, Cancel, Yes, and No) and an icon.
  • FlexApplication Class
    A default, or Application, container that lets you start adding content to your application without explicitly defining another container.
  • FlexAreaChart Class
    Represents data as an area bounded by a line connecting the values in the data. The AreaChart control can be used to represent different variations, including simple areas, stacked, 100% stacked, and high/low.
  • FlexAreaSeries Class
    Defines a data series for an AreaChart control.
  • FlexAxisRenderer Class
    Describe the horizontal and vertical axes of a chart. An axis is responsible for rendering the labels, tick marks, and title along its length.
  • FlexBarChart Class
    Represents data as a series of horizontal bars whose length is determined by values in the data. A BarChart control can represent different chart variations, including simple bars, clustered bars, stacked, 100% stacked, and high/low.
  • FlexBarSeries Class
    Defines a data series for a BarChart control.
  • FlexBox Class
    A Box container lays out its children in a single vertical column or a single horizontal row.
  • FlexBubbleChart Class
    Represents data with three values for each data point. Each data point is defined by a value determining its position along the horizontal axis, a value determining its position along the vertical axis, and a value determining the size of the chart element, relative to the other data points on the chart.
  • FlexBubbleSeries Class
    Defines a data series for a BubbleChart control.
  • FlexButton Class
    The Button control is a commonly used rectangular button. Button controls look like they can be pressed. They can have a text label, an icon, or both on their face.
  • FlexButtonBar Class
    Defines a horizontal or vertical group of logically related push buttons with a common look and navigation.
  • FlexCandlestickChart Class
    Represents financial data as a series of candlesticks representing the high, low, opening, and closing values of a data series.
  • FlexCandlestickSeries Class
    Represents financial data as a series of candlesticks representing the high, low, opening, and closing values of a data series.
  • FlexCanvas Class
    A Canvas layout container defines a rectangular region in which you place child containers and controls. It is the only container that lets you explicitly specify the location of its children within the container by using the x and y properties of each child.
  • FlexCartesianChart Class
    A base class for the common chart types. CartesianChart defines the basic layout behavior of the standard rectangular, two-dimensional charts.
  • FlexChart Class
    The link between the Flex component architecture and the DualStyleObject architecture. It extends the Flex UIComponent base class, but contains DualStyleObject classes.
  • FlexChartLegend Class
    Adds a legend to your charts, where the legend displays the label for each data series in the chart and a key showing the chart element for the series.
  • FlexChartSeries Class
    The base class for the classes that let you specify a data series for a chart control.
  • FlexCheckBox Class
    The CheckBox control consists of an optional label and a small box that can contain a check mark or not.
  • FlexColorPicker Class
    Provides a way for a user to choose a color from a swatch list.
  • FlexColumnChart Class
    Represents data as a series of vertical columns whose height is determined by values in the data.
  • FlexColumnSeries Class
    Defines a data series for a ColumnChart control.
  • FlexComboBase Class
    The base class for controls that display text in a text field and have a button that causes a drop-down list to appear where the user can choose which text to display.
  • FlexComboBox Class
    Contains a drop-down list from which the user can select a single value.
  • FlexContainer Class
    An abstract base class for components that controls the layout characteristics of child components.
  • FlexContainerMovieClip Class
    Container components created in Adobe Flash CS3 Professional for use in Flex are subclasses of the mx.flash.ContainerMovieClip class.
  • FlexDataGrid Class
    The DataGrid control is like a List except that it can show more than one column of data making it suited for showing objects with multiple properties.
  • FlexDateChooser Class
    Displays the name of a month, the year, and a grid of the days of the month, with columns labeled for the day of the week.
  • FlexDateField Class
    A text field that shows the date with a calendar icon on its right side.
  • FlexDisplayObject Class
    The base class for all objects that can be placed on the display list. The display list manages all objects displayed in Flash Player or Adobe AIR.
  • FlexDividedBox Class
    Measures and lays out its children horizontally or vertically in exactly the same way as a Box container, but it inserts draggable dividers in the gaps between the children. Users can drag any divider to resize the children on each side.
  • FlexForm Class
    Use this class to control the layout of a form, mark form fields as required or optional, handle error messages, and bind your form data to the Flex data model to perform data checking and validation. This class also lets you use style sheets to configure the appearance of your forms.
  • FlexFormItem Class
    Defines a label and one or more children arranged horizontally or vertically. Children can be controls or other containers. A single Form container can hold multiple FormItem containers.
  • FlexHLOCChart Class
    The HLOCChart (High Low Open Close) control represents financial data as a series of elements representing the high, low, closing, and optionally opening values of a data series.
  • FlexHLOCSeries Class
    Represents financial data as a series of elements representing the high, low, closing, and, optionally, opening values of a data series.
  • FlexHLOCSeriesBase Class
    Represents financial data as a series of elements representing the high, low, closing, and, optionally, opening values of a data series.
  • FlexImage Class
    Lets you import JPEG, PNG, GIF, and SWF files at runtime.
  • FlexLabel Class
    Displays a single line of noneditable text.
  • FlexLineChart Class
    Represents a data series as points connected by a continuous line.
  • FlexLineSeries Class
    Defines a data series for a LineChart control.
  • FlexLinkBar Class
    Defines a horizontal or vertical row of LinkButton controls that designate a series of link destinations.
  • FlexList Class
    Displays a list of items horizontally, verically, or laid out in tiles.
  • FlexListBase Class
    The ListBase class is the base class for controls that represent lists of items that can have one or more selected and can scroll through the items.
  • FlexListLabel Class
    Defines the default item renderer for a control. By default, the item renderer draws the text associated with each item in the list, and an optional icon.
  • FlexLoader Class
    Loads and displays a specified SWF file. You typically use SWFLoader for loading one Flex application into a host Flex application.
  • FlexMenu Class
    Creates a pop-up menu of individually selectable choices, similar to the File or Edit menu found in most software applications. The popped up menu can have as many levels of submenus as needed.
  • FlexMenuBar Class
    Defines a horizontal, top-level menu bar that contains one or more menus. Clicking on a top-level menu item opens a pop-up submenu that is an instance of the Menu control.
  • FlexNavigationBar Class
    The superclass for navigator controls, such as the LinkBar and TabBar controls. This class cannot be instantiated directly.
  • FlexNumericStepper Class
    Lets the user select a number from an ordered set.
  • FlexObject Class
    The base class for all visual components, both interactive and noninteractive.
  • FlexOLAPDataGrid Class
    Expands on the functionality of the AdvancedDataGrid control to add support for the display of the results of OLAP queries.
  • FlexPanel Class
    Consists of a title bar, a caption, a border, and a content area for its children.
  • FlexPieChart Class
    Represents a data series as a standard pie chart.
  • FlexPieSeries Class
    Defines the data series for a PieChart control.
  • FlexPlotChart Class
    Represents data with two values for each data point. One value determines the position of the data point along the horizontal axis, and one value determines its position along the vertical axis.
  • FlexPlotSeries Class
    Defines a data series for a PlotChart control.
  • FlexPopUpButton Class
    The PopUpButton control adds a flexible pop-up control interface to a Button control. It contains a main button and a secondary button, called the pop-up button, which pops up any UIComponent object when a user clicks the pop-up button.
  • FlexProgressBar Class
    The ProgressBar control provides a visual representation of the progress of a task over time. There are two types of ProgressBar controls: determinate and indeterminate.
  • FlexRadioButton Class
    The RadioButton control lets the user make a single choice within a set of mutually exclusive choices.
  • FlexRepeater Class
    Identifies the repeater control, which creates multiple instances of its subcomponents.
  • FlexRule Class
    Creates a single horizontal or vertical line. You typically use this control to create a dividing line within a container.
  • FlexScrollBar Class
    Lets you control the portion of data that is displayed when there is too much data to fit in a display area.
  • FlexScrollBase Class
    The ScrollControlBase class is the base class for controls with scroll bars.
  • FlexSlider Class
    Lets users select a value by moving a slider thumb between the end points of the slider track.
  • FlexStandalonePlayer Class
    The Flex Standalone Player.
  • FlexTabNavigator Class
    Extends the ViewStack container by including a TabBar container for navigating between its child containers.
  • FlexTextArea Class
    A multiline text field with a border and optional scroll bars.
  • FlexTitleWindow Class
    Contains a title bar, a caption, a border, and a content area for its child.
  • FlexToggleButtonBar Class
    Defines a horizontal or vertical group of buttons that maintain their selected or deselected state.
  • FlexTree Class
    The Tree control lets a user view hierarchical data arranged as an expandable tree.
  • FlexUIMovieClip Class
    Components created in Adobe Flash CS3 Professional for use in Flex are subclasses of the mx.flash.UIMovieClip class.
  • FlexVideoDisplay Class
    Lets you play an FLV file in a Flex application. It supports progressive download over HTTP, streaming from the Flash Media Server, and streaming from a Camera object.
  • FlexViewStack Class
    Consists of a collection of child containers stacked on top of each other, where only one child at a time is visible. When a different child container is selected, it seems to replace the old one because it appears in the same location. However, the old child container still exists; it is just invisible.
  • FlexWindow Class
    The Window is a top-level container for additional windows in an AIR desktop application.
  • FlexWindowedApplication Class
    The WindowedApplication defines the application container that you use to create Flex applications for AIR applications.
  • SparkAirHTML Class
    The HTML control lets you display HTML content in your application.
  • SparkApplication Class
    Flex defines a default, or Application, container that lets you start adding content to your application without explicitly defining another container.
  • SparkBorderContainer Class
    The BorderContainer class defines a set of CSS styles that control the appearance of the border and background fill of the container.
  • SparkButton Class
    The SparkButton component is a commonly used rectangular button. The SparkButton component looks like it can be pressed.
  • SparkButtonBar Class
    The ButtonBar control defines a horizontal group of logically related buttons with a common look and navigation.
  • SparkButtonBarButton Class
    The ButtonBarButton class defines the custom item renderer used by the ButtonBar control.
  • SparkButtonBase Class
    The SparkButtonBase class is the base class for the all Spark button components.
  • SparkCheckBox Class
    The CheckBox component consists of an optional label and a small box that can contain a check mark or not.
  • SparkComboBox Class
    The ComboBox control is a child class of the DropDownListBase control. Like the DropDownListBase control, when the user selects an item from the drop-down list in the ComboBox control, the data item appears in the prompt area of the control.
  • SparkComplexDisplay Class
    A complex rendered object.
  • SparkDataGrid Class
    Identifies a Spark data grid control.
  • SparkDataGridLabel Class
    Identifies a spark data grid label control.
  • SparkDataGroup Class
    The DataGroup class is the base container class for data items.
  • SparkDataRenderer Class
    The SparkDataRenderer class is the base class for data components in spark.
  • SparkDropDownList Class
    The SparkDropDownList control contains a drop-down list from which the user can select a single value.
  • SparkDropDownListBase Class
    The SparkDropDownListBase control contains a drop-down list from which the user can select a single value.
  • SparkForm Class
    Identifies a Spark form control.
  • SparkFormItem Class
    Identifies a Spark form item control.
  • SparkGroup Class
    Use this container when you want to manage visual children, both visual components and graphical components.
  • SparkGroupBase Class
    The GroupBase class defines the base class for components that display visual elements.
  • SparkImage Class
    Identifies a Spark image control.
  • SparkLabel Class
    Label is a low-level UIComponent that can render one or more lines of uniformly-formatted text.
  • SparkList Class
    The List control displays a vertical list of items.
  • SparkListBase Class
    The ListBase class is the base class for all components that support selection.
  • SparkListLabel Class
    A simple rendered object.
  • SparkMuteButton Class
    The MuteButton class defines the mute button used by the VideoPlayer control.
  • SparkNavigatorContent Class
    The NavigatorContent class defines a Spark container that can be used in an MX navigator container, such as the ViewStack, TabNavigator and Accordion containers.
  • SparkNumericStepper Class
    The NumericStepper control lets you select a number from an ordered set. The NumericStepper provides the same functionality as the Spinner component, but adds a TextInput control so that you can directly edit the value of the component, rather than modifying it by using the control's arrow buttons.
  • SparkObject Class
    The SparkObject class defines the base class for all spark components.
  • SparkPanel Class
    The Panel class defines a container that includes a title bar, a caption, a border, and a content area for its children.
  • SparkPopUpAnchor Class
    Identifies a Spark PopUpAnchor control.
  • SparkRadioButton Class
    The RadioButton component allows the user make a single choice within a set of mutually exclusive choices. A RadioButtonGroup is composed of two or more RadioButton components with the same groupName property.
  • SparkRange Class
    The Range class holds a value and an allowed range for that value, defined by minimum and maximum properties.
  • SparkRichEditableText Class
    RichEditableText is a low-level UIComponent for displaying, scrolling, selecting, and editing richly-formatted text.
  • SparkRichText Class
    RichText is a low-level UIComponent that can display one or more lines of richly-formatted text and embedded images.
  • SparkScrollBar Class
    The ScrollBarBase class helps to position the portion of data that is displayed when there is too much data to fit in a display area.
  • SparkSkinnableContainer Class
    The SparkSkinnableContainer class is the base class for skinnable containers that have visual content.
  • SparkSkinnableContainerBase Class
    Base class for spark container components.
  • SparkSkinnableDataContainer Class
    The SkinnableDataContainer class is the base container class for data items.
  • SparkSkinnablePopUpContainer Class
    Identifies a SparkSkinnablePopUpContainer control.
  • SparkSkinnableTextBase Class
    The base class for skinnable components, such as the Spark TextInput and TextArea, that include an instance of RichEditableText in their skin to provide rich text display, scrolling, selection, and editing.
  • SparkSlider Class
    Lets users select a value by moving a slider thumb between the end points of the slider track.
  • SparkSpinner Class
    A Spinner component selects a value from an ordered set. It uses two buttons that increase or decrease the current value based on the current value of the stepSize property.
  • SparkTabBar Class
    The TabBar class displays a set of identical tabs. One tab can be selected at a time, and the first tab is selected by default.
  • SparkTextArea Class
    TextArea is a text-entry control that lets users enter and edit multiple lines of richly formatted text. It can display horizontal and vertical scrollbars for scrolling through the text and supports vertical scrolling with the mouse wheel.
  • SparkTextBase Class
    The base class for Spark text controls such as Label and RichText which display text using CSS styles for the default format.
  • SparkTextInput Class
    TextInput is a text-entry control that lets users enter and edit a single line of uniformly-formatted text.
  • SparkTileGroup Class
    The TileGroup container is an instance of the Group container that uses the TileLayout class.
  • SparkTitleWindow Class
    The TitleWindow class extends Panel to include a close button and move area.
  • SparkToggleButton Class
    The ToggleButton component defines a toggle button. Clicking the button toggles it between the up and an down states.
  • SparkToggleButtonBase Class
    The ToggleButtonBase component is the base class for the Spark button components that support the selected property.
  • SparkTrackBase Class
    The TrackBase class is a base class for components with a track and one or more thumb buttons, such as Slider and ScrollBar.
  • SparkVideoDisplay Class
    Identifies a Spark video display control.
  • SparkVideoPlayer Class
    The VideoPlayer control is a skinnable video player that supports progressive download, multi-bitrate streaming, and streaming video.
  • SparkVolumeBar Class
    The VolumeBar class defines a drop-down slider to control the volume of the VideoDisplay control.
  • SparkWindow Class
    The Window is a top-level container for additional windows in an AIR desktop application.
  • SparkWindowedApplication Class
    The WindowedApplication defines the application container that you use to create Flex applications for AIR applications.
Parent topic: Classes


FlexAccordion Class

Description

An Accordion navigator container has a collection of child containers, but only one of them at a time is visible. It creates and manages navigator buttons (accordion headers), which you use to navigate between the children.

There is one navigator button associated with each child container, and each navigator button belongs to the Accordion container, not to the child. When the user clicks a navigator button, the associated child container is displayed. The transition to the new child uses an animation to make it clear to the user that one child is disappearing and a different one is appearing.

The Accordion container does not extend the ViewStack container, but it implements all the properties, methods, styles, and events of the ViewStack container, such as selectedIndex and selectedChild.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexAccordion is derived from the FlexContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexAccordion has the following methods:

  • Change
  • Type

Properties

In addition to the properties it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexAccordion has the following properties:

  • headerHeight
  • horizontalGap
  • paddingBottom
  • paddingTop
  • selectedChild
  • selectedIndex
  • textSelectedColor
  • verticalGap
Parent topic: Flex Class Reference


FlexAdvancedDataGrid Class

Description

Expands on the functionality of the standard DataGrid control to add data visualization features to your Apache Flex application. These features provide greater control of data display, data aggregation, and data formatting.

The AdvancedDataGrid control is like a List control except that it can show more than one column of data, making it suited for showing objects with multiple properties.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexAdvancedDataGrid is derived from the FlexListBase class.The following classes derive from the FlexAdvancedDataGrid class:
  • FlexOLAPDataGrid

Methods

In addition to the methods it inherits from FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexAdvancedDataGrid has the following methods:

  • Close
  • ColumnGroupedADGHeaderShift
  • ColumnStretch
  • GetCellData
  • GetGroupedItemChildrenCount
  • GetRowData
  • HeaderClick
  • HeaderShift
  • IsGroupedItem
  • Open

Properties

In addition to the properties it inherits from FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexAdvancedDataGrid has the following properties:

  • allowDragSelection
  • depthColors
  • disabledColor
  • displayItemsExpanded
  • editable
  • headerColors
  • headerHeight
  • horizontalGridLineColor
  • indentation
  • minColumnWidth
  • openDuration
  • paddingBottom
  • paddingLeft
  • paddingRight
  • paddingTop
  • resizableColumns
  • selectedCells
  • selectionMode
  • verticalGridLineColor
Parent topic: Flex Class Reference


FlexAlert Class

Description

A pop-up dialog box that can contain a message, a title, buttons (any combination of OK, Cancel, Yes, and No) and an icon.

The Alert control is modal, which means it will retain focus until the user closes it.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexAlert is derived from the FlexPanel class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexPanel, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexAlert has the following methods:

  • Type

Properties

In addition to the properties it inherits from FlexPanel, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexAlert has the following properties:

  • defaultButtonFlag
  • text
Parent topic: Flex Class Reference


FlexApplication Class

Description

A default, or Application, container that lets you start adding content to your application without explicitly defining another container.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexApplication is derived from the FlexContainer class.The following classes derive from the FlexApplication class:
  • FlexWindowedApplication

Methods

FlexApplication inherits all its methods from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexApplication has the following properties:

  • url
Parent topic: Flex Class Reference


FlexAreaChart Class

Description

Represents data as an area bounded by a line connecting the values in the data. The AreaChart control can be used to represent different variations, including simple areas, stacked, 100% stacked, and high/low.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexAreaChart is derived from the FlexCartesianChart class. No classes derive from this class.

Methods

FlexAreaChart inherits all its methods from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexAreaChart inherits all its properties from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexAreaSeries Class

Description

Defines a data series for an AreaChart control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexAreaSeries is derived from the FlexChartSeries class. No classes derive from this class.

Methods

FlexAreaSeries inherits all its methods from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin, FlexAreaSeries has the following properties:

  • form
  • minField
  • radius
  • xField
  • yField
Parent topic: Flex Class Reference


FlexAxisRenderer Class

Description

Describe the horizontal and vertical axes of a chart. An axis is responsible for rendering the labels, tick marks, and title along its length.

AxisRenderer objects inherit some of their visual properties from the enclosing chart object. The text format of the labels and title defaults to the CSS text properties of the renderer. You can control the formatting of the axis title separately by specifying a axisTitleStyleName, either on the AxisRenderer or on the enclosing chart.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexAxisRenderer is derived from the FlexObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexAxisRenderer has the following methods:

  • GetValues

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexAxisRenderer has the following properties:

  • canDropLabels
  • canStagger
  • columnNames
  • firstVisibleRow
  • heightLimit
  • labelGap
  • labelRotation
  • lastVisibleRow
  • length
  • minorTickLength
  • minorTickPlacement
  • minorTicks
  • numColumns
  • numRows
  • placement
  • showLabels
  • showLine
  • tickLength
  • tickPlacement
  • ticks
Parent topic: Flex Class Reference


FlexBarChart Class

Description

Represents data as a series of horizontal bars whose length is determined by values in the data. A BarChart control can represent different chart variations, including simple bars, clustered bars, stacked, 100% stacked, and high/low.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexBarChart is derived from the FlexCartesianChart class. No classes derive from this class.

Methods

FlexBarChart inherits all its methods from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin, FlexBarChart has the following properties:

  • barWidthRatio
  • maxBarWidth
Parent topic: Flex Class Reference


FlexBarSeries Class

Description

Defines a data series for a BarChart control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexBarSeries is derived from the FlexChartSeries class. No classes derive from this class.

Methods

FlexBarSeries inherits all its methods from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin, FlexBarSeries has the following properties:

  • barWidthRatio
  • maxBarWidth
  • minField
  • offset
  • xField
  • yField
Parent topic: Flex Class Reference


FlexBox Class

Description

A Box container lays out its children in a single vertical column or a single horizontal row.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexBox is derived from the FlexContainer class.The following classes derive from the FlexBox class:
  • FlexDividedBox
  • FlexNavigationBar

Methods

FlexBox inherits all its methods from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexBox has the following properties:

  • direction
  • horizontalAlign
  • verticalAlign
Parent topic: Flex Class Reference


FlexBubbleChart Class

Description

Represents data with three values for each data point. Each data point is defined by a value determining its position along the horizontal axis, a value determining its position along the vertical axis, and a value determining the size of the chart element, relative to the other data points on the chart.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexBubbleChart is derived from the FlexCartesianChart class. No classes derive from this class.

Methods

FlexBubbleChart inherits all its methods from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexBubbleChart inherits all its properties from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexBubbleSeries Class

Description

Defines a data series for a BubbleChart control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexBubbleSeries is derived from the FlexChartSeries class. No classes derive from this class.

Methods

FlexBubbleSeries inherits all its methods from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin, FlexBubbleSeries has the following properties:

  • maxRadius
  • radiusField
  • xField
  • yField
Parent topic: Flex Class Reference


FlexButton Class

Description

The Button control is a commonly used rectangular button. Button controls look like they can be pressed. They can have a text label, an icon, or both on their face.

Buttons typically use event listeners to perform an action when the user selects the control. When a user clicks the mouse on a Button control, and the Button control is enabled, it dispatches a click event and a buttonDown event. A button always dispatches events such as the mouseMove, mouseOver, mouseOut, rollOver, rollOut, mouseDown, and mouseUp events whether enabled or disabled.

You can customize the look of a Button control and change its functionality from a push button to a toggle button. You can change the button appearance by using a skin for each of the button's states.

The label of a Button control uses a bold typeface. If you embed a font that you want to use for the label of the Button control, you must embed the bold typeface.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexButton is derived from the FlexObject class.The following classes derive from the FlexButton class:
  • FlexCheckBox
  • FlexPopUpButton
  • FlexRadioButton

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexButton has the following methods:

  • Type

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexButton has the following properties:

  • color
  • disabledColor
  • fillAlphas
  • fillColors
  • focusAlpha
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • label
  • labelPlacement
  • selected
  • textAlign
  • textDecoration
  • textIndent
  • textRollOverColor
  • textSelectedColor
  • toggle
Parent topic: Flex Class Reference


FlexButtonBar Class

Description

Defines a horizontal or vertical group of logically related push buttons with a common look and navigation.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexButtonBar is derived from the FlexNavigationBar class.The following classes derive from the FlexButtonBar class:
  • FlexToggleButtonBar

Methods

FlexButtonBar inherits all its methods from FlexNavigationBar, FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexButtonBar inherits all its properties from FlexNavigationBar, FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexCandlestickChart Class

Description

Represents financial data as a series of candlesticks representing the high, low, opening, and closing values of a data series.

The top and bottom of the vertical line in each candlestick represent the high and low values for the datapoint, while the top and bottom of the filled box represents the opening and closing values. Each candlestick is filled differently depending on whether the closing value for the datapoint is higher or lower than the opening value.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexCandlestickChart is derived from the FlexCartesianChart class. No classes derive from this class.

Methods

FlexCandlestickChart inherits all its methods from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin, FlexCandlestickChart has the following properties:

  • columnWidthRatio
  • maxColumnWidth
Parent topic: Flex Class Reference


FlexCandlestickSeries Class

Description

Represents financial data as a series of candlesticks representing the high, low, opening, and closing values of a data series.

The top and bottom of the vertical line in each candlestick represent the high and low values for the datapoint, while the top and bottom of the filled box represent the opening and closing values. Each candlestick is filled differently depending on whether the closing value for the datapoint is higher or lower than the opening value.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexCandlestickSeries is derived from the FlexHLOCSeriesBase class. No classes derive from this class.

Methods

FlexCandlestickSeries inherits all its methods from FlexHLOCSeriesBase, FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexCandlestickSeries inherits all its properties from FlexHLOCSeriesBase, FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexCanvas Class

Description

A Canvas layout container defines a rectangular region in which you place child containers and controls. It is the only container that lets you explicitly specify the location of its children within the container by using the x and y properties of each child.

Flex sets the children of a Canvas layout container to their preferred width and preferred height. You may override the value for a child's preferred width by setting its width property to either a fixed pixel value or a percentage of the container size. You can set the preferred height in a similar manner.

If you use percentage sizing inside a Canvas container, some of your components may overlap. If this is not the effect you want, plan your component positions and sizes carefully.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexCanvas is derived from the FlexContainer class. No classes derive from this class.

Methods

FlexCanvas inherits all its methods from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexCanvas inherits all its properties from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexCartesianChart Class

Description

A base class for the common chart types. CartesianChart defines the basic layout behavior of the standard rectangular, two-dimensional charts.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexCartesianChart is derived from the FlexChart class.The following classes derive from the FlexCartesianChart class:
  • FlexAreaChart
  • FlexBarChart
  • FlexBubbleChart
  • FlexCandlestickChart
  • FlexColumnChart
  • FlexHLOCChart
  • FlexLineChart
  • FlexPlotChart

Methods

FlexCartesianChart inherits all its methods from FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChart, FlexObject, FlexDisplayObject, and AnyWin, FlexCartesianChart has the following properties:

  • gutterBottom
  • gutterLeft
  • gutterRight
  • gutterTop
  • horizontalAxisRatio
  • textAlign
  • verticalAxisRatio
Parent topic: Flex Class Reference


FlexChart Class

Description

The link between the Flex component architecture and the DualStyleObject architecture. It extends the Flex UIComponent base class, but contains DualStyleObject classes.

You typically do not use the ChartBase class directly. Instead you use one of its subclasses, such as PlotChart or BubbleChart. It acts as the base class for the common chart types provided in the mx.charts package.

This class defines a number of CSS styles and properties that provide easy access to the more common features of the framework.

A chart's minimum size is 20 x 20 pixels. A chart's maximum size is unbounded. A chart's preferred size is 400 x 400 pixels.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexChart is derived from the FlexObject class.The following classes derive from the FlexChart class:
  • FlexCartesianChart
  • FlexPieChart

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexChart has the following methods:

  • DragCancel
  • DragDrop
  • DragStart
  • GetValues
  • Select

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexChart has the following properties:

  • clipContent
  • columnNames
  • dataTipMode
  • description
  • dragEnabled
  • dropEnabled
  • firstVisibleRow
  • fontFamily
  • fontSize
  • lastVisibleRow
  • maximumDataTipCount
  • mouseSensitivity
  • numColumns
  • numRows
  • paddingBottom
  • paddingLeft
  • paddingRight
  • paddingTop
  • selectedChartItem
  • selectedChartItems
  • selectionMode
  • showDataTips
  • showDataTipTargets
Parent topic: Flex Class Reference


FlexChartLegend Class

Description

Adds a legend to your charts, where the legend displays the label for each data series in the chart and a key showing the chart element for the series.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexChartLegend is derived from the FlexObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexChartLegend has the following methods:

  • GetValues
  • LegendItemClick

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexChartLegend has the following properties:

  • columnNames
  • firstVisibleRow
  • fontWeight
  • label
  • labelPlacement
  • lastVisibleRow
  • markerAspectRatio
  • markerHeight
  • markerWidth
  • numColumns
  • numRows
  • paddingLeft
  • paddingRight
  • verticalGap
Parent topic: Flex Class Reference


FlexChartSeries Class

Description

The base class for the classes that let you specify a data series for a chart control.

You use the subclasses of the Series class with the associated chart control. You can use a Series class to specify the fill pattern and stroke characteristics for the chart elements that are associated with the data series.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexChartSeries is derived from the FlexObject class.The following classes derive from the FlexChartSeries class:
  • FlexAreaSeries
  • FlexBarSeries
  • FlexBubbleSeries
  • FlexColumnSeries
  • FlexHLOCSeriesBase
  • FlexLineSeries
  • FlexPieSeries
  • FlexPlotSeries

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexChartSeries has the following methods:

  • GetValues
  • SeriesClick
  • SeriesDoubleClick
  • SeriesItemRollOver

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexChartSeries has the following properties:

  • columnNames
  • firstVisibleRow
  • lastVisibleRow
  • numColumns
  • numRows
  • selectedIndex
  • selectedIndices
  • selectedItem
  • selectedItems
Parent topic: Flex Class Reference


FlexCheckBox Class

Description

The CheckBox control consists of an optional label and a small box that can contain a check mark or not.

You can place the optional text label to the left, right, top, or bottom of the CheckBox. When a user clicks a CheckBox control or its associated text, the CheckBox control changes its state from checked to unchecked or from unchecked to checked. CheckBox controls gather a set of true or false values that are not mutually exclusive.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexCheckBox is derived from the FlexButton class. No classes derive from this class.

Methods

FlexCheckBox inherits all its methods from FlexButton, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexCheckBox inherits all its properties from FlexButton, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexColorPicker Class

Description

Provides a way for a user to choose a color from a swatch list.

The default mode of the component shows a single swatch in a square button. When the user clicks the swatch button, the swatch panel appears and displays the entire swatch list.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexColorPicker is derived from the FlexComboBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexComboBase, FlexObject, FlexDisplayObject, and AnyWin, FlexColorPicker has the following methods:

  • Change

Properties

In addition to the properties it inherits from FlexComboBase, FlexObject, FlexDisplayObject, and AnyWin, FlexColorPicker has the following properties:

  • columnCount
  • selectedColor
  • showTextField
Parent topic: Flex Class Reference


FlexColumnChart Class

Description

Represents data as a series of vertical columns whose height is determined by values in the data.

You can use the ColumnChart to represent a variety of different charts including simple columns, clustered columns, stacked, 100% stacked, and high/low.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexColumnChart is derived from the FlexCartesianChart class. No classes derive from this class.

Methods

FlexColumnChart inherits all its methods from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin, FlexColumnChart has the following properties:

  • columnWidthRatio
  • maxColumnWidth
Parent topic: Flex Class Reference


FlexColumnSeries Class

Description

Defines a data series for a ColumnChart control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexColumnSeries is derived from the FlexChartSeries class. No classes derive from this class.

Methods

FlexColumnSeries inherits all its methods from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin, FlexColumnSeries has the following properties:

  • columnWidthRatio
  • maxColumnWidth
  • minField
  • offset
  • sortOnXField
  • xField
  • yField
Parent topic: Flex Class Reference


FlexComboBase Class

Description

The base class for controls that display text in a text field and have a button that causes a drop-down list to appear where the user can choose which text to display.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexComboBase is derived from the FlexObject class.The following classes derive from the FlexComboBase class:
  • FlexColorPicker
  • FlexComboBox
  • FlexDateField

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexComboBase has the following methods:

  • Close
  • Input
  • Open
  • Scroll
  • SelectText
  • Type

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexComboBase has the following properties:

  • backgroundAlpha
  • backgroundColor
  • backgroundImage
  • backgroundSize
  • color
  • disabledColor
  • dropShadowEnabled
  • editable
  • fillAlphas
  • fillColors
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • highlightColor
  • restrict
  • selectedIndex
  • text
  • textAlign
  • textDecoration
  • textIndent
Parent topic: Flex Class Reference


FlexComboBox Class

Description

Contains a drop-down list from which the user can select a single value.

The ComboBox can be editable, in which case the user can type entries into the TextInput portion of the ComboBox that are not in the list.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexComboBox is derived from the FlexComboBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexComboBase, FlexObject, FlexDisplayObject, and AnyWin, FlexComboBox has the following methods:

  • GetValues
  • Select
  • SelectIndex

Properties

In addition to the properties it inherits from FlexComboBase, FlexObject, FlexDisplayObject, and AnyWin, FlexComboBox has the following properties:

  • alternatingItemColors
  • columnNames
  • firstVisibleRow
  • lastVisibleRow
  • numColumns
  • numRows
  • rollOverColor
  • selectionColor
Parent topic: Flex Class Reference


FlexContainer Class

Description

An abstract base class for components that controls the layout characteristics of child components.

You do not create an instance of Container in an application. Instead, you create an instance of one of Container's subclasses, such as Canvas or HBox.

The Container class contains the logic for scrolling, clipping, and dynamic instantiation. It contains methods for adding and removing children and the logic for drawing the background and borders of containers.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexContainer is derived from the FlexObject class.The following classes derive from the FlexContainer class:
  • FlexAccordion
  • FlexApplication
  • FlexBox
  • FlexCanvas
  • FlexForm
  • FlexFormItem
  • FlexPanel
  • FlexViewStack
  • FlexWindow

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexContainer has the following methods:

  • DragCancel
  • DragDrop
  • DragStart
  • GetValues
  • MouseScroll
  • Scroll

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexContainer has the following properties:

  • backgroundAlpha
  • backgroundColor
  • backgroundDisabledColor
  • backgroundImage
  • backgroundSize
  • columnNames
  • creationIndex
  • creationPolicy
  • fillAlphas
  • fillColors
  • firstVisibleRow
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • label
  • lastVisibleRow
  • numChildren
  • numColumns
  • numRows
Parent topic: Flex Class Reference


FlexContainerMovieClip Class

Description

Container components created in Adobe Flash CS3 Professional for use in Flex are subclasses of the mx.flash.ContainerMovieClip class.

You can use a subclass of ContainerMovieClip as a Flex container, it can hold children, and it can respond to events, define view states and transitions, and work with effects in the same way as can any Flex component.

A Flash container can only have a single Flex child. However, this child can be a Flex container which allows you to add additional children.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexContainerMovieClip is derived from the FlexUIMovieClip class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexUIMovieClip, FlexDisplayObject, and AnyWin, FlexContainerMovieClip has the following methods:

  • DragDrop

Properties

FlexContainerMovieClip inherits all its properties from FlexUIMovieClip, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexDataGrid Class

Description

The DataGrid control is like a List except that it can show more than one column of data making it suited for showing objects with multiple properties.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexDataGrid is derived from the FlexListBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexDataGrid has the following methods:

  • ColumnStretch
  • Edit
  • HeaderClick
  • HeaderShift

Properties

In addition to the properties it inherits from FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexDataGrid has the following properties:

  • editable
  • headerColors
  • headerStyleName
  • horizontalGridLineColor
  • horizontalGridLines
  • minColumnWidth
  • resizableColumns
  • sortableColumns
  • verticalGridLineColor
  • verticalGridLines
Parent topic: Flex Class Reference


FlexDateChooser Class

Description

Displays the name of a month, the year, and a grid of the days of the month, with columns labeled for the day of the week.

The user can select a date, a range of dates, or multiple dates. The control contains forward and back arrow buttons for changing the month and year.

You can let users select multiple dates, disable the selection of certain dates, and limit the display to a range of dates.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexDateChooser is derived from the FlexObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexDateChooser has the following methods:

  • Change
  • ScrollDate
  • Type

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexDateChooser has the following properties:

  • allowDisjointSelection
  • allowMultipleSelection
  • color
  • disabledColor
  • disabledDays
  • disabledRanges
  • displayedMonth
  • displayedYear
  • fillColors
  • firstDayOfWeek
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • headerColors
  • maxYear
  • minYear
  • rollOverColor
  • selectedDate
  • selectedRanges
  • selectionColor
  • showToday
  • textAlign
  • textDecoration
  • textIndent
  • todayColor
  • yearNavigationEnabled
Parent topic: Flex Class Reference


FlexDateField Class

Description

A text field that shows the date with a calendar icon on its right side.

When the user clicks anywhere inside the bounding box of the control, a DateChooser control pops up and shows the dates in the month of the current date. If no date is selected, the text field is blank and the month of the current date is displayed in the DateChooser control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexDateField is derived from the FlexComboBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexComboBase, FlexObject, FlexDisplayObject, and AnyWin, FlexDateField has the following methods:

  • Change
  • ScrollDate

Properties

In addition to the properties it inherits from FlexComboBase, FlexObject, FlexDisplayObject, and AnyWin, FlexDateField has the following properties:

  • disabledDays
  • disabledRanges
  • displayedMonth
  • displayedYear
  • firstDayOfWeek
  • headerColors
  • maxYear
  • minYear
  • rollOverColor
  • selectedDate
  • showToday
  • todayColor
  • yearNavigationEnabled
Parent topic: Flex Class Reference


FlexDisplayObject Class

Description

The base class for all objects that can be placed on the display list. The display list manages all objects displayed in Flash Player or Adobe AIR.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexDisplayObject is derived from the AnyWin class.The following classes derive from the FlexDisplayObject class:
  • FlexListLabel
  • FlexObject
  • FlexUIMovieClip

Methods

In addition to the methods it inherits from AnyWin, FlexDisplayObject has the following methods:

  • GetStyle
  • ToString

Properties

In addition to the properties it inherits from AnyWin, FlexDisplayObject has the following properties:

  • alpha
  • height
  • mouseEnabled
  • tabChildren
  • tabEnabled
  • tabIndex
  • visible
  • width
  • x
  • y
Parent topic: Flex Class Reference


FlexDividedBox Class

Description

Measures and lays out its children horizontally or vertically in exactly the same way as a Box container, but it inserts draggable dividers in the gaps between the children. Users can drag any divider to resize the children on each side.

The DividedBox class is the base class for the HDividedBox and VDividedBox classes.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexDividedBox is derived from the FlexBox class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexDividedBox has the following methods:

  • Dragged
  • Pressed
  • Released

Properties

In addition to the properties it inherits from FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexDividedBox has the following properties:

  • resizeToContent
Parent topic: Flex Class Reference


FlexForm Class

Description

Use this class to control the layout of a form, mark form fields as required or optional, handle error messages, and bind your form data to the Flex data model to perform data checking and validation. This class also lets you use style sheets to configure the appearance of your forms.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexForm is derived from the FlexContainer class. No classes derive from this class.

Methods

FlexForm inherits all its methods from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexForm inherits all its properties from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexFormItem Class

Description

Defines a label and one or more children arranged horizontally or vertically. Children can be controls or other containers. A single Form container can hold multiple FormItem containers.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexFormItem is derived from the FlexContainer class. No classes derive from this class.

Methods

FlexFormItem inherits all its methods from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexFormItem has the following properties:

  • horizontalAlign
Parent topic: Flex Class Reference


FlexHLOCChart Class

Description

The HLOCChart (High Low Open Close) control represents financial data as a series of elements representing the high, low, closing, and optionally opening values of a data series.

The top and bottom of the vertical line in each element represent the high and low values for the datapoint. The right-facing tick represents the closing values, and the left tick represents the opening value if one was specified.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexHLOCChart is derived from the FlexCartesianChart class. No classes derive from this class.

Methods

FlexHLOCChart inherits all its methods from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin, FlexHLOCChart has the following properties:

  • columnWidthRatio
  • maxColumnWidth
Parent topic: Flex Class Reference


FlexHLOCSeries Class

Description

Represents financial data as a series of elements representing the high, low, closing, and, optionally, opening values of a data series.

The top and bottom of the vertical line in each element represent the high and low values for the datapoint. The right-facing tick mark represents the closing value, and the left tick mark represents the opening value, if one was specified.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexHLOCSeries is derived from the FlexHLOCSeriesBase class. No classes derive from this class.

Methods

FlexHLOCSeries inherits all its methods from FlexHLOCSeriesBase, FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexHLOCSeries inherits all its properties from FlexHLOCSeriesBase, FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexHLOCSeriesBase Class

Description

Represents financial data as a series of elements representing the high, low, closing, and, optionally, opening values of a data series.

The top and bottom of the vertical line in each element represent the high and low values for the datapoint. The right-facing tick mark represents the closing value, and the left tick mark represents the opening value, if one was specified.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexHLOCSeriesBase is derived from the FlexChartSeries class.The following classes derive from the FlexHLOCSeriesBase class:
  • FlexCandlestickSeries
  • FlexHLOCSeries

Methods

FlexHLOCSeriesBase inherits all its methods from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin, FlexHLOCSeriesBase has the following properties:

  • columnWidthRatio
  • maxColumnWidth
  • xField
Parent topic: Flex Class Reference


FlexImage Class

Description

Lets you import JPEG, PNG, GIF, and SWF files at runtime.

You can also embed any of these files and SVG files at compile time by using @Embed(source='filename').

Note: Flex also includes the SWFLoader control for loading Flex applications. You typically use the Image control for loading static graphic files and SWF files, and use the SWFLoader control for loading Flex applications. The Image control is also designed to be used in custom item renderers and item editors.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexImage is derived from the FlexLoader class. No classes derive from this class.

Methods

FlexImage inherits all its methods from FlexLoader, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexImage inherits all its properties from FlexLoader, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexLabel Class

Description

Displays a single line of noneditable text.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexLabel is derived from the FlexObject class. No classes derive from this class.

Methods

FlexLabel inherits all its methods from FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexLabel has the following properties:

  • color
  • disabledColor
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • htmlText
  • text
  • textAlign
  • textDecoration
  • textIndent
Parent topic: Flex Class Reference


FlexLineChart Class

Description

Represents a data series as points connected by a continuous line.

You can use an icon or symbol to represent each data point along the line, or show a simple line with no icons.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexLineChart is derived from the FlexCartesianChart class. No classes derive from this class.

Methods

FlexLineChart inherits all its methods from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexLineChart inherits all its properties from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexLineSeries Class

Description

Defines a data series for a LineChart control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexLineSeries is derived from the FlexChartSeries class. No classes derive from this class.

Methods

FlexLineSeries inherits all its methods from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin, FlexLineSeries has the following properties:

  • form
  • radius
  • sortOnXField
  • xField
  • yField
Parent topic: Flex Class Reference


FlexLinkBar Class

Description

Defines a horizontal or vertical row of LinkButton controls that designate a series of link destinations.

You typically use a LinkBar control to control the active child container of a ViewStack container, or to create a stand-alone set of links.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexLinkBar is derived from the FlexNavigationBar class. No classes derive from this class.

Methods

FlexLinkBar inherits all its methods from FlexNavigationBar, FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexLinkBar inherits all its properties from FlexNavigationBar, FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexList Class

Description

Displays a list of items horizontally, verically, or laid out in tiles.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexList is derived from the FlexListBase class.The following classes derive from the FlexList class:
  • FlexTree

Methods

In addition to the methods it inherits from FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexList has the following methods:

  • Edit

Properties

FlexList inherits all its properties from FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexListBase Class

Description

The ListBase class is the base class for controls that represent lists of items that can have one or more selected and can scroll through the items.

Items are supplied using the dataProvider property and displayed via item renderers.

In a model/view architecture, the ListBase-derived class represents the view, and the dataProvider object represents the model.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexListBase is derived from the FlexScrollBase class.The following classes derive from the FlexListBase class:
  • FlexAdvancedDataGrid
  • FlexDataGrid
  • FlexList

Methods

In addition to the methods it inherits from FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexListBase has the following methods:

  • Deselect
  • DoubleSelect
  • DragCancel
  • DragDrop
  • DragStart
  • GetValues
  • MultiSelect
  • Scroll
  • ScrollToIndex
  • Select
  • SelectIndex
  • Type

Properties

In addition to the properties it inherits from FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexListBase has the following properties:

  • allowMultipleSelection
  • alternatingItemColors
  • backgroundDisabledColor
  • columnCount
  • columnNames
  • columnWidth
  • dataTipField
  • firstVisibleRow
  • focusAlpha
  • iconField
  • labelField
  • lastVisibleRow
  • lockedColumnCount
  • lockedRowCount
  • numColumns
  • numRows
  • rollOverColor
  • rowCount
  • rowHeight
  • selectable
  • selectedIndex
  • selectedIndices
  • selectedItem
  • selectedItems
  • selectionColor
  • selectionDisabledColor
  • showDataTips
  • textRollOverColor
  • textSelectedColor
  • useRollOver
  • variableRowHeight
  • verticalAlign
  • wordWrap
Parent topic: Flex Class Reference


FlexListLabel Class

Description

Defines the default item renderer for a control. By default, the item renderer draws the text associated with each item in the list, and an optional icon.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexListLabel is derived from the FlexDisplayObject class. No classes derive from this class.

Methods

FlexListLabel inherits all its methods from FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexDisplayObject, and AnyWin, FlexListLabel has the following properties:

  • automationClassName
  • automationIndex
  • automationName
  • automationValue
  • className
Parent topic: Flex Class Reference


FlexLoader Class

Description

Loads and displays a specified SWF file. You typically use SWFLoader for loading one Flex application into a host Flex application.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexLoader is derived from the FlexObject class.The following classes derive from the FlexLoader class:
  • FlexImage

Methods

FlexLoader inherits all its methods from FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexLoader has the following properties:

  • source
Parent topic: Flex Class Reference


FlexMenu Class

Description

Creates a pop-up menu of individually selectable choices, similar to the File or Edit menu found in most software applications. The popped up menu can have as many levels of submenus as needed.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexMenu is derived from the FlexObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexMenu has the following methods:

  • GetValues
  • Hide
  • Select
  • Show
  • Type

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexMenu has the following properties:

  • alternatingItemColors
  • columnNames
  • firstVisibleRow
  • lastVisibleRow
  • numColumns
  • numRows
  • rollOverColor
  • rowCount
  • selectedIndex
  • selectionColor
  • textRollOverColor
  • textSelectedColor
Parent topic: Flex Class Reference


FlexMenuBar Class

Description

Defines a horizontal, top-level menu bar that contains one or more menus. Clicking on a top-level menu item opens a pop-up submenu that is an instance of the Menu control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexMenuBar is derived from the FlexObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexMenuBar has the following methods:

  • GetValues
  • Hide
  • Show
  • Type

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexMenuBar has the following properties:

  • backgroundColor
  • color
  • columnNames
  • disabledColor
  • fillColors
  • firstVisibleRow
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • lastVisibleRow
  • numChildren
  • numColumns
  • numRows
  • rollOverColor
  • selectedIndex
  • selectionColor
  • textAlign
  • textDecoration
  • textIndent
Parent topic: Flex Class Reference


FlexNavigationBar Class

Description

The superclass for navigator controls, such as the LinkBar and TabBar controls. This class cannot be instantiated directly.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexNavigationBar is derived from the FlexBox class.The following classes derive from the FlexNavigationBar class:
  • FlexButtonBar
  • FlexLinkBar

Methods

In addition to the methods it inherits from FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexNavigationBar has the following methods:

  • Change
  • Type

Properties

In addition to the properties it inherits from FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexNavigationBar has the following properties:

  • selectedIndex
Parent topic: Flex Class Reference


FlexNumericStepper Class

Description

Lets the user select a number from an ordered set.

The NumericStepper control consists of a single-line input text field and a pair of arrow buttons for stepping through the possible values. The Up Arrow and Down Arrow keys also cycle through the values.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexNumericStepper is derived from the FlexObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexNumericStepper has the following methods:

  • Change
  • Input
  • SelectText
  • Type

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexNumericStepper has the following properties:

  • color
  • disabledColor
  • fillColors
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • maximum
  • minimum
  • nextValue
  • previousValue
  • stepSize
  • textAlign
  • textDecoration
  • textIndent
  • value
Parent topic: Flex Class Reference


FlexObject Class

Description

The base class for all visual components, both interactive and noninteractive.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexObject is derived from the FlexDisplayObject class.The following classes derive from the FlexObject class:
  • FlexAxisRenderer
  • FlexButton
  • FlexChart
  • FlexChartLegend
  • FlexChartSeries
  • FlexComboBase
  • FlexContainer
  • FlexDateChooser
  • FlexLabel
  • FlexLoader
  • FlexMenu
  • FlexMenuBar
  • FlexNumericStepper
  • FlexProgressBar
  • FlexRule
  • FlexScrollBar
  • FlexScrollBase
  • FlexSlider
  • FlexVideoDisplay
  • SparkDataGridLabel
  • SparkGroupBase
  • SparkObject
  • SparkPopUpAnchor
  • SparkTextBase
  • SparkVideoDisplay

Methods

In addition to the methods it inherits from FlexDisplayObject, and AnyWin, FlexObject has the following methods:

  • ChangeFocus
  • Move
  • SetFocus

Properties

In addition to the properties it inherits from FlexDisplayObject, and AnyWin, FlexObject has the following properties:

  • automationClassName
  • automationIndex
  • automationName
  • className
  • currentState
  • enabled
  • errorColor
  • errorString
  • focusEnabled
  • id
  • numAutomationChildren
  • percentHeight
  • percentWidth
  • scaleX
  • scaleY
  • themeColor
  • toolTip
  • useHandCursor
Parent topic: Flex Class Reference


FlexOLAPDataGrid Class

Description

Expands on the functionality of the AdvancedDataGrid control to add support for the display of the results of OLAP queries.

Like all Flex data grid controls, the OLAPDataGrid control is designed to display data in a two-dimensional representation of rows and columns.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexOLAPDataGrid is derived from the FlexAdvancedDataGrid class. No classes derive from this class.

Methods

FlexOLAPDataGrid inherits all its methods from FlexAdvancedDataGrid, FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexAdvancedDataGrid, FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexOLAPDataGrid has the following properties:

  • defaultCellString
Parent topic: Flex Class Reference


FlexPanel Class

Description

Consists of a title bar, a caption, a border, and a content area for its children.

Typically, you use Panel containers to wrap top-level application modules. For example, you can include a shopping cart in a Panel container.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexPanel is derived from the FlexContainer class.The following classes derive from the FlexPanel class:
  • FlexAlert
  • FlexTitleWindow

Methods

FlexPanel inherits all its methods from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexPanel has the following properties:

  • dropShadowEnabled
  • footerColors
  • headerColors
  • headerHeight
  • status
  • title
Parent topic: Flex Class Reference


FlexPieChart Class

Description

Represents a data series as a standard pie chart.

The data for the data provider determines the size of each wedge in the pie chart relative to the other wedges. You can use the PieSeries class to create standard pie charts, doughnut charts, or stacked pie charts.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexPieChart is derived from the FlexChart class. No classes derive from this class.

Methods

FlexPieChart inherits all its methods from FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChart, FlexObject, FlexDisplayObject, and AnyWin, FlexPieChart has the following properties:

  • innerRadius
  • textAlign
Parent topic: Flex Class Reference


FlexPieSeries Class

Description

Defines the data series for a PieChart control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexPieSeries is derived from the FlexChartSeries class. No classes derive from this class.

Methods

FlexPieSeries inherits all its methods from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin, FlexPieSeries has the following properties:

  • calloutGap
  • explodeRadius
  • field
  • fontSize
  • innerRadius
  • insideLabelSizeLimit
  • labelPosition
  • maxLabelRadius
  • nameField
  • outerRadius
  • startAngle
Parent topic: Flex Class Reference


FlexPlotChart Class

Description

Represents data with two values for each data point. One value determines the position of the data point along the horizontal axis, and one value determines its position along the vertical axis.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexPlotChart is derived from the FlexCartesianChart class. No classes derive from this class.

Methods

FlexPlotChart inherits all its methods from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexPlotChart inherits all its properties from FlexCartesianChart, FlexChart, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexPlotSeries Class

Description

Defines a data series for a PlotChart control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexPlotSeries is derived from the FlexChartSeries class. No classes derive from this class.

Methods

FlexPlotSeries inherits all its methods from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexChartSeries, FlexObject, FlexDisplayObject, and AnyWin, FlexPlotSeries has the following properties:

  • radius
  • xField
  • yField
Parent topic: Flex Class Reference


FlexPopUpButton Class

Description

The PopUpButton control adds a flexible pop-up control interface to a Button control. It contains a main button and a secondary button, called the pop-up button, which pops up any UIComponent object when a user clicks the pop-up button.

A PopUpButton control can have a text label, an icon, or both on its face. When a user clicks the main part of the PopUpButton control, it dispatches a click event.

One common use for the PopUpButton control is to have the pop-up button open a List control or a Menu control that changes the function and label of the main button.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexPopUpButton is derived from the FlexButton class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexButton, FlexObject, FlexDisplayObject, and AnyWin, FlexPopUpButton has the following methods:

  • Close
  • Open

Properties

FlexPopUpButton inherits all its properties from FlexButton, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexProgressBar Class

Description

The ProgressBar control provides a visual representation of the progress of a task over time. There are two types of ProgressBar controls: determinate and indeterminate.

A determinate ProgressBar control is a linear representation of the progress of a task over time. You use a determinate ProgressBar when the scope of the task is known. It displays when the user has to wait for an extended amount of time.

An indeterminate ProgressBar control represents time-based processes for which the scope is not yet known. As soon as you can determine the scope, you should use a determinate ProgressBar control.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexProgressBar is derived from the FlexObject class. No classes derive from this class.

Methods

FlexProgressBar inherits all its methods from FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexProgressBar has the following properties:

  • barColor
  • borderColor
  • color
  • conversion
  • direction
  • disabledColor
  • fillColors
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • indeterminate
  • label
  • labelPlacement
  • labelWidth
  • maximum
  • minimum
  • percentComplete
  • textAlign
  • textDecoration
  • textIndent
  • value
Parent topic: Flex Class Reference


FlexRadioButton Class

Description

The RadioButton control lets the user make a single choice within a set of mutually exclusive choices.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexRadioButton is derived from the FlexButton class. No classes derive from this class.

Methods

FlexRadioButton inherits all its methods from FlexButton, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexButton, FlexObject, FlexDisplayObject, and AnyWin, FlexRadioButton has the following properties:

  • groupName
Parent topic: Flex Class Reference


FlexRepeater Class

Description

Identifies the repeater control, which creates multiple instances of its subcomponents.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexRepeater is derived from the AnyWin class. No classes derive from this class.

Methods

In addition to the methods it inherits from AnyWin, FlexRepeater has the following methods:

  • GetValues

Properties

In addition to the properties it inherits from AnyWin, FlexRepeater has the following properties:

  • automationClassName
  • automationIndex
  • automationName
  • className
  • columnNames
  • count
  • firstVisibleRow
  • id
  • lastVisibleRow
  • numColumns
  • numRows
  • recycleChildren
  • startingIndex
Parent topic: Flex Class Reference


FlexRule Class

Description

Creates a single horizontal or vertical line. You typically use this control to create a dividing line within a container.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexRule is derived from the FlexObject class. No classes derive from this class.

Methods

FlexRule inherits all its methods from FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexRule has the following properties:

  • color
  • strokeWidth
Parent topic: Flex Class Reference


FlexScrollBar Class

Description

Lets you control the portion of data that is displayed when there is too much data to fit in a display area.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexScrollBar is derived from the FlexObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexScrollBar has the following methods:

  • Scroll

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexScrollBar has the following properties:

  • fillColors
  • lineScrollSize
  • pageScrollSize
  • scrollPosition
  • trackColors
Parent topic: Flex Class Reference


FlexScrollBase Class

Description

The ScrollControlBase class is the base class for controls with scroll bars.

The user interacts with the scroll bar or the developer accesses methods and properties that alter the viewable area. The ScrollControlBase takes a single child object and positions and masks or sizes that object to display the viewable content. All items to be scrolled must be children of that content object.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexScrollBase is derived from the FlexObject class.The following classes derive from the FlexScrollBase class:
  • FlexListBase
  • FlexTextArea
  • SparkAirHTML

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexScrollBase has the following methods:

  • MouseScroll

Properties

FlexScrollBase inherits all its properties from FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexSlider Class

Description

Lets users select a value by moving a slider thumb between the end points of the slider track.

The current value of the slider is determined by the relative location of the thumb between the end points of the slider, corresponding to the slider's minimum and maximum values.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexSlider is derived from the FlexObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexSlider has the following methods:

  • Change

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexSlider has the following properties:

  • dataTipPrecision
  • direction
  • fillColors
  • labels
  • labelStyleName
  • liveDragging
  • maximum
  • minimum
  • showDataTip
  • snapInterval
  • thumbCount
  • tickColor
  • tickLength
  • tickThickness
  • trackColors
  • value
  • values
Parent topic: Flex Class Reference


FlexStandalonePlayer Class

Description

The Flex Standalone Player.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexStandalonePlayer is derived from the MainWin class. No classes derive from this class.

Methods

FlexStandalonePlayer inherits all its methods from MainWin, AnyWin, AnyWin, and AnyWin.

Properties

FlexStandalonePlayer inherits all its properties from MainWin, AnyWin, AnyWin, and AnyWin.

Parent topic: Flex Class Reference


FlexTabNavigator Class

Description

Extends the ViewStack container by including a TabBar container for navigating between its child containers.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexTabNavigator is derived from the FlexViewStack class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexViewStack, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexTabNavigator has the following methods:

  • Change

Properties

In addition to the properties it inherits from FlexViewStack, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexTabNavigator has the following properties:

  • horizontalAlign
  • horizontalGap
  • tabHeight
  • tabWidth
Parent topic: Flex Class Reference


FlexTextArea Class

Description

A multiline text field with a border and optional scroll bars.

The TextArea control supports the HTML rendering capabilities of Flash Player and AIR.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexTextArea is derived from the FlexScrollBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexTextArea has the following methods:

  • Input
  • Scroll
  • SelectText
  • Type

Properties

In addition to the properties it inherits from FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexTextArea has the following properties:

  • color
  • disabledColor
  • displayAsPassword
  • editable
  • fontFamily
  • fontSize
  • fontStyle
  • fontWeight
  • horizontalScrollPolicy
  • htmlText
  • length
  • maxChars
  • restrict
  • selectionBeginIndex
  • selectionEndIndex
  • text
  • wordWrap
Parent topic: Flex Class Reference


FlexTitleWindow Class

Description

Contains a title bar, a caption, a border, and a content area for its child.

Typically, you use TitleWindow containers to wrap self-contained application modules. For example, you can include a form in a TitleWindow container. When the user completes the form, you can close the TitleWindow container programmatically, or let the user close it by using the Close button.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexTitleWindow is derived from the FlexPanel class. No classes derive from this class.

Methods

FlexTitleWindow inherits all its methods from FlexPanel, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexPanel, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexTitleWindow has the following properties:

  • showCloseButton
Parent topic: Flex Class Reference


FlexToggleButtonBar Class

Description

Defines a horizontal or vertical group of buttons that maintain their selected or deselected state.

Only one button in the ToggleButtonBar control can be in the selected state. This means that when a user selects a button in a ToggleButtonBar control, the button stays in the selected state until the user selects a different button.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexToggleButtonBar is derived from the FlexButtonBar class. No classes derive from this class.

Methods

FlexToggleButtonBar inherits all its methods from FlexButtonBar, FlexNavigationBar, FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

FlexToggleButtonBar inherits all its properties from FlexButtonBar, FlexNavigationBar, FlexBox, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


FlexTree Class

Description

The Tree control lets a user view hierarchical data arranged as an expandable tree.

Each item in a tree can be a leaf or a branch. A leaf item is an end point in the tree. A branch item can contain leaf or branch items, or it can be empty.

By default, a leaf is represented by a text label next to a file icon. A branch is represented by a text label next to a folder icon, with a disclosure triangle that a user can open to expose children.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexTree is derived from the FlexList class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexList, FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexTree has the following methods:

  • Close
  • Open

Properties

In addition to the properties it inherits from FlexList, FlexListBase, FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, FlexTree has the following properties:

  • depthColors
  • disabledColor
  • editable
  • indentation
Parent topic: Flex Class Reference


FlexUIMovieClip Class

Description

Components created in Adobe Flash CS3 Professional for use in Flex are subclasses of the mx.flash.UIMovieClip class.

The UIMovieClip class implements the interfaces necessary for a Flash component to be used like a normal Flex component. Therefore, a subclass of UIMovieClip can be used as a child of a Flex container or as a skin, and it can respond to events, define view states and transitions, and work with effects in the same way as can any Flex component.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexUIMovieClip is derived from the FlexDisplayObject class.The following classes derive from the FlexUIMovieClip class:
  • FlexContainerMovieClip

Methods

In addition to the methods it inherits from FlexDisplayObject, and AnyWin, FlexUIMovieClip has the following methods:

  • ChangeFocus
  • SetFocus

Properties

In addition to the properties it inherits from FlexDisplayObject, and AnyWin, FlexUIMovieClip has the following properties:

  • automationClassName
  • automationIndex
  • automationName
  • className
  • currentState
  • enabled
  • errorColor
  • errorString
  • focusEnabled
  • id
  • numAutomationChildren
  • percentHeight
  • percentWidth
  • scaleX
  • scaleY
  • themeColor
  • toolTip
  • useHandCursor
Parent topic: Flex Class Reference


FlexVideoDisplay Class

Description

Lets you play an FLV file in a Flex application. It supports progressive download over HTTP, streaming from the Flash Media Server, and streaming from a Camera object.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexVideoDisplay is derived from the FlexObject class. No classes derive from this class.

Methods

FlexVideoDisplay inherits all its methods from FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, FlexVideoDisplay has the following properties:

  • source
  • totalTime
  • volume
Parent topic: Flex Class Reference


FlexViewStack Class

Description

Consists of a collection of child containers stacked on top of each other, where only one child at a time is visible. When a different child container is selected, it seems to replace the old one because it appears in the same location. However, the old child container still exists; it is just invisible.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexViewStack is derived from the FlexContainer class.The following classes derive from the FlexViewStack class:
  • FlexTabNavigator

Methods

In addition to the methods it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexViewStack has the following methods:

  • Type

Properties

In addition to the properties it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexViewStack has the following properties:

  • selectedChild
  • selectedIndex
Parent topic: Flex Class Reference


FlexWindow Class

Description

The Window is a top-level container for additional windows in an AIR desktop application.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexWindow is derived from the FlexContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexWindow has the following methods:

  • StateChange

Properties

In addition to the properties it inherits from FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexWindow has the following properties:

  • alwaysInFront
  • closed
  • isAIRWindow
  • maxHeight
  • maximizable
  • maxWidth
  • minHeight
  • minimizable
  • minWidth
  • resizable
  • showStatusBar
  • status
  • systemChrome
  • title
  • transparent
  • WindowState
Parent topic: Flex Class Reference


FlexWindowedApplication Class

Description

The WindowedApplication defines the application container that you use to create Flex applications for AIR applications.

Availability

This class is supported only on the Open Agent.

Inheritance

FlexWindowedApplication is derived from the FlexApplication class. No classes derive from this class.

Methods

FlexWindowedApplication inherits all its methods from FlexApplication, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexApplication, FlexContainer, FlexObject, FlexDisplayObject, and AnyWin, FlexWindowedApplication has the following properties:

  • alwaysInFront
  • applicationID
  • autoExit
  • closed
  • maxHeight
  • maximizable
  • maxWidth
  • minHeight
  • minimizable
  • minWidth
  • resizable
  • showStatusBar
  • status
  • systemChrome
  • title
  • transparent
  • WindowState
Parent topic: Flex Class Reference


SparkAirHTML Class

Description

The HTML control lets you display HTML content in your application.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkAirHTML is derived from the FlexScrollBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin, SparkAirHTML has the following methods:

  • Scroll

Properties

SparkAirHTML inherits all its properties from FlexScrollBase, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkApplication Class

Description

Flex defines a default, or Application, container that lets you start adding content to your application without explicitly defining another container.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkApplication is derived from the SparkSkinnableContainer class.The following classes derive from the SparkApplication class:
  • SparkWindowedApplication

Methods

In addition to the methods it inherits from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkApplication has the following methods:

  • Type

Properties

In addition to the properties it inherits from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkApplication has the following properties:

  • colorCorrection
  • controlBarVisible
  • url
  • viewSourceURL
Parent topic: Flex Class Reference


SparkBorderContainer Class

Description

The BorderContainer class defines a set of CSS styles that control the appearance of the border and background fill of the container.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkBorderContainer is derived from the SparkSkinnableContainer class. No classes derive from this class.

Methods

SparkBorderContainer inherits all its methods from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkBorderContainer inherits all its properties from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkButton Class

Description

The SparkButton component is a commonly used rectangular button. The SparkButton component looks like it can be pressed.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkButton is derived from the SparkButtonBase class.The following classes derive from the SparkButton class:
  • SparkMuteButton

Methods

SparkButton inherits all its methods from SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkButton has the following properties:

  • emphasized
Parent topic: Flex Class Reference


SparkButtonBar Class

Description

The ButtonBar control defines a horizontal group of logically related buttons with a common look and navigation.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkButtonBar is derived from the SparkListBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkButtonBar has the following methods:

  • SelectIndex

Properties

SparkButtonBar inherits all its properties from SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkButtonBarButton Class

Description

The ButtonBarButton class defines the custom item renderer used by the ButtonBar control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkButtonBarButton is derived from the SparkToggleButton class. No classes derive from this class.

Methods

SparkButtonBarButton inherits all its methods from SparkToggleButton, SparkToggleButtonBase, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkToggleButton, SparkToggleButtonBase, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkButtonBarButton has the following properties:

  • allowDeselection
  • showsCaret
Parent topic: Flex Class Reference


SparkButtonBase Class

Description

The SparkButtonBase class is the base class for the all Spark button components.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkButtonBase is derived from the SparkObject class.The following classes derive from the SparkButtonBase class:
  • SparkButton
  • SparkToggleButtonBase

Methods

In addition to the methods it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkButtonBase has the following methods:

  • Type

Properties

In addition to the properties it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkButtonBase has the following properties:

  • autoRepeat
  • label
  • stickyHighlighting
Parent topic: Flex Class Reference


SparkCheckBox Class

Description

The CheckBox component consists of an optional label and a small box that can contain a check mark or not.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkCheckBox is derived from the SparkToggleButtonBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkToggleButtonBase, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkCheckBox has the following methods:

  • DragCancel
  • DragDrop
  • DragStart

Properties

SparkCheckBox inherits all its properties from SparkToggleButtonBase, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkComboBox Class

Description

The ComboBox control is a child class of the DropDownListBase control. Like the DropDownListBase control, when the user selects an item from the drop-down list in the ComboBox control, the data item appears in the prompt area of the control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkComboBox is derived from the SparkDropDownListBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkDropDownListBase, SparkList, SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkComboBox has the following methods:

  • Input
  • SelectText

Properties

In addition to the properties it inherits from SparkDropDownListBase, SparkList, SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkComboBox has the following properties:

  • maxChars
  • restrict
Parent topic: Flex Class Reference


SparkComplexDisplay Class

Description

A complex rendered object.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkComplexDisplay is derived from the SparkListLabel class. No classes derive from this class.

Methods

SparkComplexDisplay inherits all its methods from SparkListLabel, SparkDataRenderer, SparkGroup, SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkComplexDisplay inherits all its properties from SparkListLabel, SparkDataRenderer, SparkGroup, SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkDataGrid Class

Description

Identifies a Spark data grid control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkDataGrid is derived from the SparkSkinnableContainerBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkDataGrid has the following methods:

  • ColumnStretch
  • EditNext
  • GetValues
  • HeaderClick
  • Select
  • Type

Properties

In addition to the properties it inherits from SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkDataGrid has the following properties:

  • columnNames
  • columnsLength
  • firstVisibleRow
  • lastVisibleRow
  • numColumns
  • numRows
  • rowHeight
  • selectedCell
  • selectedCells
  • selectedIndex
  • selectedIndices
  • selectedItem
  • selectedItems
  • selectionLength
  • selectionMode
  • showDataTips
Parent topic: Flex Class Reference


SparkDataGridLabel Class

Description

Identifies a spark data grid label control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkDataGridLabel is derived from the FlexObject class. No classes derive from this class.

Methods

SparkDataGridLabel inherits all its methods from FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, SparkDataGridLabel has the following properties:

  • automationValue
Parent topic: Flex Class Reference


SparkDataGroup Class

Description

The DataGroup class is the base container class for data items.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkDataGroup is derived from the SparkGroupBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin, SparkDataGroup has the following methods:

  • Select

Properties

SparkDataGroup inherits all its properties from SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkDataRenderer Class

Description

The SparkDataRenderer class is the base class for data components in spark.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkDataRenderer is derived from the SparkGroup class.The following classes derive from the SparkDataRenderer class:
  • SparkListLabel

Methods

SparkDataRenderer inherits all its methods from SparkGroup, SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkDataRenderer inherits all its properties from SparkGroup, SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkDropDownList Class

Description

The SparkDropDownList control contains a drop-down list from which the user can select a single value.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkDropDownList is derived from the SparkDropDownListBase class. No classes derive from this class.

Methods

SparkDropDownList inherits all its methods from SparkDropDownListBase, SparkList, SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkDropDownListBase, SparkList, SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkDropDownList has the following properties:

  • prompt
Parent topic: Flex Class Reference


SparkDropDownListBase Class

Description

The SparkDropDownListBase control contains a drop-down list from which the user can select a single value.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkDropDownListBase is derived from the SparkList class.The following classes derive from the SparkDropDownListBase class:
  • SparkComboBox
  • SparkDropDownList

Methods

In addition to the methods it inherits from SparkList, SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkDropDownListBase has the following methods:

  • Open

Properties

In addition to the properties it inherits from SparkList, SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkDropDownListBase has the following properties:

  • isDropDownOpen
Parent topic: Flex Class Reference


SparkForm Class

Description

Identifies a Spark form control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkForm is derived from the SparkSkinnableContainer class. No classes derive from this class.

Methods

SparkForm inherits all its methods from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkForm inherits all its properties from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkFormItem Class

Description

Identifies a Spark form item control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkFormItem is derived from the SparkSkinnableContainer class. No classes derive from this class.

Methods

SparkFormItem inherits all its methods from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkFormItem has the following properties:

  • label
  • required
  • sequenceLabel
Parent topic: Flex Class Reference


SparkGroup Class

Description

Use this container when you want to manage visual children, both visual components and graphical components.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkGroup is derived from the SparkGroupBase class.The following classes derive from the SparkGroup class:
  • SparkDataRenderer
  • SparkTileGroup

Methods

SparkGroup inherits all its methods from SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin, SparkGroup has the following properties:

  • blendMode
  • scaleGridBottom
  • scaleGridLeft
  • scaleGridRight
  • scaleGridTop
Parent topic: Flex Class Reference


SparkGroupBase Class

Description

The GroupBase class defines the base class for components that display visual elements.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkGroupBase is derived from the FlexObject class.The following classes derive from the SparkGroupBase class:
  • SparkDataGroup
  • SparkGroup

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, SparkGroupBase has the following methods:

  • DragCancel
  • DragDrop
  • DragStart
  • GetValues
  • MouseScroll
  • Scroll
  • Type

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, SparkGroupBase has the following properties:

  • autoLayout
  • clipAndEnableScrolling
  • columnNames
  • contentHeight
  • contentWidth
  • firstVisibleRow
  • horizontalScrollPosition
  • lastVisibleRow
  • luminosityClip
  • luminosityInvert
  • maskType
  • mouseEnabledWhereTransparent
  • numColumns
  • numElements
  • numRows
  • resizeMode
  • verticalScrollPosition
Parent topic: Flex Class Reference


SparkImage Class

Description

Identifies a Spark image control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkImage is derived from the SparkObject class. No classes derive from this class.

Methods

SparkImage inherits all its methods from SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkImage has the following properties:

  • bytesLoaded
  • bytesTotal
  • clearOnLoad
  • contentLoaderGrouping
  • fillMode
  • horizontalAlign
  • preliminaryHeight
  • preliminaryWidth
  • scaleMode
  • smooth
  • source
  • sourceHeight
  • sourceWidth
  • trustedSource
  • verticalAlign
Parent topic: Flex Class Reference


SparkLabel Class

Description

Label is a low-level UIComponent that can render one or more lines of uniformly-formatted text.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkLabel is derived from the SparkTextBase class. No classes derive from this class.

Methods

SparkLabel inherits all its methods from SparkTextBase, FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkLabel inherits all its properties from SparkTextBase, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkList Class

Description

The List control displays a vertical list of items.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkList is derived from the SparkListBase class.The following classes derive from the SparkList class:
  • SparkDropDownListBase

Methods

In addition to the methods it inherits from SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkList has the following methods:

  • SelectIndex

Properties

In addition to the properties it inherits from SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkList has the following properties:

  • allowMultipleSelection
  • dragEnabled
  • dragMoveEnabled
  • dropEnabled
  • selectedIndices
  • selectedItems
Parent topic: Flex Class Reference


SparkListBase Class

Description

The ListBase class is the base class for all components that support selection.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkListBase is derived from the SparkSkinnableDataContainer class.The following classes derive from the SparkListBase class:
  • SparkButtonBar
  • SparkList
  • SparkTabBar

Methods

In addition to the methods it inherits from SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkListBase has the following methods:

  • GetItemsCount
  • Select
  • Type

Properties

In addition to the properties it inherits from SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkListBase has the following properties:

  • caretIndex
  • labelField
  • requireSelection
  • selectedIndex
  • selectedItem
  • useVirtualLayout
Parent topic: Flex Class Reference


SparkListLabel Class

Description

A simple rendered object.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkListLabel is derived from the SparkDataRenderer class.The following classes derive from the SparkListLabel class:
  • SparkComplexDisplay

Methods

SparkListLabel inherits all its methods from SparkDataRenderer, SparkGroup, SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkDataRenderer, SparkGroup, SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin, SparkListLabel has the following properties:

  • automationValue
  • dragging
  • label
  • selected
  • showsCaret
Parent topic: Flex Class Reference


SparkMuteButton Class

Description

The MuteButton class defines the mute button used by the VideoPlayer control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkMuteButton is derived from the SparkButton class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkButton, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkMuteButton has the following methods:

  • MuteChange

Properties

In addition to the properties it inherits from SparkButton, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkMuteButton has the following properties:

  • muted
  • volume
Parent topic: Flex Class Reference


SparkNavigatorContent Class

Description

The NavigatorContent class defines a Spark container that can be used in an MX navigator container, such as the ViewStack, TabNavigator and Accordion containers.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkNavigatorContent is derived from the SparkSkinnableContainer class. No classes derive from this class.

Methods

SparkNavigatorContent inherits all its methods from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkNavigatorContent inherits all its properties from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkNumericStepper Class

Description

The NumericStepper control lets you select a number from an ordered set. The NumericStepper provides the same functionality as the Spinner component, but adds a TextInput control so that you can directly edit the value of the component, rather than modifying it by using the control's arrow buttons.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkNumericStepper is derived from the SparkSpinner class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkSpinner, SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkNumericStepper has the following methods:

  • Input
  • SelectText

Properties

In addition to the properties it inherits from SparkSpinner, SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkNumericStepper has the following properties:

  • enableIME
  • imeMode
  • maxChars
Parent topic: Flex Class Reference


SparkObject Class

Description

The SparkObject class defines the base class for all spark components.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkObject is derived from the FlexObject class.The following classes derive from the SparkObject class:
  • SparkButtonBase
  • SparkImage
  • SparkRange
  • SparkRichEditableText
  • SparkSkinnableContainerBase
  • SparkSkinnableTextBase
  • SparkVideoPlayer

Methods

SparkObject inherits all its methods from FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkObject inherits all its properties from FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkPanel Class

Description

The Panel class defines a container that includes a title bar, a caption, a border, and a content area for its children.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkPanel is derived from the SparkSkinnableContainer class.The following classes derive from the SparkPanel class:
  • SparkTitleWindow

Methods

In addition to the methods it inherits from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkPanel has the following methods:

  • Type

Properties

In addition to the properties it inherits from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkPanel has the following properties:

  • controlBarVisible
  • title
Parent topic: Flex Class Reference


SparkPopUpAnchor Class

Description

Identifies a Spark PopUpAnchor control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkPopUpAnchor is derived from the FlexObject class. No classes derive from this class.

Methods

SparkPopUpAnchor inherits all its methods from FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, SparkPopUpAnchor has the following properties:

  • displayPopUp
  • popUpHeightMatchesAnchorHeight
  • popUpPosition
  • popUpWidthMatchesAnchorWidth
Parent topic: Flex Class Reference


SparkRadioButton Class

Description

The RadioButton component allows the user make a single choice within a set of mutually exclusive choices. A RadioButtonGroup is composed of two or more RadioButton components with the same groupName property.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkRadioButton is derived from the SparkToggleButtonBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkToggleButtonBase, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkRadioButton has the following methods:

  • DragCancel
  • DragDrop
  • DragStart

Properties

In addition to the properties it inherits from SparkToggleButtonBase, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkRadioButton has the following properties:

  • groupName
Parent topic: Flex Class Reference


SparkRange Class

Description

The Range class holds a value and an allowed range for that value, defined by minimum and maximum properties.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkRange is derived from the SparkObject class.The following classes derive from the SparkRange class:
  • SparkSpinner
  • SparkTrackBase

Methods

SparkRange inherits all its methods from SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkRange has the following properties:

  • maximum
  • minimum
  • snapInterval
  • stepSize
  • value
Parent topic: Flex Class Reference


SparkRichEditableText Class

Description

RichEditableText is a low-level UIComponent for displaying, scrolling, selecting, and editing richly-formatted text.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkRichEditableText is derived from the SparkObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkRichEditableText has the following methods:

  • DragCancel
  • DragDrop
  • DragStart
  • GetValues
  • Input
  • MouseScroll
  • SelectText
  • Type

Properties

In addition to the properties it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkRichEditableText has the following properties:

  • clipAndEnableScrolling
  • columnNames
  • contentHeight
  • contentWidth
  • displayAsPassword
  • editable
  • enableIME
  • firstVisibleRow
  • heightInLines
  • horizontalScrollPosition
  • imeMode
  • lastVisibleRow
  • maxChars
  • multiline
  • numColumns
  • numRows
  • restrict
  • selectable
  • selectionActivePosition
  • selectionAnchorPosition
  • selectionHighlighting
  • text
  • verticalScrollPosition
  • widthInChars
Parent topic: Flex Class Reference


SparkRichText Class

Description

RichText is a low-level UIComponent that can display one or more lines of richly-formatted text and embedded images.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkRichText is derived from the SparkTextBase class. No classes derive from this class.

Methods

SparkRichText inherits all its methods from SparkTextBase, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkTextBase, FlexObject, FlexDisplayObject, and AnyWin, SparkRichText has the following properties:

  • luminosityClip
  • luminosityInvert
  • maskType
Parent topic: Flex Class Reference


SparkScrollBar Class

Description

The ScrollBarBase class helps to position the portion of data that is displayed when there is too much data to fit in a display area.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkScrollBar is derived from the SparkTrackBase class. No classes derive from this class.

Methods

SparkScrollBar inherits all its methods from SparkTrackBase, SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkTrackBase, SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkScrollBar has the following properties:

  • pageSize
Parent topic: Flex Class Reference


SparkSkinnableContainer Class

Description

The SparkSkinnableContainer class is the base class for skinnable containers that have visual content.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkSkinnableContainer is derived from the SparkSkinnableContainerBase class.The following classes derive from the SparkSkinnableContainer class:
  • SparkApplication
  • SparkBorderContainer
  • SparkForm
  • SparkFormItem
  • SparkNavigatorContent
  • SparkPanel
  • SparkSkinnablePopUpContainer
  • SparkWindow

Methods

SparkSkinnableContainer inherits all its methods from SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkSkinnableContainer has the following properties:

  • autoLayout
  • creationPolicy
  • deferredContentCreated
  • numElements
Parent topic: Flex Class Reference


SparkSkinnableContainerBase Class

Description

Base class for spark container components.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkSkinnableContainerBase is derived from the SparkObject class.The following classes derive from the SparkSkinnableContainerBase class:
  • SparkDataGrid
  • SparkSkinnableContainer
  • SparkSkinnableDataContainer

Methods

In addition to the methods it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkSkinnableContainerBase has the following methods:

  • DragCancel
  • DragDrop
  • DragStart
  • GetValues

Properties

In addition to the properties it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkSkinnableContainerBase has the following properties:

  • columnNames
  • firstVisibleRow
  • lastVisibleRow
  • numColumns
  • numRows
Parent topic: Flex Class Reference


SparkSkinnableDataContainer Class

Description

The SkinnableDataContainer class is the base container class for data items.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkSkinnableDataContainer is derived from the SparkSkinnableContainerBase class.The following classes derive from the SparkSkinnableDataContainer class:
  • SparkListBase

Methods

SparkSkinnableDataContainer inherits all its methods from SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkSkinnableDataContainer has the following properties:

  • autoLayout
Parent topic: Flex Class Reference


SparkSkinnablePopUpContainer Class

Description

Identifies a SparkSkinnablePopUpContainer control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkSkinnablePopUpContainer is derived from the SparkSkinnableContainer class. No classes derive from this class.

Methods

SparkSkinnablePopUpContainer inherits all its methods from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkSkinnablePopUpContainer has the following properties:

  • isOpen
Parent topic: Flex Class Reference


SparkSkinnableTextBase Class

Description

The base class for skinnable components, such as the Spark TextInput and TextArea, that include an instance of RichEditableText in their skin to provide rich text display, scrolling, selection, and editing.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkSkinnableTextBase is derived from the SparkObject class.The following classes derive from the SparkSkinnableTextBase class:
  • SparkTextArea
  • SparkTextInput

Methods

In addition to the methods it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkSkinnableTextBase has the following methods:

  • GetValues
  • Input
  • MouseScroll
  • SelectText
  • Type

Properties

In addition to the properties it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkSkinnableTextBase has the following properties:

  • columnNames
  • displayAsPassword
  • editable
  • enableIME
  • firstVisibleRow
  • imeMode
  • lastVisibleRow
  • maxChars
  • maxWidth
  • numColumns
  • numRows
  • restrict
  • selectable
  • selectionActivePosition
  • selectionAnchorPosition
  • selectionHighlighting
  • text
Parent topic: Flex Class Reference


SparkSlider Class

Description

Lets users select a value by moving a slider thumb between the end points of the slider track.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkSlider is derived from the SparkTrackBase class.The following classes derive from the SparkSlider class:
  • SparkVolumeBar

Methods

SparkSlider inherits all its methods from SparkTrackBase, SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkSlider inherits all its properties from SparkTrackBase, SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkSpinner Class

Description

A Spinner component selects a value from an ordered set. It uses two buttons that increase or decrease the current value based on the current value of the stepSize property.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkSpinner is derived from the SparkRange class.The following classes derive from the SparkSpinner class:
  • SparkNumericStepper

Methods

In addition to the methods it inherits from SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkSpinner has the following methods:

  • Change
  • Type

Properties

In addition to the properties it inherits from SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkSpinner has the following properties:

  • allowValueWrap
Parent topic: Flex Class Reference


SparkTabBar Class

Description

The TabBar class displays a set of identical tabs. One tab can be selected at a time, and the first tab is selected by default.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkTabBar is derived from the SparkListBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkTabBar has the following methods:

  • SelectIndex

Properties

SparkTabBar inherits all its properties from SparkListBase, SparkSkinnableDataContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkTextArea Class

Description

TextArea is a text-entry control that lets users enter and edit multiple lines of richly formatted text. It can display horizontal and vertical scrollbars for scrolling through the text and supports vertical scrolling with the mouse wheel.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkTextArea is derived from the SparkSkinnableTextBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkSkinnableTextBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkTextArea has the following methods:

  • DragCancel
  • DragDrop
  • DragStart

Properties

In addition to the properties it inherits from SparkSkinnableTextBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkTextArea has the following properties:

  • heightInLines
  • widthInChars
Parent topic: Flex Class Reference


SparkTextBase Class

Description

The base class for Spark text controls such as Label and RichText which display text using CSS styles for the default format.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkTextBase is derived from the FlexObject class.The following classes derive from the SparkTextBase class:
  • SparkLabel
  • SparkRichText

Methods

In addition to the methods it inherits from FlexObject, FlexDisplayObject, and AnyWin, SparkTextBase has the following methods:

  • DragCancel
  • DragDrop
  • DragStart
  • Type

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, SparkTextBase has the following properties:

  • isTruncated
  • maxDisplayedLines
  • text
Parent topic: Flex Class Reference


SparkTextInput Class

Description

TextInput is a text-entry control that lets users enter and edit a single line of uniformly-formatted text.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkTextInput is derived from the SparkSkinnableTextBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkSkinnableTextBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkTextInput has the following methods:

  • DragCancel
  • DragDrop
  • DragStart

Properties

In addition to the properties it inherits from SparkSkinnableTextBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkTextInput has the following properties:

  • widthInChars
Parent topic: Flex Class Reference


SparkTileGroup Class

Description

The TileGroup container is an instance of the Group container that uses the TileLayout class.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkTileGroup is derived from the SparkGroup class. No classes derive from this class.

Methods

SparkTileGroup inherits all its methods from SparkGroup, SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkTileGroup inherits all its properties from SparkGroup, SparkGroupBase, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkTitleWindow Class

Description

The TitleWindow class extends Panel to include a close button and move area.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkTitleWindow is derived from the SparkPanel class. No classes derive from this class.

Methods

SparkTitleWindow inherits all its methods from SparkPanel, SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

SparkTitleWindow inherits all its properties from SparkPanel, SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkToggleButton Class

Description

The ToggleButton component defines a toggle button. Clicking the button toggles it between the up and an down states.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkToggleButton is derived from the SparkToggleButtonBase class.The following classes derive from the SparkToggleButton class:
  • SparkButtonBarButton

Methods

In addition to the methods it inherits from SparkToggleButtonBase, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkToggleButton has the following methods:

  • DragCancel
  • DragDrop
  • DragStart

Properties

SparkToggleButton inherits all its properties from SparkToggleButtonBase, SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkToggleButtonBase Class

Description

The ToggleButtonBase component is the base class for the Spark button components that support the selected property.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkToggleButtonBase is derived from the SparkButtonBase class.The following classes derive from the SparkToggleButtonBase class:
  • SparkCheckBox
  • SparkRadioButton
  • SparkToggleButton

Methods

SparkToggleButtonBase inherits all its methods from SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkButtonBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkToggleButtonBase has the following properties:

  • selected
Parent topic: Flex Class Reference


SparkTrackBase Class

Description

The TrackBase class is a base class for components with a track and one or more thumb buttons, such as Slider and ScrollBar.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkTrackBase is derived from the SparkRange class.The following classes derive from the SparkTrackBase class:
  • SparkScrollBar
  • SparkSlider

Methods

In addition to the methods it inherits from SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkTrackBase has the following methods:

  • Change
  • Type

Properties

SparkTrackBase inherits all its properties from SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Parent topic: Flex Class Reference


SparkVideoDisplay Class

Description

Identifies a Spark video display control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkVideoDisplay is derived from the FlexObject class. No classes derive from this class.

Methods

SparkVideoDisplay inherits all its methods from FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from FlexObject, FlexDisplayObject, and AnyWin, SparkVideoDisplay has the following properties:

  • autoDisplayFirstFrame
  • autoPlay
  • autoRewind
  • bytesLoaded
  • bytesTotal
  • currentTime
  • duration
  • loop
  • mediaPlayerState
  • muted
  • pauseWhenHidden
  • playing
  • scaleMode
  • volume
Parent topic: Flex Class Reference


SparkVideoPlayer Class

Description

The VideoPlayer control is a skinnable video player that supports progressive download, multi-bitrate streaming, and streaming video.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkVideoPlayer is derived from the SparkObject class. No classes derive from this class.

Methods

SparkVideoPlayer inherits all its methods from SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkVideoPlayer has the following properties:

  • muted
  • playing
  • volume
Parent topic: Flex Class Reference


SparkVolumeBar Class

Description

The VolumeBar class defines a drop-down slider to control the volume of the VideoDisplay control.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkVolumeBar is derived from the SparkSlider class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkSlider, SparkTrackBase, SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkVolumeBar has the following methods:

  • MuteChange
  • Open

Properties

In addition to the properties it inherits from SparkSlider, SparkTrackBase, SparkRange, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkVolumeBar has the following properties:

  • isDropDownOpen
  • muted
Parent topic: Flex Class Reference


SparkWindow Class

Description

The Window is a top-level container for additional windows in an AIR desktop application.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkWindow is derived from the SparkSkinnableContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkWindow has the following methods:

  • StateChange

Properties

In addition to the properties it inherits from SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkWindow has the following properties:

  • alwaysInFront
  • closed
  • isAIRWindow
  • maxHeight
  • maximizable
  • maxWidth
  • minHeight
  • minimizable
  • minWidth
  • resizable
  • showStatusBar
  • status
  • systemChrome
  • title
  • transparent
  • WindowState
Parent topic: Flex Class Reference


SparkWindowedApplication Class

Description

The WindowedApplication defines the application container that you use to create Flex applications for AIR applications.

Availability

This class is supported only on the Open Agent.

Inheritance

SparkWindowedApplication is derived from the SparkApplication class. No classes derive from this class.

Methods

SparkWindowedApplication inherits all its methods from SparkApplication, SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin.

Properties

In addition to the properties it inherits from SparkApplication, SparkSkinnableContainer, SparkSkinnableContainerBase, SparkObject, FlexObject, FlexDisplayObject, and AnyWin, SparkWindowedApplication has the following properties:

  • alwaysInFront
  • applicationID
  • autoExit
  • closed
  • maxHeight
  • maximizable
  • maxWidth
  • minHeight
  • minimizable
  • minWidth
  • resizable
  • showStatusBar
  • status
  • systemChrome
  • title
  • transparent
  • WindowState
Parent topic: Flex Class Reference


Java Classes

Lists the classes that are available for testing Java applications.

  • QapJava Class
    The class that provides the interface between Java and 4Test code.
  • Java JFC Classes
    Includes classes for Java JFC handling
  • Java SWT Classes for the Open Agent
    Includes classes for Java SWT used by the Open Agent
  • Java-Equivalent Window Classes
    Includes the Window classes that are equivalent to Java classes
Parent topic: Classes


QapJava Class

Description

The class that provides the interface between Java and 4Test code. This class is required for manipulating 4Test objects in your Java class. The constructor method cannot take any arguments.

Inheritance

QapJava derives from the AnyWin class; no classes derive from this class.

Properties

QapJava class has no properties.

Methods

In addition to the methods it inherits from the AnyWin class, QapJava has the following methods:

  • AddReturnValue Method
    Adds an object to the list of values to be returned by Java class back to 4Test.
  • Failure Method
    Indicates that the Java class failed to complete its actions successfully.
  • GetInArg Function
    Returns one of the arguments passed to InvokeJava from 4Test.
  • GetInArgCount Function
    Returns the number of arguments passed to the InvokeJava method from 4Test.
  • GetObject Function
    Returns a reference to a 4Test object that is used to invoke the method InvokeJava in a 4Test script.
  • Success Method
    Indicates that the Java class successfully completed its actions.
Parent topic: Java Classes


AddReturnValue Method

Class

QapJava.

Action

Adds an object to the list of values to be returned by Java class back to 4Test.

Syntax

QapJava.addReturnValue(aRetObj);
Variable Description
aRetObj

Object to be added to the list of items to be returned by the Java class to 4Test. OBJECT.

  • Currently, aRetObj can be a BOOLEAN, INTEGER, REAL, or STRING value only.

Notes

The objects will be returned in the order in which they are added to the return list (first in, first out). QapJava.addReturnValue can optionally add:

  • The first object to the list of values to be returned by the Java class back to 4Test.
  • The second object to the list of values to be returned by the Java class back to 4Test.
  • The third object to the list of values to be returned by the Java class back to 4Test.

Example

import segue.qapjava.QapJava;
...
OBJECT objRef;
CHECKBOX cb;
STRING stringArg;
BOOLEAN boolArg;
...
objRef = QapJava.getObject();
...
if (objRef instanceof Checkbox){
 cb = (Checkbox)objRef;
}
...
stringArg = cb.getLabel();
QapJava.addReturnValue( (String)stringArg);
boolArg = new Boolean(cb.getState());
QapJava.addReturnValue( (Boolean)boolArg);
...
}
Parent topic: QapJava Class


Failure Method

Class

QapJava.

Action

Indicates that the Java class failed to complete its actions successfully. You must call either the failure method or the success method in your Java class.

Syntax

QapJava.failure([sErrorString]);
Variable | Description
sErrorString | Optional: String that indicates the reason for failure. STRING.

Notes

If you call failure without any arguments, it passes the boolean value FALSE back to the InvokeJava method to indicate that the Java class failed to complete its actions.

If you call failure with an sErrorString argument, the method passes to InvokeJava the boolean value FALSE followed by sErrorString to indicate the reason why the Java class failed to complete its actions.

QapJava.failure indicates that InvokeJava was called with an invalid object. It also indicates:

  • That the object used to call InvokeJava was not of the expected type.
  • That there were no nodes in the tree view object.

This method can be called with an optional string argument that describes the error that caused the Java class to fail.

Once failure is called, the InvokeJava method terminates.

Example

import segue.qapjava.QapJava;
...
Object objRef;
...
objRef = QapJava.getObject();
if (objRef == null)
 QapJava.failure("Couldn't find object");
else {
...
 QapJava.success();
...
}
Parent topic: QapJava Class


GetInArg Function

Class

QapJava.

Action

Returns one of the arguments passed to InvokeJava from 4Test. Takes an index value to determine which argument to return. The index is zero-based.

Syntax

aArg = QapJava.getInArgCount(iIndex);
Variable | Description
aArg | The argument indicated by iIndex. OBJECT.
iIndex | The argument to find, specified as the index number (0-based) of the argument in the list. INTEGER.

Example

import segue.qapjava.QapJava;
...
INTEGER iArgCnt;
...
iArgCnt = QapJava.getInArgCount();
if (iArgCnt > 0) {
 Boolean b = (Boolean)QapJava.getInArg(0);
 String s = (String)QapJava.getInArg(1);
}
...
Parent topic: QapJava Class


GetInArgCount Function

Class

QapJava.

Action

Returns the number of arguments passed to the InvokeJava method from 4Test. This method must be called in Java. The Java class can retrieve each argument by calling QapJava.getInArg.

Syntax

iArgCnt = QapJava.getInArgCount();
Variable | Description
iArgCnt | The number of arguments passed to InvokeJava from 4Test. INTEGER.

Notes

QapJava.getInArgCount returns the number of arguments passed to the InvokeJava method from 4Test. It can optionally return the first or second argument passed to InvokeJava from 4Test.

Example

import segue.qapjava.QapJava;
...
INTEGER iArgCnt;
...
iArgCnt = QapJava.getInArgCount();
if (iArgCnt > 0) {
 Boolean b = (Boolean)QapJava.getInArg(0);
 String s = (String)QapJava.getInArg(1);
}
...
Parent topic: QapJava Class


GetObject Function

Class

QapJava.

Action

Returns a reference to a 4Test object that is used to invoke the function InvokeJava in a 4Test script. This function must be called in Java. The Java class can then use this reference to manipulate the 4Test object.

Syntax

objRef = QapJava.getObject();
Variable | Description
objRef | The returned object reference or null (if not successful). OBJECT.

Notes

QapJava.getObject returns a reference to the 4Test object that is used to invoke the function InvokeJava in your 4Test script.

If getObject returns the object reference, your Java class must indicate the successful outcome to 4Test by calling QapJava.success.

If getObject fails to get the object reference, it returns null. Your Java class must indicate the failed outcome to 4Test by calling QapJava.failure.

Example

import segue.qapjava.QapJava;
...
OBJECT objRef;
...
objRef = QapJava.getObject();
if (objRef == null) {
 QapJava.failure;
 return;
}
...
QapJava.success;
...
Parent topic: QapJava Class


Success Method

Class

QapJava.

Action

Indicates that the Java class successfully completed its actions. You must call either the success method or the failure method in your Java class.

Syntax

QapJava.success();

Notes

The success method passes the boolean value TRUE to the InvokeJava method to indicate the successful completion of the Java class. Once success is called, the InvokeJava method terminates.

Example

import segue.qapjava.QapJava;
...
OBJECT objRef;
...
objRef = QapJava.getObject();
if (objRef == null)
 QapJava.failure("Couldn't find object");
else {
...
 QapJava.success();
...
}
Parent topic: QapJava Class


Java JFC Classes

  • JavaJFCCheckBox Class
    Check box controls in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCCheckBoxMenuItem Class
    Menu items that can be selected or deselected in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCChildWin Class
    Moveable windows that are children of the main window of a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCComboBox Class
    Controls that have both a popup list and a text field in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCImage Class
    Images as defined in the Java Foundation Class (JFC) library.
  • JavaJFCListBox Class
    List boxes in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCMenu Class
    Menus in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCMenuItem Class
    Items on a menu in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCPageList Class
    Tabbed, multi-page dialogs and button bars in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCPopupList Class
    Popup lists in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCPopupMenu Class
    Context-sensitive menus that pop up when you click the right mouse button or some other key combination in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCProgressBar Class
    Bar-graph components that monitor a task as it is performed in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCPushButton Class
    Pushbuttons in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCRadioButton Class
    Radio buttons in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCRadioButtonMenuItem Class
    Menu items in a Java application or applet that are part of a group of menu items in which only one can be selected, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCRadioList Class
    A group of radio buttons in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCScale Class
    Scales in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCScrollBar Class
    Scroll bars in a Java application or applet, as defined the Java Foundation Class (JFC) library.
  • JavaJFCSeparator Class
    Dividers between menu items that break the items into logical groupings in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCStaticText Class
    Static text strings in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCTable Class
    A series of two or more columns in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCTextField Class
    Text fields in a Java application or applet, as defined in Java Foundation Class (JFC) library.
  • JavaJFCToggleButton Class
    Two-state buttons in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCToolBar Class
    Toolbars that can be docked or allowed to float on the desktop in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCTreeView Class
    Items organized into graphical hierarchies in a Java application or applet, as defined in the Java Foundation Class (JFC) library.
  • JavaJFCUpDown Class
    Windows containing up and down arrows in a Java application or applet, as defined in the Java Foundation Class (JFC) library. The arrows are used to increment or decrement a value.
Parent topic: Java Classes


JavaJFCCheckBox Class

Description

Check box controls in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the CheckBox class.

Methods

Inherits methods from the CheckBox class, Control class, and AnyWin class.

Properties

Inherits properties from the CheckBox class, Control class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
CheckBox Class
Control Class
AnyWin Class


JavaJFCCheckBoxMenuItem Class

Description

Menu items that can be selected or deselected in a Java application or applet, as defined in the Java Foundation Class (JFC) library. If selected, the menu item typically appears with a checkmark next to it; if unselected or deselected, the menu item does not appear with a checkmark.

Inheritance

Derived from the MenuItem class.

Methods

Inherits methods from the MenuItem class, Menu class, and AnyWin class.

Properties

Inherits all of its properties from the MenuItem class, Menu class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
MenuItem Class
Menu Class
AnyWin Class


JavaJFCChildWin Class

Description

Moveable windows that are children of the main window of a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the ChildWin class.

Methods

Inherits methods from the ChildWin class, MoveableWin class, and AnyWin class.

Properties

Inherits properties from the ChildWin class, MoveableWin class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
MoveableWin Class
AnyWin Class


JavaJFCComboBox Class

Description

Controls that have both a popup list and a text field in a Java application or applet, as defined in the Java Foundation Class (JFC) library. If users select an item from the list, the text field is filled with that string. Alternatively, users can type the string into the text field.

Inheritance

Derived from the ComboBox class.

Methods

Inherits methods from the ComboBox class, Control class, and AnyWin class.

Properties

Inherits properties from the ComboBox class, Control class, and AnyWin class.

Notes

When recording the selection of an item from a JavaJFCComboBox, it is recommended that you press the mouse button, keep it pressed while you drag the mouse to the selected item, and release the mouse after selecting the item.

If the item must be scrolled into view, then autoscroll the item by positioning the mouse slightly below the bottom of the list (or slightly above the end of the list, if the list opens above the combo box) instead of clicking on the scrollbar. Following these steps is more reliable than clicking on the combo box drop-down arrow and then clicking on the item.

Parent topic: Java JFC Classes
Related reference
ComboBox Class
Control Class
AnyWin Class


JavaJFCImage Class

Description

Images as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the AnyWin class.

Methods

Inherits methods from the AnyWin class.

Properties

Inherits properties from the AnyWin class.

Parent topic: Java JFC Classes
Related reference
AnyWin Class


JavaJFCListBox Class

Description

List boxes in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the ListBox class.

Methods

Inherits methods from the ListBox class, Control class, and AnyWin class.

Properties

Inherits properties from the ListBox class, Control class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
ListBox Class
Control Class
AnyWin Class


JavaJFCMenu Class

Description

Menus in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the Menu class.

Methods

Inherits methods from the Menu class and AnyWin class.

Properties

Inherits all of its properties from the Menu class and AnyWin class.

Parent topic: Java JFC Classes
Related reference
Menu Class
AnyWin Class


JavaJFCMenuItem Class

Description

Items on a menu in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the MenuItem class.

Methods

Inherits methods from the MenuItem class, Menu class, and AnyWin class.

Properties

Inherits all of its properties from the MenuItem class, Menu class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
MenuItem Class
Menu Class
AnyWin Class


JavaJFCPageList Class

Description

Tabbed, multi-page dialogs and button bars in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the PageList class.

Methods

Inherits methods from the PageList class, Control class and AnyWin class.

Properties

Inherits properties from the PageList class, Control class and AnyWin class.

Parent topic: Java JFC Classes
Related reference
PageList Class
Control Class
AnyWin Class


JavaJFCPopupList Class

Description

Popup lists in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the PopupList class.

Methods

Inherits all of its methods from the AnyWin class.

Properties

Inherits all of its properties from the AnyWin class.

Parent topic: Java JFC Classes
Related reference
AnyWin Class


JavaJFCPopupMenu Class

Description

Context-sensitive menus that pop up when you click the right mouse button or some other key combination in a Java application or applet, as defined in the Java Foundation Class (JFC) library. As the name "context-sensitive" implies, the content of the popup menu depends on the object you click.

JavaJFCPopupMenu is a container for menu items, which is why it does not implement any menu-related methods.

Inheritance

Derived from the AnyWin class.

Methods

Inherits methods from the AnyWin class.

Properties

Inherits all of its properties from the AnyWin class.

Notes

We strongly recommend that you call PopupSelect() on the parent of the popup menu instead of defining a JavaJFCPopupMenu and calling Pick() on its items.

In certain situations, a Java popup menu may appear to be a child of the main window, but other times be a child of a dialog box in the main window. This situation can occur for heavily populated popup menus, in other words popup menus that have their own frame that may extend beyond the frame of the window that owns it, or for certain other implementations of popup menus. For such cases, using the PopupSelect() method is more reliable than using the JavaJFCPopupMenu class.

Refer to the ParentPopupToInvoker option, which specifies how the parent of a popup menu should be determined.

When you use the SilkBean, you should insert a right-mouse Click() before JavaJFCPopupMenu in order to bring up the menu.

Parent topic: Java JFC Classes
Related reference
AnyWin Class
Pick Method


JavaJFCProgressBar Class

Description

Bar-graph components that monitor a task as it is performed in a Java application or applet, as defined in the Java Foundation Class (JFC) library. The JavaJFCProgressBar indicates, in real time, how much of the task has been completed. Like scroll bars, the JavaJFCProgressBar operates in horizontal and vertical orientation and provides an optional border.

Inheritance

Derived from the AnyWin class.

Methods

Inherits methods from the AnyWin class.

Properties

Inherits properties from the AnyWin class.

Parent topic: Java JFC Classes
Related reference
AnyWin Class


JavaJFCPushButton Class

Description

Pushbuttons in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the PushButton class.

Methods

Inherits methods from the PushButton class, Control class, and AnyWin class.

Properties

Inherits properties from the PushButton class, Control class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
PushButton Class
Control Class
AnyWin Class


JavaJFCRadioButton Class

Description

Radio buttons in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the RadioButton class.

Methods

Inherits methods from the RadioButton class, Control class, and AnyWin class.

Properties

Inherits properties from the RadioButton class, Control class, and AnyWin class.

Notes

JavaJFCRadioButton.HasFocus() does not work properly on Internet Explorer 6 or 7.

Parent topic: Java JFC Classes
Related reference
Control Class
AnyWin Class


JavaJFCRadioButtonMenuItem Class

Description

Menu items in a Java application or applet that are part of a group of menu items in which only one can be selected, as defined in the Java Foundation Class (JFC) library. The selected menu item displays its selected state. Selecting it causes any other selected item to switch to the unselected state.

Inheritance

Derived from the MenuItem class.

Methods

Inherits methods from the MenuItem class, Menu class, and AnyWin class.

Properties

Inherits all of its properties from the MenuItem class, Menu class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
MenuItem Class
Menu Class
AnyWin Class


JavaJFCRadioList Class

Description

A group of radio buttons in a Java application or applet, as defined in the Java Foundation Class (JFC) library. Only one button in a radio list can be selected at a time.

Inheritance

Derived from the RadioList class.

Methods

Inherits all of its methods from the RadioList class, Control class, and AnyWin class.

Properties

Inherits all of its properties from the RadioList class, Control class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
RadioList Class
Control Class
AnyWin Class


JavaJFCScale Class

Description

Scales in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the Scale class.

Methods

Inherits methods from the Scale class, Control class, and AnyWin class.

Properties

Inherits properties from the Scale class, Control class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
Scale Class
Control Class
AnyWin Class


JavaJFCScrollBar Class

Description

Scroll bars in a Java application or applet, as defined the Java Foundation Class (JFC) library. This class includes scroll bars that are parts of controls, such as the scroll bar on a list box.

Inheritance

Derived from the ScrollBar class.

Methods

Inherits methods from the ScrollBar class, Control class, and AnyWin class.

Properties

Inherits properties from the ScrollBar class, Control class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
ScrollBar Class
Control Class
AnyWin Class


JavaJFCSeparator Class

Description

Dividers between menu items that break the items into logical groupings in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the MenuItem class.

Methods

Inherits all of its methods from the MenuItem class, Menu class, and AnyWin class.

Properties

Inherits all of its properties from the MenuItem class, Menu class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
MenuItem Class
Menu Class
AnyWin Class


JavaJFCStaticText Class

Description

Static text strings in a Java application or applet, as defined in the Java Foundation Class (JFC) library. Static text is text that the user cannot change, such as a label.

Inheritance

Derived from the StaticText class.

Methods

Inherits methods from the StaticText class, Control class, and AnyWin class.

Properties

Inherits properties from the StaticText class, Control class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
StaticText Class
Control Class
AnyWin Class


JavaJFCTable Class

Description

A series of two or more columns in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the Table class.

Methods

Inherits methods from the Table class, Control class, and AnyWin class.

Properties

Inherits properties from the Table class, Control class, and AnyWin class.

Recording

The Java-based recorder will record MultiClickCell on CTRL+click, it records ExtendClickCell on SHIFT+click, and ExtendClickCell on SHIFT+CTRL+click.

Parent topic: Java JFC Classes
Related reference
Control Class
AnyWin Class


JavaJFCTextField Class

Description

Text fields in a Java application or applet, as defined in Java Foundation Class (JFC) library. This class includes single-line and multi-line fields whose text can be modified by the user.

Inheritance

Derived from the TextField class.

Properties

Inherits properties from the TextField class, Control class, and AnyWin class.

Methods

In addition to the methods it inherits from the TextField class, Control class, and AnyWin class, JavaJFCTextField has the following methods:

  • GetText Function (JavaJFCTextField)
    Returns the text of the text field.
  • SetText Method (JavaJFCTextField)
    Substitutes new text for all or part of the text in the text field.
  • TypeKeys Method (JavaJFCTextField)
    Sends a set of keystrokes to the window when used with the Open Agent or a set of keystrokes or mouse button presses to the window when used with the Classic Agent.
Parent topic: Java JFC Classes
Related reference
TextField Class
Control Class
AnyWin Class


GetText Function (JavaJFCTextField)

Class

JavaJFCTextField.

Action

Returns the text of the text field.

Syntax

sText = object.GetText ([iStartChar, iNumChars, useClipboard])
Variable | Description
sText | The returned text. STRING.
iStartChar | Optional: The position in the string (starting from 1) of the first character to return. INTEGER.
iNumChars | Optional: The number of characters to return. INTEGER.
useClipboard | Optional: Whether Silk Test Classic uses the new Clipboard method to return text. By default, this is set to FALSE and the original method, which is faster, is used. If you want to retrieve special characters, we recommend setting the parameter to TRUE to use the slower Clipboard method. BOOLEAN.

Notes

GetText returns the text from the single-line text field. It returns only the first line of a multi-line text field.
  • If you include iStartChar but not iNumChars, GetText returns the text from the iStartChar character to the end of the text.
  • If you include both arguments, GetText returns iNumChars characters, starting with the iStartChar character.

Example

STRING sAllText
sAllText = GotoLine.Line.GetText()
Parent topic: JavaJFCTextField Class


SetText Method (JavaJFCTextField)

Class

JavaJFCTextField.

Action

Substitutes new text for all or part of the text in the text field.

Syntax

textfield.SetText (sText [, iStartChar, iNumChars, useClipboard])
Variable | Description
sText | The text to substitute. STRING.
iStartChar | Optional: The character position in the text field (starting from 1) at which to begin the substitution. INTEGER.
iNumChars | Optional: The number of characters in the text field to substitute with sText. INTEGER.
useClipboard | Optional. Whether Silk Test Classic uses the new, Clipboard method to substitute text. By default, this is set to FALSE and the original method, which is faster, is used. If you want to substitute special characters, we recommend setting the parameter to TRUE to use the slower, Clipboard method. BOOLEAN.

Notes

  • SetText substitutes the characters sText for the text in the text field. This method works only with the first line of multi-line text fields.
  • If iStartChar is specified, SetText substitutes sText for the characters starting with the iStartChar character, and continuing to the end of the line. If both iStartChar and iNumChars are specified, it substitutes sText for iNumChars characters starting with the iStartChar character.
  • If iStartChar is omitted, SetText substitutes sText for the entire contents of the text field.
  • SetText sets up to 1024 characters.
  • If the SetText method does not work as expected, you can try the TypeKeys method.

Example 1

STRING sHello = "Hello, world"
Find.FindWhat.SetText (sHello)

Example 2

The following example illustrates date transformation using the Text Field window in the test application shipped with Silk Test Classic.

testcase GetandSetText1 ()

STRING sReturnedText
TextFieldWindow.Invoke ()
Print ("Entering the value '9/18/02'")
TextFieldWindow.TheTextField.SetText ("9/18/02")
Print ("Getting...")
sReturnedText = TextFieldWindow.TheTextField.GetText ()
Print (sReturnedText)
TextFieldWindow.Close ()

// Result:
// Entering the value '9/18/02'
// *** Y2K Notification: date value '9/18/02' has been
   changed to '09/18/2003' in TextFieldWindow.TheTextField.SetText
// Getting ...
// 09/18/2003

Note the following about this test:

  • The argument to SetText is "9/18/02". That date is of the input form m/dd/yy so it matches the rule. Therefore, the date is transformed to the form mm/dd/yyyy. In this case, the date is set to 09/18/2003, as shown in the return from GetText.
  • Silk Test Classic includes a notification message that the date has been transformed.

Example 3

This example illustrates date transformation using the Text Field window in the test application shipped with Silk Test Classic.

testcase GetandSetText2 ()

STRING sReturnedText
TextFieldWindow.Invoke ()
Print ("Entering the value '9/18/20'")
TextFieldWindow.TheTextField.SetText ("9/18/20")
Print ("Getting...")
sReturnedText = TextFieldWindow.TheTextField.GetText ()
Print (sReturnedText)
TextFieldWindow.Close ()

// Result:
// Entering the value '9/18/20'
// *** Y2K Notification: date value '9/18/20' has been
   changed to '09/18/2020' in TextFieldWindow.TheTextField.SetText
// Getting ...
// 09/18/2020

Note the following about this test:

  • The argument to SetText is "9/18/20", also of the input form m/dd/yy, so it matches the rule.
  • In this case, the year (20) is below the threshold in the rule (30), so the date is converted to 2020, instead of 1920.
Parent topic: JavaJFCTextField Class


TypeKeys Method (JavaJFCTextField)

Class

JavaJFCTextField.

Action

Sends a set of keystrokes or mouse button presses to the window when used with the Classic Agent.

Sends a set of keystrokes to the window when used with the Open Agent.

Syntax

window.TypeKeys (sEvents [, nDelay, useClipboard])
Variable | Description
sEvents | The keystrokes to type or mouse buttons to press. Mouse buttons are supported on the Classic Agent only. To specify mouse buttons, use <Button1>, <Button2>, or <Button3> in the string. STRING.
nDelay | Optional: The delay between keystrokes (in seconds and fractions of seconds). NUMBER.
useClipboard | Optional: Whether Silk Test Classic uses the new Clipboard method to send text. By default, this is set to FALSE and the original method, which is faster, is used. If you want to send special characters, we recommend setting the parameter to TRUE to use the slower Clipboard method. BOOLEAN.

Notes

  • On Windows, TypeKeys first gives the window input focus before typing into it.
  • If you specify nDelay, that value overrides the value set with the OPT_KEYBOARD_DELAY option, which you set with SetOption.
  • See Key Names for a list of key names.
  • A key can be followed by a counter, which defines how often the keys should be typed. The counter can be combined with the delay.
  • During the delay time, the screen is locked and interaction with the mouse and keyboard is no longer possible.
  • When recording with the DOM extension, TypeKeys ("<Tab>") will not be captured. Since the script refers to object to type in directly, it is not necessary to record this manual Tab. You can manually enter a TypeKeys ("<Tab>") into your script if you want to; it will just not be recorded.
  • When specifying groups of keys, such as Ctrl+Shift, the Classic Agent only supports minus signs (-) as a delimiter between key names while the Open Agent supports plus and minus signs.
  • If the TypeKeys method does not work as expected, you can try the SetText method.

Example

//shift-right will be executed 6 times
TextEditor.Document.TypeKeys ("<Shift-Right 6>")
//Shift-Right will be executed 6 times with a delay of 3 seconds before each execution, and uses the Clipboard method
TextEditor.Document.TypeKeys ("<Shift-Right 6>", 3, TRUE)
Parent topic: JavaJFCTextField Class


JavaJFCToggleButton Class

Description

Two-state buttons in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the CheckBox class.

Methods

Inherits methods from the CheckBox class, Control class, and AnyWin class.

Properties

Inherits properties from the CheckBox class, Control class, and AnyWin class.

Parent topic: Java JFC Classes
Related reference
CheckBox Class
Control Class
AnyWin Class


JavaJFCToolBar Class

Description

Toolbars that can be docked or allowed to float on the desktop in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the AnyWin class.

Methods

Inherits methods from the AnyWin class.

Properties

Inherits properties from the AnyWin class.

Parent topic: Java JFC Classes
Related reference
AnyWin Class


JavaJFCTreeView Class

Description

Items organized into graphical hierarchies in a Java application or applet, as defined in the Java Foundation Class (JFC) library.

Inheritance

Derived from the TreeView class.

Properties

Inherits all of its properties from the TreeView class, Control class, and AnyWin class.

Note: You can access nodes greater than 255 characters in a JavaTreeView via GetSubItems.

Methods

Note: Not all inherited methods have been implemented for Java controls. For instance, the GetItemImageIndex and GetItemImageState methods are not supported.

In addition to the methods it inherits from the TreeView class, Control class, and AnyWin class, JavaJFCTreeView class includes the following method:

Parent topic: Java JFC Classes
Related reference
Control Class
AnyWin Class


JavaJFCUpDown Class

Description

Windows containing up and down arrows in a Java application or applet, as defined in the Java Foundation Class (JFC) library. The arrows are used to increment or decrement a value.

Inheritance

Derived from the UpDown class.

Methods

Inherits all of its methods from the AnyWin class.

Note: Not all inherited methods have been implemented for Java controls.

Properties

Inherits all of its properties from the AnyWin class.

Parent topic: Java JFC Classes
Related reference
AnyWin Class


CBanner Class

Description

CBanner is the class used to layout the toolbar area and perspective switching toolbar in the workbench.

Availability

This class is supported only on the Open Agent.

Inheritance

CBanner is derived from the Control class.

Methods

CBanner inherits its methods from the AnyWin and Control classes.

Properties

In addition to the properties it inherits from the AnyWin and Control classes, CBanner has the following properties:

  • Bottom Property
    The control located at the bottom of the banner.
  • Left Property
    The control located on the left side of the banner.
  • Right Property
    The control located on the right side of the banner.
  • RightMinimumSize Property
    The minimum size of the control located on the right side of the banner.
  • RightWidth Property
    The width of the control located on the right side of the banner.
  • Simple Property
    Whether the banner is rendered with a simple, traditional shape.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class


Bottom Property

Class

CBanner.

Description

The control located at the bottom of the banner.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

WINDOW.

Access

Read only.

Parent topic: CBanner Class


Left Property

Class

CBanner.

Description

The control located on the left side of the banner.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

WINDOW.

Access

Read only.

Parent topic: CBanner Class


Right Property

Class

CBanner.

Description

The control located on the right side of the banner.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

WINDOW.

Access

Read only.

Parent topic: CBanner Class


RightMinimumSize Property

Class

CBanner.

Description

The minimum size of the control located on the right side of the banner.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

POINT.

Access

Read only.

Parent topic: CBanner Class


RightWidth Property

Class

CBanner.

Description

The width of the control located on the right side of the banner.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: CBanner Class


Simple Property

Class

CBanner.

Description

Whether the banner is rendered with a simple, traditional shape.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

BOOLEAN.

Access

Read and write.

Parent topic: CBanner Class


CoolBar Class

Description

CoolBar is a container class that contains SWT widgets, primarily toolbars.

Availability

This class is supported only on the Open Agent.

Inheritance

CoolBar is derived from the Control class.

Methods

CoolBar inherits all its methods from the AnyWin and Control classes.

Properties

In addition to the properties it inherits from the AnyWin and Control classes, CoolBar has the following properties:

  • ItemCount Property
    The number of items contained in the listbox, list view, coolbar, tab folder, row, or expandbar, or the number of rows in a table.
  • Items Property
    A list containing all items for the coolbar, CTabFolder, column, data grid, row, or expandbar.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class


CoolItem Class

Description

CoolItem is a class that contains selectable user interface objects that represent the areas of a CoolBar that can be dynamically positioned.

Availability

This class is supported only on the Open Agent.

Inheritance

CoolItem is derived from the Item class.

Methods

CoolItem inherits all its methods from the AnyWin and Item classes.

Properties

In addition to the properties it inherits from the AnyWin and Item classes, CoolItem has the following property:

  • Content Property
    The content of the areas that can be dynamically positioned.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Item Class


Content Property

Class

  • CoolItem
  • ExpandItem
  • ScrolledComposite
  • ViewForm

Description

The content of the areas that can be dynamically positioned.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

WINDOW.

Access

Read only.

Parent topic: CoolItem Class
Parent topic: ExpandItem Class
Parent topic: ScrolledComposite Class
Parent topic: ViewForm Class


CTabFolder Class

Description

CTabFolder is the class for an enhanced tab folder, typically having decorated tabs and the minimize, maximize, and close buttons.

Availability

This class is supported only on the Open Agent.

Inheritance

CTabFolder is derived from the Control class.

Methods and Properties

In addition to the methods and properties it inherits from the Control class, the CTabFolder class has the following methods and properties:

  • Close Method (CTabFolder)
    Closes the visible page.
  • Maximize Method (CTabFolder)
    Resizes the CTabFolder to its full (maximized) size.
  • Minimize Method (CTabFolder)
    Resizes the CTabFolder to the minimum size allowed.
  • Restore Method (CTabFolder)
    Restores the CTabFolder to its previous size.
  • Select Method (CTabFolder)
    Selects an item from the CTabFolder.
  • SelectList Method (CTabFolder)
    Selects one or more items in the tab.
  • ItemCount Property
    The number of items contained in the listbox, list view, coolbar, tab folder, row, or expandbar, or the number of rows in a table.
  • Items Property
    A list containing all items for the coolbar, CTabFolder, column, data grid, row, or expandbar.
  • SelectedIndex Property
    The index of the selected item.
  • SelectedItem Property
    The name of the selected item.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class


Close Method (CTabFolder)

Class

CTabFolder.

Action

Closes the visible page.

Syntax

Close (item)
Variable | Description
item | The page to close. LISTITEM.

Notes

This functionality is supported only if you are using the Open Agent.

If the page is not visible, precede the Close method with a Select method.

If the page does not have a Close button, Close returns an exception, E_WINDOW_TYPE_MISMATCH.

Parent topic: CTabFolder Class


Maximize Method (CTabFolder)

Class

CTabFolder.

Action

Resizes the CTabFolder to its full (maximized) size.

Syntax

Maximize ()

Notes

This functionality is supported only if you are using the Open Agent.

Parent topic: CTabFolder Class


Minimize Method (CTabFolder)

Class

CTabFolder.

Action

Resizes the CTabFolder to the minimum size allowed.

Syntax

Minimize ()

Notes

This functionality is supported only if you are using the Open Agent.

Parent topic: CTabFolder Class


Restore Method (CTabFolder)

Class

CTabFolder.

Action

Restores the CTabFolder to its previous size.

Syntax

Restore()

Notes

This functionality is supported only if you are using the Open Agent.

Restore restores the window to the width and height it had before it was reduced with the Minimize method or maximized with the Maximize method. Restore does nothing if the window is neither minimized nor maximized.

Parent topic: CTabFolder Class


Select Method (CTabFolder)

Class

CTabFolder.

Action

Selects an item from the CTabFolder.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Select (item)
Variable | Description
item | The item to select. LISTITEM.
Parent topic: CTabFolder Class


SelectList Method (CTabFolder)

Class

CTabFolder.

Action

Selects one or more items in the tab.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SelectList ()
Parent topic: CTabFolder Class


SelectedIndex Property

Class

CTabFolder class

Description

The index of the selected item.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

INTEGER

Access

Read and write

Parent topic: CTabFolder Class


SelectedItem Property

Class

CTabFolder class

Description

The name of the selected item.

Notes

This property is supported only in scripts that use the Open Agent.

Data Type

WINDOW

Access

Read only

Parent topic: CTabFolder Class


CTabItem Class

Description

CTabItem is the class for an enhanced tab within a CTabFolder.

Availability

This class is supported only on the Open Agent.

Inheritance

CTabItem is derived from the Item class.

Methods and Properties

In addition to inheriting all of its methods and properties from the Item class, the CTabItem class has the following methods and properties:

  • Close Method (CTabItem)
    Closes the visible tab.
  • Select Method (CTabItem SWTTabItem SWTTableColumn SWTTreeColumn TableColumn)
    Selects a tab or column.
  • Selected Property
    Whether the item is selected.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Item Class


Close Method (CTabItem)

Class

CTabItem.

Action

Closes the visible tab.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Close ()

Notes

If the tab is not visible, precede the Close method with a Select method.

Parent topic: CTabItem Class


Selected Property

Class

CTabItem, DataGridItem, and SWTTabItem.

Description

Returns true if the item is selected, false if it is not.

Notes

This functionality is supported only if you are using the Open Agent.

Data Type

BOOLEAN.

Access

Read and write.

Parent topic: CTabItem Class
Parent topic: SWTTabItem Class
Parent topic: DataGridItem Class
Parent topic: DomRadioButton Class


ExpandBar Class

Description

ExpandBar is the class for widgets that expand and close by clicking on a header.

Availability

This class is supported only on the Open Agent.

Inheritance

ExpandBar is derived from the Control class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin and Control classes, the ExpandBar class has the following methods and properties:

  • Collapse Method (ExpandBar)
    Collapses an ExpandBar.
  • Expand Method (ExpandBar)
    Expands an ExpandBar.
  • ExpandedItems Property
    A list of the items that are expanded.
  • ItemCount Property
    The number of items contained in the listbox, list view, coolbar, tab folder, row, or expandbar, or the number of rows in a table.
  • Items Property
    A list containing all items for the coolbar, CTabFolder, column, data grid, row, or expandbar.
Parent topic: Java SWT Classes for the Open Agent
Related reference
Control Class
AnyWin Class


Collapse Method (ExpandBar)

Class

ExpandBar.

Action

Collapse an ExpandBar.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Collapse (Item)
Variable | Description
Item | The item to collapse. LISTITEM.

Notes

Collapse collapses the specified item if it is currently expanded (that is, has visible children).

Parent topic: ExpandBar Class


Expand Method (ExpandBar)

Class

ExpandBar.

Action

Expands an ExpandBar.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Expand(Item)
Variable | Description
Item | The item to expand. LISTITEM.

Notes

Expand expands the specified item if it is currently collapsed (that is, has visible children).

  • If the item has an expand/collapse box (typically a + or - sign), Silk Test Classic expands the item by clicking on this box.

  • Otherwise, if the treeview supports the use of double-click to expand and collapse items, Silk Test Classic double-clicks on the item.

  • If neither approach is supported by the control, or if the specified item is not expandable (that is, has no children), an error is raised.

Parent topic: ExpandBar Class


ExpandedItems Property

Class

ExpandBar.

Description

A list of the items that are expanded.

Availability

This property is supported only in scripts that use the Open Agent.

Data Type

LIST OF WINDOW.

Access

Read only.

Parent topic: ExpandBar Class


ExpandItem Class

Description

ExpandItem is a class that contains the expandable items in an ExpandBar.

Availability

This class is supported only on the Open Agent.

Inheritance

ExpandItem is derived from the Item class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin and Item classes, the ExpandItem class has the following methods and properties:

  • Collapse Method (ExpandItem)
    Collapse the expandable items.
  • Expand Method (ExpandItem)
    Expands the expandable items.
  • Content Property
    The content of the areas that can be dynamically positioned.
  • Expanded Property
    Whether the item is expanded.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Item Class


Collapse Method (ExpandItem)

Class

  • ExpandItem
  • MsuiaComboBox
  • MsuiaCustom
  • MsuiaDataItem
  • MsuiaGroup
  • MsuiaListItem
  • MsuiaMenuBar
  • MsuiaMenuItem
  • MsuiaSplitButton
  • MsuiaToolBar
  • MsuiaTreeItem

Action

Collapse the expandable items.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

element.Collapse ()

Example

TreeListView.MsuiaTree1.SystemWindowsDependencyObjec.Collapse()

Notes

Collapse collapses the specified item if it is currently expanded (that is, has visible children).

Parent topic: ExpandItem Class


Expand Method (ExpandItem)

Class

  • ExpandItem
  • MsuiaComboBox
  • MsuiaCustom
  • MsuiaDataItem
  • MsuiaGroup
  • MsuiaListItem
  • MsuiaMenuBar
  • MsuiaMenuItem
  • MsuiaSplitButton
  • MsuiaToolBar
  • MsuiaTreeItem

Action

Expands the expandable items.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

element.Expand ()

Example

WPFTestApplication.MsuiaMenu1.Menu.Expand()

Notes

Expand expands the specified item if it is currently collapsed (that is, has visible children).

Parent topic: ExpandItem Class


Expanded Property

Class

ExpandItem.

Description

Whether the item is expanded.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

BOOLEAN.

Access

Read and write.

Parent topic: ExpandItem Class


Group Class

Description

Group is the class used to combine controls to give the user visual hints that those controls belong together. Consequently, the Group control does not have any other functionality that can be expressed in methods.

Availability

This class is supported only on the Open Agent, and only for the following technology domains:
  • Java SWT
  • Windows Forms
  • Win32

Inheritance

Group derives from the Control class; no classes derive from this class.

Methods

Group inherits all its methods from the AnyWin class and Control class.

Properties

Group inherits all its properties from the AnyWin class and Control class.

Parent topic: Java SWT Classes for the Open Agent
Parent topic: Win32 Classes


HorizontalSash Class

Description

HorizontalSash is the class for the horizontal border around a window pane that can be dragged to adjust the window size.

Availability

This class is supported only on the Open Agent.

Inheritance

HorizontalSash is derived from the Sash class.

Methods

HorizontalSash inherits its methods from the AnyWin, Control, and Sash classes.

Properties

HorizontalSash inherits all its properties from the AnyWin and Control classes.

Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class
Sash Class
VerticalSash Class
Move Method (Sash)


Item Class

Description

Item is the class for abstract base classes, such as RadioListToolItem.

Availability

This class is for internal use only and is supported only on the Open Agent, and only for the following technology domains:
  • Java SWT
  • Windows Forms
  • Win32

Inheritance

Item derives from the AnyWin class; several classes derive from the Item class.

Methods

Item inherits all its methods from the AnyWin class.

Properties

Item inherits all its properties from the AnyWin class.

Parent topic: Java SWT Classes for the Open Agent
Parent topic: Win32 Classes
Related reference
AnyWin Class
RadioListToolItem Class


Link Class

Description

Link is the class that opens the topic location referenced in the source.

Availability

This class is supported only on the Open Agent, and only for the following technology domains:
  • Java SWT
  • Windows Forms
  • Win32

Inheritance

Link derives from the Control class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, Link has the following methods and properties:

  • Select Method (Link)
    Selects an item.
Parent topic: Java SWT Classes for the Open Agent
Parent topic: Win32 Classes
Related reference
AnyWin Class
Control Class


Select Method (Link)

Class

Link.

Action

Selects an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Select(item)
Variable | Description
item | Optional: The item to select. This parameter is only useful for multi-selectable links. Selects the given item of the link. LISTITEM.

Notes

Select selects an item by scrolling the item into view, where the scrolling is applicable, and clicking it with the mouse, if it is not already selected.

Parent topic: Link Class


PushToolItem Class

Description

PushToolItem is the class for a pushbutton element in a toolbar control.

Availability

This class is supported only on the Open Agent, and only for the following technology domains:
  • Java SWT
  • Windows Forms
  • Win32

Inheritance

PushToolItem is derived from the ToolItem class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class, PushToolItem has the following methods and properties:

  • Select Method (DropDownToolItem PushToolItem)
    Selects an item.
Parent topic: Java SWT Classes for the Open Agent
Parent topic: Win32 Classes
Related reference
AnyWin Class
ToolItem Class


RadioListToolItem Class

Description

RadioListToolItem is the class for a radio button element in a toolbar control.

Availability

This class is supported only on the Open Agent, and only for the following technology domains:
  • Java SWT
  • Windows Forms
  • Win32

Inheritance

RadioListToolItem is derived from the ToolItem class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class, RadioListToolItem has the following methods and properties:

  • Select Method (DomainUpDown DomListBox ListViewEx RadioListToolItem)
    Selects an item.
  • State Property (CheckBox CheckBoxToolItem RadioListToolItem)
    Reads or writes the state of a check box.
Parent topic: Java SWT Classes for the Open Agent
Parent topic: Win32 Classes
Related reference
AnyWin Class
ToolItem Class


Select Method (DomainUpDown DomListBox ListViewEx RadioListToolItem)

Class

  • DomainUpDown
  • DomListBox
  • ListViewEx
  • RadioListToolItem

Action

Selects an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Select(Item)
Variable | Description
Item | The item to select. LISTITEM.

Notes

Select selects an item by scrolling the item into view, and where applicable, clicking it with the mouse if it is not already selected.

Example: Selecting an item in a DomListBox by using wildcards

Use the following code to select the first item whose name includes "Lookup" from a DomListBox:
testcase example() appstate none
  // Find the DomListBox in question
  window w = Desktop.Find("/BrowserApplication//BrowserWindow//SELECT[@id='MyDomListBox']")
  // Select the DomListBox
  w.Select("*Lookup*")
Parent topic: RadioListToolItem Class
Parent topic: DomainUpDown Class
Parent topic: DomListBox Class


Sash Class

Description

Sash is the class for the border around a window pane that can be dragged to adjust the window size.

Availability

This class is supported only on the Open Agent.

Inheritance

Sash is derived from the Control class. The following classes derive from the Sash class:

  • HorizontalSash

  • VerticalSash

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin and Control classes, Sash has the following methods and properties:

  • Move Method (Sash)
    Moves the windowpane that the sash borders.
Parent topic: Java SWT Classes for the Open Agent
Related reference
HorizontalSash Class
AnyWin Class
Control Class
VerticalSash Class


Move Method (Sash)

Class

Sash.

Action

Moves the windowpane that the sash borders.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

window.Move (amount)
Variable | Description
amount | The new position, in pixels, for the sash border. The amount must be greater than 0 and less than the width or height of the sash, depending on the type of sash (horizontal or vertical). INTEGER.
Parent topic: Sash Class


SashForm Class

Description

SashForm is the class for the border around a form that can be dragged to adjust the size of the form.

Availability

This class is supported only on the Open Agent.

Inheritance

SashForm is derived from the Control class.

Methods

SashForm inherits its methods from the AnyWin and Control classes.

Properties

In addition to the properties it inherits from the AnyWin and Control classes, SashForm has the following properties:

  • Horizontal Property
    Whether the up/down control, tabbed dialog box, button bar, or sash is horizontal.
  • MaximizedControl Property
    The sash window that is maximized in the form.
  • Vertical Property
    Whether the sash form is vertical.
  • Weights Property
    The relative sizes of the children of the sash form window.
Parent topic: Java SWT Classes for the Open Agent
Related reference
Control Class
AnyWin Class


Horizontal Property

Class

UpDownEx, Pager, and SashForm.

Description

Whether the up/down control, tabbed dialog box, button bar, or sash is horizontal.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

BOOLEAN.

Access

Read only for the Pager and UpDownEx classes.

Read and write for the SashForm class.

Parent topic: SashForm Class
Parent topic: Pager Class
Parent topic: UpDownEx Class


MaximizedControl Property

Class

SashForm.

Description

The sash window that is maximized in the form.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

WINDOW.

Access

Read only.

Parent topic: SashForm Class


Vertical Property

Class

SashForm.

Description

Whether the sash form is vertical.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

BOOLEAN.

Access

Read and write.

Parent topic: SashForm Class


Weights Property

Class

SashForm.

Description

The relative sizes of the children of the sash form window.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF INTEGER.

Access

Read and write.

Parent topic: SashForm Class


ScrollableControl Class

Description

ScrollableControl is the class for controls that are scrollable.

Availability

This class is supported only on the Open Agent.

Inheritance

ScrollableControl is derived from the Control class.

Methods

ScrollableControl inherits all of its methods from the AnyWin and Control classes.

Properties

ScrollableControl inherits all of its properties from the AnyWin and Control classes.

Parent topic: Java SWT Classes for the Open Agent
Related reference
Control Class
AnyWin Class


ScrolledComposite Class

Description

ScrolledComposite is the class for scrollbars and scrolls the content when the user uses the scrollbars.

Availability

This class is supported only on the Open Agent.

Inheritance

ScrolledComposite is derived from the Control class.

Methods

ScrolledComposite inherits its methods from the AnyWin and Control classes.

Properties

In addition to the properties it inherits from the AnyWin and Control classes, ScrolledComposite has the following properties:

  • AlwaysShowScrollbars Property
    Whether the scrollbar shows.
  • Content Property
    The content of the areas that can be dynamically positioned.
  • Origin Property
    The point in the content that currently appears in the top left corner of the scrolled composite.
Parent topic: Java SWT Classes for the Open Agent
Related reference
Control Class
AnyWin Class


AlwaysShowScrollbars Property

Class

ScrolledComposite.

Description

Whether the scrollbar shows.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

BOOLEAN.

Access

Read and write.

Parent topic: ScrolledComposite Class


Origin Property

Class

ScrolledComposite.

Description

The point in the content that currently appears in the top left corner of the scrolled composite.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

POINT.

Access

Read and write.

Parent topic: ScrolledComposite Class


Shell Class

Description

Shell is the class for windows that the desktop or window manager is managing.

Availability

This class is supported only on the Open Agent.

Inheritance

Shell is derived from the MainWin class.

Methods

Shell inherits all of its methods from the MainWin class, MoveableWin class, and AnyWin class.

Properties

Shell inherits all of its properties from the MainWin class, MoveableWin class, and AnyWin class.

Parent topic: Java SWT Classes for the Open Agent
Related reference
MainWin Class
MoveableWin Class
AnyWin Class


Spinner Class

Description

Spinner is the class to enter and modify numeric values for up/down controls.

Availability

This class is supported only on the Open Agent.

Inheritance

Spinner is derived from the Control class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin and Control classes, the Spinner class has the following methods and properties:

  • Decrement Method (Spinner)
    Decreases the value when the spinner controls are pressed.
  • Increment Method (Spinner)
    Increases the value when the spinner controls are pressed.
  • PageDecrement Method (Spinner)
    Decreases the value when the page spinner controls are pressed.
  • PageIncrement Method (Spinner)
    Increases the value when the page spinner controls are pressed.
  • SetValue Method (Spinner)
    Sets the value for the spinner control.
  • IncrementCount Property
    Amount to increase the position value of the spinner control after pressing it.
  • PageSize Property
    The internal page size of the spinner control.
  • Position Property
    Returns the position for the up/down control.
  • Range Property
    The range of the scale, scroll bar, spinner control, or up/down control.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class


Decrement Method (Spinner)

Class

Spinner.

Action

Decreases the value when the spinner controls are pressed.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Decrement (value)
Variable | Description
value | Optional: The amount to decrement. The default value is "1". INTEGER.

Notes

To decrement the spinner controls to a specific value and verify that it reaches that value, set the Position property.

Example

MyDialog.Spinner1.Decrement(3)
Parent topic: Spinner Class


Increment Method (Spinner)

Class

Spinner.

Action

Increases the value when the spinner controls are pressed.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Increment (value)
Variable | Description
value | Optional: The amount to increment. The default value is "1". INTEGER.

Notes

To increment the spinner controls to a specific value and verify that it reaches that value, set the Position property.

Example

MyDialog.Spinner1.Increment(3)
Parent topic: Spinner Class


PageDecrement Method (Spinner)

Class

Spinner.

Action

Decreases the value when the page spinner controls are pressed.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

PageDecrement (value)
Variable | Description
value | Optional: The amount to decrement. The default value is "1". INTEGER.

Example

MyDialog.Spinner1.PageDecrement(3)
Parent topic: Spinner Class


PageIncrement Method (Spinner)

Class

Spinner.

Action

Increases the value when the page spinner controls are pressed.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

PageIncrement (value)
Variable | Description
value | Optional: The amount to decrement. The default value is "1". INTEGER.

Example

MyDialog.Spinner1.PageIncrement(3)
Parent topic: Spinner Class


SetValue Method (Spinner)

Class

Spinner.

Action

Sets the value for the spinner control.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SetValue (value)
Variable | Description
value | The amount to set. The default value is "1". INTEGER.

Example

MyDialog.Spinner1.SetValue(3)
Parent topic: Spinner Class


IncrementCount Property

Class

Spinner.

Description

Amount to increase the position value of the spinner control after pressing it.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: Spinner Class


PageSize Property

Class

Spinner.

Description

The internal page size of the spinner control.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: Spinner Class


Position Property

Description

Returns the position for the up/down control.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: Spinner Class
Parent topic: UpDownEx Class


StyledText Class

Description

StyledText is the class for an editable user interface object that displays lines of text.

Availability

This class is supported only on the Open Agent.

Inheritance

StyledText is derived from the TextField class.

Methods

StyledText inherits its methods from the AnyWin, Control, and TextField classes.

Properties

In addition to the properties it inherits from the AnyWin, Control, and TextField classes, StyledText has the following property:

  • Editable Property
    Whether the text is editable.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class
TextField Class


Editable Property

Class

StyledText.

Description

Whether the text is editable.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

BOOLEAN.

Access

Read and write.

Parent topic: StyledText Class


SWTBrowser Class

Description

SWTBrowser is the class for the browser widget.

Availability

This class is supported only on the Open Agent.

Inheritance

SWTBrowser is derived from the Control class.

Methods

SWTBrowser inherits its methods from the AnyWin and Control classes.

Properties

SWTBrowser inherits all its properties from the AnyWin and Control classes.

Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class


SWTDateTime Class

Description

SWTDateTime is the class for SWT date and time elements in a calendar, date, or time control.

Availability

This class is supported only on the Open Agent.

Inheritance

SWTDateTime is derived from the Control class; no classes derive from this class.

Identification of Date Time Controls

SWTDateTime appends a 1, 2, or 3 to the class name to indicate which type of control is selected:

  • 1 (SWTDateTime1) - Calendar control with two buttons (previous month, next month)

  • 2 (SWTDateTime2) - Date control with spin buttons (up, down)

  • 3 (SWTDateTime3) -Time control with spin buttons (up, down)

Example

The following example uses the various properties of the control.

[-] testcase TestGetCurrent()  appstate none
      [-] do
// Set the CurrentDate
            [ ] SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime3.CurrentDate = "2008-10-05 09:15:45"
            [ ] Verify(SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime3.Year, 2008, "  year")
            [ ] Verify(SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime3.Month, OCTOBER, " month")
            [ ] Verify(SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime3.Day, 5, " day")
            [ ] Verify(SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime3.Hours, 9, " hours")
            [ ] Verify(SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime3.Minutes, 15, " minutes")
            [ ] Verify(SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime3.Seconds, 45, " seconds")
            [ ] DateTime dt = SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime3.CurrentDate
            [ ] Print(dt)
      [-] except
            [ ] Print(ExceptData())

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin and Control classes, SWTDateTime has the following methods and properties:

  • Select Method (MonthCalendar SWTDateTime)
    Selects a date and time.
  • CurrentDate Property
    The date specified in the date or calendar control.
  • Day Property
    The day specified in the date or calendar control.
  • Hours Property
    The hour specified in the date, time, or calendar control.
  • Minutes Property
    The minute specified in the date, time, or calendar control.
  • Month Property
    The month specified in the date, time, or calendar control.
  • Seconds Property
    The second specified in the date, time, or calendar control.
  • Year Property
    The year specified in the date or calendar control.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class


Select Method (MonthCalendar SWTDateTime)

Class

MonthCalendar and SWTDateTime.

Action

Selects a date and time.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Select (selectedDate)
Variable | Description
selectedDate | The date and time to select. DATETIME.

Notes

For the SWTDateTime class, if an invalid property value is set in the Date control, then an E_INVALID_PARAMETER exception is thrown.

Example

This is a typical example using the MonthCalendar class:

MonthCalendar1.Select("2008-03-06")
The following 4Test statement is recorded when a specific date in the Java SWT Calendar control is selected and the previous month or next month button in the Calendar control is clicked.
SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime1.Select("YYYY-MM-DD")
The following 4Test statement is recorded when a day or month or year is selected in the Date control and then the <spin up> or <spin down> button is clicked or <cursor up> or <cursor down> is pressed.
SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime2.Select("YYYY-MM-DD")
The following 4Test statement is recorded when hours or minutes or seconds are selected in the Time control and then the <spin up> or <spin down> button is clicked or <cursor up> or <cursor down> is pressed.
SWTControls.PageList1.Control22.DateTimeControls.SWTDateTime3.Select("YYYY-MM-DD hh:mm:ss.000")
Parent topic: SWTDateTime Class
Parent topic: MonthCalendar Class


CurrentDate Property

Class

SWTDateTime.

Description

The date specified in the date or calendar control.

Notes

This property is supported only in scripts for Java SWT-based applications that use the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: SWTDateTime Class


Day Property

Class

SWTDateTime.

Description

The day specified in the date or calendar control.

Notes

Valid values include: 1 - 31

This property is supported only in scripts for Java SWT-based applications that use the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: SWTDateTime Class


Hours Property

Class

SWTDateTime.

Description

The hour specified in the date, time, or calendar control.

Notes

Valid values include: 0 - 23

This property is supported only in scripts for Java SWT-based applications that use the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: SWTDateTime Class


Minutes Property

Class

SWTDateTime.

Description

The minute specified in the date, time, or calendar control.

Notes

Valid values include: 0 - 59

This property is supported only in scripts for Java SWT-based applications that use the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: SWTDateTime Class


Month Property

Class

SWTDateTime.

Description

The month specified in the date, time, or calendar control.

Notes

Valid values include: 1 - 12

This property is supported only in scripts for Java SWT-based applications that use the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: SWTDateTime Class


Seconds Property

Class

SWTDateTime.

Description

The second specified in the date, time, or calendar control.

Notes

Valid values: 0 - 59

This property is supported only in scripts for Java SWT-based applications that use the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: SWTDateTime Class


Year Property

Class

SWTDateTime.

Description

The year specified in the date or calendar control.

Notes

Valid values include: 1752 - 9999

This property is supported only in scripts for Java SWT-based applications that use the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: SWTDateTime Class


SWTTabControl Class

Description

SWTTabControl is the class for tab controls in an SWT multi-page dialog.

Availability

This class is supported only on the Open Agent.

Inheritance

SWTTabControl is derived the PageList class.

Identification of SWTTabControl pages

In SWTTabControl methods, you can invoke a tab directly using the tab item, or you can use the tab folder hierarchy. By default, Silk Test Classic records tab items directly. However, you can set record and replay options for the Open Agent to use the tab folder hierarchy.

Example

The following example records tab items:

SwtTestApplication.Control.StandardCtrlSample.Pick()
SWTControls.SWTTabControl1.TabFolder.Select()
SWTControls.SWTTabControl1.TabFolder.ScrollableControl1.TabFolder.SWTTabControl1.Tab11.Select()

The following example records tab folder actions:

SwtTestApplication.Control.StandardCtrlSample.Pick()
SWTControls.SWTTabControl1.Select("TabFolder")
SWTControls.SWTTabControl1.TabFolder.ScrollableControl1.TabFolder.SWTTabControl1.Select("Tab 1")

Methods

SWTTabControl inherits all of its methods from the PageList class.

Properties

In addition to the properties it inherits from the PageList class, SWTTabControl has the following properties:

  • SelectedTabItem Property
    The name of the selected item.
  • TabItems Property
    A list of tab items in the tab control.
Parent topic: Java SWT Classes for the Open Agent
Related reference
PageList Class


SelectedTabItem Property

Class

SWTTabControl.

Description

The name of the selected item.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

WINDOW.

Access

Read only.

Parent topic: SWTTabControl Class


TabItems Property

Class

SWTTabControl.

Description

A list of tab items in the tab control.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF WINDOW.

Access

Read only.

Parent topic: SWTTabControl Class


SWTTabItem Class

Description

SWTTabItem is the class for an enhanced tab within a SWTTabControl.

Availability

This class is supported only on the Open Agent.

Inheritance

SWTTabItem is derived from the Item class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin and Item classes, the SWTTabItem class has the following methods and properties:

  • Select Method (CTabItem SWTTabItem SWTTableColumn SWTTreeColumn TableColumn)
    Selects a tab or column.
  • Selected Property
    Whether the item is selected.
Parent topic: Java SWT Classes for the Open Agent
Related reference
Item Class
AnyWin Class


SWTTable Class

Description

SWTTable is the class for SWT tables.

Availability

This class is supported only on the Open Agent.

Inheritance

SWTTable is derived from the Control class; no classes derive from this class.

Methods and Properties

In addition to the methods and Properties it inherits from the AnyWin and Control classes, SWTTable has the following methods and properties:

  • Check Method (SWTTable)
    Checks the check box.
  • DoubleSelect Method (SWTTable)
    Double-clicks an item.
  • ExtendSelectRow Method (SWTTable)
    Selects a range of rows.
  • FocusRow Method (SWTTable)
    Focuses on a row in the table.
  • MultiSelectRow Method (SWTTable)
    Adds a row from the table to the set of selected rows.
  • MultiUnselectRow Method (SWTTable)
    Removes a row from the set of selected rows.
  • SelectRow Method (SWTTable)
    Selects a row in the table.
  • Uncheck Method (SWTTable)
    Unchecks the check box.
  • AllowsCheck Property
    Whether the tree or table can display a checkmark.
  • AllowsMultiSelect Property
    Whether the list view or table supports selecting multiple items.
  • ColumnCount Property
    Returns the number of columns per item in the grid, header, table, or tree.
  • ColumnItems Property
    A list containing all items in the column.
  • RowCount Property
    Number of rows within a grid or table.
  • RowItems Property
    A list containing all rows in the table or grid.
  • SelectedIndices Property
    A list containing the indices of the selected items.
  • SelectedItems Property (SWTTable TableEx WinFormsDataGrid)
    The selected items within a table or data grid.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class


Check Method (SWTTable)

Class

SWTTable.

Action

Checks the check box.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.Check(Item)
Variable | Description
Item | The check box to check. LISTITEM.

Example

SWTControls.SWTTabControl1.Control14.SWTTabControl1.Table.Table1.Check("Index:0")
Parent topic: SWTTable Class


DoubleSelect Method (SWTTable)

Class

SWTTable.

Action

Double-clicks an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.DoubleSelect (row, [column], modifiers)
Variable | Description
row | The row to double-click. LISTITEM.
column | Optional. The column to double-click. LISTITEM.
modifiers | The modifier to double-click. MODIFIERKEYSTATE.

Notes

DoubleSelect scrolls the specified item into view and then double-clicks it.

Example

SWTControls.SWTTabControl1.Control14.SWTTabControl1.Table.Table1.DoubleSelect("Index:0", 1, MOD_NONE)
Parent topic: SWTTable Class


ExtendSelectRow Method (SWTTable)

Class

SWTTable.

Action

Selects a range of rows.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.ExtendSelect (row, [column])
Variable | Description
row | The row to which to extend the selection. LISTITEM.
column | Optional. The column to which to extend the selection. LISTITEM.

Notes

ExtendSelect requires that the table already has a selected item. Precede the call with a call to Select to select the first item.

Example

SWTControls.SWTTabControl1.Control14.SWTTabControl1.Table.Table1.ExtendSelectRow(5, 1)
Parent topic: SWTTable Class


FocusRow Method (SWTTable)

Class

SWTTable.

Action

Focuses on a row in the table.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.FocusRow (row)
Variable | Description
row | The row on which to focus. LISTITEM.

Example

SWTControls.SWTTabControl1.Control14.SWTTabControl1.Table.Table1.FocusRow("Index:0")
Parent topic: SWTTable Class


MultiSelectRow Method (SWTTable)

Class

SWTTable.

Action

Adds a row from the table to the set of selected rows.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.MultiSelectRow (row, [column])
Variable | Description
row | The row to select. LISTITEM.
column | Optional: The column to select. LISTITEM.

Notes

MultiSelect Ctrl+clicks on the item if the table supports multiple selections and the item is selected.

Example

SWTControls.SWTTabControl1.Control14.SWTTabControl1.Table.Table1.MultiSelectRow("#3")
Parent topic: SWTTable Class


MultiUnselectRow Method (SWTTable)

Class

SWTTable.

Action

Removes a row from the set of selected rows.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.MultiUnselectRow (row, [column])
Variable | Description
row | The row to remove from the selection. LISTITEM.
column | Optional: The column to remove from the selection. LISTITEM.

Notes

MultiUnselect Ctrl+clicks on the item if the table supports multiple selections and the item is selected.

Example

SWTControls.SWTTabControl1.Control14.SWTTabControl1.Table.Table1.MultiUnselectRow("#4")
Parent topic: SWTTable Class


SelectRow Method (SWTTable)

Class

SWTTable.

Action

Selects a row in the table.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

table.SelectRow (row,[column])
Variable | Description
row | The row to select. LISTITEM.
column | Optional. The column to select. LISTITEM.

Example

SWTControls.SWTTabControl1.Control14.SWTTabControl1.Table.Table1.SelectRow("#2")
Parent topic: SWTTable Class


Uncheck Method (SWTTable)

Class

SWTTable class

Action

Unchecks the check box.

Syntax

table.Uncheck(Item)
Variable | Description
Item | The check box to uncheck. LISTITEM.

Notes

This method is supported only in scripts that use the Open Agent.

Example

SWTControls.SWTTabControl1.Control14.SWTTabControl1.Table.Table1.Uncheck("Index:4")
Parent topic: SWTTable Class


SWTTableColumn Class

Description

SWTTableColumn is the class for columns in an SWT table.

Availability

This class is supported only on the Open Agent.

Inheritance

SWTTableColumn is derived from the Item class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin and Item classes, SWTTableColumn has the following methods and properties:

  • Resize Method (DataGridColumn SWTTableColumn SWTTreeColumn TableColumn)
    Resizes a column of the table or tree.
  • Select Method (CTabItem SWTTabItem SWTTableColumn SWTTreeColumn TableColumn)
    Selects a tab or column.
  • Width Property
    The width of the column.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Item Class


SWTTableRow Class

Description

SWTTableRow is the class for rows in an SWT table.

Availability

This class is supported only on the Open Agent.

Inheritance

SWTTableRow is derived from the Item class.

Methods

SWTTableRow inherits all of its methods from the AnyWin and Item classes.

Properties

In addition to the properties it inherits from the AnyWin and Item classes, SWTTableRow has the following properties:

  • Checked Property
    Whether the check box in the row is checked.
  • iItemCount property
    The number of items in the combo box list, list box, menu, popup list, radio list, or tree view.
  • Items Property String
    A list containing all items in the row.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Item Class


Items Property String

Class

SWTTableRow.

Description

A list containing all items in the row.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF STRING.

Access

Read and write

Parent topic: SWTTableRow Class


SWTTree Class

Description

SWTTree is the class for SWT tree-widgets.

Availability

This class is supported only on the Open Agent.

Inheritance

SWTTree is derived from the TreeView class.

Methods and Properties

In addition to the methods and properties it inherits from the TreeView class, SWTTree has the following methods and properties:

  • ExtendSelect Method (SWTTree)
    Selects a range of items by extending the selection in the extend-selection tree.
  • FindItemInColumn Function
    Returns the index of a named item.
  • GetContentsOfColumn Function
    Returns the contents of a column from a treeview control.
  • GetItemsOfColumn Function
    Returns the contents of a column from a treeview control.
  • GetSelectedTextOfColumn Function
    Returns the text (full path) of a column from a treeview control.
  • MultiSelect Method (SWTTree)
    Adds an item from the tree to the set of selected items.
  • MultiUnselect Method (SWTTree)
    Removes an item in the tree from the set of selected items.
  • ColumnCount Property
    Returns the number of columns per item in the grid, header, table, or tree.
  • Columns Property
    A list of all columns in the tree.
Parent topic: Java SWT Classes for the Open Agent
Related reference
TreeView Class


ExtendSelect Method (SWTTree)

Class

SWTTree.

Action

Selects a range of items by extending the selection in the extend-selection tree.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

ExtendSelect (itemPath)
Variable | Description
itemPath | The item to which to extend the selection. LISTITEM.

Notes

ExtendSelect requires that the list already has a selected item. Precede the call with a call to Select to select the first item.

Example

SWTControls.SWTTabControl1.Control17.SWTTabControl1.Tree.TreeViewEx1.ExtendSelect("/Node 2/Node 2.2")
Parent topic: SWTTree Class


FindItemInColumn Function

Class

SWTTree.

Action

Returns the index of a named item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

iIndex = treeview.FindItemInColumn (item, column)
Variable | Description
item | The item to find. STRING.
column | The column to find. INTEGER.

Notes

FindItemInColumn returns the global index of a treeview item specified by path. The returned index is the flat index of the item, as if the treeview were a simple list box. As with all treeview functions, the index is relative to the items which are currently viewable (that is, those that have no collapsed ancestors).

Example

SWTControls.SWTTabControl1.Control17.SWTTabControl1.Tree.TreeViewEx1.FindItemInColumn("/1", 10)
Parent topic: SWTTree Class
Parent topic: SWT
Related reference
GetContentsOfColumn Function
SWTTree Class


GetContentsOfColumn Function

Class

SWTTree.

Action

Returns the contents of a column from a treeview control.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

lsContents = treeview.GetContentsOfColumn (bRawMode, [column])
Variable | Description
lsContents | List of currently viewable items in the treeview. LIST OF STRING.
bRawMode | Prevents spaces from being trimmed from items. BOOLEAN.
column | Optional. The column for which you want to view content. INTEGER.

Notes

GetContentsOfColumn returns a list of strings, with one list element for each currently viewable item (that is, an item with no collapsed ancestors). Each string specifies the full path of an item from the root of the tree.

Example

LIST OF STRING lsContents = SWTControls.SWTTabControl1.Control17.SWTTabControl1.Tree.TreeViewEx1.GetContentsOfColumn(true, 3)
Parent topic: SWTTree Class
Parent topic: SWT
Related reference
FindItemInColumn Function
SWTTree Class


GetItemsOfColumn Function

Class

SWTTree.

Action

Returns the contents of a column from a treeview control.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

treeview.GetItemsOfColumn ([allItems, column])
Variable | Description
allItems | Optional: TRUE if the result should include nonviewable items (children of non-expanded items). Default is FALSE. BOOLEAN.
column | Optional: The column for which you want to view content. INTEGER.

Example

Verify(SWTControls.SWTTabControl1.Control17.SWTTabControl1.Tree.TreeViewEx1.GetItemsOfColumn(TRUE,3), tree2)
Parent topic: SWTTree Class
Parent topic: SWT
Related reference
FindItemInColumn Function
SWTTree Class


GetSelectedTextOfColumn Function

Class

SWTTree.

Action

Returns the text (full path) of a column from a treeview control.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

treeview.GetSelectedTextOfColumn ([column])
Variable | Description
column | Optional: The column for which you want to view content. INTEGER.

Notes

GetSelectedTextOfColumn returns the full path of the currently selected item in the treeview. If no item is selected, the return value is an empty string.

Example

Verify(SWTControls.SWTTabControl1.Control17.SWTTabControl1.Tree.TreeViewEx1.GetSelectedTextOfColumn(3), "2")
Parent topic: SWTTree Class
Parent topic: SWT
Related reference
FindItemInColumn Function
SWTTree Class


MultiSelect Method (SWTTree)

Class

SWTTree.

Action

Adds an item from the tree to the set of selected items.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

MultiSelect (itemPath)
Variable | Description
itemPath | The item to select. LISTITEM.

Notes

MultiSelect Ctrl+clicks on the item if the tree supports multiple selections and the item is selected.

Example

MyDialog.MyTreeView.MultiSelect("/root/child/grandchild")
Parent topic: SWTTree Class


MultiUnselect Method (SWTTree)

Class

SWTTree.

Action

Removes an item in the tree from the set of selected items.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

MultiUnselect (itemPath)
Variable | Description
itemPath | The item to unselect. LISTITEM.

Notes

MultiUnselect Ctrl+clicks on the item if the tree supports multiple selections and the item is selected.

Example

MyDialog.MyTreeView.MultiUnselect("/root/child/grandchild")
Parent topic: SWTTree Class


Columns Property

Class

SWTTree.

Description

A list of all columns in the tree.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF WINDOW.

Access

Read only.

Parent topic: SWTTree Class


SWTTreeColumn Class

Description

SwtTreeColumn is the class for columns in a tree widget.

Availability

This class is supported only on the Open Agent.

Inheritance

SwtTreeColumn is derived from the Item class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin and Item classes, SwtTreeColumn has the following methods and properties:

  • Resize Method (DataGridColumn SWTTableColumn SWTTreeColumn TableColumn)
    Resizes a column of the table or tree.
  • Select Method (CTabItem SWTTabItem SWTTableColumn SWTTreeColumn TableColumn)
    Selects a tab or column.
  • Width Property
    The width of the column.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Item Class


ToggleButton Class

Description

ToggleButton is the class for buttons that have a state that can be changed by selecting the button.

Availability

This class is supported only on the Open Agent.

Inheritance

ToggleButton is derived from the Control class; no classes derive from this class.

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and Control class, ToggleButton has the following methods and properties:

  • Select Method (CheckBoxToolItem DomCheckBox ToggleButton)
    Selects an item.
  • iState Property
    The state of the toggle button.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class


iState Property

Class

ToggleButton.

Description

The state of the toggle button. Valid values include: 1=checked, 2=unchecked, 3=undecided.

Data Type

INTEGER.

Access

Read and write.

Parent topic: ToggleButton Class


ToolItem Class

Description

ToolItem is the class for a tool item in a toolbar control.

Availability

This class is supported only on the Open Agent, and only for the following technology domains:
  • Java SWT
  • Windows Forms
  • Win32

Inheritance

ToolItem is derived from the Item class; several classes derive from the ToolItem class.

Methods

ToolItem inherits all its methods from the AnyWin class and Item class.

Properties

ToolItem inherits all its properties from the AnyWin class and Item class.

Parent topic: Java SWT Classes for the Open Agent
Parent topic: Win32 Classes
Related reference
AnyWin Class
Item Class


VerticalSash Class

Description

VerticalSash is the class for the vertical border around a window pane that can be dragged to adjust the window size.

Availability

This class is supported only on the Open Agent.

Inheritance

VerticalSash is derived from the Sash class.

Methods

VerticalSash inherits its methods from the AnyWin, Control, and Sash classes.

Properties

VerticalSash inherits all its properties from the AnyWin and Control classes.

Parent topic: Java SWT Classes for the Open Agent
Related reference
HorizontalSash Class
Sash Class
AnyWin Class
Control Class
Move Method (Sash)


ViewForm Class

Description

ViewForm is the class to lay out a view's label, menu, or toolbar-local bar in the workbench.

Availability

This class is supported only on the Open Agent.

Inheritance

ViewForm is derived from the Control class.

Methods

ViewForm inherits all of its methods from the AnyWin and Control classes.

Properties

In addition to the properties it inherits from the AnyWin and Control classes, the ViewForm class has the following properties:

  • Content Property
    The content of the areas that can be dynamically positioned.
  • TopCenter Property
    The window located in the top center of the pane.
  • TopLeft Property
    The window located in the top left of the pane.
  • TopRight Property
    The window located in the top right of the pane.
Parent topic: Java SWT Classes for the Open Agent
Related reference
AnyWin Class
Control Class


TopCenter Property

Class

ViewForm.

Description

The window located in the top center of the pane.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

WINDOW.

Access

Read only.

Parent topic: ViewForm Class


TopLeft Property

Class

ViewForm.

Description

The window located in the top left of the pane.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

WINDOW.

Access

Read only.

Parent topic: ViewForm Class


TopRight Property

Class

ViewForm.

Description

The window located in the top right of the pane.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

WINDOW.

Access

Read only.

Parent topic: ViewForm Class


Java-Equivalent Window Classes

  • JavaApplet Class
    Class for a Java applet embedded in a browser page in a Web application.
  • JavaDialogBox Class
    Dialogs in a Java application or applet.
  • JavaMainWin Class
    The main window in a Java application or applet.
Parent topic: Java Classes


JavaApplet Class

Description

JavaApplet is the class for a Java applet embedded in a browser page in a Web application. JavaApplet is a container class that contains Java controls.

Inheritance

Derived from the AnyWin class.

Properties

Inherits all of its properties from the AnyWin class.

Examples

There is a Java applet on the Java page of the GMO Web application (accessible from the Test Page).

The Java extension comes with a Java applet.

Methods

In addition to the methods JavaApplet inherits from the AnyWin class, the following method is available:

  • GetJVMInfo Function
    Gets information about the Java Virtual Machine (JVM) that is running a standalone Java application or Java applet.
Parent topic: Java-Equivalent Window Classes
Related reference
AnyWin Class


GetJVMInfo Function

Class

JavaMainWin and JavaApplet.

Action

Gets information about the Java Virtual Machine (JVM) that is running a standalone Java application or Java applet. You can also use the GetJVMInfo function to get information about the platform on which SilkBean is running.

Syntax

laJVMInfo = QapJava.GetJVMInfo (sJVMQuery);
Variable | Description
laJVMInfo

The requested information or an indication of failure. LIST OF ANYTYPE.

If the method is successful, the first element is the boolean TRUE and the second element is the requested information.

If the method fails, the first element is FALSE, with an optional second element indicating the reason of failure.

sJVMQuery | The desired information about the JVM. STRING.

Notes

You can pass the following string values in sJVMQuery:

  • "JavaVersion"
  • "JavaVendor"
  • "OSName"
  • "OSArch"
  • "OSVersion"
  • "BorlandVersion"
  • "TotalMemory "

Example

LIST OF ANYTYPE laVendor = {}

//…

laVendor = MyApp.GetJVMInfo("JavaVendor")

In this example, GetJVMInfo might return:
{TRUE, "Sun Microsystems Inc."}
Parent topic: JavaApplet Class


JavaDialogBox Class

Description

Dialogs in a Java application or applet.

Inheritance

Derived from the DialogBox class.

Methods

Inherits all of its methods from the DialogBox class, MoveableWin class, and AnyWin class.

Properties

Inherits all of its properties from the DialogBox class, MoveableWin class, and AnyWin class.

Notes

Occasionally, a submenu of a Java menu exceeds the boundaries of its application so that part of the submenu extends beyond the borders of the application. In this situation, Silk Test Classic records these very large submenus as JavaDialogBoxes, not as part of the menu. You can avoid this by expanding the JavaMainWin to a larger size before recording or by maximizing the application window.

Parent topic: Java-Equivalent Window Classes
Related reference
DialogBox Class
MoveableWin Class
AnyWin Class


JavaMainWin Class

Description

The main window in a Java application or applet.

Inheritance

Derived from the MainWin class.

Methods

Inherits all of its methods from the MainWin class, MoveableWin class, and AnyWin class.

Properties

Inherits all of its properties from the MainWin class, MoveableWin class, and AnyWin class.

Parent topic: Java-Equivalent Window Classes
Related reference
MainWin Class
MoveableWin Class
AnyWin Class


Mobile Class Reference

Lists the available classes for testing Mobile controls.

  • MobileButton Class
    Represents a mobile button. Mobile buttons can be clicked.
  • MobileDevice Class
    The mobile device.
  • MobileObject Class
    The base class for all mobile objects.
  • MobileTextField Class
    Represents a text field.
  • MobileWindow Class
    The mobile window.
Parent topic: Classes


MobileButton Class

Description

Represents a mobile button. Mobile buttons can be clicked.

Availability

This class is supported only on the Open Agent.

Inheritance

MobileButton is derived from the MobileObject class. No classes derive from this class.

Methods

MobileButton inherits all its methods from MobileObject, and AnyWin.

Properties

MobileButton inherits all its properties from MobileObject, and AnyWin.

Parent topic: Mobile Class Reference


MobileDevice Class

Description

The mobile device.

Availability

This class is supported only on the Open Agent.

Inheritance

MobileDevice is derived from the AnyWin class. No classes derive from this class.

Methods

In addition to the methods it inherits from AnyWin, MobileDevice has the following methods:

  • Click
  • CloseApp
  • DoubleClick
  • Drag
  • GenerateConnectionString
  • LongClick
  • MultiTouch
  • PinchIn
  • PinchOut
  • PressBack
  • PressDelete
  • PressEnter
  • PressHome
  • PressKeyCode
  • PressRecentApps
  • Rotate
  • SetLocation
  • Sleep
  • Swipe
  • SwipeDown
  • SwipeLeft
  • SwipeRight
  • SwipeUp
  • SwipeWithSegments
  • TwoPointerMultiTouch
  • TypeKeys
  • WakeUp

Properties

In addition to the properties it inherits from AnyWin, MobileDevice has the following properties:

  • DeviceId
  • DisplayHeight
  • DisplayOrientation
  • DisplayWidth
  • IsEmulator
  • Model
  • OperatingSystem
  • OsVersion
Parent topic: Mobile Class Reference


MobileObject Class

Description

The base class for all mobile objects.

Availability

This class is supported only on the Open Agent.

Inheritance

MobileObject is derived from the AnyWin class.The following classes derive from the MobileObject class:
  • MobileButton
  • MobileTextField
  • MobileWindow

Methods

In addition to the methods it inherits from AnyWin, MobileObject has the following methods:

  • Click
  • DoubleClick
  • Drag
  • DragTo
  • DragToObject
  • LongClick
  • MultiTouch
  • PinchIn
  • PinchOut
  • Swipe
  • SwipeDown
  • SwipeLeft
  • SwipeRight
  • SwipeUp
  • SwipeWithSegments
  • TwoPointerMultiTouch
  • TypeKeys

Properties

In addition to the properties it inherits from AnyWin, MobileObject has the following properties:

  • IsEnabled
  • IsFocused
  • IsSelected
  • Text
Parent topic: Mobile Class Reference


MobileTextField Class

Description

Represents a text field.

Availability

This class is supported only on the Open Agent.

Inheritance

MobileTextField is derived from the MobileObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from MobileObject, and AnyWin, MobileTextField has the following methods:

  • ClearText
  • SetText
  • TypePasswordKeys

Properties

MobileTextField inherits all its properties from MobileObject, and AnyWin.

Parent topic: Mobile Class Reference


MobileWindow Class

Description

The mobile window.

Availability

This class is supported only on the Open Agent.

Inheritance

MobileWindow is derived from the MobileObject class. No classes derive from this class.

Methods

MobileWindow inherits all its methods from MobileObject, and AnyWin.

Properties

MobileWindow inherits all its properties from MobileObject, and AnyWin.

Parent topic: Mobile Class Reference


Windows Forms Classes Used by the Open Agent

Lists the 4Test classes that are used by the Open Agent to support Windows Forms. Additionally, when you configure a Windows-based application, Silk Test Classic automatically provides built-in support for testing standard Windows-based application controls.

  • CheckBoxToolItem Class
    The class for a check box element in a toolbar control.
  • CheckedListBox Class
    Represents list boxes that contain a check box.
  • DropDownToolItem Class
    The class for drop-down element in a toolbar control.
  • DataGridColumn Class
    Represents the columns in a table.
  • DataGridItem Class
    Represents data grids and data grid view rows.
  • DataGridRow Class
    Represents the rows in a table.
  • DomainUpDown Class
    Represents Microsoft’s .NET Framework up and down controls.
  • FormsWindow Class
    Represents the top-level window of a Windows Forms application.
  • MenuStrip Class
    Creates a new menu strip for a Windows Forms application.
  • WinFormsDataGrid Class
    Represents Microsoft’s .NET Framework data-grid control.
  • Windows Based Application Class Reference
    Lists the 4Test classes for Windows Forms support.
Parent topic: Classes


CheckedListBox Class

Description

CheckedListBox represents list boxes that contain a check box.

Availability

This class is supported only on the Open Agent.

Inheritance

CheckedListBox derives from the ListBox class. No classes derive from the CheckedListBox class.

Methods

In addition to the methods that it inherits from the ListBox class, CheckedListBox has the following methods:

Properties

In addition to the properties it inherits from the ListBox class, CheckedListBox has the following properties:

  • Check Method (CheckedListBox)
    Checks a check box in the list box.
  • Uncheck Method (CheckedListBox Class)
    Unchecks the check box.
  • CheckedIndices Property
    The indices of the checked items.
  • CheckedItems Property
    The names of the checked items.
Parent topic: Windows Forms Classes Used by the Open Agent


Check Method (CheckedListBox)

Class

CheckedListBox.

Action

Checks a check box in the list box.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

listbox.Check (Item)

Variable | Description
Item | The check box to select. LISTITEM.

Example

DialogBox1.Elements.Check ("water")
Parent topic: CheckedListBox Class


Uncheck Method (CheckedListBox Class)

Class

CheckedListBox.

Action

Unchecks the check box.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

listbox.Uncheck(Item)
Variable | Description
Item | The text or index of the item to uncheck. LISTITEM.

Example

CLB.TheCheckedListBox.Uncheck("Oak")
Parent topic: CheckedListBox Class


CheckedIndices Property

Class

CheckedListBox.

Description

The indices of the checked items.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF INTEGER.

Access

Read and write.

Parent topic: CheckedListBox Class


CheckedItems Property

Class

CheckedListBox.

Description

The names of the checked items.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF LISTITEM.

Access

Read and write.

Parent topic: CheckedListBox Class


DataGridColumn Class

Description

DataGridColumn represents the columns in a table.

Availability

This class is supported only on the Open Agent.

Inheritance

DataGridColumn derives from the Item class and the AnyWin class. No classes derive from the DataGridColumn class.

Methods and Properties

In addition to the methods and properties that it inherits from the Item class, DataGridColumn has the following methods and properties:

  • AutoResize Method (DataGridColumn)
    Automatically resizes a column by double-clicking its divider.
  • Resize Method (DataGridColumn SWTTableColumn SWTTreeColumn TableColumn)
    Resizes a column of the table or tree.
  • ScrollIntoView Method
    Moves the column to the left by scrolling the data grid.
  • Select Method (DataGridColumn DataGridItem DataGridRow)
    Selects a column, item, or row.
  • Width Property
    The width of the column.
Parent topic: Windows Forms Classes Used by the Open Agent


AutoResize Method (DataGridColumn)

Class

DataGridColumn.

Action

Automatically resizes a column by double-clicking its divider.

Syntax

DataGridColumn.AutoResize ()

Availability

This functionality is supported only if you are using the Open Agent.

Example

ColumnName.AutoResize ()
Parent topic: DataGridColumn Class


ScrollIntoView Method

Class

DataGridColumn.

Action

Moves the column to the left by scrolling the data grid.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

DataGridColumn.ScrollIntoView()

Example

DataGridColumn1.ScrollIntoView()
Parent topic: DataGridColumn Class


Select Method (DataGridColumn DataGridItem DataGridRow)

Class

DataGridColumn, DataGridItem, and DataGridRow.

Action

Selects a column, item, or row.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

DataGridColumn.Select ([modifiers])
Variable | Description
modifiers | Optional: The active modifier key state while selecting the item. MODIFIERKEYSTATE.
Parent topic: DataGridColumn Class
Parent topic: DataGridItem Class
Parent topic: DataGridRow Class


DataGridItem Class

Description

DataGridItem represents data grids and data grid view rows.

Availability

This class is supported only on the Open Agent.

Inheritance

DataGridItem derives from the Control class and the AnyWin class. No classes derive from the DataGridItem class.

Methods and Properties

In addition to the methods and properties that it inherits from the Control class, DataGridItem has the following methods and properties:

  • ScrollIntoView Method (DataGridItem)
    Moves the item to the top-left corner of the data grid.
  • Select Method (DataGridColumn DataGridItem DataGridRow)
    Selects a column, item, or row.
  • Column Property
    The ordinal number of the column that contains the cell or item.
  • Row Property
    The ordinal number of the row that contains the cell or item.
  • Selected Property
    Whether the item is selected.
Parent topic: Windows Forms Classes Used by the Open Agent


ScrollIntoView Method (DataGridItem)

Class

DataGridItem.

Action

Moves the item to the top-left corner of the data grid.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

DataGridItem.ScrollIntoView ()

Example

DataGridItem20.ScrollIntoView ()
Parent topic: DataGridItem Class


Column Property

Class

DataGridItem, MsuiaDataItem, MsuiaImage, and MsuiaListItem.

Description

The ordinal number of the column that contains the cell or item.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read only.

Parent topic: DataGridItem Class


Row Property

Class

DataGridItem, MsuiaImage, and MsuiaListItem.

Description

The ordinal number of the row that contains the cell or item.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read only.

Parent topic: DataGridItem Class


DataGridRow Class

Description

DataGridRow represents the rows in a table.

Availability

This class is supported only on the Open Agent.

Inheritance

DataGridRow derives from the Item class and the AnyWin class. No classes derive from the DataGridRow class.

Methods and Properties

In addition to the methods and properties that it inherits from the Item class, DataGridRow has the following methods and properties:

  • Resize Method (DataGridRow)
    Resizes a row.
  • Select Method (DataGridColumn DataGridItem DataGridRow)
    Selects a column, item, or row.
  • ScrollIntoView Method (DataGridRow)
    Moves the row to the top by scrolling the data grid.
  • Height Property
    The height of the row.
  • ItemCount Property
    The number of items contained in the listbox, list view, coolbar, tab folder, row, or expandbar, or the number of rows in a table.
  • Items Property
    A list containing all items of the domain up and down controls, listbox, or listview.
Parent topic: Windows Forms Classes Used by the Open Agent


Resize Method (DataGridRow)

Class

DataGridRow.

Action

Resizes a row.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Resize (height)
Variable | Description
height | The new width of the row, in pixels. INTEGER.

Example

Resize (50)
Parent topic: DataGridRow Class


ScrollIntoView Method (DataGridRow)

Class

DataGridRow.

Action

Moves the row to the top by scrolling the data grid.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

DataGridRow.ScrollIntoView ()

Example

DataGridRow10.ScrollIntoView ()
Parent topic: DataGridRow Class


Height Property

Class

DataGridRow.

Description

The height of the row.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: DataGridRow Class


Items Property

Class

  • DataGridRow
  • DomainUpDown
  • DomListBox
  • ListViewEx
  • TableRow

Description

A list containing all items of the domain up and down controls, listbox, listview, or row.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF LISTITEM.

Access

Read only.

Parent topic: DataGridRow Class
Parent topic: DomainUpDown Class
Parent topic: ListViewEx Class
Parent topic: DomListBox Class


DomainUpDown Class

Description

DomainUpDown represents Microsoft’s .NET Framework up and down controls.

Availability

This class is supported only on the Open Agent.

Inheritance

DomainUpDown derives from the Control class and the AnyWin class. No classes derive from the DomainUpDown class.

Methods and Properties

In addition to the methods and properties that it inherits from the Control class, DomainUpDown has the following methods and properties:

  • Decrement Method (DomainUpDown UpDownEx)
    Decreases the position value of the up/down control.
  • Increment Method (DomainUpDown UpDownEx)
    Increases the position value of the up/down control.
  • Select Method (DomainUpDown DomListBox ListViewEx RadioListToolItem)
    Selects an item.
  • ItemCount Property
    The number of items contained in the listbox, list view, coolbar, tab folder, row, or expandbar, or the number of rows in a table.
  • Items Property
    A list containing all items of the domain up and down controls, listbox, or listview.
  • SelectedIndex Property (DomainUpDown)
    The position for the up or down control.
  • SelectedItem Property (DomainUpDown)
    The position for the up or down control.
  • Wraparound Property
    Whether values are wrapped if smaller than minimum or larger than maximum.
Parent topic: Windows Forms Classes Used by the Open Agent


Decrement Method (DomainUpDown UpDownEx)

Class

DomainUpDown and UpDownEx.

Action

Decreases the position value of the up/down control.

Availability

This method is supported only in scripts for Windows-based applications or Windows Forms applications that use the Open Agent.

Syntax

Decrement (amount)
Variable | Description
amount | Optional: The amount to decrement. The default value is "1". INTEGER.

Notes

For Windows-based applications, to decrement the up/down control to a specific value and verify that it reaches that value, set the Position property.

Example

MyDialog.UpDown1.Decrement()
Parent topic: DomainUpDown Class


Increment Method (DomainUpDown UpDownEx)

Class

DomainUpDown and UpDownEx.

Action

Increases the position value of the up/down control.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Increment(amount)
Variable | Description
amount | Optional: The amount to increment. The default value is "1". INTEGER.

Notes

For Windows-based applications, to increment the up-down control to a specific value and verify that it reaches that value, set the Position property.

Example

MyDialog.UpDown1.Increment()
Parent topic: DomainUpDown Class


SelectedIndex Property (DomainUpDown)

Class

DomainUpDown.

Description

The position for the up or down control.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: DomainUpDown Class


SelectedItem Property (DomainUpDown)

Class

DomainUpDown.

Description

The position for the up or down control.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LISTITEM.

Access

Read and write.

Parent topic: DomainUpDown Class


Wraparound Property

Class

DomainUpDown and UpDownEx.

Description

Whether values are wrapped if smaller than minimum or larger than maximum.

Notes

This property is supported only in scripts for Windows-based or Windows Forms applications that use the Open Agent.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: DomainUpDown Class
Parent topic: UpDownEx Class


FormsWindow Class

Description

FormsWindow is the class that represents the top-level window of a Windows Forms application.

Availability

This class is supported only on the Open Agent, and only for the Windows Forms technology domain.

Inheritance

FormsWindow derives from the MainWin class. No classes derive from the FormsWindow class.

Methods

FormsWindow inherits all its methods from the MainWin class.

Properties

FormsWindow inherits all its properties from the MainWin class.

Parent topic: Windows Forms Classes Used by the Open Agent


MenuStrip Class

Description

MenuStrip is the class that creates a new menu strip for a Windows Forms application.

Availability

This class is supported only on the Open Agent.

Inheritance

MenuStrip derives from the Control class. No classes derive from the MenuStrip class.

Methods

MenuStrip inherits all its methods from the Control class.

Properties

MenuStrip inherits all its properties from the Control class.

Parent topic: Windows Forms Classes Used by the Open Agent


WinFormsDataGrid Class

Description

WinFormsDataGrid represents Microsoft’s .NET Framework data-grid control.

Availability

The WinFormsDataGrid class is available for Windows Forms applications that use the Open Agent only.

Inheritance

WinFormsDataGrid derives from the Control class and the AnyWin class. No classes derive from the WinFormsDataGrid class.

Methods and Properties

In addition to the methods and properties that it inherits from the Control class and the AnyWin class,WinFormsDataGrid has the following methods and properties:

  • DoubleSelectItem Method (DataGrid)
    Double-clicks an item.
  • ExtendSelectItem Method
    Selects a range of rows.
  • MultiSelectItem Method
    Adds a row from the data grid to the set of selected rows.
  • MultiUnselectItem Method
    Removes a row from the set of selected rows.
  • ScrollIntoView Method (WinFormsDataGrid)
    Tries to bring the item to the top-left corner of the datagrid.
  • SelectAllItems Method
    Selects all items in the data grid.
  • SelectItem Method
    Selects the specified cell in a grid.
  • AllowsMultiSelect Property
    Whether the list view or table supports selecting multiple items.
  • ColumnCount Property
    Returns the number of columns per item in the grid, header, table, or tree.
  • ColumnItems Property
    A list containing all items in the column.
  • Items Property
    A list containing all items for the coolbar, CTabFolder, column, data grid, row, or expandbar.
  • RowCount Property
    Number of rows within a grid or table.
  • RowItems Property
    A list containing all rows in the table or grid.
  • SelectedItems Property (SWTTable TableEx WinFormsDataGrid)
    The selected items within a table or data grid.
Parent topic: Windows Forms Classes Used by the Open Agent


DoubleSelectItem Method (DataGrid)

Class

WinFormsDataGrid.

Action

Double-clicks an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Datagrid.DoubleSelectItem (column, row, [modifiers] )
Variable | Description
column | The index of the column to select. INTEGER.
row | The index of the row to select. INTEGER.
modifiers | Optional: The active modifier key state while selecting the item. MODIFIERKEYSTATE.

Example

DataGrid1.DoubleSelectItem (1,1)
Parent topic: WinFormsDataGrid Class


ExtendSelectItem Method

Class

WinFormsDataGrid.

Action

Selects a range of rows.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Datagrid.ExtendSelectItem (column, row)
Variable | Description
column | The index of the column to select. INTEGER.
row | The index of the row to select. INTEGER.

Example

DataGrid1.ExtendSelectItem (1,1)
DataGrid1.ExtendSelectItem (1,2)
Parent topic: WinFormsDataGrid Class


MultiSelectItem Method

Class

WinFormsDataGrid.

Action

Adds a row from the data grid to the set of selected rows.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Datagrid.MultiSelectItem (column, row)
Variable | Description
column | The index of the column to select. INTEGER.
row | The index of the row to select. INTEGER.

Example

DataGrid1.MultiSelectItem (1,1)
DataGrid1.MultiSelectItem (1,2)
Parent topic: WinFormsDataGrid Class


MultiUnselectItem Method

Class

WinFormsDataGrid.

Action

Removes a row from the set of selected rows.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Datagrid.MultiUnselectItem (column, row)
Variable | Description
column | The index of the column to select. INTEGER.
row | The index of the row to select. INTEGER.

Example

DataGrid1.MultiSelectItem (1,1)
DataGrid1.MultiSelectItem (1,2)
DataGrid1.MultiUnselectItem (1,1)
Parent topic: WinFormsDataGrid Class


ScrollIntoView Method (WinFormsDataGrid)

Class

WinFormsDataGrid.

Action

Tries to bring the item to the top-left corner of the datagrid.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Datagrid.ScrollIntoView (column, row)
Variable | Description
column | The index of the column to select. INTEGER.
row | The index of the row to select. INTEGER.

Example

DataGrid.ScrollIntoView (2,3)
Parent topic: WinFormsDataGrid Class


SelectAllItems Method

Class

WinFormsDataGrid.

Action

Selects all items in the data grid.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Datagrid.SelectAllItems()

Example

DataGrid1.SelectAllItems()
Parent topic: WinFormsDataGrid Class


SelectItem Method

Class

WinFormsDataGrid.

Action

Selects the specified cell in a grid.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Datagrid.SelectItem (column, row)
Variable | Description
column | The index of the column to select. INTEGER.
row | The index of the row to select. INTEGER.

Example

DataGrid1.SelectItem (1,1)
Parent topic: WinFormsDataGrid Class


Windows Based Application Class Reference

When you configure a Windows-based application, Silk Test Classic automatically provides built-in support for testing standard Windows Forms controls.

Silk Test Classic includes the following 4Test classes for Windows-based application support:

  • AnyWin class
  • CheckBox class
  • CheckBoxToolItem class
  • ComboBox class
  • Control class
  • DialogBox class
  • DropDownToolItem class
  • FormsWindow Class
  • Group class
  • HeaderEx class
  • HorizontalScrollBar class
  • Item class
  • Link class
  • ListViewEx class
  • MainWin class
  • Menu class
  • MenuItem class
  • MenuStrip Class
  • MonthCalendar class
  • MoveableWin class
  • PageList class
  • Pager class
  • PushButton class
  • PushToolItem class
  • RadioList class
  • RadioListToolItem class
  • Scale class
  • ScrollBar class
  • StaticText class
  • StatusBar class
  • TextField class
  • ToggleButton class
  • ToolBar class
  • ToolItem class
  • TreeView class
  • UpDownEx class
  • VerticalScrollBar class
Parent topic: Windows Forms Classes Used by the Open Agent


Rumba Class Reference

Lists the available classes for testing Rumba controls.

  • Rumba Keys
    Contains the string constants for the Rumba key mnemonics which can be used in the SendKeys and SynchSendKeys methods of the RumbaObject class.
  • RumbaCharacterAttribute Data Type
    Represents the character attributes of an on-screen character.
  • RumbaField Class
    Represents a field on the green screen.
  • RumbaLabel Class
    A field in the screen whose text can be only be retrieved but not set.
  • RumbaObject Class
    RumbaObject.
  • RumbaScreen Class
    Represents the whole green screen.
  • RumbaTextField Class
    A field in the screen whose text can be both retrieved and set.
Parent topic: Classes


Rumba Keys

Description

Contains the string constants for the Rumba key mnemonics which can be used in the SendKeys and SynchSendKeys methods of the RumbaObject class.
Includes the following string constants:
String Constant
Key Mnemonic
RK_AT
@@
RK_ALT
@A
RK_ALT_CURSOR
@e@1*
RK_ATTENTION
@A@Q
RK_BACKSPACE
@<
RK_BACKTAB
@B
RK_CLEAR
@C
RK_CMD
@A@Y
RK_CURSOR_DOWN
@V
RK_CURSOR_LEFT
@L
RK_CURSOR_RIGHT
@Z
RK_CURSOR_SELECT
@e@1*
RK_CURSOR_UP
@U
RK_DELETE
@D
RK_DUP
@S@x
RK_END
@q
RK_ENTER
@E
RK_ERASE_EOF
@F
RK_ERASE_EOL
@e@d
RK_ERASE_INPUT
@A@F
RK_FIELD_EXIT
@A@E
RK_FIELD_MARK
@S@y
RK_FIELD_MINUS
@A@-
RK_FIELD_PLUS
@A@+
RK_HELP
@H
RK_HEXADECIMAL
@A@X
RK_HOME
@0
RK_INSERT
@I
RK_INSERT_TOGGLE
@A@I
RK_LOCAL_HELP
@e@l
RK_LOCAL_PRINT
@P
RK_LOCAL_HELP_CURSOR
@e@m*
RK_LEFT_TAB
@B
RK_NEW_LINE
@e@n*
RK_PAGE_UP
@u
RK_PAGE_DOWN
@v
RK_PRINT
@A@t
RK_PRINT_SCREEN
@A@T
RK_RECORD_BACKSPACE
@A@<
RK_RESET
@R
RK_RIGHT_TAB
@T
RK_SHIFT
@S
RK_SYS_REQUEST
@A@H
RK_TAB
@T
RK_TEST
@A@C
RK_USM
@e@v
RK_APL_CUT_ON_OF
@e@2
RK_PA1
@x
RK_PA2
@y
RK_PA3
@z
RK_PA4
@+
RK_PA5
@%
RK_PA6
@&
RK_PA7
@'
RK_PA8
@(
RK_PA9
@)
RK_PA10
@*
RK_PF1
@1
RK_PF2
@2
RK_PF3
@3
RK_PF4
@4
RK_PF5
@5
RK_PF6
@6
RK_PF7
@7
RK_PF8
@8
RK_PF9
@9
RK_PF10
@a
RK_PF11
@b
RK_PF12
@c
RK_PF13
@d
RK_PF14
@e
RK_PF15
@f
RK_PF16
@g
RK_PF17
@h
RK_PF18
@i
RK_PF19
@j
RK_PF20
@k
RK_PF21
@l
RK_PF22
@m
RK_PF23
@n
RK_PF24
@o
RK_CENTS
@n@1
RK_VERTICAL_BAR
@d@2
RK_CORNER
@d@3
RK_PLUS
@d@4
RK_MINUS
@d@5
RK_QUOTE
@d@7
RK_HORIZONTAL_BAR
@d@8
RK_OPEN_BRACKET
@d@9
RK_CLOSE_BRACKET
@d@10
RK_SUBSTITUTE
@d@0
RK_SYNCHRONOUS
@d@a
Parent topic: Rumba Class Reference


RumbaCharacterAttribute Data Type

Represents the character attributes of an on-screen character.

Can include the following character attributes:
Attribute
Description
backgroundColor
The background color of the character.
foregroundColor
The foreground color of the character.
column
The column of the character on the screen.
line
The line of the character on the screen.
autoEnter
Defines if the character is part of an auto-enter text.
autoSkip
Defines if the character is part of an auto-skip text.
blinking
Defines if the character is blinking.
bold
Defines if the character is bold.
columnSeparator
Defines if the character is a column separator.
detectable
Defines if the character is part of a detectable text.
hidden
Defines if the character is part of a hidden text.
protect
Defines if the character is part of a protected text.
reverseVideo
Defines if the character is displayed in reverse video.
underlined
Defines if the character is underlined.

For additional information, see IRDEAttribute Properties in the Rumba Developer Edition (RDE) documentation.

Parent topic: Rumba Class Reference


RumbaField Class

Description

Represents a field on the green screen.

Availability

This class is supported only on the Open Agent.

Inheritance

RumbaField is derived from the RumbaObject class.The following classes derive from the RumbaField class:
  • RumbaLabel
  • RumbaTextField

Methods

In addition to the methods it inherits from RumbaObject, and AnyWin, RumbaField has the following methods:

  • GetCharacterAttributes

Properties

In addition to the properties it inherits from RumbaObject, and AnyWin, RumbaField has the following properties:

  • AutoEnter
  • AutoSkip
  • Detectable
  • Dup
  • EndColumn
  • EndLine
  • EndPosition
  • Enptui
  • FieldExitRequired
  • Hidden
  • Intense
  • Length
  • ModifiedDataTag
  • Protected
  • StartColumn
  • StartLine
  • StartPosition
  • Text
  • Type
Parent topic: Rumba Class Reference


RumbaLabel Class

Description

A field in the screen whose text can be only be retrieved but not set.

Availability

This class is supported only on the Open Agent.

Inheritance

RumbaLabel is derived from the RumbaField class. No classes derive from this class.

Methods

RumbaLabel inherits all its methods from RumbaField, RumbaObject, and AnyWin.

Properties

RumbaLabel inherits all its properties from RumbaField, RumbaObject, and AnyWin.

Parent topic: Rumba Class Reference


RumbaObject Class

Description

RumbaObject.

Availability

This class is supported only on the Open Agent.

Inheritance

RumbaObject is derived from the AnyWin class.The following classes derive from the RumbaObject class:
  • RumbaField
  • RumbaScreen

Methods

In addition to the methods it inherits from AnyWin, RumbaObject has the following methods:

  • IsFocused
  • SendKeys
  • SetFocus
  • SynchSendKeys

Properties

RumbaObject inherits all its properties from AnyWin.

Parent topic: Rumba Class Reference


RumbaScreen Class

Description

Represents the whole green screen.

Availability

This class is supported only on the Open Agent.

Inheritance

RumbaScreen is derived from the RumbaObject class. No classes derive from this class.

Methods

In addition to the methods it inherits from RumbaObject, and AnyWin, RumbaScreen has the following methods:

  • Clear
  • Connect
  • Disconnect
  • GetCharacterAttributes
  • GetContent
  • GetLines
  • Reset
  • SetCursorPosition
  • Submit
  • WaitForHostConnected
  • WriteText

Properties

In addition to the properties it inherits from RumbaObject, and AnyWin, RumbaScreen has the following properties:

  • BackgroundColor
  • CharacterSetId
  • ColumnCount
  • CursorColumn
  • CursorLine
  • CursorPosition
  • HostConnected
  • HostDeviceName
  • HostIpAddress
  • KeyboardLocked
  • LineCount
  • ScreenId
  • ScreenSize
  • SessionName
  • SupportsStructuredFields
Parent topic: Rumba Class Reference


RumbaTextField Class

Description

A field in the screen whose text can be both retrieved and set.

Availability

This class is supported only on the Open Agent.

Inheritance

RumbaTextField is derived from the RumbaField class. No classes derive from this class.

Methods

In addition to the methods it inherits from RumbaField, RumbaObject, and AnyWin, RumbaTextField has the following methods:

  • SetText

Properties

RumbaTextField inherits all its properties from RumbaField, RumbaObject, and AnyWin.

Parent topic: Rumba Class Reference


SAP Class Reference

Lists the available classes for testing SAP controls.

  • SapBarChart Class
    Class for SAP Bar Chart.
  • SapBox Class
    Class for SAP SapBox.
  • SapButton Class
    SapButton class is the class for push buttons.
  • SapCalendar Class
    SapCalendar class represents a SapCalendar.
  • SapChart Class
    Class for SAP Chart.
  • SapCheckBox Class
    SapCheckBox class is the class for check box controls.
  • SapColorSelector Class
    SapColorSelector class represents a SapColorSelector.
  • SapComboBox Class
    Class for SAP ComboBox.
  • SapComponent Class
    SapComponent class is the base class for SAP.
  • SapContainer Class
    Class for SAP Container.
  • SapContainerShell Class
    Class for SAP ConainerShell.
  • SapContextMenu Class
    The class for SAP context menus.
  • SapCustomControl Class
    Class for SAP CustomControl.
  • SapDockShell Class
    Class for SAP DockShell.
  • SapGridView Class
    Class for SAP GridView. Some of the methods that have Get as a prefix require the column as an iput parameter of type string. This parameter is different for each individual GridView element. To obtain the value of this parameter, record an action on the desired item and use the parameter that you have recorded.
  • SapHorizontalScrollBar Class
    Class for horizontal scrollbars.
  • SapHTMLViewer Class
    Class for SAP HTMLView.
  • SapLabel Class
    SapLabel class is the class for all SAP labels.
  • SapMenu Class
    Class for SAP Menu.
  • SapMenubar Class
    Class for SAP MenuBar.
  • SapNetPlan Class
    Class for SAP Net Chart.
  • SapOfficeIntegration Class
    Class for SAP OfficeIntegration.
  • SapOkCodeField Class
    SapOkCodeField class is the class for sap OkCodeField.
  • SapPicture Class
    Class for SAP picture.
  • SapRadioButton Class
    SapRadioButton class is the class for radio button controls.
  • SapScrollbar Class
    Class for SAP Scrollbar.
  • SapScrollContainer Class
    Class for SAP UserArea.
  • SapShell Class
    Class for SAP SapShell.
  • SapSimpleContainer Class
    Class for SAP SimpleContainer.
  • SapSplitterContainer Class
    Class for SAP splitter container.
  • SapStatusbar Class
    Class for SAP statusbar.
  • SapTab Class
    Class for SAP Tab.
  • SapTable Class
    SapTable class is the class for SAP tables.
  • SapTabStrip Class
    Class for SAP tab pane.
  • SapTextEdit Class
    Class for SAP TextEdit.
  • SapTextField Class
    SapTextField is the class for single-line and multi-line fields whose text can be modified by the user.
  • SapTitlebar Class
    Class for SAP Titlebar.
  • SapToolbar Class
    Class for SAP Toolbar.
  • SapToolbarControl Class
    Class for SAP ToolbarControl.
  • SapTree Class
    SapTree class is the class for all SAP trees. Some of the methods that have Get as a prefix require the nodeKey and the ItemName as iput parameters of type string. These parameters are different for each individual SapTree element. To obtain the value of these parameters, record an action on the desired item and use the parameters that you have recorded.
  • SapUserArea Class
    Class for SAP UserArea.
  • SapVerticalScrollBar Class
    Class for vertical scrollbars.
  • SapWindow Class
    SapWindow class is the class for a top-level window.
Parent topic: Classes


SapBarChart Class

Description

Class for SAP Bar Chart.

Availability

This class is supported only on the Open Agent.

Inheritance

SapBarChart is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapBarChart has the following methods:

  • BarCount
  • GetBarContent
  • GetGridLineContent
  • GridCount
  • LinkCount
  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText
  • SendData

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapBarChart has the following properties:

  • AccessibilityDescription
  • ChartCount
  • CurrentContextMenu
  • WindowHandle
Parent topic: SAP Class Reference


SapBox Class

Description

Class for SAP SapBox.

Availability

This class is supported only on the Open Agent.

Inheritance

SapBox is derived from the SapComponent class. No classes derive from this class.

Methods

SapBox inherits all its methods from SapComponent, and AnyWin.

Properties

SapBox inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapButton Class

Description

SapButton class is the class for push buttons.

Availability

This class is supported only on the Open Agent.

Inheritance

SapButton is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapButton has the following methods:

  • Select

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapButton has the following properties:

  • CharHeight
  • CharLeft
  • CharTop
  • CharWidth
Parent topic: SAP Class Reference


SapCalendar Class

Description

SapCalendar class represents a SapCalendar.

Availability

This class is supported only on the Open Agent.

Inheritance

SapCalendar is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapCalendar has the following methods:

  • ContextMenu
  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText
  • SetFirstVisibleDate
  • SetFocusDate
  • SetSelectionInterval

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapCalendar has the following properties:

  • CurrentContextMenu
  • Day
  • EndSelection
  • FirstVisibleDate
  • LastVisibleDate
  • Month
  • SelectionInterval
  • StartSelection
  • Week
  • Year
Parent topic: SAP Class Reference


SapChart Class

Description

Class for SAP Chart.

Availability

This class is supported only on the Open Agent.

Inheritance

SapChart is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapChart has the following methods:

  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText
  • ValueChange

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapChart has the following properties:

  • AccessibilityDescription
  • CurrentContextMenu
  • WindowHandle
Parent topic: SAP Class Reference


SapCheckBox Class

Description

SapCheckBox class is the class for check box controls.

Availability

This class is supported only on the Open Agent.

Inheritance

SapCheckBox is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapCheckBox has the following methods:

  • Check
  • Uncheck

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapCheckBox has the following properties:

  • CharHeight
  • CharLeft
  • CharTop
  • CharWidth
  • Checked
  • ColorIndex
  • ColorIntensified
  • ColorInverse
  • Flushing
  • IsLeftLabel
  • IsListElement
  • IsRightLabel
  • RowText
Parent topic: SAP Class Reference


SapColorSelector Class

Description

SapColorSelector class represents a SapColorSelector.

Availability

This class is supported only on the Open Agent.

Inheritance

SapColorSelector is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapColorSelector has the following methods:

  • ChangeSelection
  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapColorSelector has the following properties:

  • CurrentContextMenu
Parent topic: SAP Class Reference


SapComboBox Class

Description

Class for SAP ComboBox.

Availability

This class is supported only on the Open Agent.

Inheritance

SapComboBox is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapComboBox has the following methods:

  • GetCurrentEntryKey
  • GetCurrentEntryValue
  • GetEntryKeys
  • GetEntryValues
  • SelectItem
  • SelectKey

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapComboBox has the following properties:

  • CharHeight
  • CharLeft
  • CharTop
  • CharWidth
  • Flushing
  • IsLeftLabel
  • IsListBoxActive
  • IsRightLabel
  • IsSymbolFont
  • Key
  • Required
  • Value
Parent topic: SAP Class Reference


SapComponent Class

Description

SapComponent class is the base class for SAP.

Availability

This class is supported only on the Open Agent.

Inheritance

SapComponent is derived from the AnyWin class.The following classes derive from the SapComponent class:
  • SapBox
  • SapButton
  • SapCheckBox
  • SapComboBox
  • SapContainer
  • SapContainerShell
  • SapCustomControl
  • SapDockShell
  • SapLabel
  • SapMenu
  • SapMenubar
  • SapOkCodeField
  • SapRadioButton
  • SapScrollContainer
  • SapShell
  • SapSimpleContainer
  • SapSplitterContainer
  • SapStatusbar
  • SapTab
  • SapTable
  • SapTabStrip
  • SapTextField
  • SapTitlebar
  • SapToolbar
  • SapUserArea
  • SapWindow

Methods

In addition to the methods it inherits from AnyWin, SapComponent has the following methods:

  • IsFocused
  • SetFocus
  • ShowContextMenu

Properties

In addition to the properties it inherits from AnyWin, SapComponent has the following properties:

  • AccessibilityText
  • AccessibilityTextOnRequest
  • AccessibilityTooltip
  • Changeable
  • DefaultTooltip
  • Height
  • IconName
  • IsSymbolFont
  • Left
  • Modified
  • Name
  • ScreenLeft
  • ScreenTop
  • Tooltip
  • Top
  • Width
Parent topic: SAP Class Reference


SapContainer Class

Description

Class for SAP Container.

Availability

This class is supported only on the Open Agent.

Inheritance

SapContainer is derived from the SapComponent class. No classes derive from this class.

Methods

SapContainer inherits all its methods from SapComponent, and AnyWin.

Properties

SapContainer inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapContainerShell Class

Description

Class for SAP ConainerShell.

Availability

This class is supported only on the Open Agent.

Inheritance

SapContainerShell is derived from the SapComponent class. No classes derive from this class.

Methods

SapContainerShell inherits all its methods from SapComponent, and AnyWin.

Properties

SapContainerShell inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapContextMenu Class

Description

The class for SAP context menus.

For information on determining the items of a SAP context menu, see Determining the item names and item texts of a SapContextMenu.

Availability

This class is supported only on the Open Agent.

Inheritance

SapContextMenu is derived from the SapMenu class. No classes derive from this class.

Methods

SapContextMenu inherits all its methods from SapMenu, SapComponent, and AnyWin.

Properties

SapContextMenu inherits all its properties from SapMenu, SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapCustomControl Class

Description

Class for SAP CustomControl.

Availability

This class is supported only on the Open Agent.

Inheritance

SapCustomControl is derived from the SapComponent class. No classes derive from this class.

Methods

SapCustomControl inherits all its methods from SapComponent, and AnyWin.

Properties

SapCustomControl inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapDockShell Class

Description

Class for SAP DockShell.

Availability

This class is supported only on the Open Agent.

Inheritance

SapDockShell is derived from the SapComponent class. No classes derive from this class.

Methods

SapDockShell inherits all its methods from SapComponent, and AnyWin.

Properties

SapDockShell inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapGridView Class

Description

Class for SAP GridView. Some of the methods that have Get as a prefix require the column as an iput parameter of type string. This parameter is different for each individual GridView element. To obtain the value of this parameter, record an action on the desired item and use the parameter that you have recorded.

Availability

This class is supported only on the Open Agent.

Inheritance

SapGridView is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapGridView has the following methods:

  • ClearSelection
  • Click
  • ClickCurrentCell
  • ContextMenu
  • CurrentCellMoved
  • DeleteRows
  • DeselectColumn
  • DoubleClick
  • DoubleClickCurrentCell
  • DuplicateRows
  • GetCellColor
  • GetCellHeight
  • GetCellIcon
  • GetCellLeft
  • GetCellMaxLength
  • GetCellState
  • GetCellTooltip
  • GetCellTop
  • GetCellType
  • GetCellValue
  • GetCellWidth
  • GetColorInfo
  • GetColumnDataType
  • GetColumnPosition
  • GetColumnSortType
  • GetColumnTitles
  • GetColumnTooltip
  • GetColumnTotalType
  • GetDisplayedColumnTitle
  • GetRowTotalLevel
  • GetSymbolInfo
  • GetToolbarButtonIcon
  • GetToolbarButtonId
  • GetToolbarButtonText
  • GetToolbarButtonTooltip
  • GetToolbarButtonType
  • GetToolbarFocusButton
  • HasCellF4Help
  • InsertRows
  • IsCellChangeable
  • IsCellCheckBoxChecked
  • IsCellHotspot
  • IsCellSymbol
  • IsCellTotalExpander
  • IsColumnFiltered
  • IsColumnKey
  • IsToolbarButtonChecked
  • IsToolbarButtonEnabled
  • IsTotalRowExpanded
  • ModifyCell
  • ModifyCheckBox
  • MoveRows
  • PressButton
  • PressButtonCurrentCell
  • PressColumnHeader
  • PressEnter
  • PressF1
  • PressF4
  • PressToolbarButton
  • PressToolbarContextButton
  • PressTotalRow
  • PressTotalRowCurrentCell
  • SelectAll
  • SelectColumn
  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText
  • SelectionChanged
  • SelectToolbarMenuItem
  • SetColumnOrder
  • SetColumnWidth
  • SetCurrentCell
  • SetCurrentCellColumn
  • SetCurrentCellRow
  • SetFirstVisibleColumn
  • SetFirstVisibleRow
  • SetSelectedRows
  • TriggerModified

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapGridView has the following properties:

  • ColumnCount
  • ColumnOrder
  • CurrentCellColumn
  • CurrentCellRow
  • CurrentContextMenu
  • FirstVisibleColumn
  • FirstVisibleRow
  • FrozenColumnCount
  • RowCount
  • SelectedCells
  • SelectedColumns
  • SelectedRows
  • SelectionMode
  • Title
  • ToolbarButtonCount
  • VisibleRowCount
Parent topic: SAP Class Reference


SapHorizontalScrollBar Class

Description

Class for horizontal scrollbars.

Availability

This class is supported only on the Open Agent.

Inheritance

SapHorizontalScrollBar is derived from the SapScrollbar class. No classes derive from this class.

Methods

SapHorizontalScrollBar inherits all its methods from SapScrollbar, and AnyWin.

Properties

SapHorizontalScrollBar inherits all its properties from SapScrollbar, and AnyWin.

Parent topic: SAP Class Reference


SapHTMLViewer Class

Description

Class for SAP HTMLView.

Availability

This class is supported only on the Open Agent.

Inheritance

SapHTMLViewer is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapHTMLViewer has the following methods:

  • ContextMenu
  • SapEvent
  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapHTMLViewer has the following properties:

  • CurrentContextMenu
  • DocumentComplete
  • WindowHandle
Parent topic: SAP Class Reference


SapLabel Class

Description

SapLabel class is the class for all SAP labels.

Availability

This class is supported only on the Open Agent.

Inheritance

SapLabel is derived from the SapComponent class. No classes derive from this class.

Methods

SapLabel inherits all its methods from SapComponent, and AnyWin.

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapLabel has the following properties:

  • CharLeft
  • CharTop
  • CharWidth
  • ColorIndex
  • ColorInverse
  • DisplayedText
  • Highlighted
  • IsHotspot
  • IsLeftLabel
  • IsListElement
  • IsRightLabel
  • Maxlength
  • Numerical
Parent topic: SAP Class Reference


SapMenu Class

Description

Class for SAP Menu.

Availability

This class is supported only on the Open Agent.

Inheritance

SapMenu is derived from the SapComponent class.The following classes derive from the SapMenu class:
  • SapContextMenu

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapMenu has the following methods:

  • Select

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapMenu has the following properties:

  • IsSymbolFont
Parent topic: SAP Class Reference


SapMenubar Class

Description

Class for SAP MenuBar.

Availability

This class is supported only on the Open Agent.

Inheritance

SapMenubar is derived from the SapComponent class. No classes derive from this class.

Methods

SapMenubar inherits all its methods from SapComponent, and AnyWin.

Properties

SapMenubar inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapNetPlan Class

Description

Class for SAP Net Chart.

Availability

This class is supported only on the Open Agent.

Inheritance

SapNetPlan is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapNetPlan has the following methods:

  • GetLinkContent
  • GetNodeContent
  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText
  • SendData

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapNetPlan has the following properties:

  • AccessibilityDescription
  • CurrentContextMenu
  • LinkCount
  • NodeCount
  • WindowHandle
Parent topic: SAP Class Reference


SapOfficeIntegration Class

Description

Class for SAP OfficeIntegration.

Availability

This class is supported only on the Open Agent.

Inheritance

SapOfficeIntegration is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapOfficeIntegration has the following methods:

  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapOfficeIntegration has the following properties:

  • CurrentContextMenu
Parent topic: SAP Class Reference


SapOkCodeField Class

Description

SapOkCodeField class is the class for sap OkCodeField.

Availability

This class is supported only on the Open Agent.

Inheritance

SapOkCodeField is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapOkCodeField has the following methods:

  • Close
  • Open
  • PressF1
  • SetText

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapOkCodeField has the following properties:

  • Opened
Parent topic: SAP Class Reference


SapPicture Class

Description

Class for SAP picture.

Availability

This class is supported only on the Open Agent.

Inheritance

SapPicture is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapPicture has the following methods:

  • Click
  • ClickControlArea
  • ClickPictureArea
  • ContextMenu
  • DoubleClick
  • DoubleClickControlArea
  • DoubleClickPictureArea
  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapPicture has the following properties:

  • CurrentContextMenu
  • DisplayMode
  • Icon
  • Url
Parent topic: SAP Class Reference


SapRadioButton Class

Description

SapRadioButton class is the class for radio button controls.

Availability

This class is supported only on the Open Agent.

Inheritance

SapRadioButton is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapRadioButton has the following methods:

  • Select

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapRadioButton has the following properties:

  • CharHeight
  • CharLeft
  • CharTop
  • CharWidth
  • Flushing
  • IsLeftLabel
  • IsRightLabel
  • Selected
Parent topic: SAP Class Reference


SapScrollbar Class

Description

Class for SAP Scrollbar.

Availability

This class is supported only on the Open Agent.

Inheritance

SapScrollbar is derived from the AnyWin class.The following classes derive from the SapScrollbar class:
  • SapHorizontalScrollBar
  • SapVerticalScrollBar

Methods

In addition to the methods it inherits from AnyWin, SapScrollbar has the following methods:

  • ScrollTo

Properties

In addition to the properties it inherits from AnyWin, SapScrollbar has the following properties:

  • Maximum
  • Minimum
  • PageSize
  • Position
Parent topic: SAP Class Reference


SapScrollContainer Class

Description

Class for SAP UserArea.

Availability

This class is supported only on the Open Agent.

Inheritance

SapScrollContainer is derived from the SapComponent class. No classes derive from this class.

Methods

SapScrollContainer inherits all its methods from SapComponent, and AnyWin.

Properties

SapScrollContainer inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapShell Class

Description

Class for SAP SapShell.

Availability

This class is supported only on the Open Agent.

Inheritance

SapShell is derived from the SapComponent class.The following classes derive from the SapShell class:
  • SapBarChart
  • SapCalendar
  • SapChart
  • SapColorSelector
  • SapGridView
  • SapHTMLViewer
  • SapNetPlan
  • SapOfficeIntegration
  • SapPicture
  • SapTextEdit
  • SapToolbarControl
  • SapTree

Methods

SapShell inherits all its methods from SapComponent, and AnyWin.

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapShell has the following properties:

  • DragDropSupported
Parent topic: SAP Class Reference


SapSimpleContainer Class

Description

Class for SAP SimpleContainer.

Availability

This class is supported only on the Open Agent.

Inheritance

SapSimpleContainer is derived from the SapComponent class. No classes derive from this class.

Methods

SapSimpleContainer inherits all its methods from SapComponent, and AnyWin.

Properties

SapSimpleContainer inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapSplitterContainer Class

Description

Class for SAP splitter container.

Availability

This class is supported only on the Open Agent.

Inheritance

SapSplitterContainer is derived from the SapComponent class. No classes derive from this class.

Methods

SapSplitterContainer inherits all its methods from SapComponent, and AnyWin.

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapSplitterContainer has the following properties:

  • CurrentContextMenu
Parent topic: SAP Class Reference


SapStatusbar Class

Description

Class for SAP statusbar.

Availability

This class is supported only on the Open Agent.

Inheritance

SapStatusbar is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapStatusbar has the following methods:

  • DoubleClick

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapStatusbar has the following properties:

  • MessageId
  • MessageNumber
  • MessageType
Parent topic: SAP Class Reference


SapTab Class

Description

Class for SAP Tab.

Availability

This class is supported only on the Open Agent.

Inheritance

SapTab is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapTab has the following methods:

  • Select

Properties

SapTab inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapTable Class

Description

SapTable class is the class for SAP tables.

Availability

This class is supported only on the Open Agent.

Inheritance

SapTable is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapTable has the following methods:

  • ConfigureLayout
  • DeselectAllColumns
  • DeselectColumn
  • DeselectRow
  • GetCell
  • GetCellAbsolute
  • GetCellsForRow
  • GetColumnTitle
  • GetVisibleCellsForColumn
  • IsColumnSelected
  • IsRowSelected
  • ReorderTable
  • SelectAllColumns
  • SelectColumn
  • SelectRow

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapTable has the following properties:

  • CharHeight
  • CharLeft
  • CharTop
  • CharWidth
  • ColumnCount
  • ColumnSelectionMode
  • CurrentColumn
  • CurrentRow
  • RowCount
  • RowSelectionMode
  • TableFieldName
  • VisibleRowCount
Parent topic: SAP Class Reference


SapTabStrip Class

Description

Class for SAP tab pane.

Availability

This class is supported only on the Open Agent.

Inheritance

SapTabStrip is derived from the SapComponent class. No classes derive from this class.

Methods

SapTabStrip inherits all its methods from SapComponent, and AnyWin.

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapTabStrip has the following properties:

  • SelectedTab
  • Tabs
Parent topic: SAP Class Reference


SapTextEdit Class

Description

Class for SAP TextEdit.

Availability

This class is supported only on the Open Agent.

Inheritance

SapTextEdit is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapTextEdit has the following methods:

  • ContextMenu
  • DoubleClick
  • GetLineText
  • IsBreakpointLine
  • IsCommentLine
  • IsHighlightedLine
  • IsProtectedLine
  • PressF1
  • PressF4
  • SetSelectionIndexes
  • SetText

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapTextEdit has the following properties:

  • CurrentColumn
  • CurrentContextMenu
  • CurrentLine
  • FirstVisibleLine
  • LastVisibleLine
  • LineCount
  • SelectedText
  • SelectionEndColumn
  • SelectionEndLine
  • SelectionIndexEnd
  • SelectionIndexStart
  • SelectionStartColumn
  • SelectionStartLine
Parent topic: SAP Class Reference


SapTextField Class

Description

SapTextField is the class for single-line and multi-line fields whose text can be modified by the user.

Availability

This class is supported only on the Open Agent.

Inheritance

SapTextField is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapTextField has the following methods:

  • SetPasswordText
  • SetText

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapTextField has the following properties:

  • DisplayedText
  • IsPassword
Parent topic: SAP Class Reference


SapTitlebar Class

Description

Class for SAP Titlebar.

Availability

This class is supported only on the Open Agent.

Inheritance

SapTitlebar is derived from the SapComponent class. No classes derive from this class.

Methods

SapTitlebar inherits all its methods from SapComponent, and AnyWin.

Properties

SapTitlebar inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapToolbar Class

Description

Class for SAP Toolbar.

Availability

This class is supported only on the Open Agent.

Inheritance

SapToolbar is derived from the SapComponent class. No classes derive from this class.

Methods

SapToolbar inherits all its methods from SapComponent, and AnyWin.

Properties

SapToolbar inherits all its properties from SapComponent, and AnyWin.

Parent topic: SAP Class Reference


SapToolbarControl Class

Description

Class for SAP ToolbarControl.

Availability

This class is supported only on the Open Agent.

Inheritance

SapToolbarControl is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapToolbarControl has the following methods:

  • GetButtonIcon
  • GetButtonType
  • IsButtonChecked
  • IsButtonEnabled
  • PressContextButton
  • SelectButton
  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText
  • SelectMenuItem
  • SelectMenuItemByText

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapToolbarControl has the following properties:

  • ButtonCount
  • Changeable
  • CurrentContextMenu
  • DragDropSupported
  • FocusedButton
  • WindowHandle
Parent topic: SAP Class Reference


SapTree Class

Description

SapTree class is the class for all SAP trees. Some of the methods that have Get as a prefix require the nodeKey and the ItemName as iput parameters of type string. These parameters are different for each individual SapTree element. To obtain the value of these parameters, record an action on the desired item and use the parameters that you have recorded.

Availability

This class is supported only on the Open Agent.

Inheritance

SapTree is derived from the SapShell class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapShell, SapComponent, and AnyWin, SapTree has the following methods:

  • ChangeCheckbox
  • CollapseNode
  • DefaultContextMenu
  • DoubleSelectItem
  • DoubleSelectNode
  • EnsureVisibleHorizontalItem
  • ExpandNode
  • FindNodeKeyByPath
  • GetAbapImage
  • GetCheckBoxState
  • GetColumnIndexFromName
  • GetColumnKeys
  • GetColumnTitleFromName
  • GetHierarchyLevel
  • GetItemHeight
  • GetItemLeft
  • GetItemStyle
  • GetItemText
  • GetItemTextColor
  • GetItemTooltip
  • GetItemTop
  • GetItemType
  • GetItemWidth
  • GetListTreeNodeItemCount
  • GetNextNodeKey
  • GetNodeAbapImage
  • GetNodeChildrenCount
  • GetNodeChildrenCountByPath
  • GetNodeHeight
  • GetNodeIndex
  • GetNodeItemHeaders
  • GetNodeLeft
  • GetNodePathByKey
  • GetNodeStyle
  • GetNodeText
  • GetNodeTextByPath
  • GetNodeTextColor
  • GetNodeTooltip
  • GetNodeTop
  • GetNodeWidth
  • GetParentNodeKey
  • GetPreviousNodeKey
  • GetStyleDescription
  • GetSubNodesKeys
  • HeaderContextMenu
  • IsFolder
  • IsFolderExpandable
  • IsFolderExpanded
  • IsHighLighted
  • ItemContextMenu
  • NodeContextMenu
  • PressKey
  • SelectButton
  • SelectColumn
  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText
  • SelectHeader
  • SelectItem
  • SelectLink
  • SelectNode
  • SetCheckBoxState
  • SetColumnOrder
  • SetColumnWidth
  • SetHierarchyHeaderWidth
  • SetSelectedNode
  • SetTopNode
  • UnselectAll
  • UnselectColumn
  • UnselectNode

Properties

In addition to the properties it inherits from SapShell, SapComponent, and AnyWin, SapTree has the following properties:

  • AccessibilityDescription
  • ColumnHeaders
  • ColumnNames
  • ColumnOrder
  • ColumnTitles
  • CurrentContextMenu
  • FocusedNodeKey
  • HierarchyHeaderWidth
  • HierarchyTitle
  • NodeKeys
  • SelectedItemColumn
  • SelectedItemNode
  • SelectedNode
  • SelectedNodes
  • SelectionMode
  • TopNode
  • TreeType
Parent topic: SAP Class Reference


SapUserArea Class

Description

Class for SAP UserArea.

Availability

This class is supported only on the Open Agent.

Inheritance

SapUserArea is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapUserArea has the following methods:

  • SelectContextMenuItem
  • SelectContextMenuItemByPosition
  • SelectContextMenuItemByText

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapUserArea has the following properties:

  • CurrentContextMenu
Parent topic: SAP Class Reference


SapVerticalScrollBar Class

Description

Class for vertical scrollbars.

Availability

This class is supported only on the Open Agent.

Inheritance

SapVerticalScrollBar is derived from the SapScrollbar class. No classes derive from this class.

Methods

SapVerticalScrollBar inherits all its methods from SapScrollbar, and AnyWin.

Properties

SapVerticalScrollBar inherits all its properties from SapScrollbar, and AnyWin.

Parent topic: SAP Class Reference


SapWindow Class

Description

SapWindow class is the class for a top-level window.

Availability

This class is supported only on the Open Agent.

Inheritance

SapWindow is derived from the SapComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from SapComponent, and AnyWin, SapWindow has the following methods:

  • IsVkeyAllowed
  • JumpBackward
  • JumpForward
  • ResizeWorkingPane
  • ResizeWorkingPaneEx
  • SendVKey
  • TabBackward
  • TabForward

Properties

In addition to the properties it inherits from SapComponent, and AnyWin, SapWindow has the following properties:

  • ButtonbarVisible
  • GuiFocus
  • StatusbarVisible
  • SystemFocus
  • TitlebarVisible
  • ToolbarVisible
  • WindowHandle
  • WindowState
  • WorkingPaneHeight
  • WorkingPaneWidth
Parent topic: SAP Class Reference


Silverlight Class Reference

Lists the available classes for testing Silverlight controls.

  • SLApplication Class
    The container for Silverlight controls.
  • SLAutoCompleteBox Class
    Represents a control that provides a text box for user input and a drop-down that contains possible matches based on the input in the text box.
  • SLBase Class
    Provides a Silverlight framework-level set of properties, events, and methods for Silverlight elements.
  • SLButton Class
    Identifies a button control.
  • SLCalendar Class
    Identifies a calendar control.
  • SLCalendarButton Class
    Identifies a calendar button.
  • SLCalendarDayButton Class
    Identifies a calendar day button.
  • SLCheckBox Class
    Identifies a check box control.
  • SLComboBox Class
    Identifies a combo box control.
  • SLComboBoxItem Class
    Identifies a combo box item control.
  • SLDataGrid Class
    Identifies a data grid control.
  • SLDataGridCell Class
    Identifies a cell within a row of a data grid control.
  • SLDataGridDetails Class
    Identifies a control that displays additional details within a data grid row.
  • SLDataGridRow Class
    Identifies a row in data grid.
  • SLDataPager Class
    Identifies a data pager for paging through a collection of data.
  • SLDatePicker Class
    Represents a control that allows the user to select a date.
  • SLDescriptionViewer Class
    Identifies a description viewer control.
  • SLFrame Class
    Identifies a frame control.
  • SLGridSplitter Class
    Identifies a grid splitter control.
  • SLGroup Class
    Identifies a group control, which acts as a container for other controls.
  • SLHeader Class
    Identifies a control that provides a visual container for the labels for rows or columns.
  • SLHeaderItem Class
    Identifies a control that provides a visual label for a row or column.
  • SLHorizontalScrollBar Class
    Identifies a horizontal scroll bar.
  • SLHyperlinkButton Class
    Identifies a hyperlink button control.
  • SLImage Class
    Identifies an image control.
  • SLListBox Class
    Identifies a list box control.
  • SLListItem Class
    Identifies a list item control.
  • SLMediaElement Class
    Represents a control that contains audio and/or video.
  • SLMenu Class
    Identifies a menu control.
  • SLMenuBar Class
    Identifies a menu bar control.
  • SLMenuItem Class
    Identifies a menu item control.
  • SLMultiScaleImage Class
    Enables users to open a multi-resolution image, which can be zoomed in on and panned across.
  • SLPane Class
    Identifies a pane that can optionally have scroll bars.
  • SLPasswordBox Class
    Identifies a password box control.
  • SLPopup Class
    Identifies a popup control. Context menus are also treated as popup controls.
  • SLProgressBar Class
    Identifies a progress bar control.
  • SLRadioButton Class
    Represents a button that allows a user to select a single option from a group of options.
  • SLRepeatButton Class
    Identifies a repeat button control.
  • SLRichTextBox Class
    Identifies a rich text box control.
  • SLSeparator Class
    Identifies a separator control.
  • SLSlider Class
    Identifies a progress bar control.
  • SLSpinner Class
    Identifies a spinner control.
  • SLSplitButton Class
    Identifies a split button control.
  • SLStatusBar Class
    Identifies a status bar control.
  • SLTabControl Class
    Identifies a tab control.
  • SLTabItem Class
    Identifies a tab item control.
  • SLTable Class
    Identifies a table.
  • SLTextBlock Class
    Identifies a control for displaying small amounts of flow content.
  • SLTextBox Class
    Identifies a text box control.
  • SLThumb Class
    Identifies a thumb control.
  • SLTitleBar Class
    Identifies the caption bar on a window.
  • SLToggleButton Class
    Identifies a toggle button control.
  • SLToolBar Class
    Identifies a toolbar control.
  • SLToolTip Class
    Identifies a tooltip control.
  • SLTreeView Class
    Represents a control that displays hierarchical data in a tree structure that has items that can expand and collapse.
  • SLTreeViewItem Class
    Represents a selectable item in a tree control.
  • SLValidationSummary Class
    Identifies a validation summary control.
  • SLVerticalScrollBar Class
    Identifies a vertical scroll bar.
  • SLWindow Class
    Identifies a window control.
Parent topic: Classes


SLApplication Class

Description

The container for Silverlight controls.

Availability

This class is supported only on the Open Agent.

Inheritance

SLApplication is derived from the SLBase class. No classes derive from this class.

Methods

SLApplication inherits all its methods from SLBase, and AnyWin.

Properties

SLApplication inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLAutoCompleteBox Class

Description

Represents a control that provides a text box for user input and a drop-down that contains possible matches based on the input in the text box.

Availability

This class is supported only on the Open Agent.

Inheritance

SLAutoCompleteBox is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLAutoCompleteBox has the following methods:

  • Close
  • ScrollHorizontal
  • ScrollVertical
  • Select
  • SetHorizontalScrollPercent
  • SetVerticalScrollPercent

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLAutoCompleteBox has the following properties:

  • HorizontallyScrollable
  • HorizontalScrollPercent
  • IsOpen
  • Items
  • ItemTexts
  • VerticallyScrollable
  • VerticalScrollPercent
Parent topic: Silverlight Class Reference


SLBase Class

Description

Provides a Silverlight framework-level set of properties, events, and methods for Silverlight elements.

Availability

This class is supported only on the Open Agent.

Inheritance

SLBase is derived from the AnyWin class.The following classes derive from the SLBase class:
  • SLApplication
  • SLAutoCompleteBox
  • SLButton
  • SLCalendar
  • SLCalendarButton
  • SLCalendarDayButton
  • SLCheckBox
  • SLComboBox
  • SLComboBoxItem
  • SLDataGrid
  • SLDataGridCell
  • SLDataGridDetails
  • SLDataGridRow
  • SLDataPager
  • SLDatePicker
  • SLDescriptionViewer
  • SLFrame
  • SLGridSplitter
  • SLGroup
  • SLHeader
  • SLHeaderItem
  • SLHorizontalScrollBar
  • SLHyperlinkButton
  • SLImage
  • SLListBox
  • SLListItem
  • SLMediaElement
  • SLMenu
  • SLMenuBar
  • SLMenuItem
  • SLMultiScaleImage
  • SLPane
  • SLPasswordBox
  • SLPopup
  • SLProgressBar
  • SLRadioButton
  • SLRepeatButton
  • SLRichTextBox
  • SLSeparator
  • SLSlider
  • SLSpinner
  • SLSplitButton
  • SLStatusBar
  • SLTabControl
  • SLTabItem
  • SLTable
  • SLTextBlock
  • SLTextBox
  • SLThumb
  • SLTitleBar
  • SLToggleButton
  • SLToolBar
  • SLToolTip
  • SLTreeView
  • SLTreeViewItem
  • SLValidationSummary
  • SLVerticalScrollBar
  • SLWindow

Methods

In addition to the methods it inherits from AnyWin, SLBase has the following methods:

  • GetRawChildren
  • IsFocused
  • SetFocus

Properties

In addition to the properties it inherits from AnyWin, SLBase has the following properties:

  • AutomationId
  • ClassName
  • IsEnabled
  • Name
Parent topic: Silverlight Class Reference


SLButton Class

Description

Identifies a button control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLButton is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLButton has the following methods:

  • Select

Properties

SLButton inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLCalendar Class

Description

Identifies a calendar control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLCalendar is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLCalendar has the following methods:

  • SelectDate
  • SelectDates
  • SelectRange
  • SwitchToDecadeView
  • SwitchToMonthView
  • SwitchToYearView

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLCalendar has the following properties:

  • CanSelectMultiple
  • DisplayMode
  • IsSelectionRequired
  • SelectedDate
  • SelectedDates
  • SupportedDisplayModes
Parent topic: Silverlight Class Reference


SLCalendarButton Class

Description

Identifies a calendar button.

Availability

This class is supported only on the Open Agent.

Inheritance

SLCalendarButton is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLCalendarButton has the following methods:

  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLCalendarButton has the following properties:

  • IsSelected
Parent topic: Silverlight Class Reference


SLCalendarDayButton Class

Description

Identifies a calendar day button.

Availability

This class is supported only on the Open Agent.

Inheritance

SLCalendarDayButton is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLCalendarDayButton has the following methods:

  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLCalendarDayButton has the following properties:

  • IsSelected
Parent topic: Silverlight Class Reference


SLCheckBox Class

Description

Identifies a check box control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLCheckBox is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLCheckBox has the following methods:

  • Check
  • SetIndeterminate
  • Toggle
  • Uncheck

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLCheckBox has the following properties:

  • ToggleState
Parent topic: Silverlight Class Reference


SLComboBox Class

Description

Identifies a combo box control.

Combo boxes in Silverlight require to be opened once before information about their items can be retrieved.

Availability

This class is supported only on the Open Agent.

Inheritance

SLComboBox is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLComboBox has the following methods:

  • Close
  • Open
  • ScrollHorizontal
  • ScrollVertical
  • Select
  • SetHorizontalScrollPercent
  • SetVerticalScrollPercent

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLComboBox has the following properties:

  • HorizontallyScrollable
  • HorizontalScrollPercent
  • IsOpen
  • Items
  • ItemTexts
  • SelectedIndex
  • SelectedItem
  • SelectedItemText
  • VerticallyScrollable
  • VerticalScrollPercent
Parent topic: Silverlight Class Reference


SLComboBoxItem Class

Description

Identifies a combo box item control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLComboBoxItem is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLComboBoxItem has the following methods:

  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLComboBoxItem has the following properties:

  • IsSelected
Parent topic: Silverlight Class Reference


SLDataGrid Class

Description

Identifies a data grid control.

If the data grid has a vertical scroll bar, rows which are not in the visible area of the data grid do not expose any information (e.g. text, caption). In order to interact with such a row or retrieve information about the row it needs to be scrolled into view first.

Availability

This class is supported only on the Open Agent.

Inheritance

SLDataGrid is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLDataGrid has the following methods:

  • ScrollHorizontal
  • ScrollIntoView
  • ScrollVertical
  • Select
  • SelectCell
  • SetHorizontalScrollPercent
  • SetVerticalScrollPercent

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLDataGrid has the following properties:

  • CanSelectMultiple
  • ColumnCount
  • ColumnHeaders
  • ColumnHeaderTexts
  • HorizontallyScrollable
  • HorizontalScrollPercent
  • RowCount
  • Rows
  • RowTexts
  • SelectedCell
  • SelectedCellText
  • SelectedRow
  • SelectedRows
  • SelectedRowText
  • SelectedRowTexts
  • VerticallyScrollable
  • VerticalScrollPercent
Parent topic: Silverlight Class Reference


SLDataGridCell Class

Description

Identifies a cell within a row of a data grid control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLDataGridCell is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLDataGridCell has the following methods:

  • ScrollIntoView
  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLDataGridCell has the following properties:

  • IsSelected
Parent topic: Silverlight Class Reference


SLDataGridDetails Class

Description

Identifies a control that displays additional details within a data grid row.

Availability

This class is supported only on the Open Agent.

Inheritance

SLDataGridDetails is derived from the SLBase class. No classes derive from this class.

Methods

SLDataGridDetails inherits all its methods from SLBase, and AnyWin.

Properties

SLDataGridDetails inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLDataGridRow Class

Description

Identifies a row in data grid.

Availability

This class is supported only on the Open Agent.

Inheritance

SLDataGridRow is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLDataGridRow has the following methods:

  • ScrollIntoView
  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLDataGridRow has the following properties:

  • Cells
  • CellTexts
  • IsSelected
  • RowHeader
Parent topic: Silverlight Class Reference


SLDataPager Class

Description

Identifies a data pager for paging through a collection of data.

Availability

This class is supported only on the Open Agent.

Inheritance

SLDataPager is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLDataPager has the following methods:

  • MoveToFirstPage
  • MoveToLastPage
  • MoveToNextPage
  • MoveToPage
  • MoveToPreviousPage

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLDataPager has the following properties:

  • CurrentPage
  • PageCount
Parent topic: Silverlight Class Reference


SLDatePicker Class

Description

Represents a control that allows the user to select a date.

Availability

This class is supported only on the Open Agent.

Inheritance

SLDatePicker is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLDatePicker has the following methods:

  • CloseCalendar
  • OpenCalendar

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLDatePicker has the following properties:

  • IsCalendarOpen
  • SelectedDate
Parent topic: Silverlight Class Reference


SLDescriptionViewer Class

Description

Identifies a description viewer control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLDescriptionViewer is derived from the SLBase class. No classes derive from this class.

Methods

SLDescriptionViewer inherits all its methods from SLBase, and AnyWin.

Properties

SLDescriptionViewer inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLFrame Class

Description

Identifies a frame control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLFrame is derived from the SLBase class. No classes derive from this class.

Methods

SLFrame inherits all its methods from SLBase, and AnyWin.

Properties

SLFrame inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLGridSplitter Class

Description

Identifies a grid splitter control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLGridSplitter is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLGridSplitter has the following methods:

  • MoveHorizontal
  • MoveVertical

Properties

SLGridSplitter inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLGroup Class

Description

Identifies a group control, which acts as a container for other controls.

Availability

This class is supported only on the Open Agent.

Inheritance

SLGroup is derived from the SLBase class. No classes derive from this class.

Methods

SLGroup inherits all its methods from SLBase, and AnyWin.

Properties

SLGroup inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLHeader Class

Description

Identifies a control that provides a visual container for the labels for rows or columns.

Availability

This class is supported only on the Open Agent.

Inheritance

SLHeader is derived from the SLBase class. No classes derive from this class.

Methods

SLHeader inherits all its methods from SLBase, and AnyWin.

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLHeader has the following properties:

  • HeaderItems
Parent topic: Silverlight Class Reference


SLHeaderItem Class

Description

Identifies a control that provides a visual label for a row or column.

Availability

This class is supported only on the Open Agent.

Inheritance

SLHeaderItem is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLHeaderItem has the following methods:

  • Select

Properties

SLHeaderItem inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLHorizontalScrollBar Class

Description

Identifies a horizontal scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

SLHorizontalScrollBar is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLHorizontalScrollBar has the following methods:

  • Scroll
  • ScrollToMaximum
  • ScrollToMinimum
  • ScrollToPosition

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLHorizontalScrollBar has the following properties:

  • Maximum
  • Minimum
  • ScrollPosition
Parent topic: Silverlight Class Reference


SLHyperlinkButton Class

Description

Identifies a hyperlink button control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLHyperlinkButton is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLHyperlinkButton has the following methods:

  • Select

Properties

SLHyperlinkButton inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLImage Class

Description

Identifies an image control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLImage is derived from the SLBase class. No classes derive from this class.

Methods

SLImage inherits all its methods from SLBase, and AnyWin.

Properties

SLImage inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLListBox Class

Description

Identifies a list box control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLListBox is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLListBox has the following methods:

  • DeselectAll
  • ScrollHorizontal
  • ScrollVertical
  • Select
  • SelectAll
  • SetHorizontalScrollPercent
  • SetVerticalScrollPercent

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLListBox has the following properties:

  • CanSelectMultiple
  • HorizontallyScrollable
  • HorizontalScrollPercent
  • Items
  • ItemTexts
  • SelectedIndex
  • SelectedIndices
  • SelectedItem
  • SelectedItems
  • SelectedItemText
  • SelectedItemTexts
  • VerticallyScrollable
  • VerticalScrollPercent
Parent topic: Silverlight Class Reference


SLListItem Class

Description

Identifies a list item control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLListItem is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLListItem has the following methods:

  • Deselect
  • ScrollIntoView
  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLListItem has the following properties:

  • IsSelected
Parent topic: Silverlight Class Reference


SLMediaElement Class

Description

Represents a control that contains audio and/or video.

Availability

This class is supported only on the Open Agent.

Inheritance

SLMediaElement is derived from the SLBase class. No classes derive from this class.

Methods

SLMediaElement inherits all its methods from SLBase, and AnyWin.

Properties

SLMediaElement inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLMenu Class

Description

Identifies a menu control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLMenu is derived from the SLBase class. No classes derive from this class.

Methods

SLMenu inherits all its methods from SLBase, and AnyWin.

Properties

SLMenu inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLMenuBar Class

Description

Identifies a menu bar control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLMenuBar is derived from the SLBase class. No classes derive from this class.

Methods

SLMenuBar inherits all its methods from SLBase, and AnyWin.

Properties

SLMenuBar inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLMenuItem Class

Description

Identifies a menu item control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLMenuItem is derived from the SLBase class. No classes derive from this class.

Methods

SLMenuItem inherits all its methods from SLBase, and AnyWin.

Properties

SLMenuItem inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLMultiScaleImage Class

Description

Enables users to open a multi-resolution image, which can be zoomed in on and panned across.

Availability

This class is supported only on the Open Agent.

Inheritance

SLMultiScaleImage is derived from the SLBase class. No classes derive from this class.

Methods

SLMultiScaleImage inherits all its methods from SLBase, and AnyWin.

Properties

SLMultiScaleImage inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLPane Class

Description

Identifies a pane that can optionally have scroll bars.

Availability

This class is supported only on the Open Agent.

Inheritance

SLPane is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLPane has the following methods:

  • ScrollHorizontal
  • ScrollVertical
  • SetHorizontalScrollPercent
  • SetVerticalScrollPercent

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLPane has the following properties:

  • HorizontallyScrollable
  • HorizontalScrollPercent
  • VerticallyScrollable
  • VerticalScrollPercent
Parent topic: Silverlight Class Reference


SLPasswordBox Class

Description

Identifies a password box control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLPasswordBox is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLPasswordBox has the following methods:

  • Clear
  • SetPosition
  • SetSelection
  • SetText

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLPasswordBox has the following properties:

  • IsReadOnly
Parent topic: Silverlight Class Reference


SLPopup Class

Description

Identifies a popup control. Context menus are also treated as popup controls.

Availability

This class is supported only on the Open Agent.

Inheritance

SLPopup is derived from the SLBase class. No classes derive from this class.

Methods

SLPopup inherits all its methods from SLBase, and AnyWin.

Properties

SLPopup inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLProgressBar Class

Description

Identifies a progress bar control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLProgressBar is derived from the SLBase class. No classes derive from this class.

Methods

SLProgressBar inherits all its methods from SLBase, and AnyWin.

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLProgressBar has the following properties:

  • Maximum
  • Minimum
  • Value
Parent topic: Silverlight Class Reference


SLRadioButton Class

Description

Represents a button that allows a user to select a single option from a group of options.

Availability

This class is supported only on the Open Agent.

Inheritance

SLRadioButton is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLRadioButton has the following methods:

  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLRadioButton has the following properties:

  • IsSelected
Parent topic: Silverlight Class Reference


SLRepeatButton Class

Description

Identifies a repeat button control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLRepeatButton is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLRepeatButton has the following methods:

  • Select

Properties

SLRepeatButton inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLRichTextBox Class

Description

Identifies a rich text box control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLRichTextBox is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLRichTextBox has the following methods:

  • Clear
  • SetPosition
  • SetSelection
  • SetText

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLRichTextBox has the following properties:

  • SelectedText
  • Text
Parent topic: Silverlight Class Reference


SLSeparator Class

Description

Identifies a separator control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLSeparator is derived from the SLBase class. No classes derive from this class.

Methods

SLSeparator inherits all its methods from SLBase, and AnyWin.

Properties

SLSeparator inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLSlider Class

Description

Identifies a progress bar control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLSlider is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLSlider has the following methods:

  • DecreaseLarge
  • DecreaseSmall
  • IncreaseLarge
  • IncreaseSmall
  • SetValue
  • SetValueToMaximum
  • SetValueToMinimum

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLSlider has the following properties:

  • LargeChange
  • Maximum
  • Minimum
  • SmallChange
  • Value
Parent topic: Silverlight Class Reference


SLSpinner Class

Description

Identifies a spinner control.

A spinner control type consists of a set of buttons that enable a user to select from a set of items or set a numerical value from within a range.

Availability

This class is supported only on the Open Agent.

Inheritance

SLSpinner is derived from the SLBase class. No classes derive from this class.

Methods

SLSpinner inherits all its methods from SLBase, and AnyWin.

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLSpinner has the following properties:

  • NumericValue
  • Value
Parent topic: Silverlight Class Reference


SLSplitButton Class

Description

Identifies a split button control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLSplitButton is derived from the SLBase class. No classes derive from this class.

Methods

SLSplitButton inherits all its methods from SLBase, and AnyWin.

Properties

SLSplitButton inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLStatusBar Class

Description

Identifies a status bar control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLStatusBar is derived from the SLBase class. No classes derive from this class.

Methods

SLStatusBar inherits all its methods from SLBase, and AnyWin.

Properties

SLStatusBar inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLTabControl Class

Description

Identifies a tab control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLTabControl is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLTabControl has the following methods:

  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLTabControl has the following properties:

  • Items
  • ItemTexts
  • SelectedIndex
  • SelectedItem
  • SelectedItemText
Parent topic: Silverlight Class Reference


SLTabItem Class

Description

Identifies a tab item control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLTabItem is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLTabItem has the following methods:

  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLTabItem has the following properties:

  • IsSelected
Parent topic: Silverlight Class Reference


SLTable Class

Description

Identifies a table.

Availability

This class is supported only on the Open Agent.

Inheritance

SLTable is derived from the SLBase class. No classes derive from this class.

Methods

SLTable inherits all its methods from SLBase, and AnyWin.

Properties

SLTable inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLTextBlock Class

Description

Identifies a control for displaying small amounts of flow content.

Availability

This class is supported only on the Open Agent.

Inheritance

SLTextBlock is derived from the SLBase class. No classes derive from this class.

Methods

SLTextBlock inherits all its methods from SLBase, and AnyWin.

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLTextBlock has the following properties:

  • Text
Parent topic: Silverlight Class Reference


SLTextBox Class

Description

Identifies a text box control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLTextBox is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLTextBox has the following methods:

  • Clear
  • SetPosition
  • SetSelection
  • SetText

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLTextBox has the following properties:

  • IsReadOnly
  • Text

Examples

textBox.SetText("some text")
textBox.SetSelection(0, 4) // selects 4 characters starting from the first one
textBox.TypeKeys("<Ctrl+C>") // copies the selected text to the clipboard
Dim selectedText = Clipboard.GetText() // gets the text from the clipboard
Parent topic: Silverlight Class Reference


SLThumb Class

Description

Identifies a thumb control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLThumb is derived from the SLBase class. No classes derive from this class.

Methods

SLThumb inherits all its methods from SLBase, and AnyWin.

Properties

SLThumb inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLTitleBar Class

Description

Identifies the caption bar on a window.

Availability

This class is supported only on the Open Agent.

Inheritance

SLTitleBar is derived from the SLBase class. No classes derive from this class.

Methods

SLTitleBar inherits all its methods from SLBase, and AnyWin.

Properties

SLTitleBar inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLToggleButton Class

Description

Identifies a toggle button control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLToggleButton is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLToggleButton has the following methods:

  • Toggle

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLToggleButton has the following properties:

  • ToggleState
Parent topic: Silverlight Class Reference


SLToolBar Class

Description

Identifies a toolbar control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLToolBar is derived from the SLBase class. No classes derive from this class.

Methods

SLToolBar inherits all its methods from SLBase, and AnyWin.

Properties

SLToolBar inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLToolTip Class

Description

Identifies a tooltip control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLToolTip is derived from the SLBase class. No classes derive from this class.

Methods

SLToolTip inherits all its methods from SLBase, and AnyWin.

Properties

SLToolTip inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLTreeView Class

Description

Represents a control that displays hierarchical data in a tree structure that has items that can expand and collapse.

Availability

This class is supported only on the Open Agent.

Inheritance

SLTreeView is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLTreeView has the following methods:

  • Collapse
  • Expand
  • ExpandAll
  • ScrollHorizontal
  • ScrollVertical
  • Select
  • SetHorizontalScrollPercent
  • SetVerticalScrollPercent

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLTreeView has the following properties:

  • HorizontallyScrollable
  • HorizontalScrollPercent
  • RootItems
  • RootItemTexts
  • SelectedItem
  • SelectedItemPath
  • SelectedItemText
  • VerticallyScrollable
  • VerticalScrollPercent
  • VisibleItemPaths
Parent topic: Silverlight Class Reference


SLTreeViewItem Class

Description

Represents a selectable item in a tree control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLTreeViewItem is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLTreeViewItem has the following methods:

  • Collapse
  • Expand
  • ExpandSubTree
  • ScrollIntoView
  • Select

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLTreeViewItem has the following properties:

  • IsExpanded
  • IsLeaf
  • IsSelected
  • Items
  • ItemTexts
Parent topic: Silverlight Class Reference


SLValidationSummary Class

Description

Identifies a validation summary control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLValidationSummary is derived from the SLBase class. No classes derive from this class.

Methods

SLValidationSummary inherits all its methods from SLBase, and AnyWin.

Properties

SLValidationSummary inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


SLVerticalScrollBar Class

Description

Identifies a vertical scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

SLVerticalScrollBar is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLVerticalScrollBar has the following methods:

  • Scroll
  • ScrollToMaximum
  • ScrollToMinimum
  • ScrollToPosition

Properties

In addition to the properties it inherits from SLBase, and AnyWin, SLVerticalScrollBar has the following properties:

  • Maximum
  • Minimum
  • ScrollPosition
Parent topic: Silverlight Class Reference


SLWindow Class

Description

Identifies a window control.

Availability

This class is supported only on the Open Agent.

Inheritance

SLWindow is derived from the SLBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from SLBase, and AnyWin, SLWindow has the following methods:

  • Close
  • Move

Properties

SLWindow inherits all its properties from SLBase, and AnyWin.

Parent topic: Silverlight Class Reference


Java AWT and Swing Class Reference

Lists the available classes for testing Java AWT and Swing controls.

  • AbstractButton Class
    Defines common behaviors for buttons and menu items.
  • Applet Class
    Represents the Java Applet in the browser.
  • AppletContainer Class
    Root element of an Applet in the browser.
  • AWTButton Class
    Represents a push button.
  • AWTCanvas Class
    Represents an empty rectangular area of the screen where the application can draw or trap events from the user.
  • AWTCheckbox Class
    Represents a check box.
  • AWTCheckboxMenuItem Class
    Represents a check box control that can be inserted in a menu item.
  • AWTChoice Class
    Represents a combo box.
  • AWTComponent Class
    AWTComponent is the base class for Java AWT.
  • AWTContainer Class
    Represents a component that can contain other AWT components.
  • AWTDialog Class
    Represents a dialog box.
  • AWTFrame Class
    Represents a top-level window with a title and a border.
  • AWTHorizontalScrollbar Class
    Represents a horizontal scroll bar.
  • AWTLabel Class
    Represents a class for placing text in a container.
  • AWTList Class
    Represents a list box.
  • AWTMenu Class
    Represents a menu component that is accessed from a menu bar.
  • AWTMenuComponent Class
    Represents the base class of all menu-related controls.
  • AWTMenuItem Class
    Represents a menu item.
  • AWTRadioButton Class
    Represents a radio button.
  • AWTScrollbar Class
    Represents a scroll bar. This class includes scroll bars that are parts of controls, such as the scroll bar on a list box.
  • AWTScrollPane Class
    Represents a class that implements automatic horizontal or vertical scrolling for a single child component.
  • AWTTextArea Class
    Represents a text area.
  • AWTTextComponent Class
    Represents the base class for the AWTTextField and AWTTextArea classes.
  • AWTTextField Class
    Represents single-line and multi-line text field controls whose text can be modified by the user.
  • AWTVerticalScrollbar Class
    Represents a vertical scroll bar.
  • AWTWindow Class
    Represents a top-level window with no borders and no menubar.
  • BasicArrowButton Class
    Represents a push button with an arrow in one of the cardinal directions.
  • JButton Class
    Represents a push button.
  • JCheckBox Class
    Represents a check box.
  • JCheckBoxMenuItem Class
    Represents a check box control that can be included in a menu item.
  • JColorChooser Class
    Represents a color chooser.
  • JComboBox Class
    Represents a combo box.
  • JComponent Class
    Represents a class for all components except top-level containers.
  • JDesktopPane Class
    Represents a desktop pane.
  • JDialog Class
    Represents a dialog box.
  • JEditorPane Class
    Represents a text component where you can edit different types of content.
  • JFrame Class
    Represents a class for an extended version of AWTFrame that adds support for Java Swing.
  • JHorizontalScrollBar Class
    Represents a horizontal scroll bar.
  • JLabel Class
    Represents a display area for displaying a short text, image, or both.
  • JLayeredPane Class
    Represents a layered pane.
  • JList Class
    Represents a list box.
  • JMenu Class
    Represents a menu. A menu is a menu item that has child items.
  • JMenuBar Class
    Represents a menu bar.
  • JMenuItem Class
    Represents a menu item.
  • JPanel Class
    Represents a container class for lightweight components.
  • JPasswordField Class
    Represents a single-line field that does not show the original characters.
  • JPopupMenu Class
    Represents a context menu.
  • JProgressBar Class
    Displays the progress of an operation.
  • JRadioButton Class
    Represents a radio button.
  • JRadioButtonMenuItem Class
    Represents a radio button menu item.
  • JRootPane Class
    Represents a root pane.
  • JScrollBar Class
    Represents a scroll bar.
  • JScrollPane Class
    Represents a scroll pane which allows scrolling its content which may be larger than the pane itself.
  • JSlider Class
    Represents a slider control which can select a value within a range.
  • JSpinner Class
    Represents a spinner control which can iterate a sequence of values.
  • JSplitPane Class
    Represents a split pane control which divides two components horizontally or vertically.
  • JTabbedPane Class
    Represents a tabbed pane.
  • JTable Class
    Represents a table control which has rows and columns.
  • JTableHeader Class
    Represents table header class for the table component.
  • JTextArea Class
    Represents a multiple-line area control that displays plain text.
  • JTextComponent Class
    Represents a text control that can be marked with attributes that are represented graphically.
  • JTextField Class
    Represents a single-line text field control whose text can be modified by the user.
  • JTextPane Class
    Represents a text pane control that can be marked with attributes that are represented graphically.
  • JToggleButton Class
    Represents a two-state button.
  • JToolBar Class
    Represents a toolbar.
  • JTree Class
    Represents a tree.
  • JVerticalScrollBar Class
    Represents a vertical scroll bar.
  • JViewport Class
    Represents the Swing viewport.
  • JWindow Class
    Represents a container that can be displayed anywhere on the user's desktop.
  • OracleFormsApplication Class
    Represents an Oracle Forms application.
  • OracleFormsButton Class
    Represents a push button.
  • OracleFormsCheckbox Class
    Represents a check box.
  • OracleFormsChoice Class
    Represents a choice.
  • OracleFormsComboBox Class
    Represents a combo box.
  • OracleFormsContainer Class
    Represents a component that can contain other Oracle Forms components.
  • OracleFormsHorizontalScrollbar Class
    Represents a horizontal scroll bar.
  • OracleFormsLabel Class
    Represents a class for placing text in a container.
  • OracleFormsListBox Class
    Represents a ListBox.
  • OracleFormsListView Class
    Represents a listview.
  • OracleFormsMenu Class
    Represents a top-level menu.
  • OracleFormsMenuItem Class
    Represents a selectable item inside a Menu.
  • OracleFormsPopList Class
    Represents a PopList.
  • OracleFormsPopupMenu Class
    Represents a context menu.
  • OracleFormsRadioButton Class
    Represents a radio button.
  • OracleFormsScrollbar Class
    Represents a scroll bar.
  • OracleFormsStatusArea Class
    Represents the area containing status information.
  • OracleFormsStatusBar Class
    Represents a status bar.
  • OracleFormsStatusBarItem Class
    Represents an item within a status bar.
  • OracleFormsStatusIndicator Class
    Represents a status indicator.
  • OracleFormsTabBar Class
    Represents a tab bar.
  • OracleFormsTabBarItem Class
    Represents a tab bar item.
  • OracleFormsTabPanel Class
    Represents a container class for components.
  • OracleFormsTextField Class
    Represents an Oracle Forms text field.
  • OracleFormsTitleBar Class
    Represents a title bar.
  • OracleFormsToolBar Class
    Represents a toolbar.
  • OracleFormsToolBarItem Class
    Represents an element in a toolbar.
  • OracleFormsTree Class
    Represents a tree.
  • OracleFormsVerticalScrollbar Class
    Represents a vertical scroll bar.
  • SplitPaneDivider Class
    Represents a split pane divider.
Parent topic: Classes


AbstractButton Class

Description

Defines common behaviors for buttons and menu items.

Availability

This class is supported only on the Open Agent.

Inheritance

AbstractButton is derived from the JComponent class.The following classes derive from the AbstractButton class:
  • JButton
  • JMenuItem
  • JToggleButton

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, AbstractButton has the following methods:

  • Select

Properties

AbstractButton inherits all its properties from JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


Applet Class

Description

Represents the Java Applet in the browser.

Availability

This class is supported only on the Open Agent.

Inheritance

Applet is derived from the AWTContainer class. No classes derive from this class.

Methods

Applet inherits all its methods from AWTContainer, AWTComponent, and AnyWin.

Properties

Applet inherits all its properties from AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


AppletContainer Class

Description

Root element of an Applet in the browser.

Availability

This class is supported only on the Open Agent.

Inheritance

AppletContainer is derived from the AWTContainer class. No classes derive from this class.

Methods

AppletContainer inherits all its methods from AWTContainer, AWTComponent, and AnyWin.

Properties

AppletContainer inherits all its properties from AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


AWTButton Class

Description

Represents a push button.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTButton is derived from the AWTComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from AWTComponent, and AnyWin, AWTButton has the following methods:

  • Select

Properties

AWTButton inherits all its properties from AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


AWTCanvas Class

Description

Represents an empty rectangular area of the screen where the application can draw or trap events from the user.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTCanvas is derived from the AWTComponent class. No classes derive from this class.

Methods

AWTCanvas inherits all its methods from AWTComponent, and AnyWin.

Properties

AWTCanvas inherits all its properties from AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


AWTCheckbox Class

Description

Represents a check box.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTCheckbox is derived from the AWTComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from AWTComponent, and AnyWin, AWTCheckbox has the following methods:

  • Check
  • Toggle
  • Uncheck

Properties

In addition to the properties it inherits from AWTComponent, and AnyWin, AWTCheckbox has the following properties:

  • Checked
Parent topic: Java AWT and Swing Class Reference


AWTCheckboxMenuItem Class

Description

Represents a check box control that can be inserted in a menu item.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTCheckboxMenuItem is derived from the AWTMenuItem class. No classes derive from this class.

Methods

In addition to the methods it inherits from AWTMenuItem, AWTMenuComponent, and AnyWin, AWTCheckboxMenuItem has the following methods:

  • Check
  • Toggle
  • Uncheck

Properties

In addition to the properties it inherits from AWTMenuItem, AWTMenuComponent, and AnyWin, AWTCheckboxMenuItem has the following properties:

  • Checked
Parent topic: Java AWT and Swing Class Reference


AWTChoice Class

Description

Represents a combo box.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTChoice is derived from the AWTComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from AWTComponent, and AnyWin, AWTChoice has the following methods:

  • GetItem
  • Select

Properties

In addition to the properties it inherits from AWTComponent, and AnyWin, AWTChoice has the following properties:

  • ItemCount
  • Items
  • SelectedIndex
  • SelectedItem
Parent topic: Java AWT and Swing Class Reference


AWTComponent Class

Description

AWTComponent is the base class for Java AWT.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTComponent is derived from the AnyWin class.The following classes derive from the AWTComponent class:
  • AWTButton
  • AWTCanvas
  • AWTCheckbox
  • AWTChoice
  • AWTContainer
  • AWTLabel
  • AWTList
  • AWTRadioButton
  • AWTScrollbar
  • AWTTextComponent

Methods

In addition to the methods it inherits from AnyWin, AWTComponent has the following methods:

  • IsFocused
  • ScrollIntoView
  • SetFocus

Properties

In addition to the properties it inherits from AnyWin, AWTComponent has the following properties:

  • AccessibleName
  • AccessibleRole
  • Background
  • Cursor
  • Enabled
  • Focusable
  • Font
  • Foreground
  • Height
  • Name
  • NativeHandle
  • Width
Parent topic: Java AWT and Swing Class Reference


AWTContainer Class

Description

Represents a component that can contain other AWT components.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTContainer is derived from the AWTComponent class.The following classes derive from the AWTContainer class:
  • Applet
  • AppletContainer
  • AWTScrollPane
  • AWTWindow
  • JComponent
  • OracleFormsContainer
  • SplitPaneDivider

Methods

AWTContainer inherits all its methods from AWTComponent, and AnyWin.

Properties

AWTContainer inherits all its properties from AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


AWTDialog Class

Description

Represents a dialog box.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTDialog is derived from the AWTWindow class.The following classes derive from the AWTDialog class:
  • JDialog

Methods

AWTDialog inherits all its methods from AWTWindow, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from AWTWindow, AWTContainer, AWTComponent, and AnyWin, AWTDialog has the following properties:

  • Modal
  • Resizable
  • Title
Parent topic: Java AWT and Swing Class Reference


AWTFrame Class

Description

Represents a top-level window with a title and a border.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTFrame is derived from the AWTWindow class.The following classes derive from the AWTFrame class:
  • JFrame

Methods

AWTFrame inherits all its methods from AWTWindow, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from AWTWindow, AWTContainer, AWTComponent, and AnyWin, AWTFrame has the following properties:

  • Resizable
  • Title
Parent topic: Java AWT and Swing Class Reference


AWTHorizontalScrollbar Class

Description

Represents a horizontal scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTHorizontalScrollbar is derived from the AWTScrollbar class. No classes derive from this class.

Methods

AWTHorizontalScrollbar inherits all its methods from AWTScrollbar, AWTComponent, and AnyWin.

Properties

AWTHorizontalScrollbar inherits all its properties from AWTScrollbar, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


AWTLabel Class

Description

Represents a class for placing text in a container.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTLabel is derived from the AWTComponent class. No classes derive from this class.

Methods

AWTLabel inherits all its methods from AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from AWTComponent, and AnyWin, AWTLabel has the following properties:

  • Alignment
Parent topic: Java AWT and Swing Class Reference


AWTList Class

Description

Represents a list box.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTList is derived from the AWTComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from AWTComponent, and AnyWin, AWTList has the following methods:

  • Deselect
  • DeselectAll
  • DoubleClickItem
  • GetItem
  • Select
  • SelectAll
  • SelectRange

Properties

In addition to the properties it inherits from AWTComponent, and AnyWin, AWTList has the following properties:

  • ItemCount
  • Items
  • MultipleMode
  • SelectedIndex
  • SelectedIndices
  • SelectedItem
  • SelectedItems
Parent topic: Java AWT and Swing Class Reference


AWTMenu Class

Description

Represents a menu component that is accessed from a menu bar.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTMenu is derived from the AWTMenuItem class. No classes derive from this class.

Methods

AWTMenu inherits all its methods from AWTMenuItem, AWTMenuComponent, and AnyWin.

Properties

AWTMenu inherits all its properties from AWTMenuItem, AWTMenuComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


AWTMenuComponent Class

Description

Represents the base class of all menu-related controls.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTMenuComponent is derived from the AnyWin class.The following classes derive from the AWTMenuComponent class:
  • AWTMenuItem

Methods

In addition to the methods it inherits from AnyWin, AWTMenuComponent has the following methods:

  • IsFocused
  • SetFocus

Properties

AWTMenuComponent inherits all its properties from AnyWin.

Parent topic: Java AWT and Swing Class Reference


AWTMenuItem Class

Description

Represents a menu item.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTMenuItem is derived from the AWTMenuComponent class.The following classes derive from the AWTMenuItem class:
  • AWTCheckboxMenuItem
  • AWTMenu

Methods

In addition to the methods it inherits from AWTMenuComponent, and AnyWin, AWTMenuItem has the following methods:

  • Select

Properties

In addition to the properties it inherits from AWTMenuComponent, and AnyWin, AWTMenuItem has the following properties:

  • AccessibleName
  • Enabled
Parent topic: Java AWT and Swing Class Reference


AWTRadioButton Class

Description

Represents a radio button.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTRadioButton is derived from the AWTComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from AWTComponent, and AnyWin, AWTRadioButton has the following methods:

  • Check

Properties

In addition to the properties it inherits from AWTComponent, and AnyWin, AWTRadioButton has the following properties:

  • Checked
Parent topic: Java AWT and Swing Class Reference


AWTScrollbar Class

Description

Represents a scroll bar. This class includes scroll bars that are parts of controls, such as the scroll bar on a list box.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTScrollbar is derived from the AWTComponent class.The following classes derive from the AWTScrollbar class:
  • AWTHorizontalScrollbar
  • AWTVerticalScrollbar

Methods

In addition to the methods it inherits from AWTComponent, and AnyWin, AWTScrollbar has the following methods:

  • Page
  • ScrollTo
  • Step

Properties

In addition to the properties it inherits from AWTComponent, and AnyWin, AWTScrollbar has the following properties:

  • PageSize
  • Position
  • Range
  • StepSize
Parent topic: Java AWT and Swing Class Reference


AWTScrollPane Class

Description

Represents a class that implements automatic horizontal or vertical scrolling for a single child component.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTScrollPane is derived from the AWTContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from AWTContainer, AWTComponent, and AnyWin, AWTScrollPane has the following methods:

  • GetHorizontalBar
  • GetVerticalBar

Properties

In addition to the properties it inherits from AWTContainer, AWTComponent, and AnyWin, AWTScrollPane has the following properties:

  • Position
Parent topic: Java AWT and Swing Class Reference


AWTTextArea Class

Description

Represents a text area.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTTextArea is derived from the AWTTextComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from AWTTextComponent, AWTComponent, and AnyWin, AWTTextArea has the following methods:

  • GetHorizontalBar
  • GetVerticalBar
  • Insert
  • ReplaceRange

Properties

In addition to the properties it inherits from AWTTextComponent, AWTComponent, and AnyWin, AWTTextArea has the following properties:

  • Columns
  • Position
  • Rows
Parent topic: Java AWT and Swing Class Reference


AWTTextComponent Class

Description

Represents the base class for the AWTTextField and AWTTextArea classes.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTTextComponent is derived from the AWTComponent class.The following classes derive from the AWTTextComponent class:
  • AWTTextArea
  • AWTTextField

Methods

In addition to the methods it inherits from AWTComponent, and AnyWin, AWTTextComponent has the following methods:

  • Clear
  • SelectAll
  • SetCaretPosition
  • SetSelectionRange
  • SetText

Properties

In addition to the properties it inherits from AWTComponent, and AnyWin, AWTTextComponent has the following properties:

  • CaretPosition
  • Editable
  • SelectedText
  • SelectionEnd
  • SelectionStart
  • Text
Parent topic: Java AWT and Swing Class Reference


AWTTextField Class

Description

Represents single-line and multi-line text field controls whose text can be modified by the user.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTTextField is derived from the AWTTextComponent class. No classes derive from this class.

Methods

AWTTextField inherits all its methods from AWTTextComponent, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from AWTTextComponent, AWTComponent, and AnyWin, AWTTextField has the following properties:

  • EchoChar
  • EchoCharSet
  • IsPassword
Parent topic: Java AWT and Swing Class Reference


AWTVerticalScrollbar Class

Description

Represents a vertical scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTVerticalScrollbar is derived from the AWTScrollbar class. No classes derive from this class.

Methods

AWTVerticalScrollbar inherits all its methods from AWTScrollbar, AWTComponent, and AnyWin.

Properties

AWTVerticalScrollbar inherits all its properties from AWTScrollbar, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


AWTWindow Class

Description

Represents a top-level window with no borders and no menubar.

Availability

This class is supported only on the Open Agent.

Inheritance

AWTWindow is derived from the AWTContainer class.The following classes derive from the AWTWindow class:
  • AWTDialog
  • AWTFrame
  • JWindow

Methods

AWTWindow inherits all its methods from AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from AWTContainer, AWTComponent, and AnyWin, AWTWindow has the following properties:

  • WindowState
Parent topic: Java AWT and Swing Class Reference


BasicArrowButton Class

Description

Represents a push button with an arrow in one of the cardinal directions.

Availability

This class is supported only on the Open Agent.

Inheritance

BasicArrowButton is derived from the JButton class. No classes derive from this class.

Methods

BasicArrowButton inherits all its methods from JButton, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JButton, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin, BasicArrowButton has the following properties:

  • Direction
Parent topic: Java AWT and Swing Class Reference


JButton Class

Description

Represents a push button.

Availability

This class is supported only on the Open Agent.

Inheritance

JButton is derived from the AbstractButton class.The following classes derive from the JButton class:
  • BasicArrowButton

Methods

JButton inherits all its methods from AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JButton inherits all its properties from AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JCheckBox Class

Description

Represents a check box.

Availability

This class is supported only on the Open Agent.

Inheritance

JCheckBox is derived from the JToggleButton class. No classes derive from this class.

Methods

In addition to the methods it inherits from JToggleButton, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin, JCheckBox has the following methods:

  • Check
  • Uncheck

Properties

JCheckBox inherits all its properties from JToggleButton, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JCheckBoxMenuItem Class

Description

Represents a check box control that can be included in a menu item.

Availability

This class is supported only on the Open Agent.

Inheritance

JCheckBoxMenuItem is derived from the JMenuItem class. No classes derive from this class.

Methods

JCheckBoxMenuItem inherits all its methods from JMenuItem, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JMenuItem, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin, JCheckBoxMenuItem has the following properties:

  • Checked
Parent topic: Java AWT and Swing Class Reference


JColorChooser Class

Description

Represents a color chooser.

Availability

This class is supported only on the Open Agent.

Inheritance

JColorChooser is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JColorChooser has the following methods:

  • SetColor

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JColorChooser has the following properties:

  • Color
Parent topic: Java AWT and Swing Class Reference


JComboBox Class

Description

Represents a combo box.

Availability

This class is supported only on the Open Agent.

Inheritance

JComboBox is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JComboBox has the following methods:

  • GetItem
  • Select

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JComboBox has the following properties:

  • Editable
  • ItemCount
  • Items
  • SelectedIndex
  • SelectedItem
Parent topic: Java AWT and Swing Class Reference


JComponent Class

Description

Represents a class for all components except top-level containers.

Availability

This class is supported only on the Open Agent.

Inheritance

JComponent is derived from the AWTContainer class.The following classes derive from the JComponent class:
  • AbstractButton
  • JColorChooser
  • JComboBox
  • JLabel
  • JLayeredPane
  • JList
  • JMenuBar
  • JPanel
  • JPopupMenu
  • JProgressBar
  • JRootPane
  • JScrollBar
  • JScrollPane
  • JSlider
  • JSpinner
  • JSplitPane
  • JTabbedPane
  • JTable
  • JTableHeader
  • JTextComponent
  • JToolBar
  • JTree
  • JViewport

Methods

JComponent inherits all its methods from AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from AWTContainer, AWTComponent, and AnyWin, JComponent has the following properties:

  • ToolTipText
Parent topic: Java AWT and Swing Class Reference


JDesktopPane Class

Description

Represents a desktop pane.

Availability

This class is supported only on the Open Agent.

Inheritance

JDesktopPane is derived from the JLayeredPane class. No classes derive from this class.

Methods

JDesktopPane inherits all its methods from JLayeredPane, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JDesktopPane inherits all its properties from JLayeredPane, JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JDialog Class

Description

Represents a dialog box.

Availability

This class is supported only on the Open Agent.

Inheritance

JDialog is derived from the AWTDialog class. No classes derive from this class.

Methods

JDialog inherits all its methods from AWTDialog, AWTWindow, AWTContainer, AWTComponent, and AnyWin.

Properties

JDialog inherits all its properties from AWTDialog, AWTWindow, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JEditorPane Class

Description

Represents a text component where you can edit different types of content.

Availability

This class is supported only on the Open Agent.

Inheritance

JEditorPane is derived from the JTextComponent class.The following classes derive from the JEditorPane class:
  • JTextPane

Methods

JEditorPane inherits all its methods from JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin, JEditorPane has the following properties:

  • ContentType
  • FormattedText
  • Page
Parent topic: Java AWT and Swing Class Reference


JFrame Class

Description

Represents a class for an extended version of AWTFrame that adds support for Java Swing.

Availability

This class is supported only on the Open Agent.

Inheritance

JFrame is derived from the AWTFrame class. No classes derive from this class.

Methods

JFrame inherits all its methods from AWTFrame, AWTWindow, AWTContainer, AWTComponent, and AnyWin.

Properties

JFrame inherits all its properties from AWTFrame, AWTWindow, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JHorizontalScrollBar Class

Description

Represents a horizontal scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

JHorizontalScrollBar is derived from the JScrollBar class. No classes derive from this class.

Methods

JHorizontalScrollBar inherits all its methods from JScrollBar, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JHorizontalScrollBar inherits all its properties from JScrollBar, JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JLabel Class

Description

Represents a display area for displaying a short text, image, or both.

Availability

This class is supported only on the Open Agent.

Inheritance

JLabel is derived from the JComponent class. No classes derive from this class.

Methods

JLabel inherits all its methods from JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JLabel has the following properties:

  • Alignment
  • Text
Parent topic: Java AWT and Swing Class Reference


JLayeredPane Class

Description

Represents a layered pane.

Availability

This class is supported only on the Open Agent.

Inheritance

JLayeredPane is derived from the JComponent class.The following classes derive from the JLayeredPane class:
  • JDesktopPane

Methods

JLayeredPane inherits all its methods from JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JLayeredPane inherits all its properties from JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JList Class

Description

Represents a list box.

Availability

This class is supported only on the Open Agent.

Inheritance

JList is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JList has the following methods:

  • ClickItem
  • Deselect
  • DeselectAll
  • DoubleClickItem
  • FindItem
  • GetItem
  • GetItemRect
  • GetItemValue
  • ScrollItemIntoView
  • Select
  • SelectAll
  • SelectRange

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JList has the following properties:

  • ItemCount
  • Items
  • SelectedIndex
  • SelectedIndices
  • SelectedItem
  • SelectedItems
Parent topic: Java AWT and Swing Class Reference


JMenu Class

Description

Represents a menu. A menu is a menu item that has child items.

Availability

This class is supported only on the Open Agent.

Inheritance

JMenu is derived from the JMenuItem class. No classes derive from this class.

Methods

JMenu inherits all its methods from JMenuItem, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JMenu inherits all its properties from JMenuItem, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JMenuBar Class

Description

Represents a menu bar.

Availability

This class is supported only on the Open Agent.

Inheritance

JMenuBar is derived from the JComponent class. No classes derive from this class.

Methods

JMenuBar inherits all its methods from JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JMenuBar inherits all its properties from JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JMenuItem Class

Description

Represents a menu item.

Availability

This class is supported only on the Open Agent.

Inheritance

JMenuItem is derived from the AbstractButton class.The following classes derive from the JMenuItem class:
  • JCheckBoxMenuItem
  • JMenu
  • JRadioButtonMenuItem

Methods

In addition to the methods it inherits from AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin, JMenuItem has the following methods:

  • Select

Properties

JMenuItem inherits all its properties from AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JPanel Class

Description

Represents a container class for lightweight components.

Availability

This class is supported only on the Open Agent.

Inheritance

JPanel is derived from the JComponent class. No classes derive from this class.

Methods

JPanel inherits all its methods from JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JPanel inherits all its properties from JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JPasswordField Class

Description

Represents a single-line field that does not show the original characters.

Availability

This class is supported only on the Open Agent.

Inheritance

JPasswordField is derived from the JTextField class. No classes derive from this class.

Methods

JPasswordField inherits all its methods from JTextField, JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JTextField, JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin, JPasswordField has the following properties:

  • EchoChar
  • EchoCharSet
Parent topic: Java AWT and Swing Class Reference


JPopupMenu Class

Description

Represents a context menu.

Availability

This class is supported only on the Open Agent.

Inheritance

JPopupMenu is derived from the JComponent class. No classes derive from this class.

Methods

JPopupMenu inherits all its methods from JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JPopupMenu inherits all its properties from JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JProgressBar Class

Description

Displays the progress of an operation.

Availability

This class is supported only on the Open Agent.

Inheritance

JProgressBar is derived from the JComponent class. No classes derive from this class.

Methods

JProgressBar inherits all its methods from JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JProgressBar has the following properties:

  • Indeterminate
  • Maximum
  • Minimum
  • ProgressString
  • Value
Parent topic: Java AWT and Swing Class Reference


JRadioButton Class

Description

Represents a radio button.

Availability

This class is supported only on the Open Agent.

Inheritance

JRadioButton is derived from the JToggleButton class. No classes derive from this class.

Methods

In addition to the methods it inherits from JToggleButton, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin, JRadioButton has the following methods:

  • Check

Properties

JRadioButton inherits all its properties from JToggleButton, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JRadioButtonMenuItem Class

Description

Represents a radio button menu item.

Availability

This class is supported only on the Open Agent.

Inheritance

JRadioButtonMenuItem is derived from the JMenuItem class. No classes derive from this class.

Methods

JRadioButtonMenuItem inherits all its methods from JMenuItem, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JMenuItem, AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin, JRadioButtonMenuItem has the following properties:

  • Checked
Parent topic: Java AWT and Swing Class Reference


JRootPane Class

Description

Represents a root pane.

Availability

This class is supported only on the Open Agent.

Inheritance

JRootPane is derived from the JComponent class. No classes derive from this class.

Methods

JRootPane inherits all its methods from JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JRootPane inherits all its properties from JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JScrollBar Class

Description

Represents a scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

JScrollBar is derived from the JComponent class.The following classes derive from the JScrollBar class:
  • JHorizontalScrollBar
  • JVerticalScrollBar

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JScrollBar has the following methods:

  • Page
  • ScrollTo
  • Step

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JScrollBar has the following properties:

  • PageSize
  • Position
  • Range
  • StepSize
Parent topic: Java AWT and Swing Class Reference


JScrollPane Class

Description

Represents a scroll pane which allows scrolling its content which may be larger than the pane itself.

Availability

This class is supported only on the Open Agent.

Inheritance

JScrollPane is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JScrollPane has the following methods:

  • GetHorizontalBar
  • GetVerticalBar
  • ScrollTo

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JScrollPane has the following properties:

  • Position
Parent topic: Java AWT and Swing Class Reference


JSlider Class

Description

Represents a slider control which can select a value within a range.

Availability

This class is supported only on the Open Agent.

Inheritance

JSlider is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JSlider has the following methods:

  • SetPosition

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JSlider has the following properties:

  • Inverted
  • Maximum
  • Minimum
  • Position
Parent topic: Java AWT and Swing Class Reference


JSpinner Class

Description

Represents a spinner control which can iterate a sequence of values.

Availability

This class is supported only on the Open Agent.

Inheritance

JSpinner is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JSpinner has the following methods:

  • Next
  • Previous

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JSpinner has the following properties:

  • Value
Parent topic: Java AWT and Swing Class Reference


JSplitPane Class

Description

Represents a split pane control which divides two components horizontally or vertically.

Availability

This class is supported only on the Open Agent.

Inheritance

JSplitPane is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JSplitPane has the following methods:

  • SetPosition

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JSplitPane has the following properties:

  • DividerLocation
  • DividerSize
  • MaximumDividerLocation
  • MinimumDividerLocation
Parent topic: Java AWT and Swing Class Reference


JTabbedPane Class

Description

Represents a tabbed pane.

Availability

This class is supported only on the Open Agent.

Inheritance

JTabbedPane is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JTabbedPane has the following methods:

  • GetTabIndex
  • GetTabTitle
  • IsTabEnabled
  • Select

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JTabbedPane has the following properties:

  • SelectedTab
  • SelectedTabIndex
  • TabCount
  • TabRunCount
Parent topic: Java AWT and Swing Class Reference


JTable Class

Description

Represents a table control which has rows and columns.

Availability

This class is supported only on the Open Agent.

Inheritance

JTable is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JTable has the following methods:

  • ClearSelection
  • ClickCell
  • DoubleClickCell
  • FindCell
  • GetCellText
  • GetCellValue
  • GetColumnName
  • IsCellEditable
  • IsCellSelected
  • IsColumnSelected
  • IsRowSelected
  • MoveColumn
  • ResizeColumn
  • ScrollCellIntoView
  • SelectAll
  • SelectColumn
  • SelectRow
  • SetCellValue

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JTable has the following properties:

  • AllCellTexts
  • AllCellValues
  • ColumnCount
  • EditingColumn
  • EditingRow
  • RowCount
  • SelectedColumn
  • SelectedColumns
  • SelectedRow
  • SelectedRows
Parent topic: Java AWT and Swing Class Reference


JTableHeader Class

Description

Represents table header class for the table component.

Availability

This class is supported only on the Open Agent.

Inheritance

JTableHeader is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JTableHeader has the following methods:

  • ClickColumnHeader

Properties

JTableHeader inherits all its properties from JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JTextArea Class

Description

Represents a multiple-line area control that displays plain text.

Availability

This class is supported only on the Open Agent.

Inheritance

JTextArea is derived from the JTextComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin, JTextArea has the following methods:

  • Insert
  • ReplaceRange

Properties

In addition to the properties it inherits from JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin, JTextArea has the following properties:

  • Columns
  • Rows
Parent topic: Java AWT and Swing Class Reference


JTextComponent Class

Description

Represents a text control that can be marked with attributes that are represented graphically.

Availability

This class is supported only on the Open Agent.

Inheritance

JTextComponent is derived from the JComponent class.The following classes derive from the JTextComponent class:
  • JEditorPane
  • JTextArea
  • JTextField

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JTextComponent has the following methods:

  • Clear
  • SelectAll
  • SetCaretPosition
  • SetSelectionRange
  • SetText

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JTextComponent has the following properties:

  • CaretPosition
  • Editable
  • SelectedText
  • SelectionEnd
  • SelectionStart
  • Text
Parent topic: Java AWT and Swing Class Reference


JTextField Class

Description

Represents a single-line text field control whose text can be modified by the user.

Availability

This class is supported only on the Open Agent.

Inheritance

JTextField is derived from the JTextComponent class.The following classes derive from the JTextField class:
  • JPasswordField

Methods

JTextField inherits all its methods from JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin, JTextField has the following properties:

  • Alignment
Parent topic: Java AWT and Swing Class Reference


JTextPane Class

Description

Represents a text pane control that can be marked with attributes that are represented graphically.

Availability

This class is supported only on the Open Agent.

Inheritance

JTextPane is derived from the JEditorPane class. No classes derive from this class.

Methods

JTextPane inherits all its methods from JEditorPane, JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JEditorPane, JTextComponent, JComponent, AWTContainer, AWTComponent, and AnyWin, JTextPane has the following properties:

  • CharacterAttributes
  • LogicalStyle
  • ParagraphAttributes
Parent topic: Java AWT and Swing Class Reference


JToggleButton Class

Description

Represents a two-state button.

Availability

This class is supported only on the Open Agent.

Inheritance

JToggleButton is derived from the AbstractButton class.The following classes derive from the JToggleButton class:
  • JCheckBox
  • JRadioButton

Methods

In addition to the methods it inherits from AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin, JToggleButton has the following methods:

  • Toggle

Properties

In addition to the properties it inherits from AbstractButton, JComponent, AWTContainer, AWTComponent, and AnyWin, JToggleButton has the following properties:

  • Selected
Parent topic: Java AWT and Swing Class Reference


JToolBar Class

Description

Represents a toolbar.

Availability

This class is supported only on the Open Agent.

Inheritance

JToolBar is derived from the JComponent class. No classes derive from this class.

Methods

JToolBar inherits all its methods from JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JToolBar inherits all its properties from JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JTree Class

Description

Represents a tree.

Availability

This class is supported only on the Open Agent.

Inheritance

JTree is derived from the JComponent class. No classes derive from this class.

Methods

In addition to the methods it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JTree has the following methods:

  • CancelEditing
  • ClearSelection
  • ClickNode
  • Collapse
  • CollapseAll
  • DoubleClickNode
  • Expand
  • ExpandAll
  • GetItemRect
  • IsExpanded
  • IsPathEditable
  • ScrollPathIntoView
  • Select
  • StartEditing
  • StopEditing

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JTree has the following properties:

  • IsEditable
  • IsEditing
  • SelectedItemPath
  • SelectedItemPaths
  • SelectedItemText
  • SelectionCount
  • VisibleItemPaths
Parent topic: Java AWT and Swing Class Reference


JVerticalScrollBar Class

Description

Represents a vertical scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

JVerticalScrollBar is derived from the JScrollBar class. No classes derive from this class.

Methods

JVerticalScrollBar inherits all its methods from JScrollBar, JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

JVerticalScrollBar inherits all its properties from JScrollBar, JComponent, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


JViewport Class

Description

Represents the Swing viewport.

Availability

This class is supported only on the Open Agent.

Inheritance

JViewport is derived from the JComponent class. No classes derive from this class.

Methods

JViewport inherits all its methods from JComponent, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from JComponent, AWTContainer, AWTComponent, and AnyWin, JViewport has the following properties:

  • ViewRectangle
Parent topic: Java AWT and Swing Class Reference


JWindow Class

Description

Represents a container that can be displayed anywhere on the user's desktop.

Availability

This class is supported only on the Open Agent.

Inheritance

JWindow is derived from the AWTWindow class. No classes derive from this class.

Methods

JWindow inherits all its methods from AWTWindow, AWTContainer, AWTComponent, and AnyWin.

Properties

JWindow inherits all its properties from AWTWindow, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsApplication Class

Description

Represents an Oracle Forms application.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsApplication is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

OracleFormsApplication inherits all its methods from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsApplication has the following properties:

  • SplashScreenRunning
Parent topic: Java AWT and Swing Class Reference


OracleFormsButton Class

Description

Represents a push button.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsButton is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsButton has the following methods:

  • Select

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsButton has the following properties:

  • Default
Parent topic: Java AWT and Swing Class Reference


OracleFormsCheckbox Class

Description

Represents a check box.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsCheckbox is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsCheckbox has the following methods:

  • Check
  • Uncheck

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsCheckbox has the following properties:

  • Checked
Parent topic: Java AWT and Swing Class Reference


OracleFormsChoice Class

Description

Represents a choice.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsChoice is derived from the OracleFormsContainer class.The following classes derive from the OracleFormsChoice class:
  • OracleFormsComboBox
  • OracleFormsListBox
  • OracleFormsPopList

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsChoice has the following methods:

  • GetItemText
  • Select

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsChoice has the following properties:

  • ItemCount
  • Items
  • SelectedIndex
  • SelectedItem
Parent topic: Java AWT and Swing Class Reference


OracleFormsComboBox Class

Description

Represents a combo box.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsComboBox is derived from the OracleFormsChoice class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsChoice, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsComboBox has the following methods:

  • SetText

Properties

In addition to the properties it inherits from OracleFormsChoice, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsComboBox has the following properties:

  • DropDownOpen
  • Text
Parent topic: Java AWT and Swing Class Reference


OracleFormsContainer Class

Description

Represents a component that can contain other Oracle Forms components.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsContainer is derived from the AWTContainer class.The following classes derive from the OracleFormsContainer class:
  • OracleFormsApplication
  • OracleFormsButton
  • OracleFormsCheckbox
  • OracleFormsChoice
  • OracleFormsLabel
  • OracleFormsListView
  • OracleFormsMenu
  • OracleFormsMenuItem
  • OracleFormsRadioButton
  • OracleFormsScrollbar
  • OracleFormsStatusArea
  • OracleFormsStatusBar
  • OracleFormsStatusBarItem
  • OracleFormsStatusIndicator
  • OracleFormsTabBar
  • OracleFormsTabBarItem
  • OracleFormsTabPanel
  • OracleFormsTextField
  • OracleFormsTitleBar
  • OracleFormsToolBar
  • OracleFormsToolBarItem
  • OracleFormsTree

Methods

OracleFormsContainer inherits all its methods from AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsContainer inherits all its properties from AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsHorizontalScrollbar Class

Description

Represents a horizontal scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsHorizontalScrollbar is derived from the OracleFormsScrollbar class. No classes derive from this class.

Methods

OracleFormsHorizontalScrollbar inherits all its methods from OracleFormsScrollbar, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsHorizontalScrollbar inherits all its properties from OracleFormsScrollbar, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsLabel Class

Description

Represents a class for placing text in a container.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsLabel is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

OracleFormsLabel inherits all its methods from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsLabel inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsListBox Class

Description

Represents a ListBox.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsListBox is derived from the OracleFormsChoice class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsChoice, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsListBox has the following methods:

  • ClickItem
  • DoubleClickItem
  • GetHorizontalScrollbar
  • GetVerticalScrollbar
  • HorizontalScrollbarPage
  • HorizontalScrollbarScrollTo
  • HorizontalScrollbarScrollToMax
  • HorizontalScrollbarScrollToMin
  • HorizontalScrollbarStep
  • VerticalScrollbarPage
  • VerticalScrollbarScrollTo
  • VerticalScrollbarScrollToMax
  • VerticalScrollbarScrollToMin
  • VerticalScrollbarStep

Properties

In addition to the properties it inherits from OracleFormsChoice, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsListBox has the following properties:

  • HorizontalScrollbarPageSize
  • HorizontalScrollbarPosition
  • HorizontalScrollbarRange
  • HorizontalScrollbarStepSize
  • VerticalScrollbarPageSize
  • VerticalScrollbarPosition
  • VerticalScrollbarRange
  • VerticalScrollbarStepSize
Parent topic: Java AWT and Swing Class Reference


OracleFormsListView Class

Description

Represents a listview.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsListView is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsListView has the following methods:

  • ClearSelection
  • GetCellText
  • GetColumnName
  • GetColumnWidth
  • GetHorizontalScrollbar
  • GetVerticalScrollbar
  • HorizontalScrollbarPage
  • HorizontalScrollbarScrollTo
  • HorizontalScrollbarScrollToMax
  • HorizontalScrollbarScrollToMin
  • HorizontalScrollbarStep
  • IsRowVisible
  • ScrollToRow
  • SelectRow
  • SetColumnWidth
  • VerticalScrollbarPage
  • VerticalScrollbarScrollTo
  • VerticalScrollbarScrollToMax
  • VerticalScrollbarScrollToMin
  • VerticalScrollbarStep

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsListView has the following properties:

  • AllCellTexts
  • ColumnCount
  • FocusedRow
  • HorizontalScrollbarPageSize
  • HorizontalScrollbarPosition
  • HorizontalScrollbarRange
  • HorizontalScrollbarStepSize
  • RowCount
  • SelectedRow
  • VerticalScrollbarPageSize
  • VerticalScrollbarPosition
  • VerticalScrollbarRange
  • VerticalScrollbarStepSize
Parent topic: Java AWT and Swing Class Reference


OracleFormsMenu Class

Description

Represents a top-level menu.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsMenu is derived from the OracleFormsContainer class.The following classes derive from the OracleFormsMenu class:
  • OracleFormsPopupMenu

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsMenu has the following methods:

  • Check
  • IsChecked
  • Select
  • Uncheck

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsMenu has the following properties:

  • Checked
Parent topic: Java AWT and Swing Class Reference


OracleFormsMenuItem Class

Description

Represents a selectable item inside a Menu.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsMenuItem is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsMenuItem has the following methods:

  • Check
  • Select
  • Uncheck

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsMenuItem has the following properties:

  • Checked
Parent topic: Java AWT and Swing Class Reference


OracleFormsPopList Class

Description

Represents a PopList.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsPopList is derived from the OracleFormsChoice class. No classes derive from this class.

Methods

OracleFormsPopList inherits all its methods from OracleFormsChoice, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

In addition to the properties it inherits from OracleFormsChoice, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsPopList has the following properties:

  • DropDownOpen
Parent topic: Java AWT and Swing Class Reference


OracleFormsPopupMenu Class

Description

Represents a context menu.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsPopupMenu is derived from the OracleFormsMenu class. No classes derive from this class.

Methods

OracleFormsPopupMenu inherits all its methods from OracleFormsMenu, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsPopupMenu inherits all its properties from OracleFormsMenu, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsRadioButton Class

Description

Represents a radio button.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsRadioButton is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsRadioButton has the following methods:

  • Check

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsRadioButton has the following properties:

  • Checked
Parent topic: Java AWT and Swing Class Reference


OracleFormsScrollbar Class

Description

Represents a scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsScrollbar is derived from the OracleFormsContainer class.The following classes derive from the OracleFormsScrollbar class:
  • OracleFormsHorizontalScrollbar
  • OracleFormsVerticalScrollbar

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsScrollbar has the following methods:

  • ScrollToMax
  • ScrollToMin

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsScrollbar has the following properties:

  • PageSize
  • Position
  • Range
  • StepSize
Parent topic: Java AWT and Swing Class Reference


OracleFormsStatusArea Class

Description

Represents the area containing status information.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsStatusArea is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

OracleFormsStatusArea inherits all its methods from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsStatusArea inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsStatusBar Class

Description

Represents a status bar.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsStatusBar is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

OracleFormsStatusBar inherits all its methods from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsStatusBar inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsStatusBarItem Class

Description

Represents an item within a status bar.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsStatusBarItem is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

OracleFormsStatusBarItem inherits all its methods from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsStatusBarItem inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsStatusIndicator Class

Description

Represents a status indicator.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsStatusIndicator is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

OracleFormsStatusIndicator inherits all its methods from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsStatusIndicator inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsTabBar Class

Description

Represents a tab bar.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsTabBar is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsTabBar has the following methods:

  • GetTabIndex
  • GetTabTitle
  • IsTabEnabled
  • Select

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsTabBar has the following properties:

  • SelectedTab
  • TabCount
Parent topic: Java AWT and Swing Class Reference


OracleFormsTabBarItem Class

Description

Represents a tab bar item.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsTabBarItem is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsTabBarItem has the following methods:

  • Select

Properties

OracleFormsTabBarItem inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsTabPanel Class

Description

Represents a container class for components.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsTabPanel is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

OracleFormsTabPanel inherits all its methods from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsTabPanel inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsTextField Class

Description

Represents an Oracle Forms text field.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsTextField is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsTextField has the following methods:

  • Clear
  • GetHorizontalScrollbar
  • GetVerticalScrollbar
  • HorizontalScrollbarPage
  • HorizontalScrollbarScrollTo
  • HorizontalScrollbarScrollToMax
  • HorizontalScrollbarScrollToMin
  • HorizontalScrollbarStep
  • SelectAll
  • SetCaretPosition
  • SetSelectionRange
  • SetText
  • VerticalScrollbarPage
  • VerticalScrollbarScrollTo
  • VerticalScrollbarScrollToMax
  • VerticalScrollbarScrollToMin
  • VerticalScrollbarStep

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsTextField has the following properties:

  • CaretPosition
  • Editable
  • HorizontalScrollbarPageSize
  • HorizontalScrollbarPosition
  • HorizontalScrollbarRange
  • HorizontalScrollbarStepSize
  • IsPassword
  • PasswordChar
  • SelectedText
  • SelectionEnd
  • SelectionStart
  • Text
  • VerticalScrollbarPageSize
  • VerticalScrollbarPosition
  • VerticalScrollbarRange
  • VerticalScrollbarStepSize
Parent topic: Java AWT and Swing Class Reference


OracleFormsTitleBar Class

Description

Represents a title bar.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsTitleBar is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

OracleFormsTitleBar inherits all its methods from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsTitleBar inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsToolBar Class

Description

Represents a toolbar.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsToolBar is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

OracleFormsToolBar inherits all its methods from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsToolBar inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsToolBarItem Class

Description

Represents an element in a toolbar.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsToolBarItem is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsToolBarItem has the following methods:

  • Select

Properties

OracleFormsToolBarItem inherits all its properties from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


OracleFormsTree Class

Description

Represents a tree.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsTree is derived from the OracleFormsContainer class. No classes derive from this class.

Methods

In addition to the methods it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsTree has the following methods:

  • ClickItem
  • Collapse
  • CollapseAll
  • DoubleClickItem
  • Expand
  • ExpandAll
  • GetHorizontalScrollbar
  • GetVerticalScrollbar
  • HorizontalScrollbarPage
  • HorizontalScrollbarScrollTo
  • HorizontalScrollbarScrollToMax
  • HorizontalScrollbarScrollToMin
  • HorizontalScrollbarStep
  • IsExpanded
  • IsVisible
  • ScrollItemIntoView
  • Select
  • VerticalScrollbarPage
  • VerticalScrollbarScrollTo
  • VerticalScrollbarScrollToMax
  • VerticalScrollbarScrollToMin
  • VerticalScrollbarStep

Properties

In addition to the properties it inherits from OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin, OracleFormsTree has the following properties:

  • HorizontalScrollbarPageSize
  • HorizontalScrollbarPosition
  • HorizontalScrollbarRange
  • HorizontalScrollbarStepSize
  • SelectedItemPath
  • SelectedItemText
  • VerticalScrollbarPageSize
  • VerticalScrollbarPosition
  • VerticalScrollbarRange
  • VerticalScrollbarStepSize
Parent topic: Java AWT and Swing Class Reference


OracleFormsVerticalScrollbar Class

Description

Represents a vertical scroll bar.

Availability

This class is supported only on the Open Agent.

Inheritance

OracleFormsVerticalScrollbar is derived from the OracleFormsScrollbar class. No classes derive from this class.

Methods

OracleFormsVerticalScrollbar inherits all its methods from OracleFormsScrollbar, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Properties

OracleFormsVerticalScrollbar inherits all its properties from OracleFormsScrollbar, OracleFormsContainer, AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


SplitPaneDivider Class

Description

Represents a split pane divider.

Availability

This class is supported only on the Open Agent.

Inheritance

SplitPaneDivider is derived from the AWTContainer class. No classes derive from this class.

Methods

SplitPaneDivider inherits all its methods from AWTContainer, AWTComponent, and AnyWin.

Properties

SplitPaneDivider inherits all its properties from AWTContainer, AWTComponent, and AnyWin.

Parent topic: Java AWT and Swing Class Reference


Win32 Classes

Lists the available classes for testing Win32 controls.

  • CheckBoxToolItem Class
    The class for a check box element in a toolbar control.
  • DropDownToolItem Class
    The class for drop-down element in a toolbar control.
  • Group Class
    Group is the class used to combine controls to give the user visual hints that those controls belong together.
  • HeaderEx Class
    The class for list header controls.
  • Item Class
    The class for abstract base classes, such as RadioListToolItem.
  • Link Class
    Link is the class that opens the topic location referenced in the source.
  • ListViewEx Class
    ListViewEx is the class for elaborated list controls that support multiple ways of viewing a list of nonhierarchical data.
  • MonthCalendar Class
    The class that selects the calendar date and time.
  • Pager Class
    The class for tabbed, multi-page dialog boxes, and for button bars for the Open Agent.
  • PushToolItem Class
    The class for a pushbutton element in a toolbar control.
  • RadioListToolItem Class
    RadioListToolItem is the class for a radio button element in a toolbar control.
  • ToolItem Class
    The class for a tool item in a toolbar control.
  • UpDownEx Class
    The class for up-down controls.
Parent topic: Classes


HeaderEx Class

Description

HeaderEx is the class for list header controls. Headers are most commonly used in controls of the ListViewEx class.

Availability

The HeaderEx class is available only in Windows-based applications that use the Open Agent. This class offers slightly different functions and properties from those in the Header class, which is available in winclass.inc for use with the Classic Agent.

Inheritance

HeaderEx derives from the Control class; no classes derive from the HeaderEx class.

Properties and Methods

In addition to the properties and methods it inherits from the AnyWin class and Control class, HeaderEx has the following properties and methods:

  • ColumnCount Property
    Returns the number of columns per item in the grid, header, table, or tree.
  • ColumnOrder Property
    The header's item indices as they are currently ordered.
  • DividerDoubleSelect Method
    Double-clicks the divider on the right side of the specified item.
  • DoubleSelect Method (HeaderEx)
    Double-clicks an item.
  • GetColumnTitle Function
    Returns the title of a specified header item.
  • GetColumnWidth Function
    Returns the width of a specified column.
  • Resize Method (HeaderEx)
    Resizes an item of the header.
  • Select Method (HeaderEx)
    Selects an item or button.
Parent topic: Win32 Classes
Related reference
AnyWin Class
Control Class
ListViewEx Class


ColumnOrder Property

Class

HeaderEx.

Description

The header's item indices as they are currently ordered.

Notes

This property is supported only in scripts for Windows-based applications that use the Open Agent.

Data Type

LIST OF INTEGER.

Access

Read only.

Parent topic: HeaderEx Class


DividerDoubleSelect Method

Class

HeaderEx.

Action

Double-clicks the divider on the right side of the specified item.

Availability

This method is supported only in scripts for Windows-based applications that use the Open Agent.

Syntax

DividerDoubleSelect (item, button)
Variable | Description
item | The path or index of the item to select. LISTITEM.
button | The button to select. 1=left, 2=right, 3=middle. INTEGER.

Notes

DividerDoubleSelect scrolls the specified item into view and then double-clicks the divider on the right side of the item.

Parent topic: HeaderEx Class


DoubleSelect Method (HeaderEx)

Class

HeaderEx.

Action

Double-clicks an item.

Availability

This method is supported only in scripts for Windows-based applications that use the Open Agent.

Syntax

DoubleSelect (item, button)
Variable | Description
item | The path or index of the item to double-click. LISTITEM.
button | The index of the mouse button to use to perform the double-click. 1=left, 2=right, 3=middle. INTEGER.

Notes

DoubleSelect scrolls the specified item into view and then double-clicks it.

Parent topic: HeaderEx Class


GetColumnTitle Function

Class

HeaderEx.

Action

Returns the title of a specified header item.

Availability

This method is supported only in scripts for Windows-based applications that use the Open Agent.

Syntax

GetColumnTitle (itemIndex)
Variable | Description
itemIndex | The index of the item. INTEGER.

Notes

The GetColumnTitle method returns the title of the columns heading. If the column with the specified index is not available, GetColumnTitle throws an E_ITEM_INDEX_INVALID exception.

Example

This example returns the column title of the Catalog page of a Windows-based application.

Print(CatalogPage.GetColumnTitle(2))

// Result:
// Item Name
Parent topic: HeaderEx Class


GetColumnWidth Function

Class

HeaderEx.

Action

Returns the width of a specified column.

Availability

This method is supported only in scripts for Windows-based applications that use the Open Agent.

Syntax

GetColumnWidth (item)
Variable | Description
item | The item to return the width for. LISTITEM.
Parent topic: HeaderEx Class


Resize Method (HeaderEx)

Class

HeaderEx.

Action

Resizes an item of the header.

Availability

This method is supported only in scripts for Windows-based applications that use the Open Agent.

Syntax

Resize (item, width)
Variable | Description
item | The item to resize. LISTITEM.
width | The new width of the header, in pixels. INTEGER.

Example

Resize (Address, 50)
Parent topic: HeaderEx Class


Select Method (HeaderEx)

Class

HeaderEx.

Action

Selects an item or button.

Availability

This method is supported only in scripts for Windows-based applications that use the Open Agent.

Syntax

Select (item, button)
Variable | Description
item | The path or index of the item to select. LISTITEM.
button | The index of the mouse button to use for selection. 1=left, 2=right, 3=middle. INTEGER.

Notes

Select selects an item by scrolling the item into view (where applicable) and clicking it with the mouse, if it is not already selected.

Parent topic: HeaderEx Class


ListViewEx Class

Description

ListViewEx is the class for elaborated list controls that support multiple ways of viewing a list of nonhierarchical data. These views include large and small rearrangable icons and a detail or report view. ListViewEx supports nonhierarchical views.

Availability

The ListViewEx class is available only in Windows-based applications that use the Open Agent. This class offers slightly different functions and properties from those in the ListView class, which is available in winclass.inc for use with the Classic Agent.

Inheritance

ListViewEx derives from the Control class; no classes derive from this class.

Identification of ListViewEx Items

Items in a listview can be identified by any of the following:
Identifier
Example
Absolute Index
someListView.Select(1) // selects the first item
Name
 someListView.Select("TheItem") // selects the first item named "TheItem"
Name and Sibling Index
someListView.Select("TheItem#3") // selects the third item named "TheItem"

The preceding identifiers only consider the first column. Wildcards, such as "*", are not supported. However, you can use the ColumnCount property and the GetItemText method to access other columns.

Properties and Methods

In addition to the properties and methods it inherits from the AnyWin class and Control class, ListViewEx has the following properties and methods:

  • AllowsCheck Property (ListViewEx)
    Indicates whether this list view supports checking items.
  • AllowsMultiSelect Property
    Whether the list view or table supports selecting multiple items.
  • Check Method (ListViewEx)
    Checks an item.
  • CheckedIndices Property (ListViewEx)
    Gets a list containing the indices of the checked items.
  • CheckedItems Property (ListViewEx)
    Gets a list containing the checked items.
  • ColumnCount Property
    Returns the number of columns per item in the grid, header, table, or tree.
  • DoubleSelect Method (ListViewEx)
    Double-clicks an item.
  • ExtendSelect Method (ListViewEx)
    Selects a range of items by extending the selection in the listview.
  • GetContents Function (ListViewEx)
    Returns the contents of a listview control.
  • GetItemImageIndex (ListViewEx)
    Returns the index into the image list or the index into the state image list for listviews that contain icons.
  • GetItemIndex Function (ListViewEx)
    Returns the index of an item in the listview.
  • GetItemRect Function (ListViewEx)
    Returns the size and position of the item relative to the listview.
  • GetItemText Function (ListViewEx)
    Returns the text contained in a column of a listview item.
  • ItemCount Property
    The number of items contained in the listbox, list view, coolbar, tab folder, row, or expandbar, or the number of rows in a table.
  • Items Property
    A list containing all items of the domain up and down controls, listbox, or listview.
  • MultiSelect Method (ListViewEx)
    Adds an item in the list to the set of currently selected items.
  • MultiUnselect Method (ListViewEx)
    Removes an item in the list from the set of selected items.
  • Select Method (ListViewEx)
    Selects an item from the listview.
  • SelectedIndices Property
    A list containing the indices of the selected items.
  • SelectedItems Property (DomListBox ListViewEx)
    A list containing the selected items.
  • SetItemFocus Method (ListViewEx)
    Gives focus to the item in the list.
  • Uncheck Method (ListViewEx)
    Unchecks an item.
Parent topic: Win32 Classes
Related reference
AnyWin Class
Control Class
TreeView Class


AllowsCheck Property (ListViewEx)

Class

ListViewEx.

Action

Indicates whether this list view supports checking items.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

Boolean.

Access

Read only.
Parent topic: ListViewEx Class


Check Method (ListViewEx)

Class

ListViewEx.

Action

Checks an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Check(item)
Variable | Description
item | The item to check. LISTITEM.
Parent topic: ListViewEx Class


CheckedIndices Property (ListViewEx)

Class

ListViewEx.

Action

Gets a list containing the indices of the checked items.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF INTEGER.

Access

Read only.
Parent topic: ListViewEx Class


CheckedItems Property (ListViewEx)

Class

ListViewEx.

Action

Gets a list containing the checked items.

Availability

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF INTEGER.

Access

Read only.
Parent topic: ListViewEx Class


DoubleSelect Method (ListViewEx)

Class

ListViewEx.

Action

Double-clicks an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

DoubleSelect (item, modifiers)
Variable | Description
item | The item to double-click. LISTITEM.
modifiers | Optional: The modifier keys to press while double-clicking the item. Alt, Shift, and Ctrl. Use a modifier to click multiple items. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Notes

DoubleSelect scrolls the specified item into view and then double-clicks it.

Example

TestApplication.ListViewDialog.TheListView.DoubleSelect("TheItem")
Parent topic: ListViewEx Class


ExtendSelect Method (ListViewEx)

Class

ListViewEx.

Action

Selects a range of items by extending the selection in the listview.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

listview.ExtendSelect (item)
Variable | Description
item | The item to which to extend the selection. LISTITEM.

Notes

ExtendSelect extends the list selection by scrolling the item into view and selecting it.

ExtendSelect requires that the list already has a selected item. Precede the call with a call to Select to select the first item.

Example

// Selects the items between TheFirstItem and TheLastItem, inclusive
TestApplication.ListViewDialog.Elements.Select("TheFirstItem")
TestApplication.ListViewDialog.Elements.ExtendSelect("TheLastItem")
Parent topic: ListViewEx Class


GetContents Function (ListViewEx)

Class

ListViewEx.

Action

Returns the contents of a listview control. Each returned item is delimited by a semicolon.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

lsContents = listview.GetContents ([iColumn, bRawMode])
Variable | Description
lsContents | The listview contents. LIST OF STRING.
iColumn | Optional: In Details view, you can specify this argument to get only the contents of a specific column. INTEGER.
bRawMode | Optional: Prevents spaces from being trimmed from items. BOOLEAN.

Notes

If you set iColumn to NULL the parameter value is ignored. To return all contents, regardless of a specific column, call GetContents(NULL, TRUE).

If you set bRawMode to FALSE, accelerator characters are trimmed. For example, AB&CD will result in ABCD, as the ampersand character (&) is treated as an accelerator. To return complete text, set bRawMode to TRUE. In the previous example, AB&CD is returned as AB&CD.

Example

Verify(TestApplication.ListViewDialog.GetContents(NULL, TRUE),lsExpectedContents)
Parent topic: ListViewEx Class


GetItemImageIndex (ListViewEx)

Class

ListViewEx.

Action

Returns the index into the image list or the index into the state image list for listviews that contain icons.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

iIndex = object.GetItemImageIndex (liItem, fromStateImageList)
Variable | Description
iIndex | Index to the icon of the item in the image list or to the state of the icon in the state image list. INTEGER.
liItem | Item in the listview. LISTITEM.
fromStateImageList | If FALSE, then the GetItemImageIndex method returns the index to the icon of the item in the image list. If TRUE, then the GetItemImageIndex method returns the index to the state of the icon in the state image list. FALSE by default. BOOLEAN.

Example

INTEGER iItem, iIndex
STRING sText
for iItem = 2 to 3
sText = Options.Advanced.OptionsTreeView.GetItemText(iItem)
iIndex = Options.Advanced.OptionsTreeView.GetItemImageIndex(iItem)
Print("{sText}: {iIndex}")
Parent topic: ListViewEx Class


GetItemIndex Function (ListViewEx)

Class

ListViewEx.

Action

Returns the index of an item in the listview.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

iIndex = listView.GetItemIndex(sItem)
Variable | Description
iIndex | The item index. INTEGER.
sItem | The item to find. STRING.

Notes

If the item sItem is not found, GetItemIndex returns zero (0).

Example

INTEGER iIndex
// Determine which number d: is in list of drives
TextEditor.File.Open.Pick()
iIndex = Open.Drives.GetItemIndex("d:*")
Parent topic: ListViewEx Class


GetItemRect Function (ListViewEx)

Class

ListViewEx.

Action

Returns the size and position of the item relative to the listview.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SizeRect = listview.GetItemRect (Item[, bIconRect, iColumn])
Variable | Description
SizeRect | The size and position of the item. RECT.
Item | The item to find. LISTITEM.
bIconRect | Optional: TRUE to return the size and position of the icon. Default returns the rectangle of the text. BOOLEAN.
iColumn | Optional: The column position of the item. Default returns the whole line. INTEGER.

Notes

GetItemRect returns information about the location of a listview item. By default, GetItemRect returns the rectangle for the text of the item. The rectangle returned includes the item’s X and Y position relative to the listview, its width, and its height.

Optional: the return value can specify the location and size of the item’s icon instead. If the item is currently scrolled out of view, the returned coordinates will reflect this. For example, if item 1 is specified, and the top item visible is item 10, then the Y coordinate returned is a negative number.

Example

RECT rect
rect = TestApplication.ListViewDialog.TheListView.GetItemRect("item to capture", TRUE)
TestApplication.ListViewDialog.CaptureBitmap(rect.xPos, rect.yPos, rect.xSize, rect.ySize)
Parent topic: ListViewEx Class


GetItemText Function (ListViewEx)

Class

ListViewEx.

Action

Returns the text contained in a column of a listview item. The column is specified by the item and the column index.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

sItemText = listView.GetItemText (item, columnIndex)
Variable | Description
sItemText | The text returned by the item. STRING.
item | The text of the item. LISTITEM.
columnIndex | The column position of the item. INTEGER.

Example

The following example returns the first column for the fourth item.

Verify(TestApplication.ListViewDialog.TheListView.GetItemText(4, 1)
Parent topic: ListViewEx Class


MultiSelect Method (ListViewEx)

Class

ListViewEx.

Action

Adds an item in the list to the set of currently selected items.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

MultiSelect (item)
Variable | Description
item | The item to multi-select. LISTITEM.

Notes

MultiSelect Ctrl+clicks on the item if the list supports multiple selections and the item is not already selected.

Example

TestApplication.ListViewDialog.TheListView.MultiSelect("TheItem")
Parent topic: ListViewEx Class


MultiUnselect Method (ListViewEx)

Class

ListViewEx.

Action

Removes an item in the list from the set of selected items.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

MultiUnselect (item)
Variable | Description
item | The item to multi-unselect. LISTITEM.

Notes

MultiUnselect Ctrl+clicks on the item if the list supports multiple selections and the item is selected.

Example

TestApplication.ListViewDialog.TheListView.MultiUnselect("TheItem")
Parent topic: ListViewEx Class


Select Method (ListViewEx)

Class

ListViewEx.

Action

Selects an item from the listview.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

listView.Select (Item)
Variable | Description
Item | The item to select. LISTITEM.

Notes

Select selects an item by scrolling the item into view (where applicable) and clicking it with the mouse, if it is not already selected. After selecting the item, Silk Test Classic verifies that the item was selected, and raises the exception E_CONTROL_NOT_RESPONDING if it was not.

If an invalid Item is passed as a parameter, Select() raises the exception E_ITEM_NOT_FOUND.

Example

TestApplication.ListViewDialog.XList.Select ("List")
Parent topic: ListViewEx Class


SelectedItems Property (DomListBox ListViewEx)

Class

DomListBox, ListViewEx.

Description

A list containing the selected items.

Notes

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF LISTITEM.

Access

Read only for ListViewEx class.

Read and write for DomListBox class.

Parent topic: ListViewEx Class
Parent topic: DomListBox Class


SetItemFocus Method (ListViewEx)

Class

ListViewEx.

Action

Gives focus to the item in the list.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

SetItemFocus(item)
Variable | Description
item | The item to focus on. LISTITEM.

Notes

This method is supported only in scripts for Windows-based applications.

Example

TestApplication.ListViewDialog.TheListView.SetItemFocus("List")
Parent topic: ListViewEx Class


Uncheck Method (ListViewEx)

Class

ListViewEx.

Action

Unchecks an item.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Uncheck(item)
Variable | Description
item | The item to uncheck. LISTITEM.
Parent topic: ListViewEx Class


MonthCalendar Class

Description

MonthCalendar is the class that selects the calendar date and time.

Availability

This class is supported only on the Open Agent.

Inheritance

MonthCalendar is derived from the Control class; no classes derive from this class.

Properties and Methods

In addition to the properties and methods it inherits from the AnyWin class and Control class, MonthCalendar has the following properties and methods:

  • ExtendSelect Method (MonthCalendar)
    Selects a range of dates and times.
  • Select Method (MonthCalendar SWTDateTime)
    Selects a date and time.
  • SelectNextMonth Method (MonthCalendar)
    Selects the next month.
  • SelectPreviousMonth Method (MonthCalendar)
    Selects the previous month.
Parent topic: Win32 Classes
Related reference
AnyWin Class
Control Class


ExtendSelect Method (MonthCalendar)

Class

MonthCalendar class

Action

Selects a range of dates and times.

Syntax

ExtendSelect (selectedDate)
Variable | Description
selectedDate | The DateTime that you want to select. DATETIME.

Notes

This method is supported only in scripts that use the Open Agent.

Example

MonthCalendar1.ExtendSelect("2008-03-06")
Parent topic: MonthCalendar Class


SelectNextMonth Method (MonthCalendar)

Class

MonthCalendar class

Action

Selects the next month.

Syntax

SelectNextMonth (selectedYear, selectedMonth)
Variable | Description
selectedYear | The year to select. INTEGER.
selectedMonth | The month to select. INTEGER.

Notes

This method is supported only in scripts that use the Open Agent.

Select selects an item by scrolling the item into view (where applicable) and clicking it with the mouse, if it is not already selected.

Parent topic: MonthCalendar Class


SelectPreviousMonth Method (MonthCalendar)

Class

MonthCalendar class

Action

Selects the previous month.

Syntax

SelectPreviousMonth (selectedYear, selectedMonth)
Variable | Description
selectedYear | The year to select. INTEGER.
selectedMonth | The month to select. INTEGER.

Notes

This method is supported only in scripts that use the Open Agent.

Select selects an item by scrolling the item into view (where applicable) and clicking it with the mouse, if it is not already selected.

Parent topic: MonthCalendar Class


Pager Class

Description

Pager is the class for tabbed, multi-page dialog boxes, and for button bars.

On Windows, this class corresponds to the TabControl control.

On Windows, Silk Test Classic only supports major tabs; it does not support minor tabs (also called "subpages" or "child pages").

Availability

This functionality is supported only if you are using the Open Agent.

Inheritance

Pager derives from the Control class. No classes derive from this class.

Identification of Pager Pages

In Pager methods, you identify a specific page by its tab name or its index value relative to the other pages in the pagelist.

Properties and Methods

In addition to the properties and methods it inherits from the AnyWin class and Control class, Pager has the following properties and methods:

  • Horizontal Property
    Whether the up/down control, tabbed dialog box, button bar, or sash is horizontal.
  • ScrollDown Method
    Moves the scroll bar down.
  • ScrollUp Method
    Moves the scroll bar up.
Parent topic: Win32 Classes
Related reference
AnyWin Class
Control Class


ScrollDown Method

Class

Pager class

Action

Moves the scroll bar down.

Syntax

ScrollDown ()

Notes

This method is supported only in scripts for Windows-based applications that use the Open Agent.

Parent topic: Pager Class


ScrollUp Method

Class

Pager class

Action

Moves the scroll bar up.

Syntax

ScrollUp ()

Notes

This method is supported only in scripts for Windows-based applications that use the Open Agent.

Parent topic: Pager Class


UpDownEx Class

Description

UpDownEx is the class for up-down controls.

Availability

The UpDownEx class is available only in Windows-based applications that use the Open Agent. This class offers slightly different functions and properties from those in the UpDown class, which is available in winclass.inc for use with the Classic Agent.

Inheritance

UpDownEx derives from the Control class; no classes derive from the UpDownEx class.

Methods and Properties

In addition to the properties and methods it inherits from the AnyWin class and Control class, UpDownEx has the following properties and methods:

  • Decrement Method (UpDown)
    Decreases the position value of the up/down control.
  • Horizontal Property
    Whether the up/down control, tabbed dialog box, button bar, or sash is horizontal.
  • Increment Method (UpDown)
    Increases the position value of the up/down control.
  • Position Property
    Returns the position for the up/down control.
  • Range Property
    The range of the scale, scroll bar, spinner control, or up/down control.
  • Wraparound Property
    Whether values are wrapped if smaller than minimum or larger than maximum.
Parent topic: Win32 Classes
Related reference
AnyWin Class
Control Class


Decrement Method (UpDown)

Class

UpDown.

Action

Decreases the position value of the up/down control.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

updown.Decrement ([iAmount])
Variable | Description
iAmount | Optional: The amount to decrement. INTEGER.

Notes

Decrement clicks the up-down control's Down button iAmount times. Decrement does not verify that the clicks change the value of the control. To decrement the up/down control to a specific value and verify that it reaches that value, use SetPosition.

Example

MyDialog.UpDown1.Decrement()
Parent topic: UpDownEx Class


Increment Method (UpDown)

Class

UpDown.

Action

Increases the position value of the up/down control.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

updown.Increment(iAmount)
Variable | Description
iAmount | Optional: The amount to increment. INTEGER.

Notes

Increment clicks the up-down control's Up button iAmount times. Increment does not verify that the clicks change the value of the control. To increment the up/down control to a specific value and verify that it reaches that value, use SetPosition.

Example

MyDialog.UpDown1.Increment()
Parent topic: UpDownEx Class


WPF Class Reference

Lists the available classes for testing WPF controls.

  • WPFBase Class
    Provides a WPF framework-level set of properties, events, and methods for Windows Presentation Foundation (WPF) elements.
  • WPFButton Class
    Represents a Windows button control, which reacts to the ButtonBase.Click event.
  • WPFButtonBase Class
    Represents the base class for all Button controls.
  • WPFCalendar Class
    Represents a control that enables a user to select a date by using a visual calendar display.
  • WPFCheckBox Class
    Represents a check box.
  • WPFColumnHeader Class
    Represents a header column in a ListView control.
  • WPFComboBox Class
    Represents a selection control with a drop-down list that can be shown or hidden by clicking the arrow on the control.
  • WPFComboBoxItem Class
    Represents a selectable item in a ComboBox.
  • WPFContentControl Class
    Represents a control with a single piece of content.
  • WPFContextMenu Class
    a context menu.
  • WPFControl Class
    Represents the base class for user interface (UI) elements that use a ControlTemplate to define their appearance.
  • WPFDataGrid Class
    Represents a control that displays data in a customizable grid.
  • WPFDataGridCell Class
    Represents a cell of a data grid control.
  • WPFDataGridColumnHeader Class
    Represents an individual data grid column header.
  • WPFDataGridRow Class
    Represents a data grid row.
  • WPFDataGridRowHeader Class
    Represents an individual data grid row header.
  • WPFDatePicker Class
    Represents a control that allows the user to select a date.
  • WPFDocumentViewer Class
    Represents a document viewing control that can host paginated FixedDocument content such as an XpsDocument.
  • WPFDocumentViewerBase Class
    Provides a base class for viewers that are intended to display fixed or flow content (represented by a FixedDocument or FlowDocument, respectively).
  • WPFDrawingVisual Class
    DrawingVisual is a visual object that can be used to render vector graphics on the screen. The content is persisted by the system.
  • WPFExpander Class
    Represents the control that displays a header that has a collapsible window that displays content.
  • WPFFlowDocumentPageViewer Class
    Represents a control for viewing flow content in a fixed viewing mode that shows content one page at a time.
  • WPFFlowDocumentReader Class
    Represents a control for viewing flow content in a continuous scrolling mode.
  • WPFFlowDocumentScrollViewer Class
    Represents a control for viewing flow content in a continuous scrolling mode.
  • WPFFrame Class
    Represents the base class for all Frame controls.
  • WPFFrameworkContentElement Class
    Base class for all FrameworkContentElement derived classes. This class does not add any properties or methods.
  • WPFFrameworkElement Class
    Provides a set of properties and methods for FrameworkElement derived classes.
  • WPFGridSplitter Class
    Represents the control that redistributes space between columns or rows of a Grid control.
  • WPFGroupBox Class
    Represents a control that creates a container that has a border and a header.
  • WPFHeaderedContentControl Class
    Provides the base implementation for all controls that contain single content and have a header.
  • WPFHeaderedItemsControl Class
    Represents the base class for user interface (UI) elements that use a ControlTemplate to define their appearance.
  • WPFHyperlink Class
    Represents Hyperlinks that can be embedded as child controls or inside text.
  • WPFImage Class
    Represents a control that displays an image.
  • WPFItemsControl Class
    Represents a control that can be used to present a collection of items.
  • WPFLabel Class
    Represents the text label for a control.
  • WPFListBox Class
    Contains a list of selectable items.
  • WPFListBoxItem Class
    Represents a selectable item in a ListBox.
  • WPFListView Class
    Represents a control that displays a list of data items. The ListView can have a table-like style.
  • WPFListViewItem Class
    Represents an item in a ListView control.
  • WPFMediaElement Class
    Represents a control that contains audio and/or video.
  • WPFMenu Class
    Represents a Windows menu control that enables you to hierarchically organize elements associated with commands and event handlers.
  • WPFMenuBase Class
    Represents a control that defines choices for users to select.
  • WPFMenuItem Class
    Represents a selectable item inside a Menu.
  • WPFMultiSelector Class
    Provides an abstract class for controls that allow multiple items to be selected.
  • WPFNavigationWindow Class
    Represents a window that supports content navigation.
  • WPFPage Class
    Encapsulates a page of content that can be navigated to and hosted by Windows Internet Explorer, NavigationWindow, and Frame.
  • WPFPasswordBox Class
    Represents a PasswordBox control.
  • WPFPopup Class
    Represents a pop-up window that has content.
  • WPFProgressBar Class
    Represents a ProgressBar control.
  • WPFRadioButton Class
    Represents a radio button.
  • WPFRangeBase Class
    Represents an element that has a value within a specific range.
  • WPFRepeatButton Class
    Represents a control that raises its selection event repeatedly from the time it is pressed until it is released.
  • WPFRichTextBox Class
    Represents a RichTextBox control.
  • WPFScrollBar Class
    Represents a control that provides a scroll bar that has a sliding Thumb whose position corresponds to a value.
  • WPFScrollViewer Class
    Represents a scrollable area that can contain other visible elements.
  • WPFSelector Class
    Represents a control that allows a user to select items from among its child elements.
  • WPFSlider Class
    Represents a control that lets the user select from a range of values by moving a Thumb control along a Track.
  • WPFStatusBar Class
    Represents a control that displays items and information in a horizontal bar in an application window.
  • WPFStatusBarItem Class
    Represents an item of a StatusBar control.
  • WPFStickyNoteControl Class
    Represents a control that lets users attach typed text or handwritten annotations to documents.
  • WPFTabControl Class
    Represents a control that contains multiple items that share the same space on the screen.
  • WPFTabItem Class
    Represents a selectable item inside a TabControl.
  • WPFTextBlock Class
    Represents a control with a single piece of content.
  • WPFTextBox Class
    Represents a control that can be used to display or edit unformatted text.
  • WPFTextBoxBase Class
    Represents a control with a single piece of content.
  • WPFThumb Class
    Represents a control that can be dragged by the user.
  • WPFTickBar Class
    Represents a control that draws a set of tick marks for a Slider control.
  • WPFToggleButton Class
    Represents a toggle button.
  • WPFToolBar Class
    Provides a container for a group of commands or controls.
  • WPFToolBarTray Class
    Represents the container that handles the layout of a ToolBar.
  • WPFToolkitCalendar Class
    Represents a control that enables a user to select a date by using a visual calendar display.
  • WPFToolkitDataGrid Class
    Represents a control that displays data in a customizable grid.
  • WPFToolkitDataGridCell Class
    Represents a cell of a data grid control.
  • WPFToolkitDataGridColumnHeader Class
    Represents an individual data grid column header.
  • WPFToolkitDataGridRow Class
    Represents a data grid row.
  • WPFToolkitDataGridRowHeader Class
    Represents an individual data grid row header.
  • WPFToolkitDatePicker Class
    Represents a control that allows the user to select a date.
  • WPFToolTip Class
    Represents a tool tip.
  • WPFTrack Class
    Represents a control primitive that handles the positioning and sizing of a Thumb control and two RepeatButton controls that are used to set a Value.
  • WPFTreeView Class
    Represents a control that displays hierarchical data in a tree structure that has items that can expand and collapse.
  • WPFTreeViewItem Class
    Represents a selectable item in a TreeView control.
  • WPFUserControl Class
    Provides a simple way to create a control. For additional information about interacting with a user control, see Custom Controls.
  • WPFViewport3D Class
    Provides a rendering surface for 3-D visual content.
  • WPFVisual3D Class
    Provides services and properties common to visual 3-D objects, including hit-testing, coordinate transformation, and bounding box calculations.
  • WPFWindow Class
    Provides the ability to create, configure, show, and manage the lifetime of windows and dialog boxes.
Parent topic: Classes


WPFBase Class

Description

Provides a WPF framework-level set of properties, events, and methods for Windows Presentation Foundation (WPF) elements.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFBase is derived from the AnyWin class.The following classes derive from the WPFBase class:
  • WPFDrawingVisual
  • WPFFrameworkContentElement
  • WPFFrameworkElement
  • WPFVisual3D

Methods

In addition to the methods it inherits from AnyWin, WPFBase has the following methods:

  • BringIntoView
  • IsFocused
  • SetFocus

Properties

In addition to the properties it inherits from AnyWin, WPFBase has the following properties:

  • IsEnabled
  • ToolTip
Parent topic: WPF Class Reference


WPFButton Class

Description

Represents a Windows button control, which reacts to the ButtonBase.Click event.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFButton is derived from the WPFButtonBase class. No classes derive from this class.

Methods

WPFButton inherits all its methods from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFButton has the following properties:

  • IsCancel
  • IsDefault
  • IsDefaulted
Parent topic: WPF Class Reference


WPFButtonBase Class

Description

Represents the base class for all Button controls.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFButtonBase is derived from the WPFContentControl class.The following classes derive from the WPFButtonBase class:
  • WPFButton
  • WPFColumnHeader
  • WPFDataGridColumnHeader
  • WPFDataGridRowHeader
  • WPFRepeatButton
  • WPFToggleButton
  • WPFToolkitDataGridColumnHeader
  • WPFToolkitDataGridRowHeader

Methods

In addition to the methods it inherits from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFButtonBase has the following methods:

  • Select

Properties

In addition to the properties it inherits from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFButtonBase has the following properties:

  • ClickMode
Parent topic: WPF Class Reference


WPFCalendar Class

Description

Represents a control that enables a user to select a date by using a visual calendar display.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFCalendar is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFCalendar has the following methods:

  • SelectDate
  • SelectDates
  • SelectRange
  • SetDisplayDate

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFCalendar has the following properties:

  • BlackoutDates
  • DisplayDate
  • DisplayDateEnd
  • DisplayDateStart
  • DisplayMode
  • FirstDayOfWeek
  • IsTodayHighlighted
  • SelectedDate
  • SelectedDates
  • SelectionMode
Parent topic: WPF Class Reference


WPFCheckBox Class

Description

Represents a check box.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFCheckBox is derived from the WPFToggleButton class. No classes derive from this class.

Methods

WPFCheckBox inherits all its methods from WPFToggleButton, WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFCheckBox inherits all its properties from WPFToggleButton, WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFColumnHeader Class

Description

Represents a header column in a ListView control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFColumnHeader is derived from the WPFButtonBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFColumnHeader has the following methods:

  • Resize

Properties

WPFColumnHeader inherits all its properties from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFComboBox Class

Description

Represents a selection control with a drop-down list that can be shown or hidden by clicking the arrow on the control.

Certain combo boxes (i.e. ones that use an items source internally) require to open the combo box once before the items are available in the application under test.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFComboBox is derived from the WPFSelector class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFComboBox has the following methods:

  • Close
  • Open

Properties

In addition to the properties it inherits from WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFComboBox has the following properties:

  • IsDropDownOpen
  • IsEditable
  • IsReadOnly
  • Items
  • MaxDropDownHeight
  • SelectedItem
  • StaysOpenOnEdit
  • Text
Parent topic: WPF Class Reference


WPFComboBoxItem Class

Description

Represents a selectable item in a ComboBox.

Certain combo boxes (i.e. ones that use an items source internally) require to open the combo box once before the items are available in the application under test.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFComboBoxItem is derived from the WPFListBoxItem class. No classes derive from this class.

Methods

WPFComboBoxItem inherits all its methods from WPFListBoxItem, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFComboBoxItem inherits all its properties from WPFListBoxItem, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFContentControl Class

Description

Represents a control with a single piece of content.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFContentControl is derived from the WPFControl class.The following classes derive from the WPFContentControl class:
  • WPFButtonBase
  • WPFFrame
  • WPFHeaderedContentControl
  • WPFLabel
  • WPFListBoxItem
  • WPFScrollViewer
  • WPFStatusBarItem
  • WPFToolTip
  • WPFUserControl
  • WPFWindow

Methods

WPFContentControl inherits all its methods from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFContentControl has the following properties:

  • Content
  • HasContent
Parent topic: WPF Class Reference


WPFContextMenu Class

Description

a context menu.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFContextMenu is derived from the WPFMenuBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFMenuBase, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFContextMenu has the following methods:

  • Close

Properties

In addition to the properties it inherits from WPFMenuBase, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFContextMenu has the following properties:

  • HorizontalOffset
  • IsOpen
  • Placement
  • PlacementRectangle
  • StaysOpen
  • VerticalOffset
Parent topic: WPF Class Reference


WPFControl Class

Description

Represents the base class for user interface (UI) elements that use a ControlTemplate to define their appearance.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFControl is derived from the WPFFrameworkElement class.The following classes derive from the WPFControl class:
  • WPFCalendar
  • WPFContentControl
  • WPFDataGridCell
  • WPFDataGridRow
  • WPFDatePicker
  • WPFDocumentViewerBase
  • WPFFlowDocumentReader
  • WPFFlowDocumentScrollViewer
  • WPFItemsControl
  • WPFPasswordBox
  • WPFRangeBase
  • WPFStickyNoteControl
  • WPFTextBoxBase
  • WPFThumb
  • WPFToolkitCalendar
  • WPFToolkitDataGridCell
  • WPFToolkitDataGridRow
  • WPFToolkitDatePicker

Methods

WPFControl inherits all its methods from WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFFrameworkElement, WPFBase, and AnyWin, WPFControl has the following properties:

  • FontFamily
  • FontSize
  • IsTabStop
  • TabIndex
Parent topic: WPF Class Reference


WPFDataGrid Class

Description

Represents a control that displays data in a customizable grid.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFDataGrid is derived from the WPFMultiSelector class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFMultiSelector, WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDataGrid has the following methods:

  • BeginEdit
  • CancelEdit
  • CommitEdit
  • ScrollIntoView
  • Select
  • SelectCell

Properties

In addition to the properties it inherits from WPFMultiSelector, WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDataGrid has the following properties:

  • Columns
  • CurrentCell
  • IsReadOnly
  • Items
  • SelectedCell
  • SelectedCells
  • SelectedCellText
  • SelectedCellTexts
  • SelectedItem
  • SelectedItems
  • SelectionMode
  • SelectionUnit
Parent topic: WPF Class Reference


WPFDataGridCell Class

Description

Represents a cell of a data grid control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFDataGridCell is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDataGridCell has the following methods:

  • Deselect
  • ScrollIntoView
  • Select

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDataGridCell has the following properties:

  • IsEditing
  • IsReadOnly
  • IsSelected
Parent topic: WPF Class Reference


WPFDataGridColumnHeader Class

Description

Represents an individual data grid column header.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFDataGridColumnHeader is derived from the WPFButtonBase class. No classes derive from this class.

Methods

WPFDataGridColumnHeader inherits all its methods from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFDataGridColumnHeader inherits all its properties from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFDataGridRow Class

Description

Represents a data grid row.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFDataGridRow is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDataGridRow has the following methods:

  • Deselect
  • ScrollIntoView
  • Select

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDataGridRow has the following properties:

  • Cells
  • IsSelected
Parent topic: WPF Class Reference


WPFDataGridRowHeader Class

Description

Represents an individual data grid row header.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFDataGridRowHeader is derived from the WPFButtonBase class. No classes derive from this class.

Methods

WPFDataGridRowHeader inherits all its methods from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFDataGridRowHeader inherits all its properties from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFDatePicker Class

Description

Represents a control that allows the user to select a date.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFDatePicker is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDatePicker has the following methods:

  • ClearSelection
  • SelectDate

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDatePicker has the following properties:

  • SelectedDate
Parent topic: WPF Class Reference


WPFDocumentViewer Class

Description

Represents a document viewing control that can host paginated FixedDocument content such as an XpsDocument.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFDocumentViewer is derived from the WPFDocumentViewerBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFDocumentViewerBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDocumentViewer has the following methods:

  • DecreaseZoom
  • FitToHeight
  • FitToWidth
  • IncreaseZoom
  • MoveDown
  • MoveLeft
  • MoveRight
  • MoveUp
  • ScrollPageDown
  • ScrollPageLeft
  • ScrollPageRight
  • ScrollPageUp
  • Select
  • ZoomToActualSize

Properties

In addition to the properties it inherits from WPFDocumentViewerBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDocumentViewer has the following properties:

  • CanDecreaseZoom
  • CanIncreaseZoom
  • HorizontalOffset
  • Selection
  • VerticalOffset
  • Zoom
Parent topic: WPF Class Reference


WPFDocumentViewerBase Class

Description

Provides a base class for viewers that are intended to display fixed or flow content (represented by a FixedDocument or FlowDocument, respectively).

Availability

This class is supported only on the Open Agent.

Inheritance

WPFDocumentViewerBase is derived from the WPFControl class.The following classes derive from the WPFDocumentViewerBase class:
  • WPFDocumentViewer
  • WPFFlowDocumentPageViewer

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDocumentViewerBase has the following methods:

  • CanGoToPage
  • FirstPage
  • GoToPage
  • LastPage
  • NextPage
  • PreviousPage

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFDocumentViewerBase has the following properties:

  • CanGoToNextPage
  • CanGoToPreviousPage
  • MasterPageNumber
  • PageCount
  • Text
Parent topic: WPF Class Reference


WPFDrawingVisual Class

Description

DrawingVisual is a visual object that can be used to render vector graphics on the screen. The content is persisted by the system.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFDrawingVisual is derived from the WPFBase class. No classes derive from this class.

Methods

WPFDrawingVisual inherits all its methods from WPFBase, and AnyWin.

Properties

WPFDrawingVisual inherits all its properties from WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFExpander Class

Description

Represents the control that displays a header that has a collapsible window that displays content.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFExpander is derived from the WPFHeaderedContentControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFHeaderedContentControl, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFExpander has the following methods:

  • Collapse
  • Expand

Properties

In addition to the properties it inherits from WPFHeaderedContentControl, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFExpander has the following properties:

  • ExpandDirection
  • IsExpanded
Parent topic: WPF Class Reference


WPFFlowDocumentPageViewer Class

Description

Represents a control for viewing flow content in a fixed viewing mode that shows content one page at a time.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFFlowDocumentPageViewer is derived from the WPFDocumentViewerBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFDocumentViewerBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFFlowDocumentPageViewer has the following methods:

  • DecreaseZoom
  • IncreaseZoom
  • Select
  • ToggleFindDialog

Properties

In addition to the properties it inherits from WPFDocumentViewerBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFFlowDocumentPageViewer has the following properties:

  • CanDecreaseZoom
  • CanIncreaseZoom
  • MaxZoom
  • MinZoom
  • Selection
  • Zoom
  • ZoomIncrement
Parent topic: WPF Class Reference


WPFFlowDocumentReader Class

Description

Represents a control for viewing flow content in a continuous scrolling mode.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFFlowDocumentReader is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFFlowDocumentReader has the following methods:

  • CanGoToPage
  • DecreaseZoom
  • FirstPage
  • GoToPage
  • IncreaseZoom
  • LastPage
  • NextPage
  • PreviousPage
  • Select
  • SwitchViewingMode
  • ToggleFindDialog

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFFlowDocumentReader has the following properties:

  • CanDecreaseZoom
  • CanGoToNextPage
  • CanGoToPreviousPage
  • CanIncreaseZoom
  • MaxZoom
  • MinZoom
  • PageCount
  • PageNumber
  • Selection
  • Text
  • ViewingMode
  • Zoom
  • ZoomIncrement
Parent topic: WPF Class Reference


WPFFlowDocumentScrollViewer Class

Description

Represents a control for viewing flow content in a continuous scrolling mode.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFFlowDocumentScrollViewer is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFFlowDocumentScrollViewer has the following methods:

  • DecreaseZoom
  • IncreaseZoom
  • Select
  • ToggleFindDialog

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFFlowDocumentScrollViewer has the following properties:

  • CanDecreaseZoom
  • CanIncreaseZoom
  • MaxZoom
  • MinZoom
  • Selection
  • Text
  • Zoom
  • ZoomIncrement
Parent topic: WPF Class Reference


WPFFrame Class

Description

Represents the base class for all Frame controls.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFFrame is derived from the WPFContentControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFFrame has the following methods:

  • GoBack
  • GoForward
  • Navigate
  • Refresh
  • StopLoading

Properties

In addition to the properties it inherits from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFFrame has the following properties:

  • CanGoBack
  • CanGoForward
  • Source
Parent topic: WPF Class Reference


WPFFrameworkContentElement Class

Description

Base class for all FrameworkContentElement derived classes. This class does not add any properties or methods.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFFrameworkContentElement is derived from the WPFBase class.The following classes derive from the WPFFrameworkContentElement class:
  • WPFHyperlink

Methods

WPFFrameworkContentElement inherits all its methods from WPFBase, and AnyWin.

Properties

WPFFrameworkContentElement inherits all its properties from WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFFrameworkElement Class

Description

Provides a set of properties and methods for FrameworkElement derived classes.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFFrameworkElement is derived from the WPFBase class.The following classes derive from the WPFFrameworkElement class:
  • WPFControl
  • WPFImage
  • WPFMediaElement
  • WPFPage
  • WPFPopup
  • WPFTextBlock
  • WPFTickBar
  • WPFToolBarTray
  • WPFTrack
  • WPFViewport3D

Methods

In addition to the methods it inherits from WPFBase, and AnyWin, WPFFrameworkElement has the following methods:

  • GetMaximumScrollPosition
  • GetScrollPosition
  • PointFromScreen
  • PointToScreen
  • Scroll
  • ScrollToPosition

Properties

In addition to the properties it inherits from WPFBase, and AnyWin, WPFFrameworkElement has the following properties:

  • ActualHeight
  • ActualWidth
  • Name
Parent topic: WPF Class Reference


WPFGridSplitter Class

Description

Represents the control that redistributes space between columns or rows of a Grid control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFGridSplitter is derived from the WPFThumb class. No classes derive from this class.

Methods

WPFGridSplitter inherits all its methods from WPFThumb, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFGridSplitter inherits all its properties from WPFThumb, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFGroupBox Class

Description

Represents a control that creates a container that has a border and a header.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFGroupBox is derived from the WPFHeaderedContentControl class. No classes derive from this class.

Methods

WPFGroupBox inherits all its methods from WPFHeaderedContentControl, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFGroupBox inherits all its properties from WPFHeaderedContentControl, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFHeaderedContentControl Class

Description

Provides the base implementation for all controls that contain single content and have a header.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFHeaderedContentControl is derived from the WPFContentControl class.The following classes derive from the WPFHeaderedContentControl class:
  • WPFExpander
  • WPFGroupBox
  • WPFTabItem

Methods

WPFHeaderedContentControl inherits all its methods from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFHeaderedContentControl inherits all its properties from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFHeaderedItemsControl Class

Description

Represents the base class for user interface (UI) elements that use a ControlTemplate to define their appearance.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFHeaderedItemsControl is derived from the WPFItemsControl class.The following classes derive from the WPFHeaderedItemsControl class:
  • WPFMenuItem
  • WPFToolBar
  • WPFTreeViewItem

Methods

WPFHeaderedItemsControl inherits all its methods from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFHeaderedItemsControl inherits all its properties from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFHyperlink Class

Description

Represents Hyperlinks that can be embedded as child controls or inside text.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFHyperlink is derived from the WPFFrameworkContentElement class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFFrameworkContentElement, WPFBase, and AnyWin, WPFHyperlink has the following methods:

  • Navigate

Properties

In addition to the properties it inherits from WPFFrameworkContentElement, WPFBase, and AnyWin, WPFHyperlink has the following properties:

  • NavigateUri
  • TargetName
Parent topic: WPF Class Reference


WPFImage Class

Description

Represents a control that displays an image.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFImage is derived from the WPFFrameworkElement class. No classes derive from this class.

Methods

WPFImage inherits all its methods from WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFImage inherits all its properties from WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFItemsControl Class

Description

Represents a control that can be used to present a collection of items.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFItemsControl is derived from the WPFControl class.The following classes derive from the WPFItemsControl class:
  • WPFHeaderedItemsControl
  • WPFMenuBase
  • WPFSelector
  • WPFStatusBar
  • WPFTreeView

Methods

WPFItemsControl inherits all its methods from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFItemsControl has the following properties:

  • HasItems
  • IsTextSearchEnabled
  • Items
  • ItemTexts
Parent topic: WPF Class Reference


WPFLabel Class

Description

Represents the text label for a control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFLabel is derived from the WPFContentControl class. No classes derive from this class.

Methods

WPFLabel inherits all its methods from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFLabel inherits all its properties from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFListBox Class

Description

Contains a list of selectable items.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFListBox is derived from the WPFSelector class.The following classes derive from the WPFListBox class:
  • WPFListView

Methods

In addition to the methods it inherits from WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFListBox has the following methods:

  • DeselectAll
  • ScrollIntoView
  • SelectAll

Properties

In addition to the properties it inherits from WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFListBox has the following properties:

  • Items
  • SelectedItem
  • SelectedItems
  • SelectedItemTexts
  • SelectionMode
Parent topic: WPF Class Reference


WPFListBoxItem Class

Description

Represents a selectable item in a ListBox.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFListBoxItem is derived from the WPFContentControl class.The following classes derive from the WPFListBoxItem class:
  • WPFComboBoxItem
  • WPFListViewItem

Methods

In addition to the methods it inherits from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFListBoxItem has the following methods:

  • Deselect
  • ScrollIntoView
  • Select

Properties

In addition to the properties it inherits from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFListBoxItem has the following properties:

  • IsSelected
Parent topic: WPF Class Reference


WPFListView Class

Description

Represents a control that displays a list of data items. The ListView can have a table-like style.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFListView is derived from the WPFListBox class. No classes derive from this class.

Methods

WPFListView inherits all its methods from WPFListBox, WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFListBox, WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFListView has the following properties:

  • ColumnHeaders
  • Items
  • SelectedItem
  • SelectedItems
Parent topic: WPF Class Reference


WPFListViewItem Class

Description

Represents an item in a ListView control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFListViewItem is derived from the WPFListBoxItem class. No classes derive from this class.

Methods

WPFListViewItem inherits all its methods from WPFListBoxItem, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFListViewItem inherits all its properties from WPFListBoxItem, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFMediaElement Class

Description

Represents a control that contains audio and/or video.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFMediaElement is derived from the WPFFrameworkElement class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFFrameworkElement, WPFBase, and AnyWin, WPFMediaElement has the following methods:

  • Pause
  • Play
  • Stop

Properties

In addition to the properties it inherits from WPFFrameworkElement, WPFBase, and AnyWin, WPFMediaElement has the following properties:

  • Balance
  • CanPause
  • HasAudio
  • HasVideo
  • IsMediaLoaded
  • IsMuted
  • Length
  • Position
  • SpeedRatio
  • Volume
Parent topic: WPF Class Reference


WPFMenu Class

Description

Represents a Windows menu control that enables you to hierarchically organize elements associated with commands and event handlers.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFMenu is derived from the WPFMenuBase class. No classes derive from this class.

Methods

WPFMenu inherits all its methods from WPFMenuBase, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFMenuBase, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFMenu has the following properties:

  • IsMainMenu
Parent topic: WPF Class Reference


WPFMenuBase Class

Description

Represents a control that defines choices for users to select.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFMenuBase is derived from the WPFItemsControl class.The following classes derive from the WPFMenuBase class:
  • WPFContextMenu
  • WPFMenu

Methods

In addition to the methods it inherits from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFMenuBase has the following methods:

  • Check
  • Select
  • Uncheck

Properties

In addition to the properties it inherits from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFMenuBase has the following properties:

  • Items
Parent topic: WPF Class Reference


WPFMenuItem Class

Description

Represents a selectable item inside a Menu.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFMenuItem is derived from the WPFHeaderedItemsControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFHeaderedItemsControl, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFMenuItem has the following methods:

  • Check
  • CloseSubmenu
  • OpenSubmenu
  • Select
  • Uncheck

Properties

In addition to the properties it inherits from WPFHeaderedItemsControl, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFMenuItem has the following properties:

  • HasSubmenu
  • IsChecked
  • IsPressed
  • IsSubmenuOpen
  • Items
  • Role
  • StaysOpenOnClick
Parent topic: WPF Class Reference


WPFMultiSelector Class

Description

Provides an abstract class for controls that allow multiple items to be selected.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFMultiSelector is derived from the WPFSelector class.The following classes derive from the WPFMultiSelector class:
  • WPFDataGrid
  • WPFToolkitDataGrid

Methods

WPFMultiSelector inherits all its methods from WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFMultiSelector has the following properties:

  • SelectedItems
  • SelectedItemTexts
Parent topic: WPF Class Reference


WPFNavigationWindow Class

Description

Represents a window that supports content navigation.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFNavigationWindow is derived from the WPFWindow class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFWindow, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFNavigationWindow has the following methods:

  • GoBack
  • GoForward
  • Navigate
  • Refresh
  • StopLoading

Properties

In addition to the properties it inherits from WPFWindow, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFNavigationWindow has the following properties:

  • CanGoBack
  • CanGoForward
  • Source
Parent topic: WPF Class Reference


WPFPage Class

Description

Encapsulates a page of content that can be navigated to and hosted by Windows Internet Explorer, NavigationWindow, and Frame.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFPage is derived from the WPFFrameworkElement class. No classes derive from this class.

Methods

WPFPage inherits all its methods from WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFFrameworkElement, WPFBase, and AnyWin, WPFPage has the following properties:

  • Title
Parent topic: WPF Class Reference


WPFPasswordBox Class

Description

Represents a PasswordBox control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFPasswordBox is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFPasswordBox has the following methods:

  • Clear
  • Paste
  • SelectAll
  • SetText

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFPasswordBox has the following properties:

  • MaxLength
  • PasswordChar
Parent topic: WPF Class Reference


WPFPopup Class

Description

Represents a pop-up window that has content.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFPopup is derived from the WPFFrameworkElement class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFFrameworkElement, WPFBase, and AnyWin, WPFPopup has the following methods:

  • Close

Properties

In addition to the properties it inherits from WPFFrameworkElement, WPFBase, and AnyWin, WPFPopup has the following properties:

  • StaysOpen
Parent topic: WPF Class Reference


WPFProgressBar Class

Description

Represents a ProgressBar control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFProgressBar is derived from the WPFRangeBase class. No classes derive from this class.

Methods

WPFProgressBar inherits all its methods from WPFRangeBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFProgressBar inherits all its properties from WPFRangeBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFRadioButton Class

Description

Represents a radio button.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFRadioButton is derived from the WPFToggleButton class. No classes derive from this class.

Methods

WPFRadioButton inherits all its methods from WPFToggleButton, WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFToggleButton, WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFRadioButton has the following properties:

  • GroupName
Parent topic: WPF Class Reference


WPFRangeBase Class

Description

Represents an element that has a value within a specific range.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFRangeBase is derived from the WPFControl class.The following classes derive from the WPFRangeBase class:
  • WPFProgressBar
  • WPFScrollBar
  • WPFSlider

Methods

WPFRangeBase inherits all its methods from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFRangeBase has the following properties:

  • LargeChange
  • Maximum
  • Minimum
  • SmallChange
  • Value
Parent topic: WPF Class Reference


WPFRepeatButton Class

Description

Represents a control that raises its selection event repeatedly from the time it is pressed until it is released.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFRepeatButton is derived from the WPFButtonBase class. No classes derive from this class.

Methods

WPFRepeatButton inherits all its methods from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFRepeatButton has the following properties:

  • Delay
  • Interval
Parent topic: WPF Class Reference


WPFRichTextBox Class

Description

Represents a RichTextBox control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFRichTextBox is derived from the WPFTextBoxBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFTextBoxBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFRichTextBox has the following methods:

  • Clear
  • Select
  • SetText

Properties

In addition to the properties it inherits from WPFTextBoxBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFRichTextBox has the following properties:

  • CaretIndex
  • SelectedText
  • SelectionLength
  • SelectionStart
Parent topic: WPF Class Reference


WPFScrollBar Class

Description

Represents a control that provides a scroll bar that has a sliding Thumb whose position corresponds to a value.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFScrollBar is derived from the WPFRangeBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFRangeBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFScrollBar has the following methods:

  • SetValue
  • SetValueToMaximum
  • SetValueToMinimum

Properties

In addition to the properties it inherits from WPFRangeBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFScrollBar has the following properties:

  • Orientation
  • ViewportSize
Parent topic: WPF Class Reference


WPFScrollViewer Class

Description

Represents a scrollable area that can contain other visible elements.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFScrollViewer is derived from the WPFContentControl class. No classes derive from this class.

Methods

WPFScrollViewer inherits all its methods from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFScrollViewer inherits all its properties from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFSelector Class

Description

Represents a control that allows a user to select items from among its child elements.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFSelector is derived from the WPFItemsControl class.The following classes derive from the WPFSelector class:
  • WPFComboBox
  • WPFListBox
  • WPFMultiSelector
  • WPFTabControl

Methods

In addition to the methods it inherits from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFSelector has the following methods:

  • Select

Properties

In addition to the properties it inherits from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFSelector has the following properties:

  • SelectedIndex
  • SelectedItem
  • SelectedItemText
Parent topic: WPF Class Reference


WPFSlider Class

Description

Represents a control that lets the user select from a range of values by moving a Thumb control along a Track.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFSlider is derived from the WPFRangeBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFRangeBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFSlider has the following methods:

  • DecreaseLarge
  • DecreaseSmall
  • IncreaseLarge
  • IncreaseSmall
  • SetValue
  • SetValueToMaximum
  • SetValueToMinimum

Properties

In addition to the properties it inherits from WPFRangeBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFSlider has the following properties:

  • Delay
  • IsDirectionReversed
  • IsMoveToPointEnabled
  • IsSelectionRangeEnabled
  • IsSnapToTickEnabled
  • Orientation
  • SelectionEnd
  • SelectionStart
  • TickFrequency
  • TickPlacement
Parent topic: WPF Class Reference


WPFStatusBar Class

Description

Represents a control that displays items and information in a horizontal bar in an application window.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFStatusBar is derived from the WPFItemsControl class. No classes derive from this class.

Methods

WPFStatusBar inherits all its methods from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFStatusBar has the following properties:

  • Items
Parent topic: WPF Class Reference


WPFStatusBarItem Class

Description

Represents an item of a StatusBar control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFStatusBarItem is derived from the WPFContentControl class. No classes derive from this class.

Methods

WPFStatusBarItem inherits all its methods from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFStatusBarItem inherits all its properties from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFStickyNoteControl Class

Description

Represents a control that lets users attach typed text or handwritten annotations to documents.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFStickyNoteControl is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFStickyNoteControl has the following methods:

  • Collapse
  • Expand

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFStickyNoteControl has the following properties:

  • Author
  • IsExpanded
Parent topic: WPF Class Reference


WPFTabControl Class

Description

Represents a control that contains multiple items that share the same space on the screen.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFTabControl is derived from the WPFSelector class. No classes derive from this class.

Methods

WPFTabControl inherits all its methods from WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTabControl has the following properties:

  • Items
  • SelectedItem
Parent topic: WPF Class Reference


WPFTabItem Class

Description

Represents a selectable item inside a TabControl.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFTabItem is derived from the WPFHeaderedContentControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFHeaderedContentControl, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTabItem has the following methods:

  • Deselect
  • Select

Properties

In addition to the properties it inherits from WPFHeaderedContentControl, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTabItem has the following properties:

  • IsSelected
Parent topic: WPF Class Reference


WPFTextBlock Class

Description

Represents a control with a single piece of content.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFTextBlock is derived from the WPFFrameworkElement class. No classes derive from this class.

Methods

WPFTextBlock inherits all its methods from WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFFrameworkElement, WPFBase, and AnyWin, WPFTextBlock has the following properties:

  • FontFamily
  • FontSize
  • Text
  • TextAlignment
  • TextTrimming
  • TextWrapping
Parent topic: WPF Class Reference


WPFTextBox Class

Description

Represents a control that can be used to display or edit unformatted text.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFTextBox is derived from the WPFTextBoxBase class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFTextBoxBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTextBox has the following methods:

  • Clear
  • GetCharacterIndexFromLineIndex
  • GetFirstVisibleLineIndex
  • GetLastVisibleLineIndex
  • GetLineIndexFromCharacterIndex
  • GetLineLength
  • GetLineText
  • ScrollToLine
  • Select
  • SetText

Properties

In addition to the properties it inherits from WPFTextBoxBase, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTextBox has the following properties:

  • CaretIndex
  • CharacterCasing
  • LineCount
  • MaxLength
  • MaxLines
  • MinLines
  • SelectedText
  • SelectionLength
  • SelectionStart
  • TextAlignment
  • TextWrapping
Parent topic: WPF Class Reference


WPFTextBoxBase Class

Description

Represents a control with a single piece of content.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFTextBoxBase is derived from the WPFControl class.The following classes derive from the WPFTextBoxBase class:
  • WPFRichTextBox
  • WPFTextBox

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTextBoxBase has the following methods:

  • AppendText
  • Copy
  • Cut
  • Paste
  • Redo
  • SelectAll
  • Undo

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTextBoxBase has the following properties:

  • AcceptsReturn
  • AcceptsTab
  • AutoWordSelection
  • CanRedo
  • CanUndo
  • HorizontalScrollBarVisibility
  • IsReadOnly
  • IsSpellCheckEnabled
  • IsUndoEnabled
  • Text
  • VerticalScrollBarVisibility
Parent topic: WPF Class Reference


WPFThumb Class

Description

Represents a control that can be dragged by the user.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFThumb is derived from the WPFControl class.The following classes derive from the WPFThumb class:
  • WPFGridSplitter

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFThumb has the following methods:

  • DragCancel
  • DragComplete
  • DragDelta
  • DragStart

Properties

WPFThumb inherits all its properties from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFTickBar Class

Description

Represents a control that draws a set of tick marks for a Slider control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFTickBar is derived from the WPFFrameworkElement class. No classes derive from this class.

Methods

WPFTickBar inherits all its methods from WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFTickBar inherits all its properties from WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFToggleButton Class

Description

Represents a toggle button.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToggleButton is derived from the WPFButtonBase class.The following classes derive from the WPFToggleButton class:
  • WPFCheckBox
  • WPFRadioButton

Methods

In addition to the methods it inherits from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToggleButton has the following methods:

  • Check
  • SetIndeterminate
  • Uncheck

Properties

In addition to the properties it inherits from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToggleButton has the following properties:

  • IsChecked
  • IsThreeState
  • State
Parent topic: WPF Class Reference


WPFToolBar Class

Description

Provides a container for a group of commands or controls.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolBar is derived from the WPFHeaderedItemsControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFHeaderedItemsControl, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolBar has the following methods:

  • CloseOverflowItems
  • OpenOverflowItems

Properties

In addition to the properties it inherits from WPFHeaderedItemsControl, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolBar has the following properties:

  • HasOverflowItems
  • IsOverflowOpen
  • Orientation
Parent topic: WPF Class Reference


WPFToolBarTray Class

Description

Represents the container that handles the layout of a ToolBar.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolBarTray is derived from the WPFFrameworkElement class. No classes derive from this class.

Methods

WPFToolBarTray inherits all its methods from WPFFrameworkElement, WPFBase, and AnyWin.

Properties

In addition to the properties it inherits from WPFFrameworkElement, WPFBase, and AnyWin, WPFToolBarTray has the following properties:

  • IsLocked
  • Orientation
  • ToolBars
Parent topic: WPF Class Reference


WPFToolkitCalendar Class

Description

Represents a control that enables a user to select a date by using a visual calendar display.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolkitCalendar is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitCalendar has the following methods:

  • SelectDate
  • SelectDates
  • SelectRange
  • SetDisplayDate

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitCalendar has the following properties:

  • BlackoutDates
  • DisplayDate
  • DisplayDateEnd
  • DisplayDateStart
  • DisplayMode
  • FirstDayOfWeek
  • IsTodayHighlighted
  • SelectedDate
  • SelectedDates
  • SelectionMode
Parent topic: WPF Class Reference


WPFToolkitDataGrid Class

Description

Represents a control that displays data in a customizable grid.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolkitDataGrid is derived from the WPFMultiSelector class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFMultiSelector, WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitDataGrid has the following methods:

  • BeginEdit
  • CancelEdit
  • CommitEdit
  • ScrollIntoView
  • Select
  • SelectCell

Properties

In addition to the properties it inherits from WPFMultiSelector, WPFSelector, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitDataGrid has the following properties:

  • Columns
  • CurrentCell
  • IsReadOnly
  • Items
  • SelectedCell
  • SelectedCells
  • SelectedCellText
  • SelectedCellTexts
  • SelectedItem
  • SelectedItems
  • SelectionMode
  • SelectionUnit
Parent topic: WPF Class Reference


WPFToolkitDataGridCell Class

Description

Represents a cell of a data grid control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolkitDataGridCell is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitDataGridCell has the following methods:

  • Deselect
  • ScrollIntoView
  • Select

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitDataGridCell has the following properties:

  • IsEditing
  • IsReadOnly
  • IsSelected
Parent topic: WPF Class Reference


WPFToolkitDataGridColumnHeader Class

Description

Represents an individual data grid column header.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolkitDataGridColumnHeader is derived from the WPFButtonBase class. No classes derive from this class.

Methods

WPFToolkitDataGridColumnHeader inherits all its methods from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFToolkitDataGridColumnHeader inherits all its properties from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFToolkitDataGridRow Class

Description

Represents a data grid row.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolkitDataGridRow is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitDataGridRow has the following methods:

  • Deselect
  • ScrollIntoView
  • Select

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitDataGridRow has the following properties:

  • Cells
  • IsSelected
Parent topic: WPF Class Reference


WPFToolkitDataGridRowHeader Class

Description

Represents an individual data grid row header.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolkitDataGridRowHeader is derived from the WPFButtonBase class. No classes derive from this class.

Methods

WPFToolkitDataGridRowHeader inherits all its methods from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFToolkitDataGridRowHeader inherits all its properties from WPFButtonBase, WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFToolkitDatePicker Class

Description

Represents a control that allows the user to select a date.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolkitDatePicker is derived from the WPFControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitDatePicker has the following methods:

  • ClearSelection
  • SelectDate

Properties

In addition to the properties it inherits from WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFToolkitDatePicker has the following properties:

  • SelectedDate
Parent topic: WPF Class Reference


WPFToolTip Class

Description

Represents a tool tip.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFToolTip is derived from the WPFContentControl class. No classes derive from this class.

Methods

WPFToolTip inherits all its methods from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFToolTip inherits all its properties from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFTrack Class

Description

Represents a control primitive that handles the positioning and sizing of a Thumb control and two RepeatButton controls that are used to set a Value.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFTrack is derived from the WPFFrameworkElement class. No classes derive from this class.

Methods

WPFTrack inherits all its methods from WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFTrack inherits all its properties from WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFTreeView Class

Description

Represents a control that displays hierarchical data in a tree structure that has items that can expand and collapse.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFTreeView is derived from the WPFItemsControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTreeView has the following methods:

  • Collapse
  • Expand
  • ExpandAll
  • Select

Properties

In addition to the properties it inherits from WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTreeView has the following properties:

  • ColumnHeaders
  • Items
  • SelectedItem
  • SelectedItemPath
  • SelectedItemText
  • VisibleItemPaths
Parent topic: WPF Class Reference


WPFTreeViewItem Class

Description

Represents a selectable item in a TreeView control.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFTreeViewItem is derived from the WPFHeaderedItemsControl class. No classes derive from this class.

Methods

In addition to the methods it inherits from WPFHeaderedItemsControl, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTreeViewItem has the following methods:

  • Collapse
  • Expand
  • ExpandSubTree
  • Select

Properties

In addition to the properties it inherits from WPFHeaderedItemsControl, WPFItemsControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFTreeViewItem has the following properties:

  • IsExpanded
  • IsSelected
  • Items
Parent topic: WPF Class Reference


WPFUserControl Class

Description

Provides a simple way to create a control. For additional information about interacting with a user control, see Custom Controls.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFUserControl is derived from the WPFContentControl class. No classes derive from this class.

Methods

WPFUserControl inherits all its methods from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFUserControl inherits all its properties from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFViewport3D Class

Description

Provides a rendering surface for 3-D visual content.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFViewport3D is derived from the WPFFrameworkElement class. No classes derive from this class.

Methods

WPFViewport3D inherits all its methods from WPFFrameworkElement, WPFBase, and AnyWin.

Properties

WPFViewport3D inherits all its properties from WPFFrameworkElement, WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFVisual3D Class

Description

Provides services and properties common to visual 3-D objects, including hit-testing, coordinate transformation, and bounding box calculations.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFVisual3D is derived from the WPFBase class. No classes derive from this class.

Methods

WPFVisual3D inherits all its methods from WPFBase, and AnyWin.

Properties

WPFVisual3D inherits all its properties from WPFBase, and AnyWin.

Parent topic: WPF Class Reference


WPFWindow Class

Description

Provides the ability to create, configure, show, and manage the lifetime of windows and dialog boxes.

Availability

This class is supported only on the Open Agent.

Inheritance

WPFWindow is derived from the WPFContentControl class.The following classes derive from the WPFWindow class:
  • WPFNavigationWindow

Methods

In addition to the methods it inherits from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFWindow has the following methods:

  • Activate
  • LoadAssembly

Properties

In addition to the properties it inherits from WPFContentControl, WPFControl, WPFFrameworkElement, WPFBase, and AnyWin, WPFWindow has the following properties:

  • Title
  • WindowState
Parent topic: WPF Class Reference


BrowserApplication Class

Description

BrowserApplication is the class that represents the top-level window of a browser application.

Availability

This functionality is supported only if you are using the Open Agent.

Inheritance

BrowserApplication derives from the MainWin class. No classes derive from the BrowserApplication class.

Methods and Properties

In addition to the methods and properties it inherits from the MainWin class, BrowserApplication has the following methods and properties:

Additionally, BrowserApplication provides the dynamic property browsertype, which you can use to determine which one of the supported browsers is currently used. For a complete list of the supported browsers, refer to the Release Notes.

  • ClearCache Method (BrowserApplication)
    Removes temporary internet files and optionally removes cookies.
  • CloseOtherTabs Method (BrowserApplication)
    Closes all tabs but the selected one.
  • CloseTab Function
    Closes either a specified tab or the active tab.
  • ExistsTab Method
    Tests whether a browser window exists and is currently selected.
  • GetActiveTab Function (BrowserApplication)
    Returns the browser window that is currently active.
  • GetSelectedTab Method (BrowserApplication)
    Returns the browser window that is currently selected.
  • GetSelectedTabIndex Function
    Returns the index identifier of the currently selected tab (starting with 1).
  • GetSelectedTabName Function
    Returns the name of the currently selected tab.
  • GetTabCount Function
    Returns the number of available tabs.
  • Navigate Method (BrowserApplication
    Loads the page with the specified URL.
  • OpenTab Method
    Opens a new tab and navigates to the given URL.
  • SelectTab Method
    Selects the specified tab.
Parent topic: xBrowser Classes
Related reference
MainWin Class


ClearCache Method (BrowserApplication)

Class

BrowserApplication.

Action

Removes temporary internet files and optionally removes cookies.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

browserApplication.ClearCache([option])
Variable | Description
option | Optional: Type 0 to remove all temporary internet files including cookies. Type 1 to remove all temporary internet files excluding cookies. Type 2 to delete all cookies. INTEGER.

Notes

ClearCache() is only supported for Internet Explorer.

Example

WINDOW app = Desktop.Find("./BrowserApplication")
app.ClearCache(1)
Parent topic: BrowserApplication Class


CloseOtherTabs Method (BrowserApplication)

Class

BrowserApplication.

Availability

This functionality is supported only if you are using the Open Agent.

This method works with the following browsers:
  • Mozilla Firefox
  • Internet Explorer 7.0 or later
  • Google Chrome

Action

Closes all tabs but the selected one.

Syntax

browserWindow.CloseOtherTabs()

Notes

When several tabs are open, the browser only displays some of the tabs and scroll buttons. CloseOtherTabs closes all other tabs except for the selected one, including the tabs that are not currently visible.

Example

InternetExplorer.CloseOtherTabs()
Parent topic: BrowserApplication Class


CloseTab Function

Class

BrowserApplication.

Action

Closes either a specified tab or the active tab.

Availability

This function is supported only in scripts that use the Open Agent, and works with the following browsers:
  • Mozilla Firefox
  • Internet Explorer 7.0 or later
  • Google Chrome

Syntax

browserWindow = browserApplication.CloseTab([tab])
Variable | Description
tab | Optional: The tab to close. LISTITEM.

Notes

When several tabs are open, Internet Explorer only displays some of the tabs and scroll buttons. As a result, only the currently visible tabs work with this method, which affects index semantics. For example, only the currently visible tabs are used with the LISTITEM tab parameter. Index 1 identifies the first visible tab.

CloseTab returns the active BrowserWindow after closing the tab.

Example

InternetExplorer.CloseTab()
Parent topic: BrowserApplication Class


ExistsTab Method

Class

BrowserApplication.

Action

Tests whether a browser application exists and is currently selected.

Syntax

bDoesExist = browserApplication.ExistsTab (tab)
Variable | Description
bDoesExist | Whether the browser application exists and is currently selected. BOOLEAN.
tab | Optional: The tab that is checked for being existent and currently selected.

Notes

  • ExistsTab returns TRUE if the browser application exists and is currently selected, or FALSE if the browser application does not exist, or is not selected.

  • ExistsTab does not raise an error if the browser application does not exist. To check whether or not a browser application exists and to raise an error if it does not, use ExistsTab with the Verify function, as shown below:
    Verify(SaveMessage.ExistsTab(tab),TRUE)

  • ExistsTab should always be part of another statement, so that the value returned by ExistsTab is used.

Example

[-] if(InternetExplorer.ExistsTab(3))
    [ ] InternetExplorer.SelectTab(3)
Parent topic: BrowserApplication Class


GetActiveTab Function (BrowserApplication)

Class

BrowserApplication.

Action

Returns the browser window that is currently active.

Availability

This function is supported only in scripts that use the Open Agent, and works with the following browsers:
  • Mozilla Firefox
  • Internet Explorer 7.0 or later
  • Google Chrome

Syntax

browserWindow = browserApplication.GetActiveTab()

Example

[ ] Window w
[ ] w = browser.GetActiveTab()
[-] if(w != NULL)
    [ ] Print(The active browser window is", w)
Parent topic: BrowserApplication Class


GetSelectedTab Method (BrowserApplication)

Class

BrowserApplication.

Action

Returns the browser window that is currently selected.

Availability

This function is supported only in scripts that use the Open Agent, and works with the following browsers:
  • Mozilla Firefox
  • Internet Explorer 7.0 or later
  • Google Chrome

Syntax

browserWindow = browserApplication.GetSelectedTab()

Example

[ ] Window w
[ ] w = browser.GetSelectedTab()
[-] if(w != NULL)
    [ ] Print(The selected browser window is", w)
Parent topic: BrowserApplication Class


GetSelectedTabIndex Function

Class

BrowserApplication.

Action

Returns the index identifier of the currently selected tab (starting with 1).

Availability

This function is supported only in scripts that use the Open Agent, and works with Mozilla Firefox or Internet Explorer version 7 or later.

Syntax

iIndex = browser.GetSelectedTabIndex()
Variable | Description
iIndex | The index of the current tab. INTEGER.

Notes

GetSelectedTabIndex returns the index identifier of the currently selected tab in the browser.

When several tabs are open, Internet Explorer only displays some of the tabs and scroll buttons. As a result, GetSelectedTabIndex only returns the index relative to the currently visible tabs. Index 1 identifies the first visible tab.

Example

Verify(browser.GetSelectedTabIndex(), 4)
Parent topic: BrowserApplication Class


GetSelectedTabName Function

Class

BrowserApplication.

Action

Returns the name of the currently selected tab.

Availability

This function is supported only in scripts that use the Open Agent, and works with the following browsers:
  • Mozilla Firefox
  • Internet Explorer 7.0 or later
  • Google Chrome

Syntax

sTab = browser.GetSelectedTabName()
Variable | Description
sTab | The name of the current tab. STRING.

Notes

GetSelectedTabName returns the name of the currently selected tab in the browser.

Example

Verify(browser.GetSelectedTabName(), "About SilkTest")
Parent topic: BrowserApplication Class


GetTabCount Function

Class

BrowserApplication.

Action

Returns the number of available tabs.

Availability

This function is supported only in scripts that use the Open Agent, and works with the following browsers:
  • Mozilla Firefox
  • Internet Explorer 7.0 or later
  • Google Chrome

Syntax

iTab = browser.GetTabCount()
Variable | Description
iTab | The number of available tabs. INTEGER.

Notes

GetTabCount returns the number of available tabs in the browser.

When several tabs are open, Internet Explorer only displays some of the tabs and scroll buttons. As a result, GetTabCount only returns the number of currently visible tabs.

Example

Verify(browser.GetTabCount(), 4)
Parent topic: BrowserApplication Class


Navigate Method (BrowserApplication

Class

BrowserApplication.

Action

Loads the page with the specified URL.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

browserApplication.Navigate(sUrl)
Variable | Description
sUrl | The URL. STRING.

Example

browserApplication.Navigate("http://www.microfocus.com")
Parent topic: BrowserApplication Class


OpenTab Method

Class

BrowserApplication.

Action

Opens a new tab and navigates to the given URL.

Availability

This function is supported only in scripts that use the Open Agent, and works with the following browsers:
  • Mozilla Firefox
  • Internet Explorer 7.0 or later
  • Google Chrome

Syntax

browserWindow = browserApplication.OpenTab([url])
Variable | Description
url | Optional: The URL of the tab to open. STRING.

Notes

OpenTab returns the opened browser window.

Example

InternetExplorer.OpenTab()
Parent topic: BrowserApplication Class


SelectTab Method

Class

BrowserApplication.

Action

Selects the specified tab.

Availability

This function is supported only in scripts that use the Open Agent, and works with the following browsers:
  • Mozilla Firefox
  • Internet Explorer 7.0 or later
  • Google Chrome

Syntax

browserWindow = browserApplication.SelectTab(tab)
Variable | Description
tab | The tab to select. LISTITEM.

Notes

When several tabs are open, Internet Explorer only displays some of the tabs and scroll buttons. As a result, only the currently visible tabs work with this method, which affects index semantics. For example, only the currently visible tabs are used with the LISTITEM tab parameter. Index 1 identifies the first visible tab.

Example

InternetExplorer.SelectTab(3)
Parent topic: BrowserApplication Class


BrowserObject Class

Description

BrowserObject is the class that represents the base class for all objects that are contained within a BrowserApplication.

Availability

This class is supported only on the Open Agent.

Inheritance

BrowserObject derives from the AnyWin class. The following class derives from the BrowserObject class:

  • BrowserWindow class

Limitations

Inherited methods from the AnyWin class that are not supported:

  • ClearTrap
  • GenerateDecl
  • GetAppId
  • GetArrayProperty
  • GetEverything
  • GetHandle
  • GetHelpText
  • GetID
  • GetInputLanguage
  • GetNativeClass
  • IsActive
  • IsArrayProperty
  • IsEnabled
  • IsVisible
  • OpenContextMenu
  • ScrollIntoView
  • SetArrayProperty
  • SetEnabled
  • SetInputLanguage
  • SetTrap
  • SetVisible
  • VerifyActive
  • VerifyEnabled
  • VerifyEverything

Inherited properties from the AnyWin class that are not supported:

  • AppId
  • Background
  • bActive
  • bEnabled
  • Foreground
  • hWnd
  • sFont
  • sID

Methods

In addition to the methods it inherits from the AnyWin class, BrowserObject has the following methods:

  • SetFocus Method (BrowserObject)
    Gives focus to the control.
  • Visible Property (BrowserObject)
    Returns whether the displayed object is visible.
Parent topic: xBrowser Classes
Related reference
BrowserWindow Class
AnyWin Class


SetFocus Method (BrowserObject)

Class

BrowserObject class.

Action

Gives focus to the control.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

control.SetFocus ( )

Notes

SetFocus gives the input focus to the specified control, which means it makes it the control to which the GUI directs keystrokes.

It is not necessary to call SetFocus before using any of the functions that operate on controls. Call it in cases where you plan to use TypeKeys to pass keystrokes to a pop-up window, and you need to display the window first.

Example

BasicControls.MsuiaTab1.Button.Simple.ButtonA.SetFocus()
Parent topic: BrowserObject Class


Visible Property (BrowserObject)

Class

BrowserObject.

Action

Returns whether the displayed object is visible. Displayed objects that are not visible are disabled. For example, if Visible=false for an object, the object cannot be clicked.

Syntax

protected BOOLEAN Visible {get}

Data Type

BOOLEAN.

Access

Read only.
Parent topic: BrowserObject Class


BrowserWindow Class

Description

BrowserWindow is the class that represents the top-level container for a web page. It exposes the DOM tree through DomElements. Examples include a tab in a browser or an embedded browser control in Java SWT. To check if a BrowserWindow exists and is currently selected, use the ExistsTab method of the BrowserApplication class.

Availability

This class is supported only on the Open Agent.

Inheritance

BrowserWindow derives from the BrowserObject class; no classes derive from the BrowserWindow class.

Limitations

Inherited methods from the AnyWin class that are not supported:

  • ClearTrap
  • GenerateDecl
  • GetAppId
  • GetArrayProperty
  • GetEverything
  • GetHandle
  • GetHelpText
  • GetID
  • GetInputLanguage
  • GetNativeClass
  • IsActive
  • IsArrayProperty
  • IsEnabled
  • IsVisible
  • OpenContextMenu
  • ScrollIntoView
  • SetArrayProperty
  • SetEnabled
  • SetInputLanguage
  • SetTrap
  • SetVisible
  • VerifyActive
  • VerifyEnabled
  • VerifyEverything

Inherited properties from the AnyWin class that are not supported:

  • AppId
  • Background
  • bActive
  • bEnabled
  • Foreground
  • hWnd
  • sFont
  • sID

Methods and Properties

In addition to the methods and properties it inherits from the AnyWin class and BrowserObject class, BrowserWindow has the following methods and properties:

  • AcceptAlert Method (BrowserWindow)
    Accepts a JavaScript alert by pressing OK.
  • Back Method
    Returns the URL to the previous URL in the history.
  • Close Method (BrowserWindow)
    Closes a modal browser dialog box, a tab of the browser, or the browser itself if it is the last tab (or Internet Explorer 6).
  • DismissAlert Method (BrowserWindow)
    Dismisses a JavaScript alert.
  • ExecuteJavaScript Method
    Evaluates JavaScript code within the context of the top level document.
  • Forward Method
    Advances the URL to the next URL in the history.
  • GetAlertText Method (BrowserWindow)
    Retrieves the message text of a JavaScript alert.
  • GetBrowserMajorVersion Method (BrowserWindow)
    Returns the major version number of the browser.
  • GetHtmlRect Method (BrowserWindow)
    Retrieves the rectangle of a DomElement relative to the BrowserWindow in HTML pixels.
  • GetPageSource Method (BrowserWindow)
    Returns the page source of the specified website.
  • GetUrl Function
    Returns the URL for the main document.
  • GetUserAgent Function
    Returns the browser version for a browser window.
  • IsAlertPresent Method (BrowserWindow)
    Returns true if a JavaScript alert is open.
  • Navigate Method (BrowserWindow)
    Navigates the main document to a URL.
  • Reload Method
    Reloads the main document.
  • SetViewportName (BrowserWindow)
    Set the size of the browser window to the specified size from your Browser Size list.
  • SetViewportSize (BrowserWindow)
    Sets the size of the browser window to the specified width and height.
Parent topic: xBrowser Classes
Related reference
BrowserObject Class
AnyWin Class


AcceptAlert Method (BrowserWindow)

Class

BrowserWindow.

Action

Accepts a JavaScript alert by pressing OK.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

browserWindow.AcceptAlert([promptInput])
Variable | Description
promptInput | Optional: If the JavaScript alert is a prompt, this text is passed to the alert. String.
Parent topic: BrowserWindow Class


Back Method

Class

BrowserWindow.

Action

Returns the URL to the previous URL in the history.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

window.Back()

Example

InternetExplorer.Page.Back()
Parent topic: BrowserWindow Class


Close Method (BrowserWindow)

Class

BrowserWindow.

Action

Closes a modal browser dialog box, a tab of the browser, or the browser itself if it is the last tab (or Internet Explorer 6).

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

browserwindow.Close()

Example

InternetExplorer.Page.Close()
Parent topic: BrowserWindow Class


DismissAlert Method (BrowserWindow)

Class

BrowserWindow.

Action

Dismisses a JavaScript alert.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

browserWindow.DismissAlert([promptInput])
Parent topic: BrowserWindow Class


ExecuteJavaScript Method

Class

BrowserWindow and DomElement.

Action

Evaluates JavaScript code within the context of the top level document. For pages that contain frames, this means that the script will run within the document that contains the frameset definition.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

object.ExecuteJavaScript(code, elementName)
Variable | Description
code | The JavaScript code to evaluate. STRING.
elementName | Optional: A name for the current element that can be used in the script. For example, alert(currentElement.tagName); opens a message box and displays the current element's tag name. STRING. This parameter is only available for the DomElement class.

Notes

  • BrowserWindow.ExecuteJavaScript() and
DomElement.ExecuteJavaScript() basically provide the same functionality for the Open Agent as
ExecScript(),
ExecMethod(), and
ExecLine() do for the Classic Agent.

  • ExecuteJavaScript forwards directly to the eval() DOM method. Therefore, the string provided to this method can be anything that the JavaScript runtime can evaluate. The method fails if the runtime cannot evaluate the JavaScript code.

  • This method does not return a value.

  • In framesets, BrowserWindow.ExecuteJavaScript() always evaluates the code in the top level document. DomElement.ExecuteJavaScript() always evaluates the code in the document that contains the element. Therefore, use DomElement.ExecuteJavaScript() to evaluate code within frames.

Examples

The following example calls an existing JavaScript function already contained within the page.

InternetExplorer.Page.ExecuteJavaScript("tfShowMsg(tfForm)")
Verify(InternetExplorer.Page.Find(".//input[@name='tfShowChange']").GetText(),
  "Text changed in left TextField.")

The following example injects new functions into the document and calls them.

STRING strJavaScript = "function InjectedFunction()
  "{document.getElementsByName('Pets')[0].options[2].selected=true;}"
InternetExplorer.Page.ExecuteJavaScript(strJavaScript)
InternetExplorer.Page.ExecuteJavaScript("InjectedFunction()")
Verify(FindDomElement(".//select[@name='Pets']").GetText(), "Fishes")

The following example triggers a DOM event by checking to see if the default name is currentElement.

FindDomElement(".//a[@innerText='Citrus']").ExecuteJavaScript("currentElement.onmouseover();")
Verify(FindDomElement(".//img[@name='imSwitch']").GetProperty("src"),
  "http://borland.com/HtmlTestPages/images/citrus.jpg")
Parent topic: BrowserWindow Class
Parent topic: DomElement Class


Forward Method

Class

BrowserWindow.

Action

Advances the URL to the next URL in the history.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

Forward()

Example

InternetExplorer.Page.Forward()
Parent topic: BrowserWindow Class


GetAlertText Method (BrowserWindow)

Class

BrowserWindow.

Action

Retrieves the message text of a JavaScript alert.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

alertText = browserWindow.GetAlertText()
Variable | Description
alertText | The message text of a JavaScript alert. String.
Parent topic: BrowserWindow Class


GetBrowserMajorVersion Method (BrowserWindow)

Class

BrowserWindow.

Action

Returns the major version number of the browser. For example, for Mozilla Firefox 23.0.1 the method returns 23.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

browserMajorVersion = browserWindow.GetBrowserMajorVersion()
Variable | Description
browserMajorVersion | INTEGER.
Parent topic: BrowserWindow Class


GetHtmlRect Method (BrowserWindow)

Class

BrowserWindow.

Action

Retrieves the rectangle of a DomElement relative to the BrowserWindow in HTML pixels. In contrast to the screen coordinates that are provided by the GetRect function, the coordinates provided by GetHtmlRect are not effected by the zoom level on mobile browsers. The Click function also uses HTML pixel coordinates for any DomElement. We recommend to use GetHtmlRect for all position calculations within the browser. This will ensure that your scripts are cross-browser capable and your position calculations are not effected by changing zoom levels on mobile browsers.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

htmlRect = browserWindow.GetHtmlRect()
Variable | Description
htmlRect | RECT.
Parent topic: BrowserWindow Class


GetPageSource Method (BrowserWindow)

Class

BrowserWindow class.

Action

Returns the page source of the specified website.

Syntax

pageSource = browserWindow.GetPageSource ()
Variable | Description
pageSource | The page source of the specified website. STRING.
Parent topic: BrowserWindow Class


GetUrl Function

Class

BrowserWindow.

Action

Returns the URL for the main document.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

sUrl = window.GetUrl()

Example

Verify(InternetExplorer.Page.GetUrl(),"http://www.borland.com/HtmlTestPages/Radio.html")
Parent topic: BrowserWindow Class


GetUserAgent Function

Class

BrowserWindow.

Action

Returns the browser version for a browser window.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

sText = GetUserAgent()
Variable | Description
sText | The browser version of the browser window. STRING.

Example

function IsInternetExplorer7(WINDOW browserWindow)
return StrPos("MSIE 7", browserWindow.GetUserAgent())
Parent topic: BrowserWindow Class


IsAlertPresent Method (BrowserWindow)

Class

BrowserWindow.

Action

Returns true if a JavaScript alert is open.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

alertPresent = browserWindow.IsAlertPresent()
Variable | Description
alertPresent | True if a JavaScript alert is open. Boolean.
Parent topic: BrowserWindow Class


Navigate Method (BrowserWindow)

Class

BrowserWindow.

Action

Navigates the main document to a URL.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

browserWindow.Navigate(sUrl)
Variable | Description
sUrl | The URL. STRING.

Example

page.Navigate(originalUrl)
Parent topic: BrowserWindow Class
Parent topic: Browser Window Declaration


Reload Method

Class

BrowserWindow.

Action

Reloads the main document.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

window.Reload(bypassCache)
Variable | Description
bypassCache | Optional: To allow the reload to use the browser cache, specify FALSE. By default, this value is set to FALSE. To force the reload to bypass the browser cache, specify TRUE. When you are using Google Chrome, setting this parameter has no effect. BOOLEAN.

Example

page.Reload(TRUE)
Parent topic: BrowserWindow Class


SetViewportName (BrowserWindow)

Class

BrowserWindow.

Action

Set the size of the browser window to the specified size from your Browser Size list.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

browserWindow.SetViewportName(viewportName [, orientation])
Variable | Description
viewportName | The name of the browser size in your Browser Size list. INTEGER.
orientation | Optional: The orientation of the browser window. DisplayOrientation.
Parent topic: BrowserWindow Class


SetViewportSize (BrowserWindow)

Class

BrowserWindow.

Action

Sets the size of the browser window to the specified width and height.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

browserWindow.SetViewportSize(width, height)
Variable | Description
width | The new width of the browser window. INTEGER.
height | The new height of the browser window. INTEGER.
Parent topic: BrowserWindow Class


DomButton Class

Description

DomButton is the class that represents the top-level container for a web page. It exposes the DOM tree through DomElements. Examples include a tab in Internet Explorer 7 or an embedded browser control in Java SWT.

Availability

This class is supported only on the Open Agent.

Inheritance

DomButton derives from the DomElement class and BrowserObject class; no classes derive from the DomButton class.

Methods and Properties

In addition to the methods and properties it inherits from the DomElement class and BrowserObject class, DomButton has the following methods and properties:

  • Select Method (DomButton)
    Clicks a button.
Parent topic: xBrowser Classes
Related reference
DomElement Class
BrowserObject Class


Select Method (DomButton)

Class

DomButton.

Action

Clicks a button.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

button.Select()

Example

domButton.Select()
Parent topic: DomButton Class


DomCheckBox Class

Description

DomCheckBox is the class that represents all DOM elements that were specified using the <input type='checkbox'> tag.

Availability

This class is supported only on the Open Agent.

Inheritance

DomCheckBox derives from the DomElement class and BrowserObject class; no classes derive from the DomCheckBox class.

Methods and Properties

In addition to the methods and properties it inherits from the DomElement class and BrowserObject class, DomCheckBox has the following methods and properties:

  • Check Method (DomCheckBox)
    Checks the check box.
  • IsChecked Method (DomCheckBox)
    Returns TRUE if the checkbox is checked and FALSE otherwise.
  • Select Method (CheckBoxToolItem DomCheckBox ToggleButton)
    Selects an item.
  • SetUndecided Method (DomCheckBox)
    Sets the check box to the undecided state.
  • State Property (DomCheckBox)
    Reads or writes the state of a check box in a browser.
  • Toggle Method (DomCheckBox)
    Toggles the state of the check box.
  • Uncheck Method (DomCheckBox)
    Unchecks the check box.
Parent topic: xBrowser Classes
Related reference
DomElement Class
BrowserObject Class


Check Method (DomCheckBox)

Class

DomCheckBox.

Action

Checks the check box.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

checkbox.Check()
Parent topic: DomCheckBox Class


IsChecked Method (DomCheckBox)

Class

DomCheckBox.

Action

Returns TRUE if the checkbox is checked and FALSE otherwise.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

checked = checkbox.IsChecked()
Variable | Description
checked | TRUE if the checkbox is checked and FALSE otherwise. BOOLEAN.
Parent topic: DomCheckBox Class


SetUndecided Method (DomCheckBox)

Class

DomCheckBox.

Action

Sets the check box to the undecided state.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

checkbox.SetUndecided()
Parent topic: DomCheckBox Class


State Property (DomCheckBox)

Class

DomCheckBox.

Description

Reads or writes the state of a check box. Values include:
  • 1=checked
  • 2=unchecked

For a DomCheckBox, the Open Agent does not support the state "undecided". A check box is often undecided in its initial state. It is neither checked nor unchecked, but is light gray.

Data Type

INTEGER.

Access

Read and write.

Parent topic: DomCheckBox Class


Toggle Method (DomCheckBox)

Class

DomCheckBox.

Action

Toggles the state of the check box. If the checkbox is checked it is unchecked and vice versa. If the checkbox is in the undecided state it is left undecided.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

checkbox.Toggle()
Parent topic: DomCheckBox Class


Uncheck Method (DomCheckBox)

Class

DomCheckBox.

Action

Unchecks the check box.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

checkbox.Uncheck()
Parent topic: DomCheckBox Class


DomElement Class

Description

DomElement is the class that represents any element in the DOM tree.

Availability

This class is supported only on the Open Agent.

Inheritance

DomElement derives from the BrowserObject class. The following classes derive from the DomElement class:

  • DomButton
  • DomCheckBox
  • DomForm
  • DomLink
  • DomListBox
  • DomRadioButton
  • DomTable
  • DomTableRow
  • DomTextField

Methods and Properties

In addition to the methods and properties it inherits from the BrowserObject class, DomElement has the following methods and properties:

  • DomClick Method
    Invokes a click using the DOM API.
  • DomDoubleClick Method
    Invokes a double-click using the DOM API.
  • DomMouseMove Method
    Invokes a mouse move using the DOM API.
  • ExecuteJavaScript Method
    Evaluates JavaScript code within the context of the top level document.
  • GetCssStyle Method (DomElement)
    Retrieves the computed CSS style with the specified style name.
  • GetDomAttribute Function
    Gets the value of an object specific DOM attribute.
  • GetDomAttributeList Function
    Returns the names of all DOM attributes that are available for this element.
  • GetHtmlRect Method (DomElement)
    Retrieves the rectangle of a DomElement relative to the BrowserWindow in HTML pixels.
  • GetText Function (DomElement)
    Returns the specified text in the first line of the object or the full text of the object.
  • Highlight Method
    Highlights a DOM element.
  • ScrollIntoView Method (DomElement)
    Scrolls the DOM element into the visible area of the browser window.
  • SetDomAttribute Method
    Sets the value of an object specific DOM attribute.
  • Unhighlight Method
    Removes the highlight from a DOM element, which restores the original foreground and background colors.
Parent topic: xBrowser Classes
Related concepts
Comparing API Playback and Native Playback for xBrowser
Related reference
DomButton Class
DomCheckBox Class
BrowserObject Class
DomLink Class
DomListBox Class
DomRadioButton Class


DomClick Method

Class

DomElement.

Action

Invokes a click using the DOM API.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

object.DomClick([button, pos])
Variable | Description
button | Optional: The mouse button to press. Values include:1=left, 2=right,3=center. INTEGER.
pos | Optional: The coordinates (relative to the window) at which to click. POINT.

Notes

As an alternative to the DomClick method, you can invoke the Click function which uses low-level replay for DomElements and subclasses.

Example

Desktop.Find("//BrowserApplication").Find("//BrowserWindow").Find("//INPUT[@id='autoquote:zipcode']").DomClick(1,
{59, 11})
Parent topic: DomElement Class


DomDoubleClick Method

Class

DomElement.

Action

Invokes a double-click using the DOM API.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

object.DomDoubleClick([button, pos, modifiers])
Variable | Description
button | Optional: The mouse button to press. Values include:1=left, 2=right,3=center. INTEGER.
pos | Optional: The coordinates (relative to the window) at which to click. POINT.
modifiers | Optional: The modifier to double-click. MODIFIERKEYSTATE.

Notes

As an alternative to the DomDoubleClick method, you can invoke the DoubleClick function which uses low-level replay for DomElements and subclasses.

Example

Desktop.Find("//BrowserApplication").Find("//BrowserWindow").Find("//IMG[@src='http://demo.borland.com/InsuranceWebExtJS/images/tilesV.png']").DomDoubleClick(1,
{102, 71})
Parent topic: DomElement Class


DomMouseMove Method

Class

DomElement.

Action

Invokes a mouse move using the DOM API.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

object.DomMouseMove([pos])
Variable | Description
pos | Optional: The coordinates (relative to the window) of the new location. POINT.

Notes

As an alternative to the DomMouseMove method, you can invoke the MouseMove function, which uses low-level replay for DomElements and subclasses.

Parent topic: DomElement Class


GetCssStyle Method (DomElement)

Class

DomElement.

Action

Retrieves the computed CSS style with the specified style name.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

cssStyle = element.GetCssStyle(styleName)
Variable | Description
cssStyle | String.
styleName | The CSS style name, for example 'text-decoration'. String.
Parent topic: DomElement Class


GetDomAttribute Function

Class

DomElement.

Action

Gets the value of an object specific DOM attribute. Retrieval works for attributes of type int, boolean, and string. Other attribute types are converted to string, which may not deliver the expected result.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

object.GetDomAttribute(attributeName)
Variable | Description
attributeName | The name of the attribute. STRING.
Parent topic: DomElement Class


GetDomAttributeList Function

Class

DomElement.

Action

Returns the names of all DOM attributes that are available for this element. DOM elements can dynamically add any attribute. For a list of defined DOM attributes, refer to the WC3 documentation for the Document Object Model HTML.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

list = GetDomAttributeList([specifiedOnly])
Variable | Description
list | The names of the available attributes. LIST OF STRING.
specifiedOnly | Optional: Return only the names of the specified attributes. When you are using Google Chrome or Internet Explorer 9 or later, this parameter is always set to true. BOOLEAN.

Example

// print all dom attributes of the ok button
LIST OF STRING lsAttributes =
  Desktop.Find(".//DomButton[@caption='OK']").GetDomAttributeList()
STRING strAttribute
for each strAttribute in lsAttributes
  Print(strAttribute)
Parent topic: DomElement Class


GetHtmlRect Method (DomElement)

Class

DomCheckBox.

Action

Retrieves the rectangle of a DomElement relative to the BrowserWindow in HTML pixels. In contrast to the screen coordinates that are provided by the GetRect function, the coordinates provided by GetHtmlRect are not effected by the zoom level on mobile browsers. The click function also uses HTML pixel coordinates for any DomElement. Micro Focus recommends using GetHtmlRect for all position calculations within the browser. This will ensure that your scripts are cross-browser capable and your position calculations are not effected by changing zoom levels on mobile browsers.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

htmlRect = element.GetHtmlRect()
Variable | Description
htmlRect | RECT.
Parent topic: DomElement Class


GetText Function (DomElement)

Class

DomElement.

Action

Returns the specified text in the first line of the object or the full text of the object.

Syntax

sText = object.GetText ([iStartChar, iNumChars, bFullText])
Variable | Description
sText | The text. STRING.
iStartChar | Optional: The position in the text (starting with 1) of the first character to return. Default is 1. INTEGER.
iNumChars | Optional: The number of characters to return. Default is all characters after iStartChar. INTEGER.
bFullText | Optional: If TRUE, returns the full text of the object. If FALSE (the default), returns the first line. BOOLEAN.

Notes

The GetText function returns the specified text in the first line of an object. Calling GetText with no arguments returns the entire first line of text. GetText returns up to 1023 characters.

GetText with the DOM extension returns the first line as defined by any line break characters such as <BR>. GetText always returns the same value regardless of browser size, font size, or browser. This happens because the DOM does not offer a visual interpretation of browser content and therefore Silk Test Classic has no way of knowing where the line break appears on the screen.

Example

Window link = FindBrowserApplication("/BrowserApplication")
                                                                                .FindBrowserWindow("//BrowserWindow")
                     .FindDomLink("A[@id='story2128000']")
String linkText = link.GetText()
print(linkText)
Parent topic: DomElement Class


Highlight Method

Class

DomElement.

Action

Highlights a DOM element.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

domelement.Highlight(foregroundColor, backgroundColor)
Variable | Description
foregroundColor | Foreground color for highlighted DOM elements. STRING.
backgroundColor | Background color for highlighted DOM elements. STRING.

Example

// helper method that checks
// if a property has a specific value
void CheckProperty(WINDOW domElement, STRING strName, STRING strValue)
  STRING strActualValue = domElement.GetProperty(strName)
  // value as expected -> highlight the element green
  if (strActualValue == strValue)
    domElement.Highlight("#000000", "#00FF00")
  // value different -> highlight the element red
  else
    domElement.Highlight("#000000", "#FF0000")
Parent topic: DomElement Class


ScrollIntoView Method (DomElement)

Class

DomElement.

Action

Scrolls the DOM element into the visible area of the browser window.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

object.ScrollIntoView()
Parent topic: DomElement Class


SetDomAttribute Method

Class

DomElement.

Action

Sets the value of an object specific DOM attribute. This works for attributes of type int, boolean, and string. If the specified attribute does not exist, a new attribute is created.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

domelement.SetDomAttribute(attributeName, attributeValue)
Variable | Description
attributeyName | The name of the attribute. STRING.
attributeValue | The value to set. ANYTYPE.

Example

// modify a dom link to navigate to www.borland.com
domLink.SetDomAttribute(“href”, “http://www.borland.com”)
domLink.Click()
Verify(page.GetUrl(), “http://www.borland.com”)
Parent topic: DomElement Class


Unhighlight Method

Class

DomElement.

Action

Removes the highlight from a DOM element, which restores the original foreground and background colors.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

domelement.Unhighlight()

Example

domElement.Unhighlight()
Parent topic: DomElement Class


DomForm Class

Description

DomForm is the class that represents all DOM elements that are specified using the <form> tag.

Availability

This class is supported only on the Open Agent.

Inheritance

DomForm derives from the DomElement class and BrowserObject class; no classes derive from the DomForm class.

Methods and Properties

In addition to the methods and properties it inherits from the DomElement class and BrowserObject class, DomForm has the following methods and properties:

  • Submit Method (DomForm)
    Clicks a form.
Parent topic: xBrowser Classes
Related reference
DomElement Class
BrowserObject Class


Submit Method (DomForm)

Class

DomForm.

Action

Clicks a form.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

form.Submit()

Example

domForm.Submit()
Parent topic: DomForm Class


DomLink Class

Description

DomLink is the class that represents all DOM elements that were specified using the <a> tag.

Availability

This class is supported only on the Open Agent.

Inheritance

DomLink derives from the DomElement class and BrowserObject class; no classes derive from the DomLink class.

Methods and Properties

In addition to the methods and properties it inherits from the DomElement class and BrowserObject class, DomLink has the following methods and properties:

  • Select Method (DomLink)
    Clicks a link.
Parent topic: xBrowser Classes
Related reference
DomElement Class
BrowserObject Class


Select Method (DomLink)

Class

DomLink.

Action

Clicks a link.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

link.Select()

Example

domLink.Select()
Parent topic: DomLink Class


DomListBox Class

Description

DomListBox is the class that represents all DOM elements that were specified using the <select> tag.

Availability

This class is supported only on the Open Agent.

Inheritance

DomListBox derives from the DomElement class and BrowserObject class; no classes derive from the DomListBox class.

Methods and Properties

In addition to the methods and properties it inherits from the DomElement class and BrowserObject class, DomListBox has the following methods and properties:

  • FindItem Function (DomListBox)
    Returns the index of an item in the list box.
  • GetSelText Function (DomListBox)
    Returns the text of the selected item in the list.
  • MultiSelect Method (DomListBox)
    Selects an item in the multi- or extend-selection list box.
  • Select Method (DomainUpDown DomListBox ListViewEx RadioListToolItem)
    Selects an item.
  • Unselect Method (DomListBox)
    Removes the focus from the currently selected item.
  • AllowsMultiSelect Property
    Whether the list view or table supports selecting multiple items.
  • ItemCount Property
    The number of items contained in the listbox, list view, coolbar, tab folder, row, or expandbar, or the number of rows in a table.
  • Items Property
    A list containing all items of the domain up and down controls, listbox, or listview.
  • SelectedIndices Property
    A list containing the indices of the selected items.
  • SelectedItems Property (DomListBox ListViewEx)
    A list containing the selected items.
Parent topic: xBrowser Classes
Related reference
DomElement Class
BrowserObject Class


FindItem Function (DomListBox)

Class

DomListBox

Action

Returns the index of an item in the list box.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

iIndex = list.FindItem(sItem)
Variable | Description
iIndex | The item index. INTEGER.
sItem | The item to find. STRING.

Notes

If the item sItem is not found, FindItem returns zero (0).

Example

To find the index of the item with the name "Lookup" from the list box "MyDomListBox":

// Find the DomListBox in question
window w = Desktop.Find("/BrowserApplication//BrowserWindow//SELECT[@id='MyDomListBox']")
// Find the index of the item
INTEGER iIndex = w.FindItem("Lookup")
Parent topic: DomListBox Class


GetSelText Function (DomListBox)

Class

DomListBox

Action

Returns the text of the selected item in the list.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

sText = list.GetSelText( )
Variable | Description
sText | The text of the selected item. STRING.

Notes

GetSelText returns the text of the selected item in the list. If nothing is selected, GetSelText returns an empty string (""). If the item selected contains no text or is graphical, GetSelText returns a pound sign (#) followed by the index number of the item.

Example

To get the text of the selected item with from the list box "MyDomListBox":

// Find the DomListBox in question
window w = Desktop.Find("/BrowserApplication//BrowserWindow//SELECT[@id='MyDomListBox']")
STRING sSelected = w.GetSelText()
Parent topic: DomListBox Class


MultiSelect Method (DomListBox)

Class

DomListBox.

Action

Selects an item in the multi- or extend-selection list box.

Syntax

listbox.MultiSelect (items)
Variable | Description
items | The item to select. LIST OF LISTITEM.

Notes

If the item is not selected, MultiSelect selects the item by scrolling it into view and clicking it with the mouse. If the item is already selected, MultiSelect does nothing.

After calling MultiSelect, Silk Test Classic checks whether the item was selected, and raises the exception E_CONTROL_NOT_RESPONDING if it was not.

You cannot use this method with single-selection lists.

Example

WINDOW MultiSelectListBox = page.Find(".//select[@name='colors']")
MultiSelectListBox.MultiSelect({"Blue", "Yellow"})
Parent topic: DomListBox Class


Unselect Method (DomListBox)

Class

DomListBox.

Action

Removes the focus from the currently selected item.

Syntax

Unselect(Item)
Variable | Description
Item | The item from which to remove focus. LISTITEM.

Notes

This functionality is supported only if you are using the Open Agent.

Example

// unselect the item with index 1
domListBox.Unselect(1)
Parent topic: DomListBox Class


DomRadioButton Class

Description

DomRadioButton is the class that represents all DOM elements that were specified using the <input type='radio'> tag.

Availability

This class is supported only on the Open Agent.

Inheritance

DomRadioButton derives from the DomElement class and BrowserObject class; no classes derive from the DomRadioButton class.

Methods and Properties

In addition to the methods and properties it inherits from the DomElement class and BrowserObject class, DomRadioButton has the following methods and properties:

  • RadioListSelect Method
    Selects the specified item.
  • Select Method (DomRadioButton)
    Clicks a radio button.
  • RadioListItemCount Property
    Number of items in the radiolist.
  • RadioListItems Property
    List of items in the radiolist.
  • RadioListSelectedIndex Property
    The index of the selected item in the radiolist.
  • RadioListSelectedItem Property
    Gets or sets the item that is selected in the radiolist.
  • Selected Property
    Whether the item is selected.
Parent topic: xBrowser Classes
Related reference
DomElement Class
BrowserObject Class


RadioListSelect Method

Class

DomRadioButton.

Action

Selects the specified item.

Syntax

radiobutton.RadioListSelect(item)
Variable | Description
item | The item to select. LISTITEM

Notes

This functionality is supported only if you are using the Open Agent.

This method works only with Internet Explorer version 7 or later.

Example

rb.RadioListSelect("Chimpanzee")
Verify(rb.RadioListSelectedItem, "Chimpanzee")
rb.RadioListSelect(4)
Verify(rb.RadioListSelectedItem, 4)
Parent topic: DomRadioButton Class


Select Method (DomRadioButton)

Class

DomRadioButton.

Action

Clicks a radio button.

Syntax

radiobutton.Select()

Notes

This functionality is supported only if you are using the Open Agent.

Example

WINDOW rb = GetRadioButtonInForm()
Verify(rb.Selected, FALSE)
rb.Select()
Verify(rb.Selected, TRUE)
Parent topic: DomRadioButton Class


RadioListItemCount Property

Class

DomRadioButton.

Description

Number of items in the radiolist.

Notes

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read only.

Parent topic: DomRadioButton Class


RadioListItems Property

Class

DomRadioButton.

Description

List of items in the radiolist.

Notes

This functionality is supported only if you are using the Open Agent.

Data Type

LIST OF LISTITEM.

Access

Read only.

Parent topic: DomRadioButton Class


RadioListSelectedIndex Property

Class

DomRadioButton.

Description

The index of the selected item in the radiolist.

Notes

This functionality is supported only if you are using the Open Agent.

Data Type

INTEGER.

Access

Read and write.

Parent topic: DomRadioButton Class


RadioListSelectedItem Property

Class

DomRadioButton.

Description

Gets or sets the item that is selected in the radiolist.

Notes

This functionality is supported only if you are using the Open Agent.

Data Type

LISTITEM.

Access

Read and write.

Parent topic: DomRadioButton Class


DomTable Class

Description

DomTable is the class that represents all DOM elements that were specified using the <table> tag.

Availability

This class is supported only on the Open Agent.

Inheritance

DomTable derives from the DomElement class and BrowserObject class; no classes derive from the DomTable class.

Methods and Properties

In addition to the methods and properties it inherits from the DomElement class and BrowserObject class, DomTable has the following methods and properties:

  • GetCell Function (DomTable)
    Returns the specified cell of a table.
  • GetCellText Function (DomTable)
    Returns the content of a cell element.
  • GetColumnCount Function (DomTable)
    Returns the number of columns in a table.
  • GetRow Function
    Returns the row object.
  • GetRowCount Function (DomTable)
    Returns the number of rows in a table.
  • GetRows Function
    Returns a list of DomTable rows.
  • GetRowText Function (DomTable)
    Returns the content of all cell elements of a specified row.
Parent topic: xBrowser Classes
Related concepts
Testing Columns and Tables
Related reference
BrowserObject Class


GetCell Function (DomTable)

Class

DomTable.

Action

Returns the specified cell of a table.

Syntax

window=table.GetCell(row,col)
Variable | Description
row | The index of the row from which to select the cell. LISTITEM.
col | The index of the column from which to select the cell. LISTITEM.

Notes

This functionality is supported only if you are using the Open Agent.

Example

WINDOW cell = table.GetCell(2,3)
Parent topic: DomTable Class


GetCellText Function (DomTable)

Class

DomTable.

Action

Returns the content of a cell element.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

cellText = table.GetCellText(row,col)
Variable | Description
cellText | STRING.
row | The index of the row from which to select the cell. LISTITEM.
col | The index of the column from which to select the cell. LISTITEM.

Example

cellText = table.GetCellText(1, 4)
Verify(cellText, "D")
Parent topic: DomTable Class


GetColumnCount Function (DomTable)

Class

DomTable.

Action

Returns the number of columns in a table.

Syntax

table.GetColumnCount()

Data Type

INTEGER.

Notes

This functionality is supported only if you are using the Open Agent.

Example

colCount = table.GetColumnCount()
Verify(colCount, 15)
Parent topic: DomTable Class


GetRow Function

Class

DomTable.

Action

Returns the row object.

Syntax

window = table.GetRow(itemIdentifier)
Variable | Description
itemIdentifier | The index of the row that you want to select. LISTITEM.

Notes

This functionality is supported only if you are using the Open Agent.

Example

WINDOW row = table.GetRow(1)
Parent topic: DomTable Class


GetRowCount Function (DomTable)

Class

DomTable.

Action

Returns the number of rows in a table.

Syntax

table.GetRowCount()

Notes

This functionality is supported only if you are using the Open Agent.

Example

table  = browser.find(".//DomTable[@id='xplannerTable']")
rowCount = table.GetRowCount()
Verify(rowCount, 11)
Parent topic: DomTable Class


GetRows Function

Class

DomTable.

Action

Returns a list of DomTable rows.

Syntax

list = table.GetRows()

Notes

This functionality is supported only if you are using the Open Agent.

Example

WINDOW browser = findBrowser()
WINDOW table  = browser.find(".//DomTable[@id='table1']")
LIST of WINDOW rows  = table.GetRows()
Parent topic: DomTable Class


GetRowText Function (DomTable)

Class

DomTable.

Action

Returns the content of all cell elements of a specified row.

Syntax

table.GetRowText (Row)
Variable | Description
Row | The index of the row that you want to select. LISTITEM.

Notes

DomTableRow

Example

rowText = table.GetRowText(1)
Verify(rowText, {"A","B","C","D"})
Parent topic: DomTable Class


DomTableRow Class

Description

DomTableRow is the class that represents all DOM elements that were specified using the <tr> tag.

Availability

This class is supported only on the Open Agent.

Inheritance

DomTableRow derives from the DomElement class and BrowserObject class; no classes derive from the DomTableRow class.

Methods and Properties

In addition to the methods and properties it inherits from the DomElement class and BrowserObject class, DomTableRow has the following methods and properties:

  • GetCell Function (DomTableRow)
    Returns the specified cell of a row in a table.
  • GetCellCount Function
    Returns the number of cells of the row.
Parent topic: xBrowser Classes
Related concepts
Testing Columns and Tables
Related reference
BrowserObject Class


GetCell Function (DomTableRow)

Class

DomTableRow.

Action

Returns the specified cell of a row in a table.

Syntax

window=table.GetCell(itemIdentifier)
Variable | Description
itemIdentifier | The index of the row from which to select the cell. LISTITEM.

Notes

This functionality is supported only if you are using the Open Agent.

Example

WINDOW row  = browser.find(".//DomTable//DomTableRow[2]")
WINDOW cell = row.GetCell(3)
Verify(cell.getText(), "1.2b")
Parent topic: DomTableRow Class


GetCellCount Function

Class

DomTableRow.

Action

Returns the number of cells of the row.

Syntax

table.GetCellCount()

Notes

This functionality is supported only if you are using the Open Agent.

Example

WINDOW browser = findBrowser()
WINDOW table  = browser.find(".//DomTable[@id='table1']")
WINDOW row = table.GetRow(1)
Verify(row.GetCellCount(), 4)
Parent topic: DomTableRow Class


DomTextField Class

Description

DomTextField is the class that represents all DOM elements that were specified using one of the following tags:
          <input type='text'>,
          <input type='password'>,
          <input type='file'> or
          <textarea>.

Availability

This class is supported only on the Open Agent.

Inheritance

DomTextField derives from the DomElement class and BrowserObject class; no classes derive from the DomTextField class.

Methods and Properties

In addition to the methods and properties it inherits from the DomElement class and BrowserObject class, DomTextField has the following methods and properties:

  • ClearText Method (ComboBox DomTextField TextField)
    Removes all text from the text field or the text field of the combo box.
  • SetText Method (DomTextField)
    Sets the text in the text box.
  • IsPassword Property (DomTextField)
    Gets whether the control is a password text field.
  • Text Property (DomTextField)
    Explains purpose of topic. Written as sentence fragment. Contains no more than two sentences.
Parent topic: xBrowser Classes
Related reference
BrowserObject Class


SetText Method (DomTextField)

Class

DomTextField.

Action

Sets the text in the text box.

Syntax

TextField.SetText(text)
Variable | Description
text | The text to substitute for the contents of the text field. STRING.

Notes

This functionality is supported only if you are using the Open Agent.

Example

Browser.Find(".//input[@name='billName']").SetText("John")
Parent topic: DomTextField Class


IsPassword Property (DomTextField)

Class

DomTextField.

Action

Gets whether the control is a password text field.

Data Type

BOOLEAN.

Access

Read only.

Parent topic: DomTextField Class


Text Property (DomTextField)

Class

DomTextField.

Action

Gets the text that is displayed in the text field.

Data Type

STRING.

Access

Read only.

Parent topic: DomTextField Class


Functions

This section includes the functions that are available in 4Test.

  • Agent Information
    Includes functions that provide information about the Agent.
  • Argument Pass Modes
    Describes the pass modes for function arguments.
  • Application State Control Functions
    Includes functions for application state control.
  • Array Manipulation
    Includes functions for array manipulation.
  • Character and String Conversions
    Includes functions for character and string conversions.
  • Data Type Manipulation
    Includes functions for data type manipulation.
  • Database
    Includes functions for database.
  • Data Driven
    Includes functions for data driven testing.
  • Date and Time Manipulation
    Includes functions for date and time manipulation.
  • Distributed Processing
    Includes functions for distributed processing.
  • Distributed Results Logging
    Includes functions for distributed results logging.
  • Exception Handling
    Includes functions for exception handling.
  • File Manipulation
    Includes functions for file manipulation.
  • Java Functions
    Includes functions for java.
  • List Manipulation
    Includes functions for list manipulation.
  • Locale
    Includes functions for locale.
  • Numeric Operations
    Includes functions for numeric operations.
  • Operating System Calls
    Includes functions for operating system calls.
  • Product Version Information
    Includes functions for product version information.
  • Password Encryption
    Includes functions for password encryption.
  • Random Value Operations
    Includes functions for random value operations.
  • Registry Operations (Classic Agent)
    Includes functions for registry operations with the Classic Agent.
  • Results File Operations
    Lists the functions for results file operations.
  • Runtime Status Messages
    Includes functions for runtime status messages.
  • Script Information
    Includes functions for script information.
  • Semaphores
    Includes functions for semaphores.
  • Set Manipulation
    Includes functions for set manipulation.
  • String Manipulation
    Includes functions for string manipulation.
  • SWT
    Includes functions for SWT.
  • Timer Information
    Includes functions for timers.
  • Web Browser
    Includes functions for Web browsers.
  • Windows Information
    Includes functions for Windows information.
  • Year 2000 Date Transformations
    Includes functions for date transformations.
Parent topic: The 4Test Language
Related reference
Functions by Programming Task


Agent Information

Includes functions that provide information about the Agent.

  • BindAgentOption Function
    Sets a new value for the specified agent option within a recording block or withoptions statement and returns the previous value.
  • GetAgentType Function
    Returns the Silk Test agent type, Classic Agent or Open Agent, for the specified window declaration.
  • GetMachineAgentType Function
    Returns the Silk Test agent type, Classic Agent or Open Agent, for the specified machine.
Parent topic: Functions


BindAgentOption Function

Action

Sets a new value for the specified agent option within a recording block or withoptions statement and returns the previous value.

Syntax

aOldValue = BindAgentOption (aoAgentOption, aNewValue)
Variable | Description
aOldValue | Previous value of the Agent option. The data type depends on the option. ANYTYPE.
aoAgentOption | Name of an agent option as specified by one of the constants defined for the AGENTOPTION enumerated data type.
aNewValue | Value to which to set the specified agent option. ANYTYPE.

Notes

BindAgentOption is useful when an agent option needs to be set to a particular value only for the duration of a given call. It obviates the need to get the previous value, set up a do...except statement, and so on.

BindAgentOption must be called within a recording block or a withoptions block. The value you specify overrides the value specified in the Agent Options dialog box. 4Test saves the old value of the agent option and restores it when the block is exited.

BindAgentOption uses seconds as its time unit, as does Agent.SetOption.

Example

[-] testcase Test2() appstate none
    [ ] TestApplication.SetActive()
    [ ] withoptions
    [ ] // slow down the mouse and keyboard
    [ ] BindAgentOption(OPT_KEYBOARD_DELAY, .5)
    [ ] BindAgentOption(OPT_MOUSE_DELAY, .5)
    [ ] TestApplication.Control.CheckBox.Pick()
    [ ] xCheckBox.TheCheckBox.Check()
    [ ] xCheckBox.TheCheckBox.Uncheck()
    [ ] xCheckBox.TheCheckBox.Check()
    [ ] xCheckBox.Close()
    [ ]
    [ ] // back to my usual settings, outside withoptions
    [ ] TestApplication.Control.CheckBox.Pick()
    [ ] xCheckBox.TheCheckBox.Check()
    [ ] xCheckBox.TheCheckBox.Uncheck()
    [ ] xCheckBox.TheCheckBox.Check()
    [ ] xCheckBox.Close()
Parent topic: Agent Information
Related reference
withoptions Statement


GetMachineAgentType Function

Action

Returns the Silk Test agent type, Classic Agent or Open Agent, for the specified machine.

Syntax

sAgentType = GetMachineAgentType ([hMachine])
Variable | Description
sAgentType | The type of agent, Classic_Agent or Open_Agent, that the window declaration uses. STRING.
hMachine | Optional: The handle to the machine whose Agent type you want. Default is the current machine. HMACHINE.

Notes

This function returns the name of the Silk Test agent that was used for the last agent call. For example, if you call NotepadOA.SetActive(), which uses the Open Agent, and then call GetMachineAgentType(), it returns Open Agent.

Certain functions and methods run on the Classic Agent only, such as the ClipboardClass methods. Calling GetMachineAgentType() after these functions always returns Classic Agent.

Example

[-] testcase TestGetMachineAgentType()
    [ ] // Use Classic Agent
    [ ] NotepadCA.SetActive()
    [ ] // GetMachineAgentType() defaults to Classic Agent
    [ ] Verify(GetMachineAgentType(), CLASSIC_AGENT)
    [ ]
    [ ] // Use Open Agent
    [ ] NotepadOA.SetActive()
    [ ] // GetMachineAgentType defaults to Open Agent
    [ ] Verify(GetMachineAgentType(), OPEN_AGENT)
    [ ]
    [ ] // Get Handles to both agents
    [ ] NotepadCA.SetActive()
    [ ] HANDLE hClassicMachine = GetMachine()
    [ ] NotepadOA.SetActive()
    [ ] HANDLE hOpenMachine = GetMachine()
    [ ] // Verify the handles
    [ ] Verify(GetMachineAgentType(hClassicMachine), CLASSIC_AGENT)
    [ ] Verify(GetMachineAgentType(hOpenMachine), OPEN_AGENT)
Parent topic: Agent Information
Related reference
GetMachine Function
GetAgentType Function
Disconnect Function


Argument Pass Modes

The following table describes the pass modes for function arguments.

Pass Mode | Description
in | The default. Specifies an input argument. Use this pass mode to get the value of the argument. Changes made to the argument are not reflected outside of the function, except when the argument is a complex data type.
out | Specifies an output argument, used when you only want to set the argument's value. This argument is modified in a function and the new value is passed back out of the function when the function ends.
inout | Specifies an input and output argument, used when you want to get the argument's current value and you want the function to change that value and pass the new value out.
Parent topic: Functions


Application State Control Functions

Includes functions for application state control.

  • GetAppState Function
    Returns the name of the application state function on which the specified application state or test case function is based.
  • GetAppStateList Function
    Returns the names of all the application state functions on which the specified function is based.
  • SetAppState Function
    Calls the application state function associated with the current test case for execution by the agent on the current machine.
  • SetBaseState Function
    Calls the base state function associated with the current machine.
  • SetBrowserType Function
    Sets the current browser type.
  • SetDefaultBrowserType Function
    Sets the default browser type, which is used when new Agent connections are made.
  • SetGuiType Function
    Tells 4Test to ignore the agent report of the actual GUI residing on the specified machine and instead to execute the test case as if the machine was running the specified GUI.
Parent topic: Functions


GetAppState Function

Action

Returns the name of the application state function on which the specified application state or test case function is based.

Syntax

sAppState = GetAppState (sFunctionName)
Variable | Description
sAppState | Name of the application state function on which sFunctionName is based. STRING.
sFunctionName | Name of the application state or test case function. STRING.

Notes

GetAppState allows you to access your test cases or application states programmatically, as specified by the BASEDON keyword.

The function returns an error if the specified function is not defined or is not a test case or application state function.

Example

[ ] appstate State1() basedon DefaultBaseState
[ ] appstate State2() basedon State1
[-] testcase Test1() appstate State2
    [ ]
    [-] main()
        [ ] //Prints State2
        [ ] Print("Appstate of Test1 is: {GetAppState("Test1")}")
        [ ] //Prints State1
        [ ] Print("Appstate of State2 is: {GetAppState("State2")}")
Parent topic: Application State Control Functions
Related reference
GetAppStateList Function


GetAppStateList Function

Action

Returns the names of all the application state functions on which the specified function is based.

Syntax

lsAppState = GetAppStateList (sFunctionName)
Variable | Description
lsAppState | List of application states on which sFunctionName is based, in the order they would be called. LIST OF STRING.
sFunctionName | Name of an application state or test case function. STRING.

Notes

GetAppStateList allows you to access your test cases or application states programmatically, as specified by the BASEDON keyword.

The function returns an error if the specified function is not defined or is not a test case or application state function.

Example

[ ] appstate State1() basedon DefaultBaseState
[ ] appstate State2() basedon State1
[-] testcase Test1() appstate State2
    [ ]
    [-] main()
        [ ] ListPrint(GetAppStateList("Test1"))
    [-]
        [ ] //Prints
        [ ] // ("DefaultBaseState", "State1", "State2")
Parent topic: Application State Control Functions
Related reference
GetAppState Function


SetAppState Function

Action

Calls the application state function associated with the current test case for execution by the agent on the current machine.

Syntax

SetAppState ([sAppState] )
Variable | Description
sAppState | Optional: The name of the application state function. STRING.

Notes (Standalone Testing)

You define application states with the appstate declaration. The definition of an application state can be based on another application state, which can be based on another, and so on. The base state is the lowest level of application state in this chain of inheritance.

You associate an application state with a test case when you declare the test case, as shown in the test case declaration in the example below.

Calling SetAppState for a test case, typically in the TestCaseEnter function, executes the application state chain associated with the test case, from the base state up to the highest application state.

SetAppState is called by default when you enter a test case, in the DefaultTestCaseEnter function.

In the following example, the test case uses the application state MyAppState, based on MyBaseState. Calling SetAppState executes the statements in MyBaseState followed by the statements in MyAppState.

Example (Standalone Testing)

appstate MyAppState () basedon MyBaseState
// ...
appstate MyBaseState ()
// ...
testcase MyTestCase () appstate MyAppState
// calls DefaultTestCaseEnter, which calls SetAppState

Notes (Client/Server Testing)

In a multi-client testing environment, you must execute SetAppState for each client. This invocation does not have to be within a test case. However, as with the single application case, you probably will not call this function; you call SetMultiAppStates instead, which calls SetAppState for each connected machine.

Before calling SetMultiAppStates, you must explicitly associate an application state with each machine being tested by the test case; you do this with the SetUpMachine function.

Example (Client/Server Testing)

[-] appstate MyAppState () basedon MyBaseState
    [ ] // Code to bring the application to the proper state...
[-] appstate MyBaseState ()
    [ ] // Code to bring the application to the base state...
[-] multitestcase MyTestCase (LIST OF STRING lsMachine)
    [ ] for each sMachine in lsMachine
    [ ] SetUpMachine (sMachine, Design, "MyAppState")
    [ ]
    [ ] SetMultiAppStates () // which calls SetAppState
Parent topic: Application State Control Functions
Related reference
Appstate Declaration
SetBaseState Function
SetMultiAppStates Function
SetMultiBaseStates Function
SetUpMachine Function


SetBaseState Function

Action

Calls the base state function associated with the current machine.

Syntax

SetBaseState ([sAppState])
Variable | Description
sAppState | Optional: The name of the application state function. STRING. If SetBaseState is used and no application state is provided, the test script will not navigate to the sLocation as the appstate DefaultBaseState does.

Notes

You can use SetBaseState without the optional argument sAppState when you are testing a single application from a test case. However, the DefaultTestCaseExit function automatically calls SetBaseState when you exit the test case, so it is rarely necessary to call this function. In a multi-client testing environment you must execute SetBaseState for each client. This invocation does not need to be within a test case. However, as with the single application case, you probably will not call this function. You may need to call SetMultiBaseStates, which calls SetBaseState for each connected machine, but SetMultiBaseStates is also called automatically.

As shown in the example, you define application states with the appstate declaration. The definition for an application state can be based on another application state, which can be based on another, and so on. The base state is the lowest level of application state in this chain of inheritance.

You associate an application state with a test case when you declare the test case, as shown in the test case declaration in the example. In the client/server environment, you must explicitly associate an application state with each machine being tested by the test case; you do this with the SetupMachine function.

Calling SetBaseState for a test case executes the statements associated with the base state—that is, the application state at the bottom of the appstate chain.

In the example below, the test case uses the application state MyAppState, based on MyBaseState. Calling the SetBaseState function executes only the statements in MyBaseState.

Example

[ ] appstate MyAppState () basedon MyBaseState
[-] // Code to bring the application to the proper state...
    [ ]
[ ] appstate MyBaseState ()
[-] // Code to bring the application to the base state...
    [ ]
[-] multitestcase MyTestCase (LIST OF STRING lsMachine)
    [ ] for each sMachine in lsMachine
    [ ] SetUpMachine (sMachine, Design, "MyAppState")
    [ ]
    [ ] // Call SetMultiAppStates, which calls
    [ ] // SetAppState ("MyAppState")
    [ ] SetMultiAppStates ()
    [ ]
    [ ] // Body of testcase goes here ...
    [ ]
    [ ] // The exiting testcase calls DefaultMultiTestCaseExit,
    [ ] // which calls SetBaseState ("MyBaseState")
Parent topic: Application State Control Functions
Related reference
Appstate Declaration
SetAppState Function
SetMultiBaseStates Function
SetUpMachine Function


SetBrowserType Function

Action

Sets the current browser type.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

OldBrowserType = SetBrowserType (NewBrowserType [,hMachine])
Variable | Description
OldBrowserType | The previous browser type. BROWSERTYPE.
NewBrowserType | The new browser type. BROWSERTYPE or NULL.
hMachine | Optional: Machine on which to set the browser type. Default is the current machine. HMACHINE.

Notes

SetBrowserType sets the current browser type on the current machine or on a specified machine to NewBrowserType or NULL (no browser) and returns the previous browser type. SetBrowserType does not change the value set for Default Browser in Runtime Options.

Note: When you are using the Open Agent, you can check the browser type of the currently used browser application window by querying the property browsertype. For additional information, see How Can I See Which Browser I Am Currently Using?. However, the browsertype property cannot be set, since this is given by the browser. To ensure that you are testing a specific browser type, you can either change your application configuration or start the specific browser using the base state.

Example

Assume Internet Explorer 7.0 is the current browser when the following code is run:

BROWSERTYPE btOldType
btOldType = SetBrowserType (explorer8_0)
Print ("Old type: {btOldType}")
Print ("New type: {GetBrowserType()}")

// Result:
// Old type: Internet Explorer 7.0
// New type: Internet Explorer 8.0
Parent topic: Application State Control Functions
Parent topic: Web Browser
Related reference
BROWSERTYPE Data Type
GetBrowserType Function
GetDefaultBrowserType Function
SetDefaultBrowserType Function
SetProperty Method
How Can I See Which Browser I Am Currently Using?


SetDefaultBrowserType Function

Action

Sets the default browser type, which is used when new Agent connections are made.

Syntax

OldBrowserType = SetDefaultBrowserType (NewBrowserType)
Variable | Description
OldBrowserType | The previous browser type. BROWSERTYPE.
NewBrowserType | The new browser type. BROWSERTYPE or NULL.

Notes

The default browser type is the one that is used when a new Agent connection is made.

SetDefaultBrowserType sets the default browser type to NewBrowserType or NULL (no browser) and returns the previous default browser type. SetDefaultBrowserType does not change the value set for the Default Browser field in the Runtime Options dialog box.

Example

Assume Internet Explorer 7.0 is the default browser when the following code is run.

BROWSERTYPE btOldType
btOldType = SetDefaultBrowserType (firefox1_5)
Print ("Old default: {btOldType}")
Print ("New default: {GetDefaultBrowserType()}")

// Result:
// Old default: Internet Explorer 7.0
// New default: Mozilla Firefox 1.5
Parent topic: Application State Control Functions
Parent topic: Web Browser
Related reference
BROWSERTYPE Data Type
GetBrowserType Function
GetDefaultBrowserType Function
SetBrowserType Function


SetGuiType Function

Action

Tells 4Test to ignore the agent report of the actual GUI residing on the specified machine and instead to execute the test case as if the machine was running the specified GUI.

To execute a statement, the statement must be compiled. In order to compile statements for a GUI type other than the GUI type of the host machine, you should enable networking through the Network text box in the Runtime Options dialog box. Keep the Gui Targets text box empty so that all statements are compiled. Only the statements for the GUI type set by SetGuiType() are executed.

Syntax

SetGuiType (gGuiType [, hMachine])
Variable | Description
gGuiType | The GUI type that 4Test should use. GUITYPE.
hMachine | Optional: A handle to the machine to be set. If you omit this parameter, the substitute GUI will be used on the current machine. HANDLE.

Notes

Establishing a substitute GUI for a machine affects the tags that are used and the selection of commands that are conditionalized on the GUI type.

GetGuiType() returns the GUI type specified in the last SetGuiType() call. If there was no call to SetGuiType(), then GetGuiType() returns the actual GUI type of the Agent machine.

Example

    [ ] GUITYPE gtype = GetGuiType ()
    [-] if (gtype == msw2003)
        [ ] SetGuiType (mswxp)
Parent topic: Application State Control Functions
Related reference
GetGuiName Function
GetGUIType Function
GetGuiVersion Function


Array Manipulation

Includes functions for array manipulation.

  • ArrayFind Function
    Finds the position of an element in an array.
  • ArrayResize Function
    Changes the number of elements in an array.
  • ArraySize Function
    Returns the number of elements in an array.
  • ArraySort Function
    Sorts the elements in an array.
Parent topic: Functions


ArrayFind Function

Action

Finds the position of an element in an array.

Syntax

iPos = ArrayFind (aArray, aElem [, iMaxIndex])
Variable | Description
iPos | The returned position. INTEGER.
aArray | The array to search. ARRAY OF ANYTYPE.
aElem | The element to find. ANYTYPE.
iMaxIndex | Optional: The number of elements to search. INTEGER.

Notes

ArrayFind searches the array for the element aElem, and returns the index value of the element. If you specify iMaxIndex, ArrayFind searches only the first iMaxIndex elements; otherwise, the entire array is searched.

If aArray is a multi-dimensional array, you need to specify which sub-array to search. ArrayFind treats each dimension of a multi-dimensional array as an array within an array.

If it does not find aElem, ArrayFind returns zero (0).

Example

[ ] INTEGER aiTempPerDay[5][4]
[ ]
[-] testcase arrayfind_example ()
    [ ]
    [-] aiTempPerDay = {...}
        [ ] {10, 12, 8, 17}
        [ ] {-1, 0, 17, -9}
        [ ] {14, 1, 1, 0}
        [ ] {75, 32, 18, 103}
        [ ] {9, -7, -2, 3}
    [ ] Print (ArrayFind (aiTempPerDay[1], 8)) // Prints 3
    [ ] Print (ArrayFind (aiTempPerDay[5], -7)) // 2
    [ ] Print (ArrayFind (aiTempPerDay[4], 103, 3)) // 0
    [ ] Print (ArrayFind (aiTempPerDay[2], 20)) // 0
    [ ] Print (ArrayFind (aiTempPerDay, {-1, 0, 17, -9})) // 2
Parent topic: Array Manipulation
Related reference
ArrayResize Function
ArraySize Function
ArraySort Function
IsArray Function
ListFind Function


ArrayResize Function

Action

Changes the number of elements in an array.

Syntax

ArrayResize (aArray, iNewSize [, iDim])

Variable | Description
aArray | A variable containing the array to resize. inout ARRAY OF ANYTYPE.
iNewSize | The new size of the array. INTEGER.
iDim | Optional. The dimension of aArray to resize. If omitted, the default is 1. If the array is not multi-dimensional, this argument must be 1. INTEGER.

Notes

Use ArrayResize to dynamically resize arrays. The call to ArrayResize modifies the array passed in as the first argument.

Example

[ ] INTEGER aiTempPerDay[5][4]
[-] testcase arrayresize_example ()
    [-] aiTempPerDay = {...}
        [ ] {10,12, 8, 17}
        [ ] {-1, 0, 17, -9}
        [ ] {14, 1, 1, 0}
        [ ] {75, 32, 18, 103}
        [ ] {9, -7, -2, 3}
    [ ] //Resize array to change 2nd dimension from 4 to 8
    [ ] ArrayResize (aiTempPerDay, 8, 2)
    [ ] ArrayResize (aiTempPerDay, 8, 2)
Parent topic: Array Manipulation
Related reference
ArrayFind Function
ArraySize Function
ArraySort Function
IsArray Function


ArraySize Function

Action

Returns the number of elements in an array.

Syntax

iNumElems = ArraySize (aArray [, iDim])

Variable | Description
iNumElems | The number of elements in the array. INTEGER.
aArray | The array to count. ARRAY OF ANYTYPE.
iDim | Optional: The dimension of aArray to measure; if the array is not multi-dimensional, this argument must be 1. If omitted, the default is 1. INTEGER.

Notes

Do not use ArraySize() with LIST variables. ArraySize() actually measures dimensions, and LIST variables have no dimensions.

The following example determines the size of the second dimension of the array aiTempPerDay. You can use ArraySize to determine whether dynamic resizing has occurred (see the example for the ArrayResize function).

Example

iElements = ArraySize (aiTempPerDay, 2)
Parent topic: Array Manipulation
Related reference
ArrayFind Function
ArrayResize Function
ArraySort Function
IsArray Function


ArraySort Function

Action

Sorts the elements in an array.

Syntax

ArraySort(aArray[, iMaxIndex])
Variable | Description
aArray | A variable containing the array to sort. inout ARRAY of BOOLEAN, INTEGER, REAL, STRING, or ENUM. If aArray is multi-dimensional, you need to specify the sub-array to sort. ArraySort treats each dimension of a multi-dimensional array as an array within an array.
iMaxIndex | Optional: The index of the last element to sort. If omitted, the default is the entire array. If you specify iMaxIndex, only the first iMaxIndex elements in aArray are sorted; otherwise, the entire array is sorted. INTEGER.

Notes

On Windows, Silk Test Classic sorts using a dictionary-based algorithm.

To sort lists of strings and compare strings by ASCII value, add the line AsciiSort=TRUE to the [Runtime] section of the partner.ini file. This setting also affects the comparison of strings, not just sorting of lists of strings; see STRING Data Type for more information about working with strings.

ArraySort modifies the array you pass in as aArray.

ArraySort sorts strings using the 4Test locale. Strings are compared using wcscoll.

Example

[ ] INTEGER aiTempPerDay[5][4]
[-] testcase arraysort_example ()
    [-] aiTempPerDay = {...}
        [ ] {10,12, 8, 17}
        [ ] {-1, 0,17, -9}
        [ ] {14, 1,1, 0}
        [ ] {75,32, 18, 103}
        [ ] {9, -7,-2, 3}
    [ ] ArraySort (aiTempPerDay[3])
    [ ] Print(aiTempPerDay[3]) // prints: {0,1,1,14}
    [ ] ArraySort(aiTempPerDay[5], 3)
    [ ] Print(aiTempPerDay[5]) // prints: {-7,-2,9,3}
Parent topic: Array Manipulation
Related reference
ArrayFind Function
ArrayResize Function
ArraySize Function
ArraySort Function
IsArray Function
ListSort Function


Character and String Conversions

This section includes functions that enable you to convert characters or strings. For example return the character that corresponds to an ASCII code or parse a string to a numeric value.

  • Asc Function
    Returns the ASCII code for the first character in a string.
  • Chr Function
    Returns the character that corresponds to an ASCII code.
  • Lower Function
    Converts upper-case characters into lower-case characters.
  • PrintfToString Function
    Returns a formatted expression as a string.
  • Str Function
    Converts a number to the corresponding character string.
  • Upper Function
    onverts lowercase characters to uppercase.
  • Val Function
    Converts a string to a number.
Parent topic: Functions
Related reference
STRING Data Type


Asc Function

Action

Returns the ASCII code for the first character in a string.

Syntax

iCode=Asc (sString)
Variable | Description
iCode | The returned ASCII code. INTEGER.
sString | The string to process. STRING.

Notes

Asc returns an integer that corresponds to the ASCII code for the first character in sString. If sString is null, Silk Test Classic raises the exception E_NULL.

With Unicode content, Asc returns the Unicode character code of the first character in a string.

Example

[ ] STRING sInputLine // string of text as input
[ ] INTEGER iASCII // ASCII code of first char
[-] testcase asc_example ()
    [ ] sInputLine = "QAPartner"
    [ ] iASCII = Asc (sInputLine)
    [ ] // prints: ASCII for 1st letter of 'QAPartner' is 81
    [ ] Print ("1st letter of '{sInputLine}' is", iASCII)
Parent topic: Character and String Conversions
Related reference
Chr Function


Chr Function

Action

Returns the character that corresponds to an ASCII code.

Syntax

sChar = Chr (iInt)
Variable | Description
sChar | The returned character. STRING.
iInt | The ASCII code to process. INTEGER.

Notes

Chr returns the character string assigned to the code iInt in the ASCII character set. Values outside the range 0 through 255 are invalid.

With Unicode content, Chr returns the character that corresponds to a specified Unicode-character code.

Example

[ ] INTEGER iChar // the value of a character
[ ] STRING sChar // the returned character
[-] testcase chr_example ()
    [ ] iChar = 117 // this is the letter "u"
    [ ] sChar = Chr (iChar)
    [ ] Print ("Character", iChar, "is really '{sChar}'")
    [ ] // prints: Character 117 is really 'u'
Parent topic: Character and String Conversions
Related reference
Asc Function


Lower Function

Action

Converts upper-case characters into lower-case characters.

Syntax

sConverted = Lower (sToConvert)
Variable | Description
sConverted | The converted string. STRING.
sToConvert | The string to convert. STRING.

Notes

Lower converts uppercase and mixed-case strings into lowercase characters. When there are no uppercase characters in sToConvert, Lower returns sToConvert unchanged.

Lower is locale sensitive. For example, when SetLocale is used in the script, Lower works as expected.

Lower emulates the application of the C library function _wcslwr to a specified string.

Example

STRING sTitle = "Autumn in December"
Print ("Normal case: ", sTitle)
Print ("Uppercase: ", Upper (sTitle))
Print ("Lowercase: ", Lower (sTitle))
Parent topic: Character and String Conversions
Related reference
Upper Function
SetLocale Function


PrintfToString Function

Action

Returns a formatted expression as a string.

Syntax

sString = PrintfToString (sFormat, aArgs, ...)
Variable | Description
sString | The formatted string. STRING.
sFormat | The format to use. STRING.
aArgs | Any number of arguments to format. ANYTYPE.

Notes

Like Printf, PrintfToString formats an expression, given a format string and one or more arguments. But instead of printing a formatted expression to the results file, PrintfToString returns the formatted expression as a string.

Example

STRING sText
NUMBER nMyReal = 45.7
sText = PrintfToString ("%4.2f", nMyReal)
Print (sText)
Print (Len (sText))
Print (Left (sText, 2))

// Result:
// 45.70
// 5
// 45
Parent topic: Character and String Conversions
Parent topic: Results File Operations
Related reference
Printf Function
Print Function


Str Function

Action

Converts a number to the corresponding character string.

Syntax

sNum = Str (nNum [, iWidth, iDec])
Variable | Description
sNum | The returned character. STRING.
nNum | The number to convert to a character string. NUMBER.
iWidth | Optional. The length in characters of the string returned, including digits, decimal point, and sign. INTEGER.
iDec | Optional. The number of decimal places to include in the string returned. INTEGER.

Notes

Str returns a string that corresponds to nNum, including a decimal point and decimal places if iDec is specified and is greater than zero. If iDec is omitted, no decimal places are included.

If iWidth is insufficient to hold the new string, Str increases it to the appropriate length.

If iDec is less than the number of decimal places in nNum, Str rounds the number at the least significant digit before converting it to a string.

An exception is raised if iWidth or iDec is less than zero.

Example

NUMBER n = 123.789
Print (Str (n)) // prints 124
Print (">{Str (n,5)}<") // prints > 124<
Print (">{Str (n,4,2)}<") // prints >123.79<
Parent topic: Character and String Conversions
Related reference
Printf Function
Val Function


Upper Function

Action

Converts lowercase characters to uppercase.

Syntax

sConverted = Upper(sToConvert)
Variable | Description
sConverted | The converted string. STRING.
sToConvert | The string to convert. STRING.

Notes

Upper converts lowercase and mixed-case strings to uppercase.

Upper is locale sensitive; this means that it works properly when (for example) SetLocale is used.

Upper emulates the application of the C library function _wcsupr to a specified string.

Example

STRING sTitle = "Autumn in December"
Print("Normal case: ", sTitle)
Print("Uppercase: ", Upper(sTitle))
Print("Lowercase: ", Lower(sTitle))
Parent topic: Character and String Conversions
Related reference
Lower Function
SetLocale Function


Val Function

Action

Converts a string to a number.

Syntax

nNum = Val(sToConvert)
Variable | Description
nNum | The returned number. NUMBER.
sToConvert | The string to convert. STRING.

Notes

Val is the inverse of Str; it converts a string to a numeric value. Val evaluates sToConvert until it encounters a non-numeric character, the end of the string, or a second period (.) character. It interprets the first period character it encounters, if any, as a decimal point.

Val converts a string that contains a period to a REAL. A string without a period is converted to an INTEGER.

Val accepts values up to the maximum allowed for the converted type. For strings that are converted to an integer the maximum allowed value is 2147483647. Otherwise, you will receive an error message regarding an overflow or underflow, meaning that the number you define is within the minimum or maximum Silk Test Classic can represent.

Example

Print(Val("1234")) // prints: 1234
Print(Val("-.00432")) // prints: -0.004320
Print (Val ("x")) // prints: 0
Parent topic: Character and String Conversions
Related reference
Data Type Ranges
Str Function


Data Type Manipulation

Includes functions for data type manipulation.

  • FieldsOfRecord Function
    Returns the names of the fields in a record.
  • IsArray Function
    Tests whether an expression is an array.
  • IsList Function
    Tests whether an expression is a list.
  • IsNull Function
    Tests whether the value at the specified address is NULL.
  • IsSet Function
    Tests whether a variable has been assigned an initial value.
  • TypeOf Function
    Returns the data type of an expression.
  • ValuesOfEnum Function
    Returns the list of values for an enumerated type.
Parent topic: Functions


FieldsOfRecord Function

Action

Returns the names of the fields in a record.

Syntax

lsFields = FieldsOfRecord(RecordType)
Variable | Description
lsFields | The field names of the specified record type. LIST OF STRING.
RecordType | The record type whose fields to return.

Notes

FieldsOfRecord returns the list of field names of a record type as strings. Each item in the return value corresponds to a field name in the specified record type.

Example

[ ] type BORDER_LOCATION is record
[ ] INTEGER iUpperX // X coord of upper-left corner
[ ] INTEGER iUpperY // Y coord of upper-left corner
[ ] INTEGER iLowerX // X coord of lower-right corner
[ ] INTEGER iLowerY // Y coord of lower-right corner
[-] testcase FieldsOfRecordExample()
    [ ] Print(FieldsOfRecord(BORDER_LOCATION))
    [ ] // This script prints:
    [ ] // {iUpperX, iUpperY, iLowerX, iLowerY}
Parent topic: Data Type Manipulation


IsArray Function

Action

Tests whether an expression is an array.

Syntax

bTest = IsArray(aExpression)
Variable | Description
bTest | TRUE if the expression is an array. BOOLEAN.
aExpression | The expression to test. ANYTYPE.

Notes

IsArray returns TRUE if aExpression is an array, or FALSE if it is not.

Example

[-] testcase IsArrayExample()
    [ ] INTEGER i = 1
    [-] ARRAY[2] OF STRING asFruit = {...}
        [ ] "apples"
        [ ] "oranges"
    [ ] Print(IsArray(asFruit)) // prints: TRUE
    [-] Print(IsArray(i))       // prints: FALSE
Parent topic: Data Type Manipulation
Related reference
IsList Function


IsList Function

Action

Tests whether an expression is a list.

Syntax

bTest = IsList(aExpression)
Variable | Description
bTest | TRUE if the expression is a list. BOOLEAN.
aExpression | The expression to test. ANYTYPE.

IsList tests whether aExpression is a list. It returns TRUE if the expression passed in is a list, or FALSE if it is not.

Example

[-] testcase IsListExample()
    [-] LIST liItem = {...}
        [ ] 1
        [ ] 2
        [ ] 3
    [ ] INTEGER i = 0
    [ ] Print(IsList(liItem)) // prints: TRUE
    [-] Print(IsList(i))      // prints: FALSE
Parent topic: Data Type Manipulation
Related reference
IsArray Function


IsNull Function

Action

Tests whether the value at the specified address is NULL.

Syntax

bTest = IsNull(aAddr)
Variable | Description
bTest | TRUE if the value is NULL. BOOLEAN
aAddr | The address of a value that may or may not be initialized to NULL. aAddr can be a variable name or the specification for a single element of a list or an array. inout ANYTYPE.

IsNull returns TRUE if the addressed value is NULL or FALSE if it is one of the values appropriate to the data type of aAddr.

Example

[-] ARRAY[50] OF STRING my_array = {...}
    [ ] "alpha"
    [ ] "beta"
    [ ] "gamma"
[-] testcase IsNull_example()
    [ ]
    [-] Print(IsNull(my_array[3])) // Prints: FALSE
Parent topic: Data Type Manipulation
Related reference
ARRAY Data Type
IsSet Function


IsSet Function

Action

Tests whether a variable has been assigned an initial value.

Syntax

bTest = IsSet(aVar)
Variable | Description
bTest | TRUE if the variable has been assigned. BOOLEAN.
aVar | The variable to check. ANYTYPE.

Notes

IsSet checks whether a variable has been assigned an initial value, returning TRUE if it has been assigned a value or FALSE if it has not.

For aggregate types, for example LIST OF and records, IsSet() is implementation-dependent. You should only call IsSet() against the individual items of that type.

Example

STRING s // uninitialized variable
INTEGER i = 1 // initialized variable
Print (IsSet (s)) // prints: FALSE
Print (IsSet (i)) // prints: TRUE
Parent topic: Data Type Manipulation
Related reference
IsNull Function


TypeOf Function

Action

Returns the data type of an expression.

Syntax

type = TypeOf (aExpression)
Variable | Description
type | The data type of the expression. DATATYPE.
aExpression | The expression to evaluate. ANYTYPE.

Notes

TypeOf returns the data type of an expression. A variable must be initialized before TypeOf can evaluate its data type. If you pass TypeOf an uninitialized variable, Silk Test Classic raises the exception E_VAR_NOT_SET.

Example: Printing data types

[-] type CRITTER is enum
    [ ] Beaver
    [ ] Otter
    [ ] Cat
    [ ] Weasel
[-] testcase TypeOfExample ()
    [ ] BOOLEAN bPrint = TRUE
    [ ] INTEGER iOccurrences = 27
    [ ] NUMBER nTimes = -0.003
    [ ] REAL rTemperature = -40.09
    [-] ARRAY[3] OF ANYTYPE aaStuff = {...}
        [ ] 'Hello'
        [ ] 14.3
        [ ] FALSE
    [ ] CRITTER cAnimal = Cat
    [ ] Print (TypeOf (bPrint)) // prints: boolean
    [ ] Print (TypeOf (iOccurrences)) // prints: integer
    [ ] Print (TypeOf (nTimes)) // prints: real
    [ ] Print (TypeOf (rTemperature)) // prints: real
    [ ] Print (TypeOf (aaStuff)) // prints: array[3]of anytype
    [ ] Print (TypeOf (cAnimal)) // prints: CRITTER

Example: Using TypeOf with a switch statement

[-] void SwitchByType(ANYTYPE value)
     [ ] print(TypeOf(value))
     [-] switch(TypeOf(value))
          [-] case STRING
                [ ] STRING s = value
                [ ] // do things with s...
          [-] case INTEGER
                [ ] INTEGER i = value
                [ ] // do things with i...
          [-] case LIST OF STRING
                [ ] LIST OF STRING ls = value
                [ ] // do things with ls...
[ ]
[-] testcase SwitchByTypeExample() appstate none
     [ ] SwitchByType("text")
     [ ] SwitchByType(5)
     [ ] SwitchByType({"hello", "world"})
Parent topic: Data Type Manipulation
Related reference
ClassOf Function


ValuesOfEnum Function

Action

Returns the list of values for an enumerated type.

Syntax

laValues = ValuesOfEnum(enum)
Variable | Description
laValues | A list containing the values. LIST OF ANYTYPE.
enum | An enumeration for which to return the values.

Notes

ValuesOfEnum returns a list of enumerated values, each item of which corresponds to one of the values in the enumerated type. ValuesOfEnum returns the actual values of an enumerated type, not their integer equivalents.

Example

[-] type COLOR is enum
    [ ] red
    [ ] brown
    [ ] green
    [ ] orange
    [ ] blue
    [ ] yellow
[-] testcase ValuesOfEnumExample()
    [ ] Print(ValuesOfEnum(COLOR))
    [ ] // Prints:
    [ ] // {red, brown, green, orange, blue, yellow}
Parent topic: Data Type Manipulation


Database

Includes functions for database.

  • DB_ColumnPrivileges Function
    Returns the column privileges for one or more specified table columns as a result set on the statement handle.
  • DB_Columns Function
    Returns the list of column names in specified tables as a result set on the statement handle.
  • DB_Connect Function
    Opens a connection to a database system and returns a handle to that system.
  • DB_Disconnect Function
    Disconnects Silk Test Classic from the database system and releases all resources.
  • DB_ExecuteSql Function
    Sends an SQL statement to the specified database for execution.
  • DB_FetchNext Function
    Retrieves the next row from the database. If this is the first DB_FetchNext call after DB_ExecuteSql, this function retrieves the first row.
  • DB_FetchPrev Function
    Retrieves the previous row from the database.
  • DB_FinishSql Function
    Removes the results of the SQL statement and releases the associated system resource, which means the statement handle.
  • DB_ForeignKeys Function
    Returns either a list of foreign keys, which are columns in the specified table that refer to primary keys in other tables, or a list of foreign keys in other tables that refer to the primary key in the specified table.
  • DB_GetConnectAttr Function
    Returns the current value of an ODBC driver connection attribute.
  • DB_GetNewRunID Function
    Returns a new ID which you can assign to a test run.
  • DB_PrimaryKeys Function
    Returns the column names that make up the primary key for a table.
  • DB_ProcedureColumns Function
    Returns the list of input and output parameters, as well as the columns that make up the result set for the specified procedures.
  • DB_Procedures Function
    Returns the list of procedure names stored in a specific data source.
  • DB_SetConnectAttr Function
    Sets the value of an ODBC driver connection attribute.
  • DB_SpecialColumns Function
    Retrieves the optimal set of columns, which uniquely identifies a row in the specified table, and the columns that are automatically updated when any value in the row is updated by a transaction.
  • DB_Statistics Function
    Retrieves a list of statistics about a single table and the indexes that are associated with the table.
  • DB_TablePrivileges Function
    Returns a list of tables and the privileges associated with each one.
  • DB_Tables Function
    Returns the list of table names, catalog names, or schema names, and the table types that are stored in a specific data source.
  • Database Testing Example
    Shows how to use the DBTester functions together to access a database.
  • SetRunID Function
    Assigns an ID to a test run.
Parent topic: Functions


DB_ColumnPrivileges Function

Action

Returns the column privileges for one or more specified table columns as a result set on the statement handle.

Syntax

hstmnt=DB_ColumnPrivileges (hdbc, catalog-name, schema-name, table-name, column-name)
Variable | Description
hstmnt | The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.
catalog-name | Catalog name. STRING.
schema-name | String search pattern for schema names. STRING.
table-name | String search pattern for table names. STRING.
column-name | String search pattern for column names. STRING.

Notes

  • DB_ColumnPrivileges corresponds to SQLColumnPrivileges. For additional information about SQLColumnPrivileges, see SQLColumnPrivileges Function.
  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit a variable argument, which is not a required argument, specify the argument as an empty string ("").

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

Example

To retrieve the column privileges for a specific table:

[ ] STRING cat, sch, table, col, ignore, column-name, privileges
[ ] hstmnt = DB_ColumnPrivileges (hdbc, cat, sch, table, col)
[ ] // retrieve only column and privileges; ignore the rest.
[-] while (DB_FetchNext (hstmt, ignore, ignore, ignore, column-name, ignore, ignore, privileges) == TRUE) {
    [ ] //print columns and privileges ...
[-] }
Note: If you are viewing this help topic in PDF format, this code sample might include line-breaks which are not allowed in scripts. To use this code sample in a script, remove these line-breaks.
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function
DB_TablePrivileges Function


DB_Columns Function

Action

Returns the list of column names in specified tables as a result set on the statement handle.

Syntax

hstmnt = DB_Columns (hdbc, catalog-name, schema-name, table-name, column-name)
Variable | Description
hstmnt | The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.
catalog-name | Catalog name. STRING.
schema-name | String search pattern for schema names. STRING.
table-name | String search pattern for table names. STRING.
column-name | String search pattern for column names. STRING.

Notes

  • DB_Columns corresponds to SQLColumns. For additional information about SQLColumns, see SQLColumns Function.

  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit a variable argument, specify it as NULL.

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

Example

[+] testcase DBColumnsExample () appstate none
[ ] // Retrieve all columns beginning with the letter 'I' (or 'I') for all tables
[ ] // beginning with the letter 'p' (or 'P').
[ ] // Assume that hdbc is a valid database handle returned from DB_Connect().
[ ] STRING cat, sch, tbl, col, ignore, table, column, dtype
[ ]
[ ] tbl = "p%"
[ ] cat = NULL
[ ] sch = NULL
[ ] col = "I%"
[ ]
[ ] HDATABASE hdbc
[ ] HSQL hstmnt
[ ]
[ ] hdbc = DB_Connect("DSN=<DSNNAME>")
[ ]
[ ] hstmnt = DB_Columns (hdbc, cat, sch, tbl, col)
[ ] // retrieve and print only column name and type; ignore the rest.
[+] while(DB_FetchNext (hstmnt, ignore, ignore, table, column, ignore, dtype)== TRUE)
[ ] Print ("({dtype}) {table}.{column}")
[ ] DB_FinishSql (hstmnt)
[ ]
[ ] DB_Disconnect (hdbc)
[ ]
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function
DB_TablePrivileges Function


DB_Connect Function

Action

Opens a connection to a database system and returns a handle to that system. This allows you to submit SQL statements to the database for execution.

Syntax

hdbc = DB_Connect (con_string)
Variable Description
hdbc

The handle to a database as returned by DB_Connect. HDATABASE.

con_string
A connection STRING identifying the database system and any additional logon information required by your driver. The connection string has the form:
"DSN=data source name [;attr=value[; attr=value]...]"
where data source name is the name that you specified when you generated the OBDC.INI file during the installation of your ODBC driver and attr is a keyword such as UID (User ID) or PWD (Password). For additional information about the string format that is required for your driver, refer to the documentation of the driver.

Notes

  • To connect to Oracle databases, use the Oracle version of the Oracle ODBC driver. For instance, you can use the Oracle ODBC driver provided by the Oracle instant client. If you try to use the Microsoft ODBC driver that is installed by default, DB_Connect will succeed but further DML statements may fail.

  • You can issue successive calls to DB_Connect to open simultaneous connections to different database systems, or simultaneous connections to the same database system, if such connections are supported by the database system. Use DB_Disconnect to close the connection and to release the resources. The connection handle and all resources still open for SQL statements when you use DB_Disconnect.

  • DB_Connect calls do not work from a remote agent. To connect to a database system from a remote agent, use the local DSN and point that to the remote agent. Configure the DSN to point to the machine where the database is installed. For example, if you are using a DSN for Excel, map the network drive to the location where the Excel sheet is stored and select the file as worksheet in the DSN settings.

Examples

To connect to SQL Server:
hdbc = DB_Connect ("DSN=QESS;SRVR=PIONI;UID=sa;PWD=tester")
To connect to a database system from a remote agent using the local DSN for Excel server, which is LOCALMACHINE:
DB_Connect("DSN=EXCEL;SRVR=LOCALMACHINE;UID=;PWD=")
Parent topic: Database
Related reference
DB_Disconnect Function
Database Testing Example


DB_Disconnect Function

Action

Disconnects Silk Test Classic from the database system and releases all resources.

Syntax

DB_Disconnect (hdbc)
Variable | Description
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.

Example

DB_Disconnect (hdbc)
Parent topic: Database
Related reference
DB_Connect Function
Database Testing Example


DB_ExecuteSql Function

Action

Sends an SQL statement to the specified database for execution.

Syntax

hstmnt = DB_ExecuteSql (hdbc, sql_stmnt)
Variable Description
hstmnt

The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.

hdbc

The handle to a database as returned by DB_Connect. HDATABASE.

sql_stmnt

The SQL statement to be executed. STRING.

To call a stored procedure using MS SQL, use:

execute Procedure_Name

To call a stored procedure using Oracle, use:

begin; Procedure_Name; end;

Notes

Use the DB_Fetch functions to retrieve the results of a Select statement. You must use DB_FinishSql to release the resource when you no longer need the statement handle for the DB_Fetch functions.

Examples

The following example uses a Select statement:

hstmnt = DB_ExecuteSql (hdbc, "SELECT * FROM emp")

The following example calls a stored procedure using MS SQL:

hdbc = DB_Connect (connectURL)
hstmnt = DB_ExecuteSql (hdbc, "execute claimgen.generateclaim('Sandra',SYSDATE)")

The following example calls a stored procedure using Oracle:

hdbc = DB_Connect (connectURL)
hstmnt = DB_ExecuteSql (hdbc,"begin claimgen.generateclaim('Sandra',SYSDATE); COMMIT; end;")
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function
DB_FinishSql Function
Database Testing Example


DB_FetchNext Function

Action

Retrieves the next row from the database. If this is the first DB_FetchNext call after DB_ExecuteSql, this function retrieves the first row. The retrieved row becomes the current row.

Syntax

status = DB_FetchNext (hstmnt, ...)
Variable Description
status

Returns FALSE when there are no more rows. If the specified handle, hstmnt, is invalid, the function returns FALSE and an error. BOOLEAN.

hstmnt

The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.

...

A list of output arguments representing the columns of the database row. Supply a variable of the type of each column in the row in sequential order. If the supplied arguments do not match the data types of the corresponding database fields, the function returns a type mismatch error.

The list is of variable length. This means you can specify the first n columns of the row instead of supplying variables for the entire row. The output variables are filled starting with the first column in the row and continuing sequentially through the row until the function runs out of variables. Alternatively, you can specify a single list variable. Since the list length is dynamic, you will receive all the columns of the row. Likewise, you may specify a record variable that may or may not have fields for all the columns.

Notes

When you receive a valid statement handle from a DB_ExecuteSql function that specified a Select SQL command, you can issue DB_FetchPrev calls, if the database supports these, until you perform a DB_FinishSql function for that statement handle and thereby delete the handle.

Example

[ ] INTEGER index
[ ] STRING category
[-] while (DB_FetchNext (hstmnt, index, category) == TRUE) {
    [ ] // Store values in array ...
[-] }
Parent topic: Database
Related reference
DB_FetchPrev Function
DB_FinishSql Function
Database Testing Example


DB_FetchPrev Function

Action

Retrieves the previous row from the database. If the current row is the first row in the database, this function returns a status value of FALSE. If the returned status value is TRUE, the retrieved row becomes the current row.

Syntax

status = DB_FetchPrev (hstmnt, ...)
Variable Description
status

Status of the fetch operation. If there was a previous row to retrieve, returns TRUE. If a previous row could not be retrieved, returns FALSE. If the database does not support reverse fetching, returns FALSE and an error. If the specified handle, hstmnt, is invalid, returns FALSE and an error. BOOLEAN.

hstmnt

The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.

...

A list of output arguments representing the columns of the database row. Supply a variable of the type of each column in the row in sequential order. If the supplied arguments do not match the data types of the corresponding database fields, the function returns a type mismatch error.

The list is of variable length. This means you can specify the first n columns of the row instead of supplying variables for the entire row. The output variables are filled starting with the first column in the row and continuing sequentially through the row until the function runs out of variables. Alternatively, you can specify a single list variable. Since the list length is dynamic, you will receive all the columns of the row. Likewise, you may specify a record variable that may or may not have fields for all the columns.

Notes

When you receive a valid statement handle from a DB_ExecuteSql function that specified a Select SQL command, you can issue DB_FetchPrev calls, if the database supports these, until you perform a DB_FinishSql function for that statement handle and thereby delete the handle.

Example

INTEGER index
STRING category
// fetch the first two fields of the row
bStatus = DB_FetchPrev (hstmnt, index, category)
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FinishSql Function
Database Testing Example


DB_FinishSql Function

Action

Removes the results of the SQL statement and releases the associated system resource, which means the statement handle.

Syntax

DB_FinishSql (hstmnt)
Variable | Description
hstmnt | The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.

Notes

  • After executing DB_FinishSql, you can no longer execute a fetch function for that SQL statement as the statement handle no longer exists.

  • You can close all statements for a connection with the DB_Disconnect function.

Example

DB_FinishSql (hstmnt)
Parent topic: Database
Related reference
DB_Disconnect Function
Database Testing Example


DB_ForeignKeys Function

Action

Returns either a list of foreign keys, which are columns in the specified table that refer to primary keys in other tables, or a list of foreign keys in other tables that refer to the primary key in the specified table. The list is returned as a result set on the statement handle.

Syntax

hstmnt = DB_ForeignKeys (hdbc, pcatalog-name, pschema-name, ptable-name, fcatalog-name, fschema-name, ftable-name)
Variable | Description
hstmnt | The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.
pcatalog-name | Primary key table catalog name. STRING.
pschema-name | Primary key table schema name. STRING.
ptable-name | Primary key table name. STRING.
fcatalog-name | Foreign key catalog name. STRING.
fschema-name | Foreign key schema name. STRING.
ftable-name | Foreign key table name. STRING.

Notes

  • DB_ForeignKeys corresponds to SQLForeignKeys. For additional information about SQLForeignKeys, see SQLForeignKeys Function.

  • The arguments ptable-name and ftable-name cannot contain wildcards.
  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit a variable argument, which is not a required argument, specify the argument as an empty string ("").

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

Example

[ ] STRING pcat, psch, ptable, fcat, fsch, ftable, ignore, fkcol, key-seq
[ ] hstmnt = DB_ForeignKeys (hdbc, pcat, psch, ptable, fcat, fsch, ftable)
[ ] // retrieve foreign key column and key sequence; ignore the rest.
[-] while (DB_FetchNext (hstmt, ignore, ignore, ignore, ignore, ignore, ignore, ignore, fkcol, key-seq) == TRUE) {
    [ ] //print FK columns and key sequence ...
[-] }
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function


DB_GetConnectAttr Function

Action

Returns the current value of an ODBC driver connection attribute.

Syntax

status = DB_GetConnectAttr (hdbc, attr-id, attr-value)
Variable | Description
status | Status of the get operation. Returns TRUE If the get operation was successful. Otherwise, returns FALSE. BOOLEAN.
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.
attr-id | The attribute identifier to retrieve. INTEGER.
attr-value | The string or integer variable to receive the driver attribute. ANYTYPE.

Notes

DB_GetConnectAttr corresponds to SQLGetConnectAttr. For additional information about SQLGetConnectAttr, see SQLGetConnectAttr Function.

The value of attr-id might depend on the driver. Some attr-id values are common or standard.

Example

STRING s2
//Attribute identifier 105 is used to set or get the log file name
result = DB_GetConnectAttr(hdbc, 105, s2)
Print(s2)
Parent topic: Database
Related reference
DB_SetConnectAttr Function


DB_GetNewRunID Function

Action

Returns a new ID which you can assign to a test run.

Syntax

iRunID = DBGetNewRunID
Variable | Description
iRunID | The ID generated. INTEGER.

Notes

The function DBGetNewRunID() generates an ID and this ID is then assigned to a test using SetRunID().

Parent topic: Database
Related reference
SetRunID Function


DB_PrimaryKeys Function

Action

Returns the column names that make up the primary key for a table. Information is returned as a result set on the statement handle. This function does not support returning primary keys from multiple tables in a single call.

Syntax

hstmnt = DB_PrimaryKeys (hdbc, catalog-name, schema-name, table-name)
Variable | Description
hstmnt | The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.
catalog-name | Catalog name. STRING.
schema-name | String search pattern for schema names. STRING.
table-name | String search pattern for table names. STRING.

Notes

  • DB_PrimaryKeys corresponds to SQLPrimaryKeys. For additional information about SQLPrimaryKeys, see SQLPrimaryKeys Function.

  • The table-name argument is required and cannot contain a wildcard.

  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit a variable argument, which is not a required argument, specify the argument as an empty string ("").

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

Example

[ ] STRING cat, sch, table, ignore, table-name, pkcol, kname
[ ] hstmnt = DB_PrimaryKeys (hdbc, cat, sch,table)
[ ] // retrieve primary key column and key sequence; ignore the rest.
[-] while (DB_FetchNext (hstmt, ignore, ignore, table-name, pkcol, ignore, kname) == TRUE) {
    [ ] //print table name, its PK columns, and key sequence ...
[-] }
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function


DB_ProcedureColumns Function

Action

Returns the list of input and output parameters, as well as the columns that make up the result set for the specified procedures. The information is returned as a result set on the specified statement.

Syntax

hstmnt = DB_ProcedureColumns (hdbc, catalog-name, schema-name, proc-name, column-name)
Variable | Description
hstmnt | The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.
catalog-name | Catalog name. STRING.
schema-name | String search pattern for schema names. STRING.
proc-name | String search pattern for procedure names. STRING.
column-name | String search pattern for column names. STRING.

Notes

  • DB_ProcedureColumns corresponds to SQLProcedureColumns. For additional information about SQLProcedureColumns, see SQLProcedureColumns Function.

  • The catalog-name argument cannot contain a wildcard.

  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit a variable argument, which is not a required argument, specify the argument as an empty string ("").

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

Example

[ ] STRING cat, sch, proc, col,ignore, proc-name, proc-col
[ ] hstmnt = DB_ProcedureColumns (hdbc, cat, sch,"","")
[ ] // { retrieve procedure and procedure column names; ignore the rest.
[-] while (DB_FetchNext (hstmt, ignore, ignore, proc-name, proc-col) == TRUE) {
    [ ] //print procedure and procedure column names ...
[-] }
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function


DB_Procedures Function

Action

Returns the list of procedure names stored in a specific data source.

Syntax

hstmnt = DB_Procedures (hdbc, catalog-name, schema-name, proc-name)
Variable | Description
hstmnt | The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.
catalog-name | Catalog name. STRING.
schema-name | String search pattern for schema names. STRING.
proc-name | String search pattern for procedure names. STRING.

Notes

  • Procedure is a generic term used to describe an executable object, or a named entity that can be invoked using input and output parameters.

  • DB_Procedures corresponds to SQLProcedures. For additional information about SQLProcedures, see SQLProcedures Function.

  • The catalog-name argument cannot contain a wildcard.

  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit a variable argument, which is not a required argument, specify the argument as an empty string ("").

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

Example

[ ] STRING cat, sch, ignore, proc-name
[ ] hstmnt = DB_Procedures (hdbc, cat, sch, "")
[ ] // retrieve procedure names; ignore the rest.
[-] while (DB_FetchNext (hstmt, ignore, ignore, proc-name) == TRUE) {
    [ ] //print procedure names
[-] }
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function


DB_SetConnectAttr Function

Action

Sets the value of an ODBC driver connection attribute.

Syntax

status = DB_SetConnectAttr (hdbc, attr-id, new-attr-value)
Variable | Description
status | Status of the set operation. Returns TRUE If the set operation was successful. Otherwise, returns FALSE. BOOLEAN.
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.
attr-id | The identifier of the attribute that is to be set. INTEGER.
new-attr-value | The string or integer value to which the attribute is to be set. ANYTYPE.

Notes

  • DB_SetConnectAttr corresponds to SQLSetConnectAttr. For additional information about SQLSetConnectAttr, see SQLSetConnectAttr Function.

  • The value of attr -id might be driver dependent.

Example

STRING s1 = "d:\jxglog.log"
STRING s2
//Attribute identifier 105 is used to set or get the log file name
result = DB_SetConnectAttr(hdbc, 105, s1)
result = DB_GetConnectAttr(hdbc, 105, s2)
Print(s2)
Parent topic: Database
Related reference
DB_GetConnectAttr Function


DB_SpecialColumns Function

Action

Retrieves the optimal set of columns, which uniquely identifies a row in the specified table, and the columns that are automatically updated when any value in the row is updated by a transaction.

Syntax

hstmnt = DB_SpecialColumns (hdbc, type, catalog-name, schema-name, table-name, scope, nullable)
Variable Description
hstmnt

The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.

hdbc

The handle to a database as returned by DB_Connect. HDATABASE.

type
The type of the column to return.
  • "1" for SQL_BEST_ROWID
  • "2" for SQL_ROWVER
STRING.
catalog-name

Catalog name for the table. STRING.

schema-name

Schema name for the table. STRING.

table-name

Table name. STRING.

scope
Minimum required scope of the rowid.
  • "0" for SQL_SCOPE_CURROW
  • "1" for SQL_SCOPE_TRANSACTION
  • "2" for SQL_SCOPE_SESSION
STRING.
nullable
Determines whether or not to return special columns that can have a NULL value.
  • "0" for SQL_NONULLS
  • "1" for SQL_NULLABLE
STRING.

Notes

  • DB_SpecialColumns corresponds to SQLSpecialColumns. For additional information about SQLSpecialColumns, see SQLSpecialColumns Function.
  • The type argument can have one of the following values.
    Value | Description
    "1" | SQL_BEST_ROWID returns one ore more optimal columns that allow any row in the specified table to be uniquely identified.
    "2" | SQL_ROWVER returns the columns that are automatically updated by the data source when any value in the row is updated by any transaction.

  • The table-name argument is required. It cannot be an empty string or contain a wildcard.

  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit a variable argument, which is not a required argument, specify the argument as an empty string ("").

  • The scope argument can have one of the following values:
    Value | Meaning | Description
    "0" | SQL_SCOPE_CURROW | The rowid is guaranteed to be valid while positioned on the current row.
    "1" | SQL_SCOPE_TRANSACTION | The rowid is guaranteed to be valid for the duration of the current transaction.
    "2" | SQL_SCOPE_SESSION | The rowid is guaranteed to be valid for the duration of the session, across transaction boundaries.
  • The nullable argument can have one of the following values.
    Value | Meaning | Description
    "0" | SQL_NONULLS | Exclude special columns that can have NULL values.
    "1" | SQL_NULLABLE | Return special columns even if they can have NULL values.

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

Example

[ ] STRING cat, sch, name, ignore
[ ] INTEGER I
[ ]
[ ] hstmnt = DB_SpecialColumns (hdbc, "1", cat, sch, " ", "1", "1")
[ ] // retrieve columns and data types; ignore the rest.
[-] while (DB_FetchNext (hstmt, ignore, name, I) == TRUE) {
    [ ] //print columns and data types ...
[-] }
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function


DB_Statistics Function

Action

Retrieves a list of statistics about a single table and the indexes that are associated with the table. The information is returned as a result set on the statement handle.

Syntax

hstmnt = DB_Statistics (hdbc, catalog-name, schema-name, table-name, unique, reserved)
Variable Description
hstmnt

The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.

hdbc

The handle to a database as returned by DB_Connect. HDATABASE.

catalog-name

Catalog name. STRING.

schema-name

String search pattern for schema names. STRING.

table-name

String search pattern for table names. STRING.

unique
Type of index.
  • "0" for SQL_INDEX_UNIQUE.
  • "1" for " SQL_INDEX_ALL.
STRING.
reserved
Indicates the importance of the Cardinality and Pages columns in the result set.
  • "0" for SQL_QUICK
  • "1" for " SQL_ENSURE
STRING.

Notes

  • DB_Statistics corresponds to SQLStatistics. For additional information about SQLStatistics, see SQLStatistics Function.
  • The table-name argument is required. It cannot be an empty string or contain a wildcard.
  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit a variable argument, which is not a required argument, specify the argument as an empty string ("").

  • The reserved argument can have one of the following values:
    Value | Meaning | Description
    "0" | SQL_QUICK | The Cardinality and Page columns are retrieved only if they are readily available from the server.
    "1" | SQL_ENSURE | The statistics are retrieved unconditionally.

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

Example

[ ] STRING cat, sch, tab-name, ignore
[ ] INTEGER i
[ ] hstmnt = DB_Statistics (hdbc, cat, sch, "", "1", "0")
[ ] // retrieve name of table to which stats apply and whether ix is unique; // ignore the rest.
[-] while (DB_FetchNext (hstmt, ignore, ignore, tab-name, i) == TRUE) {
    [ ] //print table names and index info ...
[ ] }
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function


DB_TablePrivileges Function

Action

Returns a list of tables and the privileges associated with each one. The information is returned as a result set on the specified statement handle.

Syntax

hstmnt = DB_TablePrivileges (hdbc, catalog-name, schema-name, table-name)
Variable | Description
hstmnt | The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.
hdbc | The handle to a database as returned by DB_Connect. HDATABASE.
catalog-name | Catalog name. STRING.
schema-name | String search pattern for schema names. STRING.
table-name | String search pattern for table names. STRING.

Notes

  • DB_TablePrivileges corresponds to SQLTablePrivileges. For additional information about SQLTablePrivileges, see SQLTablePrivileges.

  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit catalog-name or schema-name, specify the arguments as an empty string ("").

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

Example

[ ] STRING cat, sch, tab, ignore, name, grantor,grantee, priv
[ ] hstmnt = DB_TablePrivileges (hdbc, cat, sch, tab)
[ ]
[ ] // retrieve tables, privilege grantee/grantee,& privileges; ignore rest.
[-] while (DB_FetchNext (hstmt, ignore, ignore, name,grantor, grantee, priv) == TRUE) {
    [ ] //print table names, privilege grantee/grantee,& privileges...
[ ] }
Parent topic: Database
Related reference
DB_ColumnPrivileges Function
DB_FetchNext Function
DB_FetchPrev Function


DB_Tables Function

Action

Returns the list of table names, catalog names, or schema names, and the table types that are stored in a specific data source. The information is returned as a result set on the statement handle.

Syntax

hstmnt = DB_Tables (hdbc, catalog-name, schema-name, table-name, table-type)
Variable Description
hstmnt

The returned handle to the executed SQL statement. This is an input parameter for other DBTester functions, for example DB_FetchNext. HSQL.

hdbc

The handle to a database as returned by DB_Connect. HDATABASE.

catalog-name

Catalog name. STRING.

schema-name

String search pattern for schema names. STRING.

table-name

String search pattern for table names. STRING.

table-type
List of table types to match.
  • "TABLE"
  • "VIEW"
  • "TABLE,VIEW"
STRING.

Notes

  • DB_Tables corresponds to SQLTables. For additional information about SQLTables, see SQLTables Function.

  • The following wildcard characters are supported for arguments:
    Wildcard character Matches
    % The percent sign matches any character sequence.
    _ The underscore matches any single character.

  • To omit an argument variable, specify it as NULL.

  • When you receive a valid statement handle, you can call DB_FetchNext or DB_FetchPrevious to manipulate the information.

  • The wildcards do not work in a DB_Tables call against SQL Server. If you use these wildcards in such a call, Silk Test Classic returns no information.

Example

[-] testcase DBTablesExample () appstate none
    [ ] // Retrieve all tables beginning with the letter 'p' (or 'P').
    [ ] // Assume that hdbc is a valid database handle returned from DB_Connect().
    [ ] STRING cat, sch, tbl, name, tbltype, ignore
    [ ]
    [ ] cat = NULL
    [ ] sch = NULL
    [ ] tbl = "p%"
    [ ] tbltype = NULL
    [ ]
    [ ] HDATABASE hdbc
    [ ] HSQL hstmnt
    [ ]
    [ ] hdbc =DB_Connect("DSN=<DSNNAME>")
    [ ]
    [ ] // retrieve and print table name; ignore the rest.
    [ ] hstmnt = DB_Tables (hdbc, cat, sch, tbl, tbltype)
    [-] while (DB_FetchNext (hstmnt,ignore,ignore,name,ignore) == TRUE)
        [ ] print (name)
    [ ]
    [ ] DB_Disconnect (hdbc)
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function


Database Testing Example

This example shows how to use the DBTester functions together to access a database. It uses all the DBTester functions except DB_FetchPrev, which you use exactly as you use DB_FetchNext. While the example is based on a sample database, but the technique is the same regardless of which ODBC database you are accessing.

[-] testcase DBTest () appstate none
    [ ]
    [ ] // This test uses the functions in DBTester
    [ ] // to directly access an ODBC database
    [ ]
    [ ]
    [ ] INTEGER id, iheadID
    [ ] STRING sDeptName
    [ ] HDATABASE hdbc
    [ ] HSQL hstmnt
    [ ]
    [ ]
    [ ] // connect to SQL 2000 Server Test DB
    [ ] hdbc = DB_Connect ("dsn=SQLServer;PWD=sql;UID=dba")
    [ ]
    [ ] // retrieve info from Department table
    [ ] hstmnt = DB_ExecuteSql (hdbc, "SELECT * FROM department")
    [ ]
    [ ] // process the information that came back
    [ ] print ("Here's the info in the Department table:")
    [ ] print ()
    [-] while (DB_FetchNext (hstmnt, id, sDeptName, iheadID))
        [ ] print ("Dept: {id} Name: {sDeptName} Head: {iheadID}")
    [ ]
    [ ] // release resources (unneeded really
    [ ] // because immediately followed by disconnect)
    [ ] DB_FinishSQL (hstmnt)
    [ ]
    [ ] // disconnect
    [ ] DB_Disconnect (hdbc)
    [ ]
    [ ] // Results:
    [ ] // Here's the info in the Department table:
    [ ] //
    [ ] // Dept: 100 Name: R & D Head: 501
    [ ] // Dept: 200 Name: Sales Head: 902
    [ ] // Dept: 300 Name: Finance Head: 1293
    [ ] // Dept: 400 Name: Marketing Head: 1576
    [ ] // Dept: 500 Name: Shipping Head: 703
Parent topic: Database
Related reference
DB_FetchNext Function
DB_FetchPrev Function


SetRunID Function

Action

Assigns an ID to a test run.

Syntax

SetRunID (iRunID)
Variable | Description
iRunID | The ID generated by DBGetNewRunID(). INTEGER.

Notes

The function DBGetNewRunID() generates an ID and this ID is then assigned to a test using SetRunID().

Parent topic: Database


Data Driven

Includes functions for data driven testing.

  • DefaultRunDataDrivenTestCase Function
    Populates the records for a data-driven test case and runs the test case using those records.
Parent topic: Functions


DefaultRunDataDrivenTestCase Function

Action

Populates the records for a data-driven test case and runs the test case using those records.

Syntax

void DefaultRunDataDrivenTestCase (sTestCaseName[,lsRowsToRun])
Variable | Description
sTestCaseName | the name of the test case to run. STRING.
lsRowsToRun

Optional: A list of queries which define the rows to run, or which specify that the sample record should be run. If this argument is not passed in, then all rows for all tables are executed. LIST OF STRING.

Specification of lsRowsToRun:

  • If NULL, all rows will be run for all tables.
  • At most, one string may be passed for each table. The string can have one of the following forms:
    • USE_SAMPLE_RECORD_<Table>: Only the sample record is used for <Table>.
    • select * from ""<Table>"" where ...: The query is executed in order to collect the rows to run for <Table>.
    • If no string is passed for a table, then all rows are executed for that table.

The statement used to run the test case is:

[ ] @(sTestCaseName) (laDataRecords)

Notes

This function runs the data-driven test case once for every combination of specified rows. For each table used by the test case, the function fetches the specified rows from the database or uses the sample record in the data-driven test script file.

The function relies on the native typecasting of a LIST OF ANYTYPE to a record type, so that the test cases are responsible for type-checking.

In accordance with standard recovery system functions, DefaultRunDataDrivenTestCase() can be overridden by RunDataDrivenTestCase().

Parent topic: Data Driven


Date and Time Manipulation

Includes functions for date and time manipulation.

  • AddDateTime Function
    Adds time to a DATETIME value and returns the new DATETIME.
  • DateStr Function
    Returns the current date.
  • DiffDateTime Function
    Calculates the difference between two DATETIME values.
  • ElapsedStr Function
    Returns the time that has elapsed since the currently executing script began running.
  • FormatDateTime Function
    Formats a DATETIME according to a format string consisting of one or more masks and returns the formatted value as a string.
  • GetDateTime Function
    Captures the current date and time from the host system and returns a DATETIME value.
  • GetDateTimePart Function
    Returns the integer value of a particular part in the specified DATETIME value.
  • MakeDateTime Function
    Generates and returns a DATETIME value constructed from the arguments you supply.
  • MakeTime Function
    Generates and returns a TIME value constructed from the arguments you supply.
  • ParseDateFormat Function
    Parses a string containing a date and validates each component of the date by comparing it to a specified format.
  • Sleep Function
    Pauses execution of the current script for the specified length of time.
  • TimeStr Function
    Returns the current time.
Parent topic: Functions


AddDateTime Function

Action

Adds time to a DATETIME value and returns the new DATETIME.

Syntax

newDT=AddDateTime (Datetime=[, iDays, iHours, iMins, iSecs, iMsecs])
Variable | Description
newDT | Returned sum of datetime and specified time values. DATETIME.
Datetime | The original DATETIME value. DATETIME.
iDays | Optional. A day’s value to add to Datetime. INTEGER.
iHours | Optional. An hour’s value to add to Datetime. INTEGER.
iMins | Optional. A minute’s value to add to Datetime. INTEGER.
iSecs | Optional. A second’s value to add to Datetime. INTEGER.
iMsecs | Optional. A microsecond’s value to add to Datetime. INTEGER.

Notes

The DATETIME data type represents values from 4713 BC to 19999 AD. You can use this function to add positive or negative numbers to a DATETIME value. The optional values are not artificially constrained—for example, you are not limited to values less than 24 for iHours or less than 60 for iMins. Remember that there is no year zero.

To skip over an optional argument, use NULL as a placeholder.

Example

datetime = GetDateTime ()
// increment current time by one hour
newDateTime = AddDateTime (datetime, NULL, 1)
Parent topic: Date and Time Manipulation
Related reference
DiffDateTime Function
MakeDateTime Function


DateStr Function

Action

Returns the current date.

Syntax

sDate=DateStr ( )
Variable | Description
sDate | The current date. STRING.

Notes

DateStr returns the current date as a string, formatted as mm/dd/yy.

DateStr is locale independent.

Example

STRING sDate
sDate = DateStr ()
Print ("Today is {sDate}")
Parent topic: Date and Time Manipulation
Related reference
TimeStr Function


DiffDateTime Function

Action

Calculates the difference between two DATETIME values.

Syntax

iDaysDiff = DiffDateTime (DateTime1, DateTime2 [,iHours, iMinutes, iSeconds, iMicrosecs])
Variable | Description
iDaysDiff | The returned difference in days resulting from subtracting DateTime2 from DateTime1. INTEGER.
DateTime1 | The DATETIME value from which DateTime2 is subtracted. DATETIME.
DateTime2 | The DATETIME value to be subtracted from DateTime1. DATETIME.
iHours | Optional. The Hours component of the difference between DateTime1 and DateTime2. out INTEGER.
iMinutes | Optional. The Minutes component of the difference between DateTime1 and DateTime2. out INTEGER.
iSeconds | Optional. The Seconds component of the difference between DateTime1 and DateTime2. out INTEGER.
iMicrosecs | Optional. The Microseconds component of the difference between DateTime1 and DateTime2. out INTEGER.

Notes

The return value is just the Days component of the difference between the DATETIME values. The hours, minutes, seconds, and microseconds differences are returned in optional out arguments.

To skip over an optional argument, use NULL as a placeholder.

You can use the optional out arguments to specify variables that receive the corresponding field from the calculated difference. In the first example below, the function returns difference values for days, hours, minutes, and seconds-ignoring microseconds. In the second example, the only values of interest are in the minutes, seconds, and microseconds fields of the difference and those are the only values returned.

Examples

iDaysDiff = DiffDateTime (CurrentDate, LastDate, iHoursDiff,
iMinsDiff, iSecsDiff)
DiffDateTime (CurrentDate, LastDate, NULL,
iMinsDiff, iSecsDiff, iMicrosecs)
Parent topic: Date and Time Manipulation
Related reference
AddDateTime Function
MakeDateTime Function


ElapsedStr Function

Action

Returns the time that has elapsed since the currently executing script began running.

Syntax

sTime =  ElapsedStr ( )
Return | Description
sTime | The elapsed time. STRING.

Notes

  • You can use this function to measure performance.
  • The elapsed time for the following is logged automatically in the results file:
    • Each test case in the currently executing script.
    • The entire currently executing script.
    • Each script in a suite.

Example

[-] main ()
    [ ] STRING sElapsedTime
    [ ] // get the elapsed time
    [ ] sElapsedTime = ElapsedStr ()
    [ ] Print ("Script has run for {sElapsedTime} (h:mm:ss)")
Parent topic: Date and Time Manipulation
Related reference
TimeStr Function


FormatDateTime Function

Action

Formats a DATETIME according to a format string consisting of one or more masks and returns the formatted value as a string.

Syntax

sDateTime = FormatDateTime(Datetime[, sFormat])
Variable | Description
sDateTime | The datetime value converted to a formatted string as specified. STRING.
Datetime | The value that is to be formatted. DATETIME.
sFormat | Optional The formatting string. If this argument is omitted, the function uses the default format. The date and time masks and the default format are listed below under Notes. STRING.

Notes

The function ignores any fields not identified by format masks. Thus you can use this function to format any subset of the specified DATETIME value.

Characters that are not in the following table are copied unchanged to the returned string—for example, the delimiter / (forward slash).

The following formatting masks are available:
Mask | Description
d | Display the day as a number without a leading zero (1-31).
dd | Display the day as a number with a leading zero (01-31).
ddd | Display the day as an abbreviation (Sun, Mon, Tue, Wed, Thu, Fri, or Sat).
dddd | Display the day as a full name (Sunday-Saturday).
w | Display the day of the week as a number (1 for Sunday through 7 for Saturday).
ww | Display the week of the year as a number (1-53).
m | Display the month as a number without a leading zero (1-12). If m immediately follows h or hh, the minute rather than the month is displayed.
mm | Display the month as a number with a leading zero (01-12). If mm immediately follows h or hh, the minute is displayed.
mmm | Display the month as an abbreviation (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, or Dec).
mmmm | Display the month as a full name (January-December).
y | Display the day of the year as a number (1-366).
yy | Display the year as a 2-digit number (00-99).
yyyy | Display the year as a 4-digit number (100-9999).
h | Display the hour as a number without leading zeros (0-23).
hh | Display the hour as a number with leading zeros (00-23).
n | Display the minute as a number without leading zeros (0-59).
nn | Display the minute as a number with leading zeros (00-59).
s | Display the second as a number without leading zeros (0-59).
ss | Display the second as a number with leading zeros (00-59)
fff | Display the millisecond as a number with leading zeros (000000-999999).
AM/PM | Use the 12-hour clock and display an uppercase AM with any hour before noon. Display an uppercase PM with any hour between noon and 11:59 P.M.
am/pm | Use the 12-hour clock and display a lowercase AM with any hour before noon. Display a lowercase PM with any hour between noon and 11:59 P.M.
A/P | Use the 12-hour clock and display an uppercase A with any hour before noon. Display an uppercase P with any hour between noon and 11:59 P.M.
a/p | Use the 12-hour clock and display a lowercase A with any hour before noon. Display a lowercase P with any hour between noon and 11:59 P.M.
xxxx | Use the date format for the current locale.
XXXX | Use the time format for the current locale.
If you specify no format string, FormatDateTime uses the following default format:
"m/d/yy h:mm:ss AM/PM"

FormatDateTime will correctly compute years that have fewer than four digits.

The following are some examples of date formats you can use.
Format | Matches These Date Strings
m/d/yy | 9/18/05, 09/18/05
mm/dd/yy | 09/18/05 (but not 9/18/05)
m-d-yy | 9-18-05, 09-18-05
yy/m/d | 05/9/18, 05/09/18
mmddyy | 091805
mm/dd/yyyy | 9/18/2006, 09/18/2006
yyyy/m/d | 2006/9/18, 2006/09/18
mmm d, yyyy | Sep 18, 2006

In addition to the date masks, date formats can include the following delimiters:

  • Space (matches one or more spaces)

  • / - : , . (forward slash, hyphen, colon, comma, or period)

Any other character in the format generates an error.

Example

STRING sTimeStamp = FormatDateTime(GetDateTime(), "hh:nn:ss AM/PM")
STRING sDateStamp = FormatDateTime(GetDateTime(), "mm/dd/yy")
Print("Script started at {sTimeStamp} on {sDateStamp}.")
Parent topic: Date and Time Manipulation
Related reference
GetDateTime Function
GetDateTimePart Function
DATETIME Data Type


GetDateTime Function

Action

Captures the current date and time from the host system and returns a DATETIME value.

Syntax

Datetime = GetDateTime()
Variable | Description
Datetime | The returned current date and time. DATETIME.

Example

DATETIME DayAndTime
STRING sTime
STRING sDate
// get current date and time
DayAndTime = GetDateTime ()
// format current date and time
sTime = FormatDateTime(DayAndTime, "hh:nn:ss AM/PM")
sDate = FormatDateTime(DayAndTime, "mm/dd/yy")
Print("Script started at {sTime} on {sDate}.")
Parent topic: Date and Time Manipulation
Related reference
GetDateTimePart Function
FormatDateTime Function


GetDateTimePart Function

Action

Returns the integer value of a particular part in the specified DATETIME value.

Syntax

iValue = GetDateTimePart (datetime, partname)
Variable | Description
iValue | The value of the field in datetime specified by the partname constant. INTEGER.
datetime | The DateTime variable from which you want a field. DATETIME.
partname | A constant from the set defined for the enumerated data type. DATETIMEPART.

Notes

  • The returned value, iValue, is the integer representing the value of the part identified by partname, the DATETIMEPART constant you passed into the function.

  • One of the DATETIMEPART members is DTP_DAYOFWEEK, which specifies the day of the week of the DATETIME variable. The GetDateTimePart function numbers days of the week starting with 0 for Sunday, 1 for Monday, and so on.

  • The FormatDateTime function numbers days of the week differently than the GetDateTimePart function, using 1 for Sunday, 2 for Monday, and so on.

Example

[ ] DATETIME dt = "2000-05-30 19:42"
[ ] DATETIMEPART dateTimePart
[ ] LIST OF DATETIMEPART lsDateTimePart = {DTP_YEAR, DTP_MONTH, DTP_DAY, DTP_HOUR, DTP_MINUTE, DTP_SECOND, DTP_MICROSEC, DTP_DAYOFYEAR, DTP_DAYOFWEEK}
[-] for each dateTimePart in lsDateTimePart
    [ ] Print("{dateTimePart}:{GetDateTimePart(dt, dateTimePart)}")
[ ]
[ ] // Result:
[ ] // DTP_YEAR: 2000
[ ] // DTP_MONTH: 5
[ ] // DTP_DAY: 30
[ ] // DTP_HOUR: 19
[ ] // DTP_MINUTE: 42
[ ] // DTP_SECOND: 0
[ ] // DTP_MICROSEC: 0
[ ] // DTP_DAYOFYEAR: 151
[ ] // DTP_DAYOFWEEK: 2
Parent topic: Date and Time Manipulation
Related reference
GetDateTime Function
DATETIME Data Type
DATETIMEPART Data Type
FormatDateTime Function


MakeDateTime Function

Action

Generates and returns a DATETIME value constructed from the arguments you supply.

Syntax

Datetime = MakeDateTime (iYear, iMonth, iDay [,iHour, iMinute, iSecond, iMicrosec])
Variable | Description
Datetime | The generated date and time. DATETIME.
iYear | The full year value (century included). INTEGER.
iMonth | The month (1 - 12). INTEGER.
iDay | The day (1 - 31). INTEGER.
iHour | Optional: The hour value in 24-hour format (0 - 23). INTEGER.
iMinute | Optional: The minute (0 - 59). INTEGER.
iSecond | Optional: The second (0 - 59). INTEGER.
iMicrosec | Optional: The microsecond (0 - 9999999). INTEGER.

Notes

  • The DATETIME data type represents values from 4713 BC to 19999 AD. Use a negative value to represent BC dates.

  • If you do not specify the optional parameters, this function sets the time to midnight.

Example

// Specify a date of Jan. 2, 1996 at 8:15 AM
datetime = MakeDateTime (1996, 1, 2, 8, 15)
Parent topic: Date and Time Manipulation
Related reference
AddDateTime Function
DiffDateTime Function
MakeTime Function


MakeTime Function

Action

Generates and returns a TIME value constructed from the arguments you supply.

Syntax

Time = MakeTime (iHour [,iMinute, iSecond, iMicrosec])
Variable | Description
Time | The returned time, as specified. TIME.
iHour | The hour value in 24-hour format (0 - 23). INTEGER.
iMinute | Optional: The minute (0 - 59). INTEGER.
iSecond | Optional: The second (0 - 59). INTEGER.
iMicrosec | Optional: The microsecond (0 - 9999999). INTEGER.

Example

// Specify a time of 2:08:15 PM
time = MakeTime (14, 8, 15)
Parent topic: Date and Time Manipulation
Related reference
AddDateTime Function
DiffDateTime Function
MakeDateTime Function


ParseDateFormat Function

Action

Parses a string containing a date and validates each component of the date by comparing it to a specified format. The string must contain a day, month, and year to be considered a valid date.

Syntax

bValidDate = ParseDateFormat (sDate, sFormat [, dtParsedDate, iThreshold, iMinYear, iMaxYear, iAging ] )
Variable | Description
bValidDate | TRUE if sDate is a valid date of the format sFormat and passes the iMinYear and iMaxYear tests; otherwise, FALSE. BOOLEAN.
sDate | The string containing the date to parse. STRING.
sFormat | The date format to compare sDate against. See below for how to specify. STRING.
dtParsedDate | Optional: Output variable to hold the parsed date if bValidDate is TRUE. Not set if bValidDate is FALSE. DATETIME (the time component is undefined).
iThreshold | Optional: Specifies how to convert a two-digit year in sDate to a four-digit year (19xx or 20xx). If the year in sDate is less than or equal to iThreshold, the year in dtParsedDate is 20xx. If the year in sDate is greater than iThreshold, the year in dtParsedDate is 19xx. INTEGER.
iMinYear | Optional: A factor in considering whether the date passes validation: If the date after transformation (after applying iThreshold and iAging) is less than iMinYear, bValidDate is set to FALSE. Specify a four-digit year. INTEGER.
iMaxYear | Optional: A factor in considering whether the date passes validation: If the date after transformation (after applying iThreshold and iAging) is greater than iMaxYear, bValidDate is set to FALSE. Specify a four-digit year. INTEGER.
iAging | Optional: Number of years to add to the date after transformation (after application of iThreshold). INTEGER. Leap years: The date February 29 will be aged to February 28 if the resulting year is not a leap year.

Notes

  • ParseDateFormat is used automatically in the Year 2000 date transformations specified in Runtime Options, but you can also call the function manually.

  • ParseDateFormat takes a string sDate and determines whether it is a valid date that conforms to a specified format sFormat. The function returns TRUE if sDate is a valid date and, optionally, stores the date as the DATETIME variable dtParsedDate. You can specify how you want two-digit years (such as 97) converted to four-digit years using the optional iThreshold argument. You can specify a range of years within which the converted date must fall in order for the function to return TRUE using iMinYear and iMaxYear.

  • Even though you may specify the format of the date string, the contents of the string are interpreted based on the 4Test locale.

Specifying sFormat

The date format consists of date masks and optional delimiters.

You can use the following masks to specify components of the date in sFormat.

Date mask | Description
yy | Two-digit year.
yyyy | Four-digit year.
m | Month with one or two digits (1–12).
mm | Month with exactly two digits (01–12).
mmm | Abbreviated month name (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, or Dec); case insensitive.
mmmm | Full month name (January, February, and so on); case insensitive.
d | Day of month with one or two digits (1–31).
dd | Day of month with exactly two digits (01–31).
ddd | Abbreviated day of the week (Sun, Mon, Tue, Wed, Thu, Fri, or Sat); case insensitive. Allowed in sFormat but ignored by ParseDateFormat.
dddd | Full day of the week (Monday, Tuesday, and so on); case insensitive. Allowed in sFormat but ignored by ParseDateFormat.

Delimiters for sFormat

Valid delimiter | Description
(Space) | One or more spaces
/ | Forward slash
- | Hyphen
: | Colon
, | Comma
. | Period

Sample Date Formats for sFormat

Format | Matches these date strings
m/d/yy | 9/18/97, 09/18/97, 9/18/30
mm/dd/yy | 09/18/97 (but not 9/18/97)
m-d-yy | 9-18-97, 09-18-97
yy/m/d | 97/9/18, 97/09/18
mmddyy | 091897
mm/dd/yyyy | 9/18/1997, 09/18/1997, 9/18/1930, 9/18/2030
yyyy/m/d | 1997/9/18, 1997/09/18
mmm d, yyyy | Sep 18, 1997

Example

This example passes three strings to ParseDateFormat:

[-] testcase ParseDateFormatTest () appstate none
    [ ] STRING sDate1, sDate2, sDate3, sFormat
    [ ] INTEGER iThreshold
    [ ] DATETIME dt = "1900-12-25" // set to dummy value in case parsing
    [ ] // fails and variable is not set by function
    [ ] sDate1 = "05/30/51"
    [ ] sDate2 = "09/21/04"
    [ ] sDate3 = "09-21-04"
    [ ] sFormat = "mm/dd/yy" // date format to compare strings to
    [ ] iThreshold = 30
    [ ]
    [ ] Print (ParseDateFormat(sDate1,sFormat,dt,iThreshold))
    [ ] Print (dt)
    [ ] Print (ParseDateFormat (sDate2,sFormat,dt,iThreshold))
    [ ] Print (dt)
    [ ] Print (ParseDateFormat (sDate3,sFormat,dt,iThreshold))
    [ ] Print (dt)
    [ ]
    [ ] // Result:
    [ ] // TRUE // sDate1 parsed as valid date of format sFormat
    [ ] // 1951-05-30 // greater than threshold, so year is 1951
    [ ] // TRUE // sDate2 parsed as valid date of format sFormat
    [ ] // 2006-09-21 // less than threshold, so year is 2006
    [ ] // FALSE // sDate3 did not parse as a valid date of format sFormat
    [ ] // 2006-09-21 // dt unchanged (not set by third call to function)
Parent topic: Date and Time Manipulation
Parent topic: Year 2000 Date Transformations


Sleep Function

Action

Pauses execution of the current script for the specified length of time.

Syntax

Sleep (nSeconds)
Variable | Description
nSeconds | The length of time in seconds for the script to pause. NUMBER

Notes

Sleep causes the script that is currently running to pause for nSeconds seconds.

Because Silk Test Classic automatically synchronizes with an application, you will almost never need to use Sleep for synchronization purposes.

Example

Sleep (0.5) // half a second
Parent topic: Date and Time Manipulation


TimeStr Function

Action

Returns the current time.

Syntax

sTime = TimeStr ( )
Variable | Description
sTime | The current time. STRING.

Notes

TimeStr returns the current time in the format hh:mm:ss.

Example

STRING sTime
sTime = TimeStr ()
Print ("The current time is {sTime}")
Parent topic: Date and Time Manipulation
Related reference
DateStr Function
ElapsedStr Function


Distributed Processing

Includes functions for distributed processing.

  • Connect Function
    Establishes a connection to the specified machine.
  • Disconnect Function
    Disconnects a machine.
  • DisconnectAll Function
    Disconnects all currently connected machines.
  • GetConnected Function
    Gets the list of machine handles for all connected machines.
  • GetMachine Function
    Returns a handle to the current machine.
  • GetMachineData Function
    Gets the named data associated with the specified machine.
  • GetMachineName Function
    Returns the name of the specified machine.
  • IsConnected Function
    Tests whether or not a machine has been connected to the Agent with the Connect function and has not been disconnected by the Disconnect function.
  • SetMachine Function
    Makes the specified machine the current machine.
  • SetMachineData Function
    Sets the named data to the specified value and associates it with the specified machine.
  • SetMultiAppStates Function
    This client/server function calls the application state function associated with each connected machine.
  • SetMultiBaseStates Function
    This client/server function calls the base state function associated with each connected machine.
  • SetUpMachine Function
    Connects one target machine and sets it up in preparation for the functions that handle application states in a multi-application environment.
Parent topic: Functions


Connect Function

Action

Establishes a connection to the specified machine.

Syntax

hMachine = Connect ([sMachine, [sAgentType]])
Variable | Description
hMachine | A handle to the machine. HMACHINE.
sMachine

Optional: The name of the machine to connect to. STRING.

For TCP/IP networking only: If you specify a machine name, Silk Test Classic connects using the default port number, 2965 for the Classic Agent or 22901 for the Open Agent. However, you can specify a port number by using a colon separator after the machine name. For example, enter mymachine:5592 to connect to mymachine through port number 5592. If the port is in use or invalid, no error is reported and the default port is used instead.

If you do not specify a machine name, Silk Test Classic returns local host or the host name specified in the Runtime Options dialog box.

sAgentType

Optional: The type of agent that you want to connect to. The allowed values are CLASSIC_AGENT and OPEN_AGENT.

If you do not specify an Agent, Silk Test Classic uses the default agent type.

Notes

  • Connect connects the running 4Test script to machine sMachine. This machine becomes the current machine. Silk Test Classic raises the exception E_AGENT if the connection cannot be made.

  • Connect establishes a link using the Silk Test agent type specified using sAgentType on sMachine. Function calls are made to the agent on sMachine which is not necessarily the machine where the script is running.

  • Connect establishes a link using the Silk Test agent type specified using sAgentType on sMachine. Function calls are made to the agent on sMachine which is not necessarily the machine where the script is running.

  • Your code should store the HMACHINE handle returned by Connect so that other distributed functions can use it later.

  • Do not use the Connect function to specify a NetBIOS adapter number; if you do, Silk Test Classic ignores this value. The NetBIOS adapter number is read by the value you set in the Network text box on the Runtime Options dialog box.

  • If you call a method on a window declaration, the window declaration determines the agent type, not the Connect function. The Silk Test agent type specified in a window declaration always overrides the agent type specified in the Connect function.

Examples

The following example illustrates the use of HMACHINE to print data from the host machine and target machine.

HMACHINE target_machine // target computer
HMACHINE host_machine // host computer
STRING sTarget = "sunfish" // target's network name
STRING sHost = "moonray" // host's network name
// save host’s handle
host_machine = GetMachine ()
// save target's handle
target_machine = Connect (sTarget)
// what is currently active on the target machine?
Print ("Active window on Target: ",Desktop.GetActive ())
// switch to host machine
SetMachine (host_machine)
// what is currently active on host machine?
Print ("Active window on Host: ",Desktop.GetActive ())
Disconnect (target_machine) // disconnect from target

The following example illustrates the use of sAgentType to create a script that uses the Classic Agent, Open Agent, or the default agent.

[-] testcase mytestcase()
    [ ] HANDLE hOpenAgent, hClassicAgent
    [ ] // this executes against the default agent, which is set in the Runtime dialog
    [ ] SomeAgentFunction1()
    [ ] // this connects to the Open Agent on a remote/local machine
    [ ] hOpenAgent = Connect("agentmachine", OPEN_AGENT)
    [ ] // this executes against the Open Agent
    [ ] hOpenAgent->SomeAgentFunction1()
    [ ] // this connects to the Classic Agent on a remote/local machine
    [ ] hClassicAgent = Connect("agentmachine",CLASSIC_AGENT)
    [ ] // this executes against the Classic Agent
    [ ] hClassicAgent->SomeAgentFunction1()
Parent topic: Distributed Processing
Related concepts
Tips for Using the Remote File Functions
Related tasks
Testing with a Remote Open Agent
Related reference
Disconnect Function
GetMachine Function


Disconnect Function

Action

Disconnects a machine.

Syntax

Disconnect (hMachine)
Variable | Description
hMachine | A handle to the machine to disconnect from. HMACHINE.

Notes

You retrieve the handle to the machine (type HMACHINE) in the call to Connect or GetMachine.

An exception is raised if the machine is already disconnected or if a bad machine handle was specified.

If you are running a distributed test and connect to an agent machine, exiting the script before you call the Disconnect function will prevent Pass and Fail totals from being reported to the results files.

Example

HMACHINE target_machine // target computer
STRING sTarget = "sunfish" // target's network name

// save target's handle
target_machine = Connect (sTarget)
// determine what is currently active on the target
Print ("Active on Target: ", Desktop.GetActive())

Disconnect (target_machine) // disconnect from target
Parent topic: Distributed Processing
Related concepts
Tips for Using the Remote File Functions
Related reference
DisconnectAll Function
Connect Function
GetMachine Function
SetMachine Function


DisconnectAll Function

Action

Disconnects all currently connected machines.

Syntax

DisconnectAll ( )

Notes

Nothing happens if no machines are connected.

Parent topic: Distributed Processing
Related reference
Connect Function
GetMachine Function
SetMachine Function


GetConnected Function

Action

Gets the list of machine handles for all connected machines.

Syntax

lhMachines = GetConnected()
Variable | Description
lhMachines | The returned list of machine handles. LIST OF HMACHINE.

Example

LIST OF HMACHINE lhAllMachines
lhAllMachines = GetConnected()
Parent topic: Distributed Processing
Related reference
Connect Function
SetUpMachine Function


GetMachine Function

Action

Returns a handle to the current machine.

Syntax

hMachine = GetMachine()
Variable | Description
hMachine | A handle to the current machine. HMACHINE.

Notes

GetMachine returns a handle to the current machine, which is set by Connect or SetMachine.

Example

HMACHINE host_machine // host computer
HMACHINE target_machine // target computer
host_machine = GetMachine()
target_machine = Connect("sunfish")
Parent topic: Distributed Processing
Related reference
Connect Function
Disconnect Function
GetMachineName Function
SetMachine Function


GetMachineData Function

Action

Gets the named data associated with the specified machine.

Syntax

aMachineData = GetMachineData(hMachine, sName)
Variable | Description
aMachineData | Returned data. ANYTYPE.
hMachine | Handle to the machine of interest. HMACHINE. Since a string specifying the Agent name for the machine is automatically cast to a legal handle for the machine, you can also supply such a string for this argument.
sName | The name that you have assigned to the data with the SetMachineData function. STRING.

Notes

Pass NULL for hMachine to specify the current machine for the current thread. The following example passes the machine handle, which is equally valid.

Example

[-] for each hMachine in GetConnected()
    [ ] spawn
    [ ] // Make specified machine the current machine
    [ ] SetMachine(hMachine)
    [ ]
    [ ] sState = GetMachineData(hMachine, "State")
    [ ] ...
Parent topic: Distributed Processing
Related reference
SetMachineData Function


GetMachineName Function

Action

Returns the name of the specified machine.

Syntax

sName = GetMachineName ([hMachine])
Variable | Description
sName | A STRING containing the name of the machine. STRING.
hMachine | Optional. The handle to the machine whose name you want. Default is the current machine. HMACHINE.

Notes

GetMachineName returns the name of the machine specified by the hMachine handle. This is the same name that was either entered in the Agent Name text box in the Runtime Options dialog box, or passed to the Connect function.

Parent topic: Distributed Processing
Related reference
Connect Function
Disconnect Function
GetMachine Function
SetMachine Function


IsConnected Function

Action

Tests whether or not a machine has been connected to the Agent with the Connect function and has not been disconnected by the Disconnect function.

Syntax

bTest = IsConnected[sMachName | hTarget])
Variable | Description
bTest | TRUE if the specified machine is connected. BOOLEAN.
sMachName | Optional: The name of the machine. If you specify no machine, IsConnected returns TRUE if any machine is connected to the Agent. STRING.
hTarget | Optional: A handle to the machine. HMACHINE.

Notes

You can optionally supply sMachName or hTarget, but not both.

Example

HMACHINE target_machineA
STRING sTargetA = "sunfish"           // one target computer
STRING sTargetB = "moonray"           // another target computer

target_machineA = Connect(sTargetA)
Print (IsConnected (sTargetA))        // prints: TRUE
Print (IsConnected (target_machineA)) // prints: TRUE
Print (IsConnected (sTargetB))        // prints:FALSE
Parent topic: Distributed Processing
Related reference
Connect Function
Disconnect Function
SetUpMachine Function


SetMachine Function

Action

Makes the specified machine the current machine.

Syntax

SetMachine (Machine)
Variable | Description
Machine | A handle to the machine to be set as the current machine. HMACHINE or STRING.

Notes

  • SetMachine makes Machine the current machine. You can obtain the handle of a machine by calling Connect or GetMachine. Machine may also be a string representing the machine name, as specified in the SetupMachine function.

  • Calls to the 4Test agent will be made on the machine on which the script is running.

Example

[-] testcase SetMachineExample ()
    [ ] HMACHINE target_machine // target computer
    [ ] HMACHINE host_machine // host computer
    [ ] host_machine = GetMachine () // save host's handle
    [ ] // save target's handle
    [ ] target_machine = Connect ("sunfish")
    [ ] // what is currently active on target machine?
    [ ] Print ("Active on Target: ", Desktop.GetActive ())
    [ ] // what is currently active on host machine?
    [ ] SetMachine (host_machine)
    [ ] Print ("Active on Host: ", Desktop.GetActive ())
Parent topic: Distributed Processing
Related reference
GetMachine Function
SetUpMachine Function


SetMachineData Function

Action

Sets the named data to the specified value and associates it with the specified machine.

Syntax

SetMachineData (hMachine, sName, aData)
Variable | Description
hMachine | The handle to the machine for which to set machine data. HMACHINE. Since a string specifying the Agent name for the machine is automatically cast to a legal handle for the machine, you can also supply such a string for this argument.
sName | The name of this machine data—to be used subsequently to retrieve the data. STRING.
aData | The data to be associated with this machine. ANYTYPE.

Notes

Pass NULL for hMachine to specify the current machine for the current thread.

You can think of machine data as being a global variable associated with the specified machine. You provide a name for the variable so you can subsequently retrieve the data and you initialize the variable with data of any type, including a user-defined type. You can set the data or retrieve the data multiple times. You can set multiple pieces of data with different names for the same machine.

Because the machine data is global, any thread in the current script can use any machine data name to retrieve the associated data, as long as the owning machine is still connected. Because you also have to supply the machine name to retrieve machine data, the data name does not have to be unique for each machine.

Machine data is freed when the script disconnects from that machine.

Example

SetUp (STRING sMach1, STRING sTestState)

// set machine data called "State" to 3d arg.’s value
SetMachineData (sMach1, "State", sTestState)
Parent topic: Distributed Processing
Related reference
GetMachineData Function


SetMultiAppStates Function

Action

This client/server function calls the application state function associated with each connected machine. If there is no application state function for a machine, it calls the DefaultBaseState function.

Syntax

SetMultiAppStates ()

Notes

This function uses spawn statements to execute all the application state functions in parallel.

Example

[-] multitestcase MyTest (STRING sMach1, STRING sMach2)
    [ ] SetupMachine (sMach1, MyFirstApp, "MyFirstAppState")
    [ ] SetupMachine (sMach2, MySecondApp,"MySecondAppState")
    [ ] SetMultiAppStates ()
Parent topic: Distributed Processing
Related reference
SetAppState Function
SetMultiBaseStates Function
SetUpMachine Function


SetMultiBaseStates Function

Action

This client/server function calls the base state function associated with each connected machine. If there is no base state function for a machine, it calls the DefaultBaseState function.

Syntax

SetMultiBaseStates ()

Notes

  • You will probably have no reason to call SetMultiBaseStates. The DefaultMultiTestCaseExit function shown below is present in the cs.inc file and is automatically called during the exit from a test case. Most users will want to use this as coded.

  • This function uses spawn statements to execute all the base state functions in parallel.

Example

[-] DefaultMultiTestCaseExit (BOOLEAN bException)
    [-] if (bException)
        [ ] ExceptLog ()
    [ ]
    [ ] SetMultiBaseStates ()
    [ ] DisconnectAll ()
Parent topic: Distributed Processing
Related reference
SetBaseState Function
SetMultiAppStates Function
SetUpMachine Function


SetUpMachine Function

Description

Connects one target machine and sets it up in preparation for the functions that handle application states in a multi-application environment.

Syntax

SetUpMachine (sMachine [, wMainWin [, sAppState]])
Variable | Description
sMachine | The name of the machine being set up. STRING.
wMainWin | Optional: The main window of the application being tested on this machine, as defined in the main window declaration for this test case. WINDOW.
sAppState | Optional: The name of the application state to be associated with this machine for this test case. STRING.

Notes

The SetUpMachine function issues a Connect call for the specified machine. It then stores information needed by other 4Test functions in a multi-application environment. Subsequently, these other functions will retrieve the main window name and the application state associated with each machine. The wMainWin and sAppState arguments are used in the recovery system. If you provide no main window name, Silk Test Classic cannot invoke your application.

Example

SetUpMachine ("client1", PersonnelApp, "MyAppState")
SetUpMachine ("client2", PersonnelApp, "MyAppState")
SetUpMachine ("server", ServerApp, "ServerAppState")
Parent topic: Distributed Processing
Related reference
Connect Function
SetMultiAppStates Function


Distributed Results Logging

Includes functions for distributed results logging.

  • GetTestsFailedCount Function
    Returns the total number of tests that failed.
  • GetTestsPassedCount Function
    Returns the total number of tests passed.
  • GetTestPlanName Function
    Returns the name of the current testplan.
  • GetTotalElapsedStr Function
    Returns the elapsed time for the test case to execute.
  • GetTotalErrorCount Function
    Returns the total number of errors generated from all test cases executed in the current test plan.
  • GetTotalWarningCount Function
    Returns the total number of warnings generated from all test cases executed in the current test plan.
  • IsTestPlan Function
    Tests whether a testplan is running.
Parent topic: Functions


GetTestsFailedCount Function

Action

Returns the total number of tests that failed.

Syntax

iCount = GetTestsFailedCount()
Variable | Description
iCount | The total number of tests failed. INTEGER.

Notes

GetTestsFailedCount does not count user defined errors when using LogError().

Parent topic: Distributed Results Logging
Related reference
GetTestsPassedCount Function
GetTotalElapsedStr Function


GetTestsPassedCount Function

Action

Returns the total number of tests passed. Only test cases that do not contain errors are counted.

Syntax

iCount = GetTestsPassedCount()
Variable | Description
iCount | The total number of tests passed. INTEGER.
Parent topic: Distributed Results Logging
Related reference
GetTestsFailedCount Function
GetTotalElapsedStr Function


GetTestPlanName Function

Action

Returns the name of the current testplan.

Syntax

sName = GetTestPlanName()
Variable | Description
sName | The name of the current testplan. Return value is NULL if not in a testplan. STRING.
Parent topic: Distributed Results Logging


GetTotalElapsedStr Function

Action

Returns the elapsed time for the test case to execute.

Syntax

sTime = GetTotalElapsedStr()
Variable | Description
sTime | Elapsed time for execution. INTEGER.
Parent topic: Distributed Results Logging
Related reference
GetTestsFailedCount Function
GetTestsPassedCount Function


GetTotalErrorCount Function

Action

Returns the total number of errors generated from all test cases executed in the current test plan.

Syntax

iCount = GetTotalErrorCount()
Variable | Description
iCount | The number of errors generated in the current test plan. INTEGER.
Parent topic: Distributed Results Logging
Related reference
GetTestsFailedCount Function
GetTestsPassedCount Function
GetTotalElapsedStr Function
GetTotalWarningCount Function


GetTotalWarningCount Function

Action

Returns the total number of warnings generated from all test cases executed in the current test plan.

Syntax

iCount = GetTotalWarningCount()
Variable | Description
iCount | The number of warnings generated in the current test plan. INTEGER.
Parent topic: Distributed Results Logging
Related reference
GetTotalErrorCount Function
GetTestsFailedCount Function
GetTestsPassedCount Function
GetTotalElapsedStr Function


IsTestPlan Function

Action

Tests whether a testplan is running.

Syntax

bTest = IsTestPlan()
Variable | Description
bTest | TRUE if the testplan is running. BOOLEAN.
Parent topic: Distributed Results Logging


Exception Handling

Includes functions for exception handling.

  • ExceptCalls Function
    Returns a list of the function calls that have caused an exception during the execution of the current test case.
  • ExceptClear Function
    Clears information related to the current exception.
  • ExceptData Function
    Returns the data associated with the most recent exception.
  • ExceptLog Function
    Logs an exception to a results file.
  • ExceptNum Function
    Returns the number of an exception.
  • ExceptPrint Function
    Prints all information about an exception to a results file.
Parent topic: Functions


ExceptCalls Function

Action

Returns a list of the function calls that have caused an exception during the execution of the current test case.

Syntax

lcFunctions = ExceptCalls ( )
Return | Description
lcFunctions | The returned information. LIST OF CALL.

Notes

ExceptCalls returns a list of records of type CALL, each of which corresponds to one function call. A CALL record has three fields, which are described in the following table:

Field | Description
iLine | The line number in the script where the call or exception occurred. INTEGER.
sFunction | The name of the function in which the call or exception occurred. STRING.
sModule | The name of the file that contains sFunction. STRING.

The list of CALL records begins with the most recent call and progresses sequentially backward from the function where the exception occurred.

Example

[-] testcase ExceptCallsTest ()
    [-] do
        [ ] MyFunction ()
    [-] except
        [ ] PrintCallStack (ExceptCalls ())
        [ ] MyFunction ()
        [ ] Print ("In MyFunction")
        [ ] raise 1, "raise an exception here"
        [ ] PrintCallStack (LIST OF CALL lcCall)
        [ ] CALL Call
        [-] for each Call in lcCall
            [ ] Print ("MODULE: {Call.sModule}", "FUNCTION: {Call.sFunction}", "LINE: {Call.iLine}")
    [ ] // This script prints:
    [ ] // In MyFunction
    [ ] // MODULE: test.t FUNCTION: MyFunction LINE: 12
    [ ] // MODULE: test.t FUNCTION: main LINE: 4
Parent topic: Exception Handling
Related reference
ExceptClear Function
ExceptData Function
ExceptLog Function
ExceptNum Function
ExceptPrint Function


ExceptClear Function

Action

Clears information related to the current exception.

Syntax

ExceptClear ( )

Notes

ExceptClear clears the information that Silk Test Classic maintains about the most recent exception. After a call to ExceptClear, the other exception information functions operate as if no exception had occurred:

  • ExceptCalls returns an empty list

  • ExceptData returns NULL

  • ExceptLog prints nothing (no error is logged)

  • ExceptNum returns zero (0)

  • ExceptPrint prints nothing

Parent topic: Exception Handling
Related reference
ExceptCalls Function
ExceptData Function
ExceptLog Function
ExceptNum Function
ExceptPrint Function


ExceptData Function

Action

Returns the data associated with the most recent exception.

Syntax

aData = ExceptData ( )
Return | Description
aData | The data from the most recent exception. ANYTYPE.

Notes

  • Exceptions are generated automatically by Silk Test Classic (implicit exceptions), or by your script, in response to application state (explicit exceptions).

  • For all exceptions raised by Silk Test Classic, the data returned by ExceptData is an error message string. For user-defined exceptions, which are generated with raise or reraise, the returned data can be any type.

Example

[-] testcase ExceptDataExample ()
    [-] do
        [ ] Verify ("xxx", "yyy")
    [-] except
        [ ] Print (ExceptData ())
    [-] do
        [ ] raise 1, "My error"
    [-] except
        [ ] Print (ExceptData ())
    [-] do
        [ ] Print ("This will cause an exception. {5/0}")
    [-] except
        [ ] Print (ExceptData ())
    [ ] // Prints:
    [ ] // *** Error: Verify Failed - expected yyy, got xxx
    [ ] // My error
    [ ] // *** Error: Divide by zero
Parent topic: Exception Handling
Related reference
ExceptCalls Function
ExceptClear Function
ExceptLog Function
ExceptNum Function
ExceptPrint Function


ExceptLog Function

Action

Logs an exception to a results file.

Syntax

ExceptLog ( )

Notes

  • ExceptLog logs an error to the results file by calling the built-in function LogError with the data from the most recent exception (an error message by convention). ExceptLog also writes the call stack information for that exception to the results file.

  • If you write your own TestCaseExit function, be sure your code calls ExceptLog if you want all errors to be officially flagged as such in your results.

Example

[-] TestCaseExit (BOOLEAN bException)
    [-] if (bException)
        [ ] ExceptLog ()
    [ ] // code to execute after an exception,
    [ ] // for example, cleanup routines
    [ ] // code to execute after every testcase,
    [ ] // whether or not an error occurred
Parent topic: Exception Handling
Related reference
ExceptCalls Function
ExceptClear Function
ExceptData Function
ExceptNum Function
ExceptPrint Function
LogError Function
LogWarning Function


ExceptNum Function

Action

Returns the number of an exception.

Syntax

iNum = ExceptNum( )
Return | Description
iNum | The number of the exception. INTEGER.

Notes

  • ExceptNum returns the number of the most recent exception passed as an argument to the raise statement, by a 4Test script, or passed from an exception raised automatically by Silk Test Classic.

  • Exceptions from Silk Test Classic are assigned negative numbers. To avoid conflicts, use positive numbers for your own exceptions.

  • Exceptions are defined in 4Test.inc in the Silk Test Classic directory.

Example

[-] testcase ExceptNumExample ()
    [-] do
        [ ] Verify ("xxx", "yyy")
    [-] except
        [ ] Print (ExceptNum () == E_VERIFY)
    [-] do
        [ ] raise 1, "My error"
    [-] except
        [ ] Print (ExceptNum ())
    [-] do
        [ ] Print ("This will cause an exception. {5/0}")
    [-] except
        [ ] Print (ExceptNum () == E_DIVIDE_BY_ZERO)
    [ ] // Prints:
    [ ] // TRUE
    [ ] // 1
    [ ] // TRUE
Parent topic: Exception Handling
Related reference
ExceptCalls Function
ExceptClear Function
ExceptData Function
ExceptLog Function
ExceptPrint Function


ExceptPrint Function

Action

Prints all information about an exception to a results file.

Syntax

ExceptPrint ( )

Notes

ExceptPrint formats and prints the combined results of calls to ExceptCalls, ExceptData, and ExceptNum. If there is no data returned from ExceptData, then ExceptNum prints instead.

Example

[-] testcase ExceptPrintExample ()
    [-] do
        [ ] Verify ("xxx", "yyy")
    [-] except
        [ ] ExceptPrint ()
    [-] do
        [ ] raise 1, "My error"
    [-] except
        [ ] ExceptPrint ()
    [-] do
        [ ] Print ("This will cause an exception. {5/0}")
    [-] except
        [ ] ExceptPrint ()
    [ ] // This script prints:
    [ ] // *** Error: Verify failed - expected yyy, got xxx
    [ ] // Occurred in Verify
    [ ] // Called from main at test.t(3)
    [ ] // My error
    [ ] // Occurred in main at test.t(6)
    [ ] // *** Error: Divide by zero
    [ ] // Occurred in main at test.t(9)
Parent topic: Exception Handling
Related reference
ExceptCalls Function
ExceptClear Function
ExceptData Function
ExceptLog Function
ExceptNum Function


File Manipulation

Includes functions for file manipulation.

  • FileClose Function
    Closes a file on the host system.
  • FileOpen Function
    Opens a file on the host system.
  • FileReadLine Function
    Returns the next line of a file on the host system.
  • FileReadValue Function
    Reads structured data, for example, a 4Test record, directly from a file on the host system.
  • FileSetPointer Function
    Sets the read/write position (in characters, not bytes) in an open file.
  • FileWriteLine Function
    Writes a line of text to a file on the host system.
  • FileWriteValue Function
    Writes structured data, for example a 4Test record, directly to a file on the host system.
  • IniFileClose Function
    Closes an initialization (.ini) file on the host system.
  • IniFileGetValue Function
    Retrieves a value from an open initialization (.ini) file on the host system.
  • IniFileOpen Function
    Opens an initialization (.ini) file on the host system.
  • IniFileSetValue function
    Changes a value in an open initialization (.ini) file on the host system.
  • IsFileRemote Function
    Tests whether a file handle points to a target (remote) machine.
  • SYS_FileClose Function
    Closes a file on the target machine.
  • SYS_FileOpen Function
    Opens a file on a target machine.
  • SYS_FileReadLine Function
    Returns the next line of a file from a target machine.
  • SYS_FileReadValue Function
    Reads structured data, for example a 4Test record, directly from a file on a target machine.
  • SYS_FileSetPointer Function
    Sets the read/write position (in characters, not bytes) in an open file on a target machine.
  • SYS_FileWriteLine Function
    Writes a line of text to a file on the target machine.
  • SYS_FileWriteValue Function
    Writes structured data, for example a 4Test record, directly to a file on a target machine.
  • SYS_IniFileClose Function
    Closes an initialization (.ini) file on a target machine.
  • SYS_IniFileGetValue Function
    Retrieves a value from an open initialization (.ini) file on the target machine.
  • SYS_IniFileOpen Function
    Opens an initialization (.ini) file on the target machine.
  • SYS_IniFileSetValue Function
    Changes a value in an open initialization (.ini) file on the target machine.
Parent topic: Functions


FileClose Function

Action

Closes a file on the host system.

Syntax

FileClose(hFile)
Variable | Description
hFile | The handle of the file to close. HFILE.

Notes

FileClose closes the file identified by hFile. You return a handle to the file (an HFILE) by calling the FileOpen function.

Silk Test Classic raises the exception E_HANDLE if the file has already been closed or if an invalid file handle is specified.

This function is not designed for remote access.

Example

// output file handle
HFILE OutputFileHandle
// Create and open file for writing,
// write to it, then close
OutputFileHandle = FileOpen("mydata.txt", FM_WRITE)
FileWriteLine(OutputFileHandle, "First line of text")
FileClose(OutputFileHandle)
Parent topic: File Manipulation
Related reference
FileOpen Function
SYS_FileClose Function
SYS_FileOpen Function


FileOpen Function

Action

Opens a file on the host system.

Syntax

hFile = FileOpen(sPath, fmMode[, fsShare[, ftType]])
Variable | Description
hFile | A handle to the opened file. HFILE.
sPath | The name of the file to open. STRING.
fmMode | The mode to open the file with. FILEMODE.
fsShare | Optional: Specifies file-sharing behavior. FILESHARE.
ftType | Optional: Specifies the format of the text file to be created. Only has an affect when creating a new file. FILETYPE.

Notes

  • FileOpen opens or creates the file that is identified by sPath, depending on the specified mode. The function returns a file handle of type HFILE, which you can pass to other file functions.

  • Any open local files are automatically closed and saved at the end of a test script.

  • The file manipulation functions that control writing to a file, for example FileWriteLine and FileWriteValue, do not test your accessibility to a file. This means that you cannot write information to a file that has been opened in read only mode with FileOpen. The function will successfully return, but no information is actually written to the file. There is no error message that indicates this.

  • FileOpen is not designed for remote access.

Example

The following code sample checks a BOOLEAN value presumably passed into the function or test case to determine whether or not the file should be shared and then sets the file-sharing behavior accordingly:

[ ] // output file handle
[ ] HFILE OutputFileHandle
[ ] FILESHARE fShare
[ ]
[ ] // check to see if file opening should lock out other writers
[ ] if (bExclusiveWrite == TRUE)
[ ]   fShare = FS_DENY_WRITE
[ ] else
[ ]   fShare = FS_DENY_NONE
[ ]
[ ] // now open the file
[ ] OutputFileHandle = FileOpen("mydata.txt", FM_WRITE, fShare)
Parent topic: File Manipulation
Related concepts
Tips for Using the Remote File Functions
Related reference
FileWriteLine Function
FileWriteValue Function
SYS_FileOpen Function


FileReadLine Function

Action

Returns the next line of a file on the host system.

Syntax

bDidRead = FileReadLine(hFile, sLine)
Variable | Description
bDidRead | Whether a line was read. BOOLEAN.
hFile | The handle of the file to read a line from. HFILE.
sLine | A variable to hold the line. out STRING.

Notes

  • FileReadLine reads the next line of a file and returns the contents of the line in sLine. Typically, you open a file with FileOpen, and then read it line by line with FileReadLine until FALSE is returned.

  • You can get a handle to a file (an HFILE) by calling the FileOpen function with the FM_READ filemode data type. An exception is raised if an invalid file handle is specified.

  • FileReadLine returns TRUE if a line was read, or FALSE if the end of the file was encountered.

  • FileReadLine modifies the sLine variable. Any previous value in sLine is discarded.

  • FileReadLine considers the end-of-line character to be a carriage return (CR), even if it is not combined with a linefeed (LF) character. In other words, both CR and CR-LF are considered line terminators.

  • 4Test recognizes that it has reached the end of a file (EOF) by no longer reading that file – in other words, by receiving a null string. It does not read any special character at the EOF.

  • For Silk Test Classic, EOF is indicated by a FALSE bDidRead return and a null string is indicated by a TRUE bDidRead return and a null string.

  • This function can handle line lengths up to 4K characters.

  • This function is not designed for remote access.

Examples

[ ] HFILE hFile
[ ] STRING sLine
[-] testcase FileReadExample()
    [ ] hFile = FileOpen("mydata.txt", FM_READ)
    [ ] while(FileReadLine(hFile, sLine))
    [ ]   // statements to process this line
    [ ] FileClose(hFile)
You can also read from a file opened in file mode FM_UPDATE, in order to begin overwriting the file in the middle instead of at the beginning. For example:
[ ] STRING s
[ ] INTEGER i
[ ] HFILE hFile = FileOpen("{GetProgramDir()}\Sample.txt", FM_UPDATE)
[-] for i = 1 to 2
    [ ] FileReadLine(hFile, s)
[ ] FileWriteLine(hFile, "*New one*")
[ ] FileWriteLine(hFile, "*This is new line two*")
[ ] FileClose (hFile)
[ ]
[ ] // Before:
[ ] // Line 1
[ ] // Line 2
[ ] // Line 3
[ ] // Line 4
[ ] // Line 5
[ ]
[ ] // After:
[ ] // Line 1
[ ] // Line 2
[ ] // *New one*
[ ] // *This is new line two*
Parent topic: File Manipulation
Related reference
FileOpen Function
FileReadValue Function
SYS_FileReadLine Function


FileReadValue Function

Action

Reads structured data, for example, a 4Test record, directly from a file on the host system.

Syntax

bResult = FileReadValue(hFile, aValue)
Variable | Description
bResult | TRUE if the read operation is successful; FALSE if at end of file. BOOLEAN.
hFile | A handle to the file. HFILE.
aValue | The data read from the file. ANYTYPE.

Notes

  • Use FileReadValue to read information from files that are structured the same way that the FileWriteValue function structures files. The file must have only one value per line. FileReadValue reads the data in a record or list as a single value, so make sure that all elements of a record or list are on the same line. FileWriteValue does this automatically when it writes a record or list. Blank lines and lines starting with "/" are ignored. See FileWriteValue for more information about how to structure files for use with FileReadValue.

  • You can read from a file opened in file mode FM_UPDATE, in order to begin overwriting the file in the middle instead of at the beginning. See the example under FileReadLine function.

  • FileReadValue raises an exception if the read operation fails.

  • 4Test recognizes that it has reached the end of a file (EOF) by no longer reading that file –in other words, by receiving a null string. It does not read any special character at the EOF.

  • For Silk Test Classic, EOF is indicated by a FALSE bDidRead return and a null string is indicated by a TRUE bDidRead return and a null string.

  • This function can handle line lengths up to 4K characters.

  • This function is not designed for remote access.

Example

The following example uses the file that was created in the example for FileWriteValue.

[-] type PERSON is record
    [ ] STRING sName
    [ ] INTEGER iAge
    [ ]
[-] STRING sFile = "people.dat"
    [ ]
[-] testcase ReadFromFile()
    [ ] ANYTYPE Item
    [ ] HFILE hFile
    [ ] hFile = FileOpen(sFile, FM_READ) // Open the file
    [ ] while(FileReadValue(hFile, Item)) // Read from file
    [ ] Print(Item)
    [ ] FileClose(hFile)
    [ ]
    [ ] // Result:
    [ ] // Number of people:
    [ ] // 3
    [ ] // {Bob, 46}
    [ ] // {Emily, 16}
    [ ] // {Craig, 13}
Parent topic: File Manipulation
Related reference
FileReadLine Function
FileWriteValue Function
SYS_FileReadValue Function


FileSetPointer Function

Action

Sets the read/write position (in characters, not bytes) in an open file.

Syntax

iPos = FileSetPointer(hFile, iNewValue[,SetMode])
Variable | Description
iPos | New read/write position in the file. INTEGER.
hFile | The handle of the file to set the read/write position in. (You get a file handle by calling the FileOpen function.) HFILE.
iNewValue | Value that specifies new position, subject to value of SetMode. INTEGER.
SetMode | Optional: Mode to use to set new position. FILEPOS.

Notes

FileSetPointer sets the read/write position in an open file. It uses the value specified for iNewValue in different ways, depending on what was specified for SetMode, which is of type FILEPOS. The value of iNewValue must be such that the new position is between 0 and the end of the file (EOF). iNewValue can take any of the following values.
Value | How the Read/Write Position is Set
FP_START | (Default) The read/write position is set to iNewValue, which must be postive.
FP_END | The read/write position is set to the file length iNewValue characters before the end of the file. iNewValue must be a negative number. For example, iCurrentPos = SYS_FileSetPointer(openFile, -4, FP_END) sets the position to 4 characters before the end of the file. If you enter a positive number for FP_END, you will receive an error message.
FP_RELATIVE | The read/write position is set to the current position + iNewValue.

FileSetPointer returns the new read/write position. The new position cannot go past the end of file or be set before the beginning of the file. If the new position is beyond the borders of the file, Silk Test Classic raises an exception condition. The set position range is from the first character of the file to the last character of the file. No other position is valid.

The file header is not part of the file range. This means that the file’s first character can be up to 3 bytes into the raw file – and that is counted as the first position in the file.

This function is not designed for remote access.

Example

INTEGER iCurrentPos
HFILE openFile
openFile = SYS_FileOpen("c:\mytests\test.log", FM_READ)
// set pointer to 3
iCurrentPos = SYS_FileSetPointer(openFile, 3)
Print(iCurrentPos)
// set pointer 4 characters from end of file
iCurrentPos = SYS_FileSetPointer(openFile, -4, FP_END)
Print(iCurrentPos)
SYS_FileClose(openFile)

// Result: (file has 71 characters)
// 3
// 6
// 67
Parent topic: File Manipulation
Related reference
FileOpen Function
SYS_FileSetPointer Function


FileWriteLine Function

Action

Writes a line of text to a file on the host system.

Syntax

FileWriteLine( hFile, sLine)
Variable | Description
hFile | The handle of the file to write to. HFILE.
sLine | The text to write. STRING.

Notes

FileWriteLine writes the specified string to the file identified by hFile. It automatically appends the appropriate character or characters, for example a carriage return/line feed sequence, needed to delimit a line of text on the current platform.

You can get a handle to a file (an HFILE) by calling the FileOpen function with the filemode data type set to either FM_WRITE, FM_UPDATE, or FM_APPEND.

The File functions that control writing to a file do not test your accessibility to a file. This means that you cannot write information to a file that has been opened in read only mode with FileOpen(). The function will successfully return, but no information is actually written to the file. There is no error message that indicates this.

This function is not designed for remote access.

Example

HFILE FileHandle
// Open file, append line, and close
FileHandle = FileOpen("mydata.txt", FM_APPEND)
FileWriteLine(FileHandle, "next line of text")
FileClose(FileHandle)
Parent topic: File Manipulation
Related reference
FileOpen Function
FileReadLine Function
SYS_FileWriteLine Function


FileWriteValue Function

Action

Writes structured data, for example a 4Test record, directly to a file on the host system.

Syntax

FileWriteValue(hFile, aValue)
Variable | Description
hFile | A handle to the file to write to. HFILE.
aValue | The data to write to the file. ANYTYPE.

Notes

  • FileWriteValue writes each piece of data (aValue) on its own line in hFile. For example, if you call FileWriteValue three times on a new file, the resulting file will have three lines.

  • You can get a handle to a file (an HFILE) by calling the SYS_FileOpen function with the filemode data type set to either FM_WRITE, FM_UPDATE, or FM_APPEND.

  • You can specify any 4Test data type as aValue. The data is written to the file as follows:
    • Strings are enclosed by double quotation marks.
    • Numbers are not enclosed by quotation marks.
    • Composite data, such as lists and records, are enclosed by curly braces, with elements separated by commas.

  • FileWriteValue raises an exception if the write operation fails.

  • You can use FileReadValue to read files created with FileWriteValue.

  • The file functions that control writing to a file do not test your accessibility to a file. This means that you cannot write information to a file that has been opened in read only mode with FileOpen(). The function will successfully return, but no information is actually written to the file. There is no error message that indicates this.

  • This function is not designed for remote access.

Example

[-] type PERSON is record
    [ ] STRING sName
    [ ] INTEGER iAge
    [ ]
[-] STRING sFile = "people.dat"
    [ ]
[-] testcase WriteToFile()
    [-] LIST OF PERSON lPerson = {...}
        [ ] {'Bob', 46}
        [ ] {'Emily', 16}
        [ ] {'Craig', 13}
    [ ] STRING sText = "Number of people:"
    [ ] INTEGER iCount = ListCount(lPerson)
    [ ] HFILE hFile
    [ ] PERSON Person
    [ ]
    [ ] hFile = FileOpen (sFile, FM_WRITE) // Open the file
    [ ]
    [ ] // write header information
    [ ] FileWriteValue(hFile, sText)
    [ ] FileWriteValue(hFile, iCount)
    [ ]
    [ ] // write the data
    [-] for each Person in lPerson // Write to the file
        [ ] FileWriteValue (hFile, Person)
    [ ] FileClose (hFile) // Close the file
    [ ]
    [ ] // Resulting contents of people.dat:
    [ ] // "Number of people:"
    [ ] // 3
    [ ] // {"Bob", 46}
    [ ] // {"Emily", 16}
    [ ] // {"Craig", 13}
Parent topic: File Manipulation
Related reference
FileOpen Function
FileReadValue Function
SYS_FileWriteValue Function


IniFileClose Function

Action

Closes an initialization (.ini) file on the host system.

Syntax

IniFileClose(hIniFile)
Variable | Description
hIniFile | A handle to the file to close. HINIFILE.

Notes

To retrieve the handle to the file (of type HINIFILE), use a call to IniFileOpen.

IniFileClose raises an exception if the file cannot be written and closed.

All set actions, such as IniFileSetValue, are written to the INI file when IniFileClose is invoked.

This function is not designed for remote access.

Example

HINIFILE hIni
hIni = IniFileOpen ("myapp.ini")
// ...
IniFileClose(hIni)
Parent topic: File Manipulation
Related reference
IniFileOpen Function
IniFileSetValue function
SYS_IniFileClose Function


IniFileGetValue Function

Action

Retrieves a value from an open initialization (.ini) file on the host system.

Syntax

sValue = IniFileGetValue(hIniFile, sSection, sName)
Variable | Description
sValue | The returned value. Limited to 255 characters. STRING.
hIniFile | A handle to the file containing the value. HINIFILE.
sSection | The section of the file containing the value to retrieve. STRING.
sName | The name of the value to retrieve. STRING.

Notes

If the value or the section is not found, IniFileGetValue returns an empty string ("").

Return values for INI file strings are limited to 255 characters (sValue).

This function is not designed for remote access.

Example

HINIFILE hIni
STRING sValue
hIni = IniFileOpen("myapp.ini")
sValue = IniFileGetValue(hIni, "Paintbrush", "width")
Parent topic: File Manipulation
Related reference
IniFileOpen Function
SYS_IniFileOpen Function
SYS_IniFileSetValue Function


IniFileOpen Function

Action

Opens an initialization (.ini) file on the host system.

Syntax

hIniFile = IniFileOpen(sFile [,ftType])
Variable | Description
hIniFile | A handle to the file. HINIFILE.
sFile | The name of the file to open. STRING.
ftType | Optional: Specifies the format of the .ini file to be created. Only has an effect when creating a new file. FILETYPE.

Notes

IniFileOpen returns a handle to the initialization file, of type HINIFILE. You use this handle when referring to the file with IniFileGetValue, IniFileSetValue, and IniFileClose. Applications typically store information in initialization files. For example, Silk Test Classic stores information in the initialization file partner.ini. If the specified file does not exist, IniFileOpen creates it.

This function is not designed for remote access.

Example

HINIFILE hIni
hIni = IniFileOpen ("myapp.ini")
Parent topic: File Manipulation
Related concepts
Tips for Using the Remote File Functions
Related reference
IniFileClose Function
IniFileGetValue Function
IniFileSetValue function
SYS_IniFileOpen Function


IniFileSetValue function

Action

Changes a value in an open initialization (.ini) file on the host system.

Syntax

IniFileSetValue(hIniFile, sSection, sName, sValue)
Variable | Description
hIniFile | A handle to the file containing the value. HINIFILE.
sSection | The section of the file containing the value to change. STRING.
sName | The name of the value to change. STRING.
sValue | The new value. STRING.

Notes

If the specified section or value doesn’t exist, IniFileSetValue adds it. IniFileSetValue does not write the initialization file to disk; it only changes or adds a value in the open file.

This function is not designed for remote access.

Example

HINIFILE hIni
hIni = IniFileOpen("myapp.ini")
IniFileSetValue(hIni, "Paintbrush", "width", "640")
Parent topic: File Manipulation
Related reference
IniFileGetValue Function
SYS_IniFileSetValue Function


IsFileRemote Function

Action

Tests whether a file handle points to a target (remote) machine.

Syntax

bRemoteHandle = IsFileRemote(hFileHandle)
Variable | Description
bRemoteHandle | TRUE if the file handle points to a target machine. BOOLEAN.
hFileHandle | The handle of the file retrieved from FileOpen(), SYS_FileOpen(), IniFileOpen(), or SYS_IniFileOpen().

Notes

IsFileRemote returns TRUE if the file handle points to a target machine, or FALSE if the file handle does not point to a target machine. The file can be of any sort, including an INI file.

Parent topic: File Manipulation
Related reference
FileOpen Function
IniFileOpen Function
SYS_IniFileOpen Function


SYS_FileClose Function

Action

Closes a file on the target machine.

Syntax

SYS_FileClose (hFile)
Variable | Description
hFile | The handle of the file to close. HFILE.

Notes

SYS_FileClose is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as FileClose. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

SYS_FileClose closes the file identified by hFile. You return a handle to the file (an HFILE) by calling the SYS_FileOpen function.

Silk Test Classic raises the exception E_HANDLE if the file has already been closed or if an invalid file handle is specified.

This function is not designed for local access.

Example

// output file handle
HFILE OutputFileHandle
// Create and open file for writing,
// write to it, then close
OutputFileHandle = SYS_FileOpen ("mydata.txt", FM_WRITE)
SYS_FileWriteLine (OutputFileHandle, "First line of text")
SYS_FileClose (OutputFileHandle)
Parent topic: File Manipulation
Related reference
SYS_FileOpen Function
FileClose Function
Machine Handle Operator


SYS_FileOpen Function

Action

Opens a file on a target machine.

Syntax

hFile = SYS_FileOpen (sPath, fmMode [, fsShare[, ftType]])
Variable | Description
hFile | A handle to the opened file. HFILE.
sPath | The name of the file to open. STRING.
fmMode | The mode to open the file with. FILEMODE.
fsShare | Optional: Specifies file-sharing behavior. FILESHARE.
ftType | Optional: Specifies the format of the text file to be created. Only has an effect when creating a new file or when reading a file using the Open Agent. FILETYPE.

Notes

  • SYS_FileOpen is executed by the agent process, not the Silk Test Classic process; but it is essentially the same as FileOpen. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

  • SYS_FileOpen opens the file identified by sPath, or creates it, depending on the mode you specify (see below). This function returns a file handle of type HFILE, which you pass to other file functions.

  • When the agent disconnects, any open files are closed and saved, but Micro Focus recommends using SYS_FileClose() when you are finished with a file. Any open files are automatically closed and saved at the end of a test script as well.

  • ftType is used with the Open Agent when creating a new file or when reading a file, and with the Classic Agent only when creating a new file. If a byte order mark (BOM) is not included in the file to be opened, the ftType parameter determines the encoding type.

  • This function is not designed for local access.

Example

The following example checks a BOOLEAN value (presumably passed into the function/test case) to determine whether or not the file should be shared and then sets the file-sharing behavior accordingly.

[ ] // output file handle
[ ] HFILE OutputFileHandle
[ ] FILESHARE fShare
[ ]
[ ] // check to see if file opening should lock out other writers
[-] if (bExclusiveWrite == TRUE)
    [ ] fShare = FS_DENY_WRITE
[-] else
    [ ] fShare = FS_DENY_NONE
[ ]
[ ] // now open the file
[ ] OutputFileHandle = SYS_FileOpen ("mydata.txt", FM_WRITE, fShare)
Parent topic: File Manipulation
Related concepts
Tips for Using the Remote File Functions
Related reference
FileOpen Function
SYS_FileClose Function
SYS_IniFileOpen Function
Machine Handle Operator


SYS_FileReadLine Function

Action

Returns the next line of a file from a target machine.

Syntax

bDidRead = SYS_FileReadLine (hFile, sLine)
Variable | Description
bDidRead | Whether a line was read. BOOLEAN.
hFile | The handle of the file to read a line from. HFILE.
sLine | A variable to hold the line. STRING.

Notes

  • SYS_ FileReadLine is executed by the agent process, not the Silk Test Classic process; but it is essentially the same as FileReadLine. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

  • SYS_ FileReadLine reads the next line of a file and returns the contents of the line in sLine. Typically, you open a file with SYS_FileOpen, and then read it line by line with SYS_ FileReadLine until FALSE is returned.

  • SYS_ FileReadLine returns TRUE if a line was read, or FALSE if the end of the file was encountered.

  • SYS_ FileReadLine modifies the sLine variable. Any previous value in sLine is discarded.

  • SYS_ FileReadLine automatically handles cross-platform end-of-line differences.

  • You can get a handle to a file (an HFILE) by calling the SYS_FileOpen function with the FM_READ filemode data type. An exception is raised if an invalid file handle is specified. You can read from a file opened in file mode FM_UPDATE, in order to begin overwriting the file in the middle instead of at the beginning. See the example under FileReadLine function.

  • 4Test recognizes that it has reached the end of a file (EOF) by no longer reading that file – in other words, by receiving a null string. It does not read any special character at the EOF.

  • For Silk Test Classic, EOF is indicated by a FALSE bDidRead return and a null string is indicated by a TRUE bDidRead return and a null string.

  • This function can handle line lengths up to 4K characters.

  • This function is not designed for local access.

Example

[ ] HFILE hFile
[ ] STRING sLine
[-] testcase FileReadExample ()
    [ ] hFile = SYS_FileOpen ("mydata.txt", FM_READ)
    [-] while (SYS_FileReadLine (hFile, sLine))
        [ ] // statements to process this line
    [ ] SYS_FileClose (hFile)
Parent topic: File Manipulation
Related reference
FileReadLine Function
SYS_FileOpen Function
SYS_FileWriteLine Function


SYS_FileReadValue Function

Action

Reads structured data, for example a 4Test record, directly from a file on a target machine.

Syntax

bResult = SYS_FileReadValue (hFile, aValue)
Variable | Description
bResult | TRUE if the read operation is successful; FALSE if at end of file. BOOLEAN.
hFile | A handle to the file. HFILE.
aValue | The data read from the file. ANYTYPE.

Notes

Use SYS_FileReadValue to read information from files that are structured the same way that the SYS_FileWriteValue function structures files. The file must have only one value per line. SYS_FileReadValue reads the data in a record or list as a single value, so make sure that all elements of a record or list are on the same line (SYS_FileWriteValue does this automatically when it writes a record or list). Blank lines and lines starting with "/" are ignored. See SYS_FileWriteValue for more information about how to structure files for use with SYS_FileReadValue.

SYS_FileReadValue is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as FileReadValue. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

SYS_FileReadValue raises an exception if the read operation fails.

You can get a handle to a file (an HFILE) by calling the SYS_FileOpen function with the FM_READ filemode data type. An exception is raised if an invalid file handle is specified. You can read from a file opened in file mode FM_UPDATE, in order to begin overwriting the file in the middle instead of at the beginning. See the example under FileReadLine function.

4Test recognizes that it has reached the end of a file (EOF) by no longer reading that file –in other words, by receiving a null string. It does not read any special character at the EOF.

For Silk Test Classic, EOF is indicated by a FALSE bDidRead return and a null string is indicated by a TRUE bDidRead return and a null string.

This function is not designed for local access.

Example

The following example uses the file that was created in the example for SYS_FileWriteValue.

type PERSON is record
STRING sName
INTEGER iAge

STRING sFile = "people.dat"

testcase ReadFromFile ()
ANYTYPE Item
HFILE hFile
hFile = SYS_FileOpen (sFile, FM_READ) // Open the file
while (SYS_FileReadValue (hFile, Item)) // Read from file
Print (Item)
SYS_ FileClose (hFile)

// Result:
// Number of people:
// 3
// {Bob, 46}
// {Emily, 16}
// {Craig, 13}
Parent topic: File Manipulation
Related reference
FileReadValue Function
SYS_FileReadLine Function
SYS_FileWriteValue Function
Machine Handle Operator


SYS_FileSetPointer Function

Action

Sets the read/write position (in characters, not bytes) in an open file on a target machine.

Syntax

iPos = SYS_FileSetPointer (hFile, iNewValue [, SetMode] )
Variable | Description
iPos | New read/write position in characters in the file. INTEGER.
hFile | The handle of the file to set the read/write position in. (You get a file handle by calling the SYS_FileOpen function.) HFILE.
iNewValue | Value that specifies new position, subject to value of SetMode. INTEGER.
SetMode | Optional. Mode to use to set new position. FILEPOS.

Notes

SYS_ FileSetPointer is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as FileSetPointer. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

SYS_FileSetPointer sets the read/write position in an open file. It uses the value specified for iNewValue in different ways, depending on what was specified for SetMode, which is of type FILEPOS. The value of iNewValue must be such that the new position is between 0 and the end of the file (EOF). iNewValue can take any of the following values.

Value | How the Read/Write Position is Set
FP_START | (Default) The read/write position is set to iNewValue, which must be positive.
FP_END | The read/write position is set to the file length iNewValue characters before the end of the file. iNewValue must be a negative number. For example, iCurrentPos = SYS_FileSetPointer (openFile, -4, FP_END) sets the position to 4 characters before the end of the file. If you enter a positive number for FP_END, you will receive an error message.
FP_RELATIVE | The read/write position is set to the current position + iNewValue.

SYS_FileSetPointer returns the new read/write position. The new position cannot go past the end of file or be set before the beginning of the file. If the new position is beyond the borders of the file, Silk Test Classic raises an exception condition. The set position range is from the first character of the file to the last character of the file. No other position is valid.

The file header is not part of the file range. This means that the file’s first character can be up to 3 bytes into the raw file – and that is counted as the first position in the file.

This function is not designed for local access.

You can use SYS_FileSetPointer with the Open Agent or the Classic Agent. When setting the pointer after the end of the file, the Open Agent does not throw an exception, while the Classic Agent does throw an exception.

Example

INTEGER iCurrentPos
HFILE openFile
openFile = SYS_FileOpen ("c:\mytests\test.log",FM_READ)
// set pointer to 3
iCurrentPos = SYS_FileSetPointer (openFile, 3)
Print (iCurrentPos)
// set pointer to 6 (original 3, plus 3 more)
iCurrentPos = SYS_FileSetPointer (openFile, 3, FP_RELATIVE)
Print (iCurrentPos)
// set pointer 4 characters from end of file
iCurrentPos = SYS_FileSetPointer (openFile, -4, FP_END)
Print (iCurrentPos)
SYS_FileClose (openFile)

// Result: (file has 71 characters)
// 3
// 6
// 67
Parent topic: File Manipulation
Related reference
SYS_FileOpen Function
SYS_FileReadLine Function
SYS_FileWriteValue Function
Machine Handle Operator


SYS_FileWriteLine Function

Action

Writes a line of text to a file on the target machine.

Syntax

SYS_FileWriteLine (hFile, sLine)
Variable | Description
hFile | The handle of the file to write to. HFILE.
sLine | The text to write. STRING.

Notes

SYS_FileWriteLine is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as FileWriteLine. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

SYS_FileWriteLine writes the specified string to the file identified by hFile. It automatically appends the appropriate character or characters (for example, a carriage return/line feed sequence) needed to delimit a line of text on the current platform.

You can get a handle to a file (an HFILE) by calling the SYS_FileOpen function with the filemode data type set to either FM_WRITE, FM_UPDATE, or FM_APPEND.

The File functions that control writing to a file do not test your accessibility to a file. This means that you cannot write information to a file that has been opened in read only mode with FileOpen(). The function will successfully return, but no information is actually written to the file. There is no error message that indicates this.

This function is not designed for local access.

Example

HFILE FileHandle
// Open file, append line, and close
FileHandle = SYS_FileOpen ("mydata.txt", FM_APPEND)
SYS_FileWriteLine (FileHandle, "next line of text")
SYS_FileClose (FileHandle)
Parent topic: File Manipulation
Related reference
SYS_FileOpen Function
SYS_FileWriteValue Function
FileWriteLine Function
Machine Handle Operator


SYS_FileWriteValue Function

Action

Writes structured data, for example a 4Test record, directly to a file on a target machine.

Syntax

SYS_FileWriteValue (hFile, aValue)
Variable | Description
hFile | A handle to the file to write to. HFILE.
aValue | The data to write to the file. ANYTYPE.

Notes

  • SYS_FileWriteValue is executed by the agent process, not the Silk Test Classic process; but it is essentially the same as FileWriteValue. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

  • You can get a handle to a file (an HFILE) by calling the SYS_FileOpen function with the filemode data type set to either FM_WRITE, FM_UPDATE, or FM_APPEND.

  • SYS_FileWriteValue writes each piece of data (aValue) on its own line in hFile. For example, if you call SYS_FileWriteValue three times on a new file, the resulting file will have three lines.

  • You can specify any 4Test data type as aValue. Data is written to the file as follows:

    • Strings are enclosed by double quotation marks.

    • Numbers are not enclosed by quotation marks.

    • Composite data (such as lists and records) are enclosed by curly braces with elements separated by commas.

  • You can use SYS_FileReadValue to read files created with SYS_FileWriteValue.

  • The file functions that control writing to a file do not test your accessibility to a file. This means that you cannot write information to a file that has been opened in read only mode with FileOpen(). The function will successfully return, but no information is actually written to the file. There is no error message that indicates this.

  • This function is not designed for local access.

Example

[-] type PERSON is record
    [ ] STRING sName
    [ ] INTEGER iAge
    [ ]
[-] STRING sFile = "people.dat"
    [ ]
[-] testcase SYS_WriteToFile ()
    [-] LIST OF PERSON lPerson = {...}
        [ ] {'Bob', 46}
        [ ] {'Emily', 16}
        [ ] {'Craig', 13}
    [ ] STRING sText = "Number of people:"
    [ ] INTEGER iCount = ListCount (lPerson)
    [ ] HFILE hFile
    [ ] PERSON Person
    [ ]
    [ ] hFile = SYS_FileOpen (sFile, FM_WRITE) // Open the file
    [ ]
    [ ] // write header information
    [ ] SYS_FileWriteValue (hFile, sText)
    [ ] SYS_FileWriteValue (hFile, iCount)
    [ ]
    [ ] // write the data
    [-] for each Person in lPerson // Write to the file
        [ ] SYS_FileWriteValue (hFile, Person)
    [ ] SYS_FileClose (hFile) // Close the file
    [ ]
    [ ] // Resulting contents of people.dat:
    [ ] // "Number of people:"
    [ ] // 3
    [ ] // {"Bob", 46}
    [ ] // {"Emily", 16}
    [ ] // {"Craig", 13}
Parent topic: File Manipulation
Related reference
FileWriteValue Function
SYS_FileOpen Function
SYS_FileReadValue Function
Machine Handle Operator


SYS_IniFileClose Function

Action

Closes an initialization (.ini) file on a target machine.

Syntax

SYS_IniFileClose (hIniFile)
Variable | Description
hIniFile | A handle to the file to close. HINIFILE.

Notes

SYS_IniFileClose is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as IniFileClose. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

To retrieve the handle to the file (of type HINIFILE), use a call to SYS_IniFileOpen.

SYS_IniFileClose raises an exception if the file cannot be written and closed.

All set actions (such as SYS_IniFileSetValue) are written to the .ini file when SYS_IniFileClose is invoked.

This function is not designed for local access.

Example

HINIFILE hIni
hIni = SYS_IniFileOpen ("myapp.ini")
// ...
SYS_IniFileClose (hIni)
Parent topic: File Manipulation
Related reference
IniFileClose Function
Machine Handle Operator


SYS_IniFileGetValue Function

Action

Retrieves a value from an open initialization (.ini) file on the target machine.

Syntax

sValue = SYS_IniFileGetValue (hIniFile, sSection, sName)
Variable | Description
sValue | The returned value. STRING.
hIniFile | A handle to the file containing the value. HINIFILE.
sSection | The section of the file containing the value to retrieve. STRING.
sName | The name of the value to retrieve. STRING.

Notes

SYS_IniFileGetValue is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as IniFileGetValue. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

If the value or the section is not found, IniFileGetValue returns an empty string ("").

You can get the handle with the SYS_IniFileOpen.

This function is not designed for local access.

You can use SYS_IniFileGetValue with the Open Agent or the Classic Agent. The Open Agent does not allow the ']' character to be part of a section name (the Classic Agent does allow it). Also, with the Open Agent '=' must not be part of a key name. The Classic Agent allows '=' to be part of a key name, but produces incorrect results.

Example

HINIFILE hIni
STRING sValue
hIni = SYS_IniFileOpen ("myapp.ini")
sValue =SYS_ IniFileGetValue (hIni, "Paintbrush", "width")
Parent topic: File Manipulation
Related reference
IniFileGetValue Function
Machine Handle Operator
SYS_IniFileOpen Function
SYS_IniFileSetValue Function


SYS_IniFileOpen Function

Action

Opens an initialization (.ini) file on the target machine.

Syntax

hIniFile = SYS_IniFileOpen (sFile [, ftType])
Variable | Description
hIniFile | A handle to the file. HINIFILE.
sFile | The name of the file to open. STRING.
ftType | Optional. Specifies the format of the .ini file to be created. Only has an effect when creating a new file. FILETYPE.

Notes

SYS_IniFileOpen returns a handle to the initialization file, of type HINIFILE. You use this handle when referring to the file with IniFileGetValue, IniFileSetValue, and IniFileClose, or the SYS_ equivalent functions. Applications typically store information in initialization files. For example, Silk Test Classic stores information in the initialization file partner.ini.

If the specified file does not exist, SYS_IniFileOpen does not actually create the file. The file is created when SYS_IniFileClose or IniFileClose is invoked and a value is set by either IniFileSetValue or SYS_IniFileSetValue.

SYS_IniFileOpen is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

When the Agent disconnects, any open files are closed and saved, but we strongly encourage you to use SYS_FileClose() when you are finished with a file. Any open files are automatically closed and saved at the end of a test script as well.

This function is not designed for local access.

Example

HINIFILE hIni
hIni = SYS_IniFileOpen ("myapp.ini")
Parent topic: File Manipulation
Related concepts
Tips for Using the Remote File Functions
Related reference
IniFileClose Function
IniFileGetValue Function
IniFileOpen Function
IniFileSetValue function
Machine Handle Operator


SYS_IniFileSetValue Function

Action

Changes a value in an open initialization (.ini) file on the target machine.

Syntax

SYS_IniFileSetValue (hIniFile, sSection, sName, sValue)
Variable | Description
hIniFile | A handle to the file containing the value. HINIFILE.
sSection | The section of the file containing the value to change. STRING.
sName | The name of the value to change. STRING.
sValue | The new value. STRING.

Notes

SYS_IniFileSetValue is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as IniFileSetValue. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

If the specified section or value does not exist, SYS_IniFileSetValue adds it.

SYS_IniFileSetValue does not write the initialization file to disk; it only changes or adds a value in the open file. All set actions (such as SYS_IniFileSetValue) are written to the .ini file when SYS_IniFileClose is invoked.

This function is not designed for local access.

Example

HINIFILE hIni
hIni = SYS_IniFileOpen ("myapp.ini")
SYS_IniFileSetValue (hIni, "Paintbrush", "width", "640")
Parent topic: File Manipulation
Related reference
IniFileSetValue function
SYS_IniFileGetValue Function
SYS_IniFileOpen Function
Machine Handle Operator


Java Functions

Includes functions for java.

  • CaptureAllClasses Function
    Records the class information of a specified Java object or ActiveX object, and of the object's children.
  • CaptureObjectClass Function
    Records the class information of a specified Java object or ActiveX object.
Parent topic: Functions


CaptureAllClasses Function

Action

Records the class information of a specified Java object or ActiveX object, and of the object's children. Using this function, you can record the methods and properties of multiple classes from a script instead of using the recorder.

The class information is stored in the results file produced by the test run.

With this approach, you can record a large number of classes using one function call, rather than having to record each class individually.

Syntax

CaptureAllClasses(wObj [,bCaptureAll]);
Variable | Description
wObj | The Java object or ActiveX object whose class information you want to capture. Serves as the starting point from which to record the classes of its children. WINDOW
bCaptureAll | Optional: TRUE to record classes with class names that already exist. FALSE to not record existing classes. For example if FALSE, the class of a JavaJFCPushButton is not recorded. Default is FALSE.

Notes

To call this function, you must load the include file captureclass.inc, which is located in the directory where you installed Silk Test Classic. We recommend adding a use statement in test scripts that call CaptureAllClasses, as in this example:

use "captureclass.inc"

If there are a large number of controls in the specified object, CaptureAllClasses might take a few minutes to complete.

After running CaptureAllClasses, we recommend that you copy the classes, along with their methods and properties from the results file to an include file. Then, load the include file before running test scripts that use this class information. Important: For some applications, CaptureAllClasses may return properties of type void, which results in a compile error. These properties must be deleted before copying them to the include file.

Parent topic: Java Functions
Related reference
use Statement


CaptureObjectClass Function

Action

Records the class information of a specified Java object or ActiveX object. Using this function, you can record the methods and properties of a class from a script instead of using the recorder.

The class information is stored in the results file produced by the test run.

Syntax

CaptureObjectClass(sClassName, wObj);
Variable | Description
sClassName | Arbitrary name assigned to the class. STRING
wObj | The Java object or ActiveX object whose class information you want to capture. WINDOW

Notes

To call this function, you must load the include file captureclass.inc, which is located in the directory where you installed Silk Test Classic. We recommend adding a use statement in test scripts that calls CaptureAllClasses, as in this example:

use "captureclass.inc"

After running CaptureObjectClass, we recommend that you copy the class, along with its methods and properties from the results file to an include file. Then, load the include file before running test scripts that use this class information.

Parent topic: Java Functions


List Manipulation

Includes functions for list manipulation.

  • ListAppend Function
    Adds an item to the end of a list.
  • ListCount Function
    Returns the number of items in a list.
  • ListDelete Function
    Deletes an item from a list.
  • ListFind Function
    Finds an item in a list.
  • ListInsert Function
    Inserts a new item into a list at any position.
  • ListMerge Function
    Merges two lists.
  • ListPrint Function
    Prints a list to the results file.
  • ListRead Function
    Reads a list from a file into a list variable.
  • ListSort Function
    Sorts a list based on the type of data it contains and replaces the original list with the sorted list.
  • ListWrite Function
    Writes the contents of a list to a newly created file or overwrites the contents of an existing file.
  • SYS_ListRead Function
    Reads a list from a file on a target machine into a list variable.
  • SYS_ListWrite Function
    Writes the contents of a list to a file on a target machine.
Parent topic: Functions
Related reference
LIST Data Type


ListAppend Function

Action

Adds an item to the end of a list.

Syntax

ListAppend (lList, aElem)
Variable | Description
lList | A variable containing the list to append to. inout LIST.
aElem | The item to append to lList. Its type must be compatible with the list item’s type. ANYTYPE.

Notes

ListAppend appends an item to an existing list. The list is modified by the call to ListAppend.

Example

LIST OF STRING lsFruit = {} // create an empty list
ListAppend (lsFruit, "apples")
ListAppend (lsFruit, "oranges")
ListPrint (lsFruit)
// Prints:
// apples
// oranges
Parent topic: List Manipulation
Related reference
LIST Data Type
ListDelete Function
ListInsert Function


ListCount Function

Action

Returns the number of items in a list.

Syntax

iCount = ListCount (lList)
Variable | Description
iCount | The number of elements in the list. INTEGER.
lList | The list to count. LIST.

Notes

ListCount returns the number of items in lList, or zero, if the list is empty.

Example

[-] LIST OF INTEGER liNumber = {...}
    [ ] -1
    [ ] 0
    [ ] 1
[ ] Print (ListCount (liNumber)) // prints: 3
Parent topic: List Manipulation
Related reference
LIST Data Type
ListFind Function


ListDelete Function

Action

Deletes an item from a list.

Syntax

ListDelete (lList, iIndex)
Variable | Description
lList | A variable containing the list to modify. inout LIST.
iIndex | The index value of the item to delete. INTEGER.

Notes

ListDelete deletes an item from a list. The list is modified by the call to ListDelete. After the item is deleted, all remaining items in lList move one position.

Silk Test Classic raises an exception if iIndex is greater than the number of items in the list or less than one.

Example

[-] LIST OF INTEGER liNum = {...}
    [ ] 10
    [ ] 20
    [ ] 30
    [ ] 40
    [ ] 50
[ ] ListDelete (liNum, 3)
[ ] Print (liNum) // prints: {10, 20, 40, 50}
Parent topic: List Manipulation
Related reference
LIST Data Type
ListAppend Function
ListInsert Function


ListFind Function

Action

Finds an item in a list.

Syntax

iPos = ListFind (lList, aItem)
Variable | Description
iPos | The position of the item. INTEGER.
lList | The list to search. LIST.
aItem | The item to find. ANYTYPE.

Notes

ListFind returns the position of aItem in lList. ListFind returns zero if the item is not in the list.

Example

[-] LIST lsFruit = {...}
    [ ] "apples"
    [ ] "oranges"
    [ ] "bananas"
[ ] Print (ListFind (lsFruit, "oranges")) // prints: 2
[ ] Print (ListFind (lsFruit, "pears")) // prints: 0
Parent topic: List Manipulation
Related reference
LIST Data Type
ListCount Function
ArrayFind Function


ListInsert Function

Action

Inserts a new item into a list at any position.

Syntax

ListInsert (lList, iIndex, aItem)
Variable | Description
lList | A variable containing the list to modify. inout LIST.
iIndex | The position at which to insert the item. INTEGER.
aItem | The item to insert. Its type must be compatible with the other items in the list. ANYTYPE.

Notes

  • The list is modified by the call to ListInsert.

  • Silk Test Classic raises an exception if iIndex is less than one or greater than the number of items in the list.

Example

[-] LIST ls = {...}
    [ ] "g"
    [ ] "s"
[ ] ListInsert (ls, 2, "m") // inserts at 2nd position
[ ] Print (ls) // prints: {g, m, s}
[ ] ListInsert (1s, 1, "c")
[ ] Print (ls) // prints: {c, g, m, s}
Parent topic: List Manipulation
Related reference
ListAppend Function
ListDelete Function
ListMerge Function


ListMerge Function

Action

Merges two lists.

Syntax

ListMerge (lOrig, lMerge [, iMergePos])
Variable | Description
lOrig | A variable containing the list into which another list is to be merged. inout LIST.
lMerge | The list to be merged into lOrig. LIST.
iMergePos | Optional: The position in lOrig at which the new list is to be inserted. If omitted, lMerge is appended to lOrig. INTEGER.

Notes

  • ListMerge inserts a new list lMerge into lOrig at iMergePos. lOrig is modified by the call to ListMerge.

  • If iMergePos is less than one or greater than the number of items in the list, Silk Test Classic raises an exception.

Example

[-] LIST x = {...}
    [ ] 1
    [ ] 2
[ ] ListMerge (x, {5, 6})
[ ] Print (x) // prints {1, 2, 5, 6}
[ ] ListMerge (x, {3, 4}, 3)
[ ] Print (x) // prints {1, 2, 3, 4, 5, 6}
Parent topic: List Manipulation
Related reference
ListAppend Function
ListDelete Function
ListInsert Function


ListPrint Function

Action

Prints a list to the results file.

Syntax

ListPrint (lList)
Variable | Description
lList | The list to print. LIST.

Notes

ListPrint prints a list to the results file, with one item per line and with quotation marks and braces removed.

Example

[-] LIST lFruit = {...}
    [ ] "apples"
    [ ] "oranges"
    [ ] "bananas"
[ ] ListPrint (lFruit)
[ ] // Prints:
[ ] // apples
[ ] // oranges
[ ] // bananas
Parent topic: List Manipulation
Related reference
ListRead Function
ListWrite Function
Print Function
Printf Function


ListRead Function

Action

Reads a list from a file into a list variable.

Syntax

ListRead (lsList, sFineName, frType)
Variable | Description
lsList | A variable to hold the new list. LIST OF STRING.
sFileName | The name (and path, if necessary) of the file containing the data. STRING.
ftType | Specifies the format of the text file to be created. Only has an effect when creating a new file. Possible values are FT_ANSI, FT_UNICODE, and FT_UTF8. The default value is FT_ANSI.

Notes

Each line in sFileName becomes an item in lsList. ListRead interprets all lines in sFileName as strings. Each line of sFileName is returned as a string; no other type of data is returned.

ListRead modifies the lsList variable. Any previous value in lsList is discarded.

Each item in the list can be a maximum of 512 characters. Silk Test Classic raises the exception E_FILE if sFileName is not found or cannot be opened.

Example

LIST OF STRING lsFruit
ListWrite ( { "apples", "oranges" }, "fruit.txt", FT_ANSI)
ListRead (lsFruit, "fruit.txt" )
ListPrint (lsFruit)
//Results
//apples
//oranges
Parent topic: List Manipulation
Related reference
ListPrint Function
ListWrite Function
SYS_ListRead Function


ListSort Function

Action

ListSort sorts a list based on the type of data it contains and replaces the original list with the sorted list.

Syntax

ListSort (lList [,bOrder])
Variable | Description
lList | Variable containing the list to be sorted. At the completion of the function, lList contains the sorted list. inout LIST.
bOrder | Optional: Whether strings that start with "$" are sorted at the beginning of the list or at the end. FALSE if "$" strings are sorted at the beginning of the list. TRUE if "$" strings are sorted at the end of the list. Default is FALSE. BOOLEAN.

Notes

  • On Windows systems, Silk Test Classic sorts using a dictionary-based algorithm.

  • To sort lists of strings and compare strings by ASCII value, add the line AsciiSort=TRUE to the [Runtime] section of the partner.ini file. This setting also affects the comparison of strings, not just the sorting of lists of strings; see STRING data type for more information about working with strings.

  • ListSort sorts only lists of type BOOLEAN, INTEGER, REAL, STRING, or ENUM. Silk Test Classic raises an exception if the list cannot be sorted.

  • ListSort sorts strings using the 4Test locale. Strings are compared using wcscoll.

Example

[-] LIST liNum = {...}
    [ ] 1
    [ ] 0
    [ ] 10
    [ ] -1
[ ] ListSort (liNum)
[ ] Print (liNum) // prints: {-1, 0, 1, 10}
Parent topic: List Manipulation
Related reference
ArraySort Function
STRING Data Type
TypeOf Function


ListWrite Function

Action

Writes the contents of a list to a newly created file or overwrites the contents of an existing file.

Syntax

ListWrite (lsList, sFileName, ftType)
Variable | Description
lsList | The text to write to a file. LIST OF STRING.
sFileName | The name (and path, if necessary) of the file to which to write. STRING.
ftType | Specifies the format of the text file to be created. Only affects the creation of new files. FT_ANSI (the default), FT_UNICODE, or FT_UTF8.

Notes

ListWrite writes the contents of a list to a new file. Each item in lsList becomes a line in sFileName. Silk Test Classic raises exception E_FILE if sFileName cannot be created.

Example

[ ] LIST OF STRING lsFruit
[ ] ListWrite ( { "apples", "oranges" }, "fruit.txt", FT_ANSI)
[ ] ListRead (lsFruit, "fruit.txt" )
[ ] ListPrint (lsFruit)
[ ] // Prints:
[ ] // apples
[ ] // oranges
Parent topic: List Manipulation
Related reference
SYS_ListWrite Function


SYS_ListRead Function

Action

Reads a list from a file on a target machine into a list variable.

Syntax

SYS_ListRead (lsList, sFileName, ftType)
Variable | Description
lsList | A variable to hold the new list. LIST OF STRING.
sFileName | The name (and path, if necessary) of the file containing the data. STRING.
ftType | Specifies the format of the text file to be created. Only has an effect when creating a new file. One of FT_ANSI, FT_UNICODE, or FT_UTF8. Default is FT_ANSI.

Notes

SYS_ListRead is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as ListRead. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Each line in sFileName becomes an item in lsList. SYS_ListRead interprets all lines in sFileName as strings. Each line of sFileName is returned as a string; no other type of data is returned.

SYS_ListRead modifies the lsList variable. Any previous value in lsList is discarded.

Each item in the list can be a maximum of 512 characters. Silk Test Classic raises the exception E_FILE if sFileName is not found or cannot be opened.

SYS_ListRead is the same as SYS_GetFileContents. The basic difference is that SYS_ListRead reads and transfers information one line at a time from the Agent, while SYS_GetFileContents transfers the whole file at once. If your network has difficulty with large data packets, use SYS_ListRead rather than SYS_GetFileContents.

You can use this function in an environment that uses the Open Agent or Classic Agent. Silk Test Classic automatically uses the appropriate Agent.

Example

LIST OF STRING lsFruit
SYS_ListWrite ( { "apples", "oranges" }, "fruit.txt" , FT_ANSI )
SYS_ListRead (lsFruit, "fruit.txt" )
ListPrint (lsFruit)

//Results
//apples
//oranges
Parent topic: List Manipulation
Related reference
ListRead Function
SYS_GetFileContents Function
SYS_ListWrite Function
Machine Handle Operator


SYS_ListWrite Function

Action

Writes the contents of a list to a file on a target machine.

Syntax

SYS_ListWrite (lsList, sFileName, ftType)
Variable | Description
lsList | The text to write to a file. LIST OF STRING.
sFileName | The name (and path, if necessary) of the file to write to. STRING.
ftType | Specifies the format of the text file to be created. Only has an effect when creating a new file. One of FT_ANSI, FT_UNICODE, or FT_UTF8. Default is FT_ANSI.

Notes

SYS_ListWrite is executed by the Agent process, not the Silk Test Classic process; but it is essentially the same as ListWrite. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

SYS_ListWrite writes the contents of a list to a file. Each item in lsList becomes one line in sFileName. Silk Test Classic raises the exception E_FILE if sFileName cannot be created.

You can use this function in an environment that uses the Open Agent or Classic Agent. Silk Test Classic automatically uses the appropriate Agent.

Example

LIST OF STRING lsFruit
SYS_ListWrite ( { "apples", "oranges" }, "fruit.txt" , FT_ANSI)
SYS_ListRead (lsFruit, "fruit.txt" )
ListPrint (lsFruit)
// Prints:
// apples
// oranges
Parent topic: List Manipulation
Related reference
ListWrite Function
SYS_ListRead Function
Machine Handle Operator


Locale

Includes functions for locale.

  • GetLocale Function
    Gets the current value of the 4Test locale.
  • SetLocale Function
    Sets the value of the 4Test locale.
  • SYS_GetLocale Function
    Gets the user locale of the machine on which the application under test is executing.
Parent topic: Functions


GetLocale Function

Action

Gets the current value of the 4Test locale.

Syntax

sLocale = GetLocale
Variable | Description
sLocale | The value of the 4Test locale. STRING.

Returns

A string for the current locale. If the locale is mixed, then the string is comprised of sub strings for each category. The sub strings are separated by semicolons, and each qualified locale is preceded by its category and an equal sign.

Notes

The 4Test locale is a Posix compliant locale.

Parent topic: Locale
Related reference
SetLocale Function
SYS_GetLocale Function


SetLocale Function

Action

Sets the value of the 4Test locale.

Syntax

sLocale = SetLocale (sLocale)
Variable | Description
sLocale | Specifies the implementation-defined 4Test locale. To specify the native locale, use an empty string (""). STRING

Returns

A string for the new locale or NULL if the request cannot be honored.

Notes

This capability gives the tester the ability to control how certain 4Test functions format, sort, and compare number, string, currency, and date/time information. It should be noted that SetLocale does not set the Silk Test Classic program locale.

The 4Test locale is a Posix compliant locale.

Example

Set the 4Test locale to the value of the user locale of the machine on which the application under test is executing.

SetLocale(SYS_GetLocale())
Parent topic: Locale
Related reference
GetLocale Function
SYS_GetLocale Function


SYS_GetLocale Function

Action

Gets the user locale of the machine on which the application under test is executing.

Syntax

sLocale = SYS_GetLocale ()

Notes

A string for the current locale. If the locale is mixed, then the string will be comprised of sub strings for each category. The sub strings are separated by semicolons, and each qualified locale is preceded by its category and an equal sign.

The 4Test locale is a Posix compliant locale.

You can use this function in an environment that uses the Open Agent or Classic Agent. Silk Test Classic automatically uses the appropriate Agent.

Parent topic: Locale
Related reference
GetLocale Function
SetLocale Function


Numeric Operations

Includes functions for numeric operations.

  • Abs Function
    Returns the absolute value of a number.
  • GetCenter Function
    Returns the center of a given rectangle as a POINT.
  • Max Function
    Returns the larger of two numbers.
  • Min Function
    Returns the smaller of two numbers.
  • SetPrecision Function
    Sets a tolerance such that if two numbers differ by less than the precision (exclusive), they will be considered equal.
  • Sqrt Function
    Returns the square root of a number.
Parent topic: Functions


Abs Function

Action

Returns the absolute value of a number.

Syntax

nAbsValue = Abs (nNumber)
Variable | Description
nAbsValue | The absolute value of nNumber. NUMBER.
nNumber | The number for which to compute the absolute value. NUMBER.

Notes

The absolute value of a number is equal to its unsigned magnitude.

Example

[-] Testcase AbsExample ()
    [ ] Print (Abs (-14.356)) // Prints 14.356000
    [ ] Print (Abs (87.4)) // Prints 87.400000
    [ ] Print (Abs (-892384)) // Prints 892384
Parent topic: Numeric Operations


GetCenter Function

Action

Returns the center of a given rectangle as a POINT.

Syntax

POINT =  GetCenter(RECT rectangle)
Variable | Description
RECT | The size and position of the rectangle for which you want to find the center. RECT.
Parent topic: Numeric Operations


Max Function

Action

Returns the larger of two numbers.

Syntax

nLarger = Max (n1, n2)
Variable | Description
nLarger | The larger number. NUMBER.
n1 | The first number to compare. NUMBER.
n2 | The second number to compare. NUMBER.

Notes

Max compares two numbers and returns whichever of them is larger.

Example

Print (Max (80.9, 78)) // prints: 80.9
Parent topic: Numeric Operations
Related reference
Min Function


Min Function

Action

Returns the smaller of two numbers.

Syntax

nSmaller = Min (n1, n2)
Variable | Description
nSmaller | The smaller number. NUMBER.
n1 | The first number to compare. NUMBER.
n2 | The second number to compare. NUMBER.

Notes

Min compares two numbers and returns whichever of them is smaller.

Example

Print (Min (69.3, 80)) // prints: 69.3
Parent topic: Numeric Operations
Related reference
Max Function


SetPrecision Function

Action

Sets a tolerance such that if two numbers differ by less than the precision (exclusive), they will be considered equal. Specifically, n1 == n2 if Abs (n1 - n2) < p, where p is the precision.

Syntax

SetPrecision (rPrecision)
Variable | Description
rPrecision | The tolerance to which real numbers are compared. REAL.

Notes

  • The default precision is 0.000001.

  • To compare two numbers significantly smaller than 1e-16 you need to normalize the difference comparison in some way. The reason is that the test for equality given above has been simplified. The complete test for equality between real numbers n1 and n2 is actually defined as:
    n1 == n2 iff abs(n1-n2) + DBL_EPSILON <= precision
    where DBL_EPSILON is the smallest number such that 1.0+DBL_EPSILON != 1.0. It is typically defined as: 2.2204460492503131e-016.

  • To normalize the comparison, apply a suitable multiplier to the precision and to the values being compared. The multiplier should be based on 1e-15, which is the first power of 10 greater than DBL_EPSILON. The example below demonstrates the use of such a multiplier.

Example

[ ] const MIN_PRECISION = 1e-15 // first power of 10 greater than DBL_EPSILON
[ ]
[-] testcase Example () appstate none
    [-] LIST OF NUMBER ln1 = {...}
        [ ] 1
        [ ] .045
        [ ] .04
        [ ] 1.0e-20
        [ ] 1.0e-20
    [-] LIST OF NUMBER ln2 = {...}
        [ ] 4
        [ ] .04
        [ ] .05
        [ ] 1.1e-20
        [ ] 1.1e-20
    [-] LIST OF REAL lrPrecisions = {...}
        [ ] 10
        [ ] .01
        [ ] .01
        [ ] 0.00000000000000000001
        [ ] 1.0e-21
    [ ] REAL r1, r2, rPrecision, rMultiplier
    [ ] INTEGER i
    [ ]
    [-] for i = 1 to ListCount (ln1)
        [-] if i <= 3
            [ ] Print ("Comparing {ln1[i]} to {ln2[i]} with precision {lrPrecisions[i]}")
        [-] else
            [ ] Printf ("Comparing %1.24f to %1.24f with precision %1.24f\n", ln1[i], ln2[i], lrPrecisions[i])
        [ ] r1 = ln1[i]  // will implicitly convert INTEGER to REAL
        [ ] r2 = ln2[i]  // will implicitly convert INTEGER to REAL
        [ ] rPrecision = lrPrecisions[i]
        [ ] // If necessary, normalize the comparison.
        [ ] // If omitted, the fourth comparison (1.0e-20 to 1.1e-20) will fail.
        [ ] rMultiplier = MIN_PRECISION / rPrecision
        [-] if rMultiplier > 1.0
            [ ] r1 *= rMultiplier
            [ ] r2 *= rMultiplier
            [ ] rPrecision *= rMultiplier
            [ ] SetPrecision (rPrecision)
            [ ] // The following verification should raise an exception
            [ ] // for the third comparison (.04 to .05 with precision .01)
            [ ] // and fifth comparison (1.0e-20 to 1.1e-20 with precision 1.0e-21)
        [-] do
            [ ] Verify (r1, r2, "the numbers match within the precision")
            [ ] // Could also use:
            [ ] // Verify (r1 == r2, TRUE, "the numbers match within the precision")
        [-] except
            [ ] LogError (ExceptData ())

The results file is:

Script OnLineHelpExample[1].t - 2 errors
Machine: (local)
Started: 03:49:33PM on 08-Nov-2006
Elapsed: 0:00:06
Passed: 0 tests (0%)
Failed: 1 test (100%)
Totals: 1 test, 2 errors, 0 warnings

Testcase Example - 2 errors
 Comparing 1 to 4 with precision 10.000000
 Comparing 0.045000 to 0.040000 with precision 0.010000
 Comparing 0.040000 to 0.050000 with precision 0.010000
 *** Error: Verify the numbers match within the precision failed - got 0.040000, expected 0.050000
 Comparing 0.000000000000000000010000 to 0.000000000000000000011000 with precision
0.000000000000000000010000
 Comparing 0.000000000000000000010000 to 0.000000000000000000011000 with precision
0.000000000000000000001000
 *** Error: Verify the numbers match within the precision failed - got 0.000000, expected 0.000000
Parent topic: Numeric Operations


Sqrt Function

Action

Returns the square root of a number.

Syntax

nNewNum = Sqrt (nOrigNum)
Variable | Description
nNewNum | The returned square root. NUMBER.
nOrigNum | The number whose square root to calculate. NUMBER.

Notes

Sqrt returns the square root of nOrigNum. An exception is raised if nOrigNum is less than zero.

Example

Print (Sqrt (4)) // prints: 2.000000
Print (Sqrt (10)) // prints: 3.162278
Parent topic: Numeric Operations


Operating System Calls

Includes functions for operating system calls.

  • HOST_GetEnv Function
    Returns the value of an environment variable on the host machine.
  • SYS_CreateRegistryKey Function
    Creates a new key in the registry.
  • SYS_CreateRegistryValue Function
    Creates a new value.
  • SYS_CompareBinary Function
    Performs binary comparison on two files.
  • SYS_CompareBitmap Function
    Compares two bitmap files.
  • SYS_CompareText Function
    Compares two text files and reports whether they match.
  • SYS_CopyFile Function
    Copies a file.
  • SYS_DeleteRegistryKey Function
    Deletes a key from the registry.
  • SYS_DeleteRegistryValue Function
    Deletes a value from the registry.
  • SYS_DirExists Function
    Checks whether the specified directory exists.
  • SYS_Execute Function
    Executes the specified command.
  • SYS_ExistsRegistryKey Function
    Checks if a key exists in the registry.
  • SYS_ExistsRegistryValue Function
    Checks if a value exists in the registry.
  • SYS_FileExists Function
    Checks whether the specified file exists.
  • SYS_GetBitmapCRC Function
    Returns the cyclic redundancy check (CRC) value of a bitmap file.
  • SYS_GetDir Function
    Returns the name of the current working directory.
  • SYS_GetDirContents Function
    Returns information about the files in a directory.
  • SYS_GetDrive Function
    Returns the name of the current drive.
  • SYS_GetEnv Function
    Returns the value of an environment variable of the operating system.
  • SYS_GetExecutableDir Function
    Returns the location of the agent executable (agent.exe) on a remote machine.
  • SYS_GetFileContents Function
    Returns the contents of the specified file on the target machine.
  • SYS_GetFreeDiskSpace Function
    Returns the amount of free disk space (in bytes or specified units) on the specified disk drive.
  • SYS_GetFreeMemory Function
    Returns the amount of free memory.
  • SYS_GetMemoryInfo Function
    Returns performance information on Windows.
  • SYS_GetName Function
    Returns the name of the operating system on the target system where the 4Test Agent is running.
  • SYS_GetRegistryKeyNames Function
    Returns a list of key names in string.
  • SYS_GetRegistryValue Function
    Returns the data value of an item in the Windows registry.
  • SYS_GetVersion Function
    Returns the version number of the operating system.
  • SYS_MakeDir Function
    Creates the specified directory.
  • SYS_MoveFile Function
    Moves the specified file.
  • SYS_RemoveDir Function
    Deletes the specified directory.
  • SYS_RemoveFile Function
    Deletes the specified file.
  • SYS_SetDir Function
    Changes the current working directory on a specified drive and changes the current drive, if specified.
  • SYS_SetDrive Function
    Sets the current drive.
  • SYS_SetEnv Function
    Sets the value of the specified environment variable.
  • SYS_SetRegistry Function
    Sets the view of the Windows registry.
  • SYS_SetRegistryValue Function
    Sets the data value of an item in the Windows registry.
  • SYS_VerifyText Function
    Compares two text files and raises an error if there are differences.
Parent topic: Functions
Related reference
SYS Functions Supported by the Open Agent and the Classic Agent


HOST_GetEnv Function

Action

Returns the value of an environment variable on the host machine.

Syntax

sValue = HOST_GetEnv(sVar)
Variable | Description
sValue | The value of the variable. STRING.
sVar | The environment variable to check. STRING.

Notes

HOST_GetEnv returns the value of the specified environment variable. The function returns an empty string ("") if the value is not defined. Unlike SYS_GetEnv, HOST_GetEnv executes in Silk Test Classic rather than in the Agent. If used in code, HOST_GetEnv is recognized by the compiler and so is seen as a constant rather than a function call. You may find it useful to access environment variables as compiler constants and in use statements.

Example

use "{HOST_GetEnv ("HOME")}\personal.inc"
Parent topic: Operating System Calls
Related reference
SYS_GetEnv Function


SYS_CreateRegistryKey Function

Action

Creates a new key in the registry. Recursively creates any missing registry keys in the given keypath.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

bSuccess = SYS_CreateRegistryKey (rcCategory, sKeypath, sKeyname, sDefaultValue)
Variable | Description
bSuccess | True if the key was successfully created, false otherwise. BOOLEAN.
rcCategory | The constant for the root key from mswconst.inc. For example HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE. LONG.
sKeypath | The path to the registry key. STRING.
sKeyname | The name of the registry key. STRING.
sDefaultValue | The default value of the registry key. STRING.

Notes

Use the include file mswconst.inc to be able to reference key values.

Parent topic: Operating System Calls


SYS_CreateRegistryValue Function

Action

Creates a new value.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

bSuccess = SYS_CreateRegistryValue (rcCategory, sKeypath, sValueName, sValue)
Variable | Description
bSuccess | True if the value was successfully created, false otherwise. BOOLEAN.
rcCategory | The constant for the root key from mswconst.inc. For example HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE. LONG.
sKeypath | The path to the registry key. STRING.
sValueName | The name of the value. STRING.
sValue | The new value. STRING.

Notes

Use the include file mswconst.inc to be able to reference key values.

Parent topic: Operating System Calls


SYS_CompareBinary Function

Action

Performs binary comparison on two files.

Syntax

bCompare = SYS_CompareBinary (sFile1, sFile2)
Variable | Description
bCompare | Whether the files are the same. BOOLEAN.
sFile1 | The name of the first file to compare. STRING.
sFile2 | The name of the second file to compare. STRING.

Notes

SYS_CompareBinary performs a binary comparison on two files and returns TRUE if the files are the same, and FALSE if not.

SYS_CompareBinary does not support wildcard characters in file names; both sFile1 and sFile2 must uniquely identify a file.

Windows Platforms

SYS_CompareBinary is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

BOOLEAN bCompare
bCompare = SYS_CompareBinary ("res1.dat", "res1.dat")
Print (bCompare) // prints: TRUE
bCompare = SYS_CompareBinary ("res1.dat", "res2.dat")
Print (bCompare) // prints: FALSE
Parent topic: Operating System Calls
Related reference
Machine Handle Operator


SYS_CompareBitmap Function

Action

Compares two bitmap files.

Syntax

bCompare = SYS_CompareBitmap (sBitmap1, sBitmap2 [, sMaskFile])
Variable | Description
bCompare | Whether the bitmaps are the same. BOOLEAN.
sBitmap1 | The name of a bitmap file to compare. STRING.
sBitmap2 | The name of a bitmap file to compare to sBitmap1. STRING.
sMaskFile | Optional: The name of a monochrome bitmap file that serves as a mask. STRING.

Notes

  • SYS_CompareBitmap compares two bitmap files, including their color tables. The extra information saved in the file (bitmap size, location, and window) is ignored for the purposes of comparison. The function returns TRUE if the bitmaps compare equal, or FALSE if they do not.

  • If the two bitmaps have the same size and the same set of pixels, but the bitmaps use different color tables, Silk Test Classic prints the warning E_BITMAPS_DIFF_COLORTABLE in the results file. If the bitmaps are not exactly the same but their differences are below the allowable tolerance level, which is set with the OPT_BITMAP_PIXEL_TOLERANCE option, Silk Test Classic prints the warning E_BITMAPS_ALMOST_MATCH.

  • The Open Agent and the Classic Agent capture bitmaps in different color depths. By default, the Open Agent captures bitmaps using the current desktop settings for color depth. The Classic Agent captures bitmaps as 24-bit images. If you create a mask file for the captured bitmap using the Bitmap Tool that comes with Silk Test Classic, the mask file is saved as a 24-bit bitmap. If the bitmap mask file does not have the same color depth as the bitmap that you capture, an error occurs. To ensure that VerifyBitmap functions do not fail due to different color-depth settings between the captured image and the mask image, ensure that the bitmaps have the same color depth.

  • To view, capture, and compare bitmaps, and to create monochrome mask files, use the Silk Test Bitmap Tool.

  • To save time, you can compare the cyclic redundancy check (CRC) values for two bitmaps using the GetBitmapCRC method and the SYS_GetBitmapCRC function, instead of comparing their bitmap images. However, if the CRC values of two bitmaps are the same, it does not guarantee that the images are the same. When the values are the same, it is very likely that the images are the same. Use the SYS_CompareBitmap function to determine if the images truly match.

Windows Platforms

SYS_CompareBitmap is executed by the agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

[ ] STRING sBaseline = "temp1.bmp"
[ ] STRING sBitmap2 = "temp2.bmp"
[ ] STRING sBitmap3 = "temp3.bmp"
[-] RECT reCaptureRegion = {...}
    [ ] 1
    [ ] 1
    [ ] 375
    [ ] 310
[ ] BOOLEAN bSame
[ ] // take bitmaps; then compare them
[ ] TextEditor.CaptureBitmap (sBaseline, reCaptureRegion)
[ ] TextEditor.CaptureBitmap (sBitmap2)
[ ] TextEditor.CaptureBitmap (sBitmap3)
[ ] bSame = SYS_CompareBitmap (sBaseline, sBitmap2)
[ ] Print (bSame) // prints: FALSE
[ ] bSame = SYS_CompareBitmap (sBitmap2, sBitmap3)
[-] Print (bSame) // prints: TRUE
Parent topic: Operating System Calls
Related reference
GetBitmapCRC Function
SYS_GetBitmapCRC Function
VerifyBitmap Method
WaitBitmap Method


SYS_CompareText Function

Action

Compares two text files and reports whether they match.

Syntax

bCompare = SYS_CompareText(sFile1, sFile2)
Variable | Description
bCompare | TRUE if the two files are the identical; otherwise, FALSE. BOOLEAN.
sFile1 | The first file to compare. STRING.
sFile2 | The second file to compare. STRING.

Notes

SYS_CompareText automatically factors out end-of-line differences between platforms.

Windows Platforms

SYS_CompareText is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

[-] if (!SYS_CompareText("baseline", "testfile"))
    [ ] LogError("Files do not match")
Parent topic: Operating System Calls
Related reference
SYS_VerifyText Function


SYS_CopyFile Function

Action

Copies a file.

Syntax

SYS_CopyFile (sToCopy, sToCopyTo)
Variable | Description
sToCopy | The name of the file to copy. STRING.
sToCopyTo | The name of the file to copy to. STRING.

Notes

SYS_CopyFile copies the file specified by sToCopy to sToCopyTo. If sToCopyTo already exists, an exception is raised and the file is not overwritten.

SYS_CopyFile does not support wildcard characters in file names. Both sToCopy and sToCopyTo must uniquely identify a file.

Windows Platforms

SYS_CopyFile is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

SYS_CopyFile ("test1.dat", "test2.dat")
Parent topic: Operating System Calls
Related reference
Machine Handle Operator
SYS_MoveFile Function


SYS_DeleteRegistryKey Function

Action

Deletes a key from the registry. The key cannot contain any sub-keys, otherwise the method will fail.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

bSuccess = SYS_DeleteRegistryKey (rcCategory, sKeypath, sKeyname)
Variable | Description
bSuccess | True if the key was successfully deleted, false otherwise. BOOLEAN.
rcCategory | The constant for the root key from mswconst.inc. For example HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE. LONG.
sKeypath | The path to the registry key. STRING.
sKeyname | The name of the registry key. STRING.

Notes

Use the include file mswconst.inc to be able to reference key values.

Parent topic: Operating System Calls


SYS_DeleteRegistryValue Function

Action

Deletes a value from the registry.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

bSuccess = SYS_DeleteRegistryValue (rcCategory, sKeypath, sValueName)
Variable | Description
bSuccess | True if the value was successfully deleted, false otherwise. BOOLEAN.
rcCategory | The constant for the root key from mswconst.inc. For example HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE. LONG.
sKeypath | The path to the registry key. STRING.
sValueName | The name of the value. STRING.

Notes

Use the include file mswconst.inc to be able to reference key values.

Parent topic: Operating System Calls


SYS_DirExists Function

Action

Checks whether the specified directory exists.

Syntax

bExists = SYS_DirExists (sDir)
Variable | Description
bExists | Whether the directory exists. TRUE if it does exist and FALSE if it does not. BOOLEAN.
sDir | The directory to check for. STRING.

Notes

SYS_DirExists works only on names of true directories, not on names of shared directories. If your script includes a call to SYS_DirExists for a shared directory, SYS_DirExists returns FALSE, not because the directory does not exist but because the directory is shared.

Windows Platforms

SYS_DirExists is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sTempDir
BOOLEAN bExists

sTempDir = SYS_GetDir () + "\tempdir"
bExists = SYS_DirExists (sTempDir)
Print (bExists) // prints: FALSE

SYS_MakeDir (sTempDir) // make subdirectory
bExists = SYS_DirExists (sTempDir)
Print (bExists) // prints: TRUE
Parent topic: Operating System Calls
Related reference
SYS_FileExists Function
Machine Handle Operator


SYS_Execute Function

Action

Executes the specified command.

Syntax

iReturn = SYS_Execute (sCmdLine [, lsOutput], ExecutionMode)
Variable | Description
iReturn | The return value of the command. INTEGER.
sCmdLine | The command to execute. STRING.
lsOutput | Optional: A variable to hold any text written to stdout when sCmdLine runs. The contents of lsOutput are ignored when the ExecutionMode is set to EM_CONTINUE_RUNNING. LIST OF STRING.
ExecutionMode | Optional: An option specified with one of the constants defined for the EXECUTIONMODE enumerated data type. Defaults to EM_WAIT_UNTIL_FINISHED if not specified.

Notes

  • SYS_Execute executes sCmdLine and returns the exit value returned by the command. Any output is stored in lsOutput; each line of text becomes an item in the list. SYS_Execute modifies the lsOutput variable. Any previous value in lsOutput is discarded.

  • If you are using the Classic Agent, do not use SYS_Execute to execute .reg files; use the Start command instead. SYS_Execute was designed to execute commands that do not require user input and that terminate almost immediately after it has been executed. Silk Test Classic waits for any command that brings up a process requiring user input. For example: SYS_Execute ("freecell.exe") starts Freecell in an invisible window and Silk Test Classic does not continue until the Freecell process is terminated. On the other hand, SYS_Execute("start freecell.exe") starts Freecell in a visible window, and still Silk Test Classic does not continue until the Freecell process is terminated. The Open Agent automatically opens the application process in a visible window and the "start <process.exe>" string is not necessary.

  • If SYS_Execute is targeted for the local host, it is processed by the Silk Test Classic process. Otherwise, SYS_Execute is executed by the agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

  • As an alternative to SYS_Execute, you can use the Shell32.dll from Microsoft Windows with the ShellExecuteW() command. Unlike SYS_Execute, ShellExecuteW() returns control to the application after it starts the executable. Or, use APP_Start() from bwcompat.inc, which is provided with Silk Test Classic. For details about APP_Start(), refer to the bwcompat.inc file. For details about ShellExecuteW(), refer to the Windows help.

  • If scripts are blocking during the execution of the SYS_Execute method, and the focus is set on the command executing and not the result of the execution, you can set the ExecutionMode to EM_CONTINUE_RUNNING. In this case the contents of lsOutput are ignored.

Example 1

LIST OF STRING lsDirOut
SYS_Execute("ls", lsDirOut, EM_WAIT_UNTIL_FINISHED)

Example 2

The following code sample creates a directory and copies a file from one directory to another:
[-] testcase Test1() appstate none
    [ ] // creates a directory 'mf_community1'
    [ ] SYS_Execute("mkdir c:\mf_community1")
[ ]
[-] testcase Test2() appstate none
    [ ] // creates a second directory 'mf_community2'
    [ ] SYS_Execute("mkdir c:\mf_community2")
[ ]
[-] testcase Test3() appstate none
    [ ] // before running this testcase, create a file in the first directory 'mf_community1' called 'myFilename.txt'
    [ ]
    [ ] // copy the file test.txt from mf_community1 to mf_community2
    [ ] // the /y parameter is to proceed if the file already exists
    [ ] SYS_Execute("copy c:\mf_community1\myFilename.txt c:\mf_community2 /y")
[ ]
[-] testcase Test4() appstate none
    [ ] // remove directories and files in the specified directory in addition to the directory itself
    [ ] SYS_Execute("rmdir c:\mf_community1 /s /q")
    [ ] SYS_Execute("rmdir c:\mf_community2 /s /q")
Parent topic: Operating System Calls
Related reference
Start Method
Machine Handle Operator
EXECUTIONMODE Data Type


SYS_ExistsRegistryKey Function

Action

Checks if a key exists in the registry.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

bExists = SYS_ExistsRegistryKey (rcCategory, sKeypath, sKeyname)
Variable | Description
bExists | True if the key exists, false otherwise. BOOLEAN.
rcCategory | The constant for the root key from mswconst.inc. For example HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE. LONG.
sKeypath | The path to the registry key. STRING.
sKeyname | The name of the registry key. STRING.

Notes

Use the include file mswconst.inc to be able to reference key values.

Parent topic: Operating System Calls


SYS_ExistsRegistryValue Function

Action

Checks if a value exists in the registry.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

bExists = SYS_ExistsRegistryValue (rcCategory, sKeypath, sValueName)
Variable | Description
bExists | True if the value exists, false otherwise. BOOLEAN.
rcCategory | The constant for the root key from mswconst.inc. For example HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE. LONG.
sKeypath | The path to the registry key. STRING.
sValueName | The name of the value. STRING.

Notes

Use the include file mswconst.inc to be able to reference key values.

Parent topic: Operating System Calls


SYS_FileExists Function

Action

Checks whether the specified file exists.

Syntax

bExists = SYS_FileExists (sFile)
Variable | Description
bExists | Whether the file exists. Returns TRUE if the file exists and FALSE if it does not. BOOLEAN.
sFile | The file to check for. STRING.

Notes

SYS_FileExists checks that the specified file exists in the specified directory or, if no path is specified, the current working directory.

Windows Platforms

SYS_FileExists is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

BOOLEAN bExists
bExists = SYS_FileExists ("textedit.exe")
Print (bExists) // prints: TRUE
bExists = SYS_FileExists ("!@#$%^&.(@!")
Print (bExists) // prints: FALSE
Parent topic: Operating System Calls
Related reference
SYS_DirExists Function
Machine Handle Operator


SYS_GetBitmapCRC Function

Action

Returns the cyclic redundancy check (CRC) value of a bitmap file.

Syntax

iCRC = SYS_GetBitmapCRC (sBitmap [, sMaskFile])
Variable | Description
iCRC | The CRC value of the bitmap. INTEGER.
sBitmap | The name of the bitmap file whose CRC value you want. STRING.
sMaskFile | Optional. The name of a monochrome bitmap file that serves as a mask. STRING.

Notes

SYS_GetBitmapCRC returns the cyclic redundancy check (CRC) value of a bitmap file on disk.

The CRC value is a 32-bit integer that is a reduction of the bitmap, which you can use for fast comparisons. The CRC value includes all the bytes in the file, including the color table.

Typically, the CRC value is a "baseline" bitmap captured with CaptureBitmap that you want to compare against the CRC value for a current screen state. You get the CRC value for a bitmap captured from the screen with GetBitmapCRC.

To save time, you can compare the CRC values for two bitmaps using the GetBitmapCRC function and the SYS_GetBitmapCRC function, instead of comparing their bitmap images. However, if the CRC values of two bitmaps are the same, it does not guarantee that the images are the same. When the values are the same, it is very likely that the images are the same. Use the SYS_CompareBitmap function to determine if the images truly match.

Windows Platforms

SYS_GetBitmapCRC is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

[ ] INTEGER fileCRC
[ ] fileCRC = SYS_GetBitmapCRC ("image.bmp")
[-] if (SYS_GetBitmapCRC ("/Window1") != fileCRC)
    [ ] // raise an exception
Parent topic: Operating System Calls
Related reference
SYS_CompareBitmap Function
GetBitmapCRC Function
Machine Handle Operator


SYS_GetDir Function

Action

Returns the name of the current working directory.

Syntax

sName = SYS_GetDir ( )
Variable | Description
sName | The name of the directory. STRING.

Notes

SYS_GetDir returns the name of the current working directory of the Silk Test Classic Agent that was used for the last call. For example, if you call NotepadCA.SetActive(), which uses the Classic Agent, and then call SYS_GetDir(), it returns the working directory of the Classic Agent.

SYS_GetDir returns a valid path on all GUIs, including standard syntax elements such as path separators (for example, a leading backslash (\) on Windows).

Windows Platforms

SYS_GetDir is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sCurrentDir
sCurrentDir = SYS_GetDir ()
Parent topic: Operating System Calls
Related reference
SYS_GetDrive Function
SYS_SetDir Function
Machine Handle Operator


SYS_GetDirContents Function

Action

Returns information about the files in a directory.

Syntax

lfInfo = SYS_GetDirContents ([sDrive[,datasetsizes]])
Variable | Description
lfInfo | The returned information about the files. LIST OF FILEINFO.
sDir | Optional: The name (including path and drive information if required) of the directory to find information about. The default is the current directory. STRING.
datasetsizes

Optional: The default is DS_BYTES; other values are DS_KILOBYTES, DS_MEGABYTES, DS_GIGABYTES, or DS_TERABYTES. This parameter affects what iSize in FILEINFO data type returns and whether it is an INTEGER or REAL.

The value returned for DS_BYTES is an integer. If the file size is greater than 2 gigabytes, the return will be 2 gigabytes (though in reality, the file size is greater than that). All other values for datasetsizes return a REAL of the actual file size.

Notes

  • SYS_GetDirContents returns information about each of the files in the specified directory, in a record of type FILEINFO. See the FILEINFO data type for a list of fields for FILEINFO.

  • SYS_GetDirContents returns only information that is accessible to the current user. Therefore it returns the contents of only those directories to which the current user has access.

Windows Platforms

SYS_GetDirContents is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

[ ] LIST OF FILEINFO lfFiles
[ ] INTEGER iCount
[ ] lfFiles = SYS_GetDirContents ()
[-] for iCount = 1 to ListCount (lfFiles)
    [ ] Print (lfFiles[iCount].sName)
Parent topic: Operating System Calls
Related reference
SYS_GetDir Function
SYS_SetDir Function
Machine Handle Operator


SYS_GetDrive Function

Action

Returns the name of the current drive.

Syntax

sName = SYS_GetDrive ( )
Variable | Description
sName | The name of the drive. STRING.

Notes

SYS_GetDrive returns the name of the current drive. The string it returns is an uppercase alphabetic character without the accompanying colon (:) character.

Windows Platforms

SYS_GetDrive is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sCurDrive
sCurDrive = SYS_GetDrive ()
Parent topic: Operating System Calls
Related reference
SYS_SetDrive Function
Machine Handle Operator


SYS_GetEnv Function

Action

Returns the value of an environment variable of the operating system.

Syntax

sValue = SYS_GetEnv (sVar)
Variable | Description
sValue | The value of the variable. STRING.
sVar | The environment variable to check. STRING.

Notes

SYS_GetEnv returns the value of the specified environment variable of the operating system. The function returns an empty string ("") if the value is not defined. For additional information on the environmental variables for Windows, refer to the MSDN.

Windows Platforms

SYS_GetEnv returns the value that the environment variable had when Silk Test Classic started, or the value assigned by a previous call to SYS_SetEnv.

SYS_GetEnv is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sValue
sValue = SYS_GetEnv ("PATH")
Print (sValue)
Parent topic: Operating System Calls
Related reference
SYS_SetEnv Function
Machine Handle Operator


SYS_GetExecutableDir Function

Action

Returns the location of the agent executable (agent.exe) on a remote machine.

Syntax

sDir = SYS_GetExecutableDir ( )
Variable | Description
sDir | Returns the location of the agent executable (agent.exe) on a remote machine. STRING.

Notes

SYS_GetExecutableDir is executed, by default, in the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

SYS_GetExecutableDir appends the appropriate directory delimiter for your platform.

A similar function, GetExecutableDir, runs within Silk Test Classic and therefore returns the directory of the Silk Test Classic (partner.exe) executable.

Example

If Silk Test Classic is installed in c:\program files\Silk\Silk Test on a remote machine, then the following Print statement returns "c:\program files\Silk\Silk Test\".

const sDir = SYS_GetExecutableDir()
print (sDir)
Parent topic: Operating System Calls
Related reference
GetExecutableDir Function
Machine Handle Operator


SYS_GetFileContents Function

Action

Returns the contents of the specified file on the target machine.

Syntax

lsContents = SYS_GetFileContents (sFileName)
Variable | Description
lsContents | A variable to hold the new list. LIST OF STRING.
sFileName | The name (and path, if necessary) of the file containing the data. STRING.

Notes

SYS_GetFileContents is similar to the SYS_ListRead, except that it by default reads the specified file on the target machine. This function is useful when doing distributed testing.

A basic difference between the two functions is that SYS_ListRead reads and transfers information one line at a time from the Agent, while SYS_GetFileContents transfers the whole file at once. If your network has difficulty with large data packets, use SYS_ListRead rather than SYS_GetFileContents.

SYS_GetFileContents is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

HMACHINE target_machine // target computer
STRING sTarget // target's network name
LIST OF STRING lsNames
// connect to target and save its handle
target_machine = Connect (sTarget)
lsNames = SYS_GetFileContents ("empnames.txt")
ListPrint (empnames.txt)
Parent topic: Operating System Calls
Related reference
ListRead Function
Machine Handle Operator


SYS_GetFreeDiskSpace Function

Action

Returns the amount of free disk space (in bytes or specified units) on the specified disk drive.

Syntax

iFree = SYS_GetFreeDiskSpace ([sDrive[,datasetsizes]])
Variable | Description
iFree | The number of bytes of free disk space. NUMBER.
sDrive | Optional: The drive to check, current drive by default. STRING.
datasetsizes

Optional: The default is DS_BYTES; other values are DS_KILOBYTES, DS_MEGABYTES, DS_GIGABYTES, or DS_TERABYTES.

The value returned for DS_BYTES is an integer. If the free space is greater than 2 gigabytes, the return will be 2 gigabytes (though in reality, the free space is greater than that). All other datasetsizes values will return a REAL of the actual disk space that is free.

Notes

SYS_GetFreeDiskSpace is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

Print (SYS_GetFreeDiskSpace())
Print (SYS_GetFreeDiskSpace("D"))
Parent topic: Operating System Calls
Related reference
DATASETSIZES Data Type
Machine Handle Operator


SYS_GetFreeMemory Function

Action

Returns the amount of free memory.

Syntax

iFree = SYS_GetFreeMemory ( )
Variable | Description
iFree | The number of bytes of free memory. INTEGER.

Notes

SYS_GetFreeMemory returns an integer that specifies the number of bytes of memory that are free at the time the function is called.

Call SYS_GetFreeMemory before you start the application you are testing (with the Start or Invoke method). Then call it again after the application is running to see how much system memory it requires.

SYS_GetFreeMemory is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

You can use this function in an environment that uses the Open Agent or Classic Agent. Silk Test Classic automatically uses the appropriate Agent.

Windows

The value SYS_GetFreeMemory returns is the same value that is displayed in the Program Manager’s About dialog.

The value returned by SYS_GetFreeMemory is not useful with 32-bit Windows.

Example

INTEGER iFreeMem
iFreeMem = SYS_GetFreeMemory ()
Print ("Number of free memory blocks: {iFreeMem}")
Parent topic: Operating System Calls
Related reference
Machine Handle Operator


SYS_GetMemoryInfo Function

Action

Returns performance information on Windows.

Availability

Windows only.

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

lBytes = SYS_GetMemoryInfo (myWndTag, Counter)
Variable | Description
lBytes | The number of bytes of the performance counter specified by Counter. LONG.
myWndTag | The window. WNDTAG.
Counter | The performance counter. MEMINFO.

Notes

SYS_GetMemoryInfo returns one of the four Windows performance counters associated with the process that owns the window specified with myWndTag. Specify the performance counter with Counter, which is of type MEMINFO, an enumerated data type with four possible values:

Value | Description
WORKING_SET | The process's working set, that is, the number of bytes displayed in the Mem Usage column on the Processes tab in the Task Manager.
VIRTUAL_SIZE | The largest address in the process's virtual address space.
PRIVATE_READWRITE | The number of bytes of writeable, committed (that is, really allocated) memory in the process's address space.
PRIVATE_BYTES | The number of bytes of private (unshared) memory in the process's address space.

In all cases, the returned value is in bytes.

You can use this function (most likely with WORKING_SET or PRIVATE_READWRITE) to get an indication of whether the application under test has a memory leak.

SYS_GetMemoryInfo is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

The Open Agent supports all SYS functions with the exception of SYS_GetMemoryInfo. SYS_GetMemoryInfo defaults to the Classic Agent when a script is executed.

Example

LONG lMem
lMem = SYS_GetMemoryInfo ("/[MainWin]Test Application",WORKING_SET)
Print ("Working set: {lMem}")
Parent topic: Operating System Calls
Related reference
Machine Handle Operator
MEMINFO Data Type
WNDTAG Data Type


SYS_GetName Function

Action

Returns the name of the operating system on the target system where the 4Test Agent is running.

Syntax

sName = SYS_GetName ( )
Variable | Description
sName | The name of the operating system. STRING.

Notes

For this Operating System | SYS_GetName Returns
Microsoft Windows 2000 | Windows 2000
Microsoft Windows XP | Windows XP
Microsoft Windows Server 2003 | Windows 2003
Microsoft Windows Vista | Windows Vista
Microsoft Windows Server 2008 | Windows Server 2008
Microsoft Windows Server 2008 R2 | Windows Server 2008 R2
Microsoft Windows 7 | Windows 7
Microsoft Windows 8 | Windows 8
Microsoft Windows Server 2012 | Windows Server 2012
Microsoft Windows 8.1 | Windows 8.1
Microsoft Windows Server 2012 R2 | Windows Server 2012 R2
New or other OS | UNKNOWN OS

Windows Platforms

SYS_GetName is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sName
sName = SYS_GetName ()
Print ("Operating System: {sName}")
Parent topic: Operating System Calls
Related reference
SYS_GetVersion Function
Machine Handle Operator


SYS_GetRegistryKeyNames Function

Action

Returns a list of key names in string.

Syntax

SYS_GetRegistryKeyNames (iKey, sPath)
Variable | Description
iKey | The registry key. INTEGER
sPath | The path to the item through the registry hierarchy. STRING.
Parent topic: Operating System Calls
Parent topic: Registry Operations (Classic Agent)


SYS_GetRegistryValue Function

Action

Returns the data value of an item in the Windows registry.

Availability

Windows platforms

Syntax

sValue = SYS_GetRegistryValue (iKey, sPath, sItem [, bConvert])
Variable | Description
sValue | The item’s data value to be retrieved. STRING.
iKey | The registry key. INTEGER
sPath | The path to the item through the registry hierarchy. STRING.
sItem | The name of the data value to retrieve. If an empty string is used, the default value of the registry key is retrieved. STRING.
bConvert | Optional. TRUE if you want a registry value of type REG_DWORD or REG_BINARY to be converted to type INTEGER: See Notes below. Default is FALSE. BOOLEAN.

Notes

Sys_GetRegistryValue can be called from Silk Test Classic or Agent C code, which might be useful if you want to access your application’s runtime settings in the registry.

Sys_GetRegistryValue is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Use the include file mswconst.inc to be able to reference key values.

With the Classic Agent, Sys_GetRegistryValue returns an incorrect value when a binary value is used. Use the Open Agent with Sys_GetRegistryValue to avoid this issue.

Sys_GetRegistryValue supports these data types:

  • REG_SZ (string)

  • REG_DWORD (4-byte binary value)

  • REG_BINARY (binary value of arbitrary length)

Retrieved REG_BINARY and REG_DWORD values are formatted within a string which includes the data type prefix, as shown in the following examples:
"REG_BINARY: 14 00 00 7e 8f 99 33 22 08 00 07 00 06"
"REG_DWORD: 0x00008f7e"

If you set bConvert to TRUE and if the registry value returned is a REG_DWORD or REG_BINARY type, Sys_GetRegistryValue converts the registry value to an integer. In the case of a REG_DWORD, it returns the actual value. In the case of a REG_BINARY, it returns the integer produced by taking the first four bytes of the value.

Example

The following example returns the current display resolution:

INTEGER iKey = HKEY_CURRENT_CONFIG // defined in msw32.inc
STRING sPath = "Display\Settings"
STRING sItem = "Resolution"
Print (SYS_GetRegistryValue (iKey, sPath, sItem))
//prints 1280.1024
Parent topic: Operating System Calls
Parent topic: Registry Operations (Classic Agent)
Related reference
SYS_SetRegistryValue Function
Machine Handle Operator


SYS_GetVersion Function

Action

Returns the version number of the operating system.

Syntax

sNumber = SYS_GetVersion ( )
Variable | Description
sNumber | The version number of the operating system. STRING.

Notes

SYS_GetVersion returns a string that corresponds to the version number of the operating system under which the 4Test Agent is running. For example, for Microsoft Windows 8, SYS_GetVersion returns "6.2". The major version number of the operating system appears to the left of the decimal point, and the minor version number appears to the right.

Windows Platforms

SYS_GetVersion is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sName = SYS_GetName ()
STRING sVersion = SYS_GetVersion ()
Print ("System is using {sName} {sVersion}")
Parent topic: Operating System Calls
Related reference
SYS_GetName Function
Machine Handle Operator


SYS_MakeDir Function

Action

Creates the specified directory.

Syntax

SYS_MakeDir (sDir)
Variable | Description
sDir | The name of the directory to create. STRING.

Notes

An exception is raised if sDir already exists.

Windows Platforms

SYS_MakeDir is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sTempDir
sTempDir = SYS_GetDir () + "\tempdir"
SYS_MakeDir (sTempDir)
Parent topic: Operating System Calls
Related reference
SYS_RemoveDir Function
Machine Handle Operator


SYS_MoveFile Function

Action

Moves the specified file.

Syntax

SYS_MoveFile (sToMove, sToMoveTo)
Variable | Description
sToMove | The name of the file to move. STRING.
sToMoveTo | The new name or directory for the file. STRING.

Notes

SYS_MoveFile can be used to rename a file or move it to a different directory. An exception is raised if sToMove does not exist or if sToMoveTo is a file that already exists.

Windows

The files sToMove and sToMoveTo must reside on the same drive.

Windows Platforms

SYS_MoveFile is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

[ ] const sOrigFile = "gui.t"
[ ] const sNewFile = "gui.tmp"
[ ] SYS_MoveFile (sOrigFile, sNewFile)
[-] if SYS_FileExists (sNewFile)
    [ ] Print ("File was moved")
Parent topic: Operating System Calls
Related reference
SYS_CopyFile Function
Machine Handle Operator


SYS_RemoveDir Function

Action

Deletes the specified directory.

Syntax

SYS_RemoveDir (sDir)
Variable | Description
sDir | The name of the directory to remove. STRING.

Notes

The specified directory must exist and must be empty for it to be removed, or an exception is raised.

Windows Platforms

SYS_RemoveDir is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sTmpDir
BOOLEAN bExists
sTmpDir = SYS_GetDir () + "\tempdir"
SYS_MakeDir (sTmpDir)
bExists = SYS_DirExists (sTmpDir)
Print (bExists) // Prints TRUE
SYS_RemoveDir (sTmpDir)
bExists = SYS_DirExists (sTmpDir)
Print (bExists) // Prints FALSE
Parent topic: Operating System Calls
Related reference
SYS_RemoveFile Function
SYS_MakeDir Function
Machine Handle Operator


SYS_RemoveFile Function

Action

Deletes the specified file.

Syntax

SYS_RemoveFile (sFile)
Variable | Description
sFile | The name of the file to delete. STRING.

Notes

An exception is raised if sFile is a directory and not a file.

Windows Platforms

SYS_RemoveFile is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

[ ] const sOrigFile = "gui.t"
[ ] const sNewFile = "gui.tmp"
[ ] SYS_CopyFile (sOrigFile, sNewFile)
[-] if (SYS_FileExists (sNewFile))
    [ ] Print ("File was copied")
    [ ] SYS_RemoveFile (sOrigFile)
[-] else
    [ ] Print ("File not found")
Parent topic: Operating System Calls
Related reference
SYS_RemoveDir Function
Machine Handle Operator


SYS_SetDir Function

Action

Changes the current working directory on a specified drive and changes the current drive, if specified.

Syntax

SYS_SetDir (sDir)
Variable | Description
sDir | The name of the directory to make the current working directory. STRING.

Notes

This function sets the working directory for all Silk Test Classic agents that are currently connected. If you use both the Classic Agent and the Open Agent, SYS_SetDir() sets the directory for both agents in order to keep the working directories synchronized.

Windows Platforms

An exception is raised if the directory does not exist, or if you do not have appropriate access privileges for the directory.

If a drive is specified in the call to SYS_SetDir, then the function changes the current drive, in other words, functioning like a call to SYS_SetDrive. In the following example, both test case Test1 and Test2 print d:\test.

[-] main()
    [ ] SYS_SetDrive("c")
    [ ] SYS_SetDir("\qap4")
    [ ] Test1()
    [ ] Test2()
    [ ]
[-] testcase Test1()
    [ ] SYS_SetDir("d:\test")
    [ ] Print(SYS_GetDir())
    [ ]
[-] testcase Test2()
    [ ] SYS_SetDrive("d")
    [ ] SYS_SetDir("\test")
    [ ] Print(SYS_GetDir())

In the Windows environments, SYS_SetDir is executed by the agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

[-] testcase SYS_SetDirExample ()
    [ ] STRING sDir
    [-] LIST OF STRING lsDirs = {...}
        [ ] "c:\mydir"
        [ ] "d:\mydir"
    [ ] BOOLEAN bFound = FALSE
    [-] for each sDir in lsDirs
        [-] if (SYS_DirExists (sDir))
            [ ] SYS_SetDir (sDir)
            [ ] bFound = TRUE
            [ ] break
    [-] if (! bFound)
        [ ] Print ("Unable to change to directory")
Parent topic: Operating System Calls
Related reference
SYS_GetDir Function
SYS_SetDrive Function
Machine Handle Operator


SYS_SetDrive Function

Action

Sets the current drive.

Availability

SYS_SetDrive is supported only on Windows.

Syntax

SYS_SetDrive (sDrive)
Variable | Description
sDrive | The letter of the drive to switch to. STRING.

Notes

An exception is raised if sDrive does not exist.

Windows Platforms

SYS_SetDrive is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

SYS_SetDrive ("C")
Parent topic: Operating System Calls
Related reference
SYS_GetDrive Function
Machine Handle Operator


SYS_SetEnv Function

Action

Sets the value of the specified environment variable.

Syntax

SYS_SetEnv (sName, sValue)
Variable | Description
sName | The name of the environment variable to set. STRING.
sValue | The new value of the environment variable. STRING.

Notes

If sName does not exist, SYS_SetEnv creates it. An exception is raised if the system is out of environment space.

SYS_SetEnv persists only as long as the current session of Silk Test Classic is open. The environment variables in Control Panel System settings are kept in the registry, so if you want to modify them with Silk Test Classic, use:

SYS_SetRegistryValue(HKEY_LOCAL_MACHINE\
"SYSTEM\CurrentControlSet\Control\Session Manager\Environment",
"Path", "<the path you want to set>"

Windows Platforms

SYS_SetEnv is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

STRING sPath
sPath = SYS_GetEnv ("PATH")
Print (sPath)
// adds new directory to the PATH variable
sPath += "c:\newdir"
SYS_SetEnv ("PATH", sPath)
sPath = SYS_GetEnv ("PATH")
Print (sPath)
Parent topic: Operating System Calls
Related reference
SYS_GetEnv Function
Machine Handle Operator


SYS_SetRegistry Function

Action

Sets the view of the Windows registry. You can use this function to switch between the 32-bit and the 64-bit view of the registry.

Availability

This functionality is supported only if you are using the Open Agent.

Windows platforms.

Syntax

SYS_SetRegistry (registryType)
Variable | Description
registryType | The view type to which you want to set the registry. REGISTRYTYPE.
Parent topic: Operating System Calls


SYS_SetRegistryValue Function

Action

Sets the data value of an item in the Windows registry.

Availability

Windows platforms

Syntax

SYS_SetRegistryValue (iKey, sPath, sItem, sValue)
Variable | Description
iKey | The registry key. INTEGER
sPath | The path to the item through the registry hierarchy. STRING.
sItem | The name of the data value to set. STRING.
sValue | The data value of the item. STRING.

Notes

SYS_SetRegistryValue sets values of existing registry items but does not allow you to create new registry items.

Use the include file mswconst.inc to be able to reference key values.

SYS_SetRegistryValue can be called from Silk Test Classic or Agent C code, which might be useful if you want to put your application’s runtime settings in the registry.

SYS_SetRegistryValue supports these three data types: REG_SZ (string), REG_DWORD (4-byte binary value), and REG_BINARY (binary value of arbitrary length). If you want to set an item that has a value of type REG_BINARY or REG_DWORD, then you must format the value within a string that includes the data type prefix, as shown in the following examples:

"REG_BINARY: 14 00 00 7e 8f 99 33 22 08 00 07 00 06"
"REG_DWORD: 0x00008f7e"

SYS_SetRegistryValue is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

The following code fragment sets the RGB values for scroll bars.

integer iKey = HKEY_CURRENT_USER // defined in msw32.inc
string sPath = "Control Panel\Colors"
string sItem = "Scrollbar"
SYS_SetRegistryValue (iKey, sPath, sItem, "255 255 255")
Parent topic: Operating System Calls
Parent topic: Registry Operations (Classic Agent)
Related reference
SYS_GetRegistryValue Function
Machine Handle Operator


SYS_VerifyText Function

Action

Compares two text files and raises an error if there are differences.

Syntax

SYS_VerifyText (sFile1, sFile2)
Variable | Description
sFile1 | The first file to compare, containing the expected baseline value. STRING.
sFile2 | The second file to compare, containing the actual test result. STRING.

Notes

Clicking on the error in the results file invokes the text Difference Viewer.

SYS_VerifyText automatically factors out end-of-line differences between platforms.

Windows Platforms

SYS_VerifyText is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

SYS_VerifyText("baseline", "testfile")
Parent topic: Operating System Calls
Related reference
SYS_CompareText Function
Machine Handle Operator


Product Version Information

Includes functions for product version information.

  • GetPartnerBuildNum Function
    Returns the build number of Silk Test Classic partner.exe.
  • GetPartnerVersion Function
    Returns the version number of Silk Test Classic partner.exe.
  • SYS_GetAgentVersion Function
    Returns the version number of the Agent on the Agent machine.
Parent topic: Functions


GetPartnerBuildNum Function

Action

Returns the build number of Silk Test Classic partner.exe; this is a substring of the partner –v command.

Syntax

sString = GetPartnerBuildNum()
Variable | Description
sString | The build number of Silk Test Classic partner.exe. STRING.

Example

For example, the build number for Silk Test version 10 is:

[ ] Print(GetPartnerBuildNum()
[ ]
[ ] // Result:
[ ] // 3225
Parent topic: Product Version Information
Related reference
GetPartnerVersion Function
SYS_GetAgentVersion Function


GetPartnerVersion Function

Action

Returns the version number of Silk Test Classic partner.exe.

Syntax

sString = GetPartnerVersion()
Variable | Description
sString | The version of Silk Test Classic partner.exe. STRING.

Example

This example shows the command and the corresponding result for Silk Test version 10.0.0:

Print(GetPartnerVersion())

// Result:
// SilkTest Partner: Release 10.0.0 [3225], 32-Bit Edition, Customer ID = 0
// Copyright © 1992-2009 Borland Software Corporation and/or its subsidiaries.
Parent topic: Product Version Information
Related reference
GetPartnerBuildNum Function
SYS_GetAgentVersion Function


SYS_GetAgentVersion Function

Action

Returns the version number of the Agent on the Agent machine.

Syntax

sString = SYS_GetAgentVersion ( )

Notes

You can use this function in an environment that uses the Open Agent or Classic Agent. Silk Test Classic automatically uses the appropriate Agent.

Example

The following example shows the Open Agent version.

Silk Test OpenAgent: Release 11.1.0 [4379], 32-Bit Edition,
Copyright 1996-2010 Micro Focus (IP) Limited. All Rights Reserved. Silk Test
contains derivative works of Micro Focus Software Corporation, Copyright
1996-2010 Micro Focus Software Corporation (a Micro Focus company).
Parent topic: Product Version Information
Related reference
GetPartnerBuildNum Function
GetPartnerVersion Function


Password Encryption

Includes functions for password encryption.

  • Decrypt Function
    Decrypts text in a password field.
  • Encrypt Function
    Encrypts text in a password field.
Parent topic: Functions


Decrypt Function

Action

Decrypts text in a password field.

Syntax

SetText (Decrypt (sText))
Variable | Description
sText | The password text to decrypt. STRING.

Notes

Returns the decrypted value, which is passed as a parameter to SetText().

Example 1

PasswordField.SetText(Decrypt("EncryptedValueForPassword"))

Example 2

 varMyVariable = Decrypt("EncryptedValue")
SetText(varMyVariable)
Parent topic: Password Encryption
Related reference
Encrypt Function


Encrypt Function

Action

Encrypts text in a password field.

Syntax

SetText(Encrypt (sText))
Variable | Description
sText | The password text to encrypt. STRING.

Notes

Encyrpts the password text, which is passed as a parameter to SetText().

Example

PasswordField.SetText(Encrypt("PasswordInClearText"))
Parent topic: Password Encryption
Related reference
Decrypt Function
TypeKeys Method (AnyWin)
TypePasswordKeys Method


Random Value Operations

Includes functions for random value operations.

  • RandInt Function
    Returns a random integer.
  • RandPick Function
    Returns a random item from a list.
  • RandReal Function
    Returns a random real number.
  • RandSeed Function
    Seeds the random number generator.
  • RandStr Function
    Returns a random string.
Parent topic: Functions


RandInt Function

Action

Returns a random integer.

Syntax

iRand = RandInt(iMin, iMax)
Variable | Description
iRand | The returned random number. INTEGER.
iMin | The minimum random value to return. INTEGER.
iMax | The maximum random value to return. INTEGER.

Notes

RandInt returns a random integer in the range (iMin, iMax), inclusive.

For more information about how random number generation works, see RandSeed function.

Example

INTEGER iScore
iScore = RandInt(0, 100)
Print("Your score is", iScore)
Parent topic: Random Value Operations
Related reference
RandReal Function
RandSeed Function


RandPick Function

Action

Returns a random item from a list.

Syntax

aElem = RandPick(lList)
Variable | Description
aElem | A random item from the list. ANYTYPE.
laList | The list to pick a random item from. LIST OF ANYTYPE.

Notes

RandPick returns a random item from laList. The item can have any data type.

Example

[-] testcase RandPickExample()
    [ ] LIST OF STRING lsItems
    [ ] STRING sRandomItem
    [-] lsItems = {...}
        [ ] "Clam Chowder"
        [ ] "Fried Chicken"
        [ ] "Lobster"
        [ ] "Green Eggs and Ham"
    [ ] sRandomItem = RandPick (lsItems)
    [ ] Print("The special of the day is {sRandomItem}.")
Parent topic: Random Value Operations
Related reference
RandSeed Function


RandReal Function

Action

Returns a random real number.

Syntax

rRand = RandReal()
Variable | Description
rRand | The returned random number. REAL.

Notes

RandReal returns a random real (floating-point) number between 0 and 1 exclusive (that is, up to but not including 1).

For more information about how random number generation works, see RandSeed Function.

Example

REAL rPercent
rPercent = RandReal()
Print ("Your annual pay raise will be {rPercent * 10}%.")
Parent topic: Random Value Operations
Related reference
RandInt Function
RandSeed Function


RandSeed Function

Action

Seeds the random number generator.

Syntax

RandSeed(iSeed)
Variable | Description
iSeed | The seed value for the random number generator. INTEGER.

Notes

  • RandSeed uses iSeed as a seed for the random values that all other random functions return.

  • For a given seed value, RandSeed will generate a reproducible series of random values. For example, the following code will always generate the same values, because the starting seed value is always the same:
    [-] testcase Rand1() appstate none
    [ ] INTEGER iSeed = 10 // a random number generation seed
    [ ] RandSeed(iSeed)
    [ ] Print(RandInt(0, 100))
    [ ] Print(RandInt(0, 100))
    [ ] Print(RandInt(0, 100))
    [ ]
    [ ] // Every time Rand1 is executed it returns the same three numbers.
  • If you do not specify a seed value using RandSeed, random number functions will return different values for each run of a script during a testing session. For example, running test case Rand2 yields different results each time.
    [-] testcase Rand2() appstate none
    [ ] // NO seed value specified
    [ ]
    [ ] Print(RandReal())
    [ ] Print(RandInt(1,12))
    [ ]
    [ ] // First run:
    [ ] // 0.363499
    [ ] // 3
    [ ]
    [ ] // Second run:
    [ ] // 0.369257
    [ ] // 11
    [ ]
    [ ] // Third run:
    [ ] // 0.067510
    [ ] // 2

  • If you do not specify a seed value, the same series of results will occur in each testing session. For example, if you exit and restart Silk Test Classic and then run Rand2 for three consecutive times, you will get the same results as if you would have executed the test three times in the previous testing session.

  • If you want more randomized values in different testing sessions, set the seed value in a more random way. For example, base the argument to RandSeed on an unpredictable value from a database or on the current time. For example, the following statement sets a seed value based on the seconds component of the current time:
    RandSeed(GetDateTimePart(GetDateTime(), DTP_SECOND))
    Using this statement before you generate random numbers will yield different results when you run a series of tests in different testing sessions. For example:
    [-] testcase Rand3() appstate none
    [ ] RandSeed(GetDateTimePart(GetDateTime(), DTP_SECOND))
    [ ] Print(RandReal())
    [ ] Print(RandInt(1,12))
    [ ]
    [ ] // First run:
    [ ] // 0.754183
    [ ] // 6
    [ ]
    [ ] // Second run:
    [ ] // 0.756977
    [ ] // 6
    [ ]
    [ ] // Third run:
    [ ] // 0.762099
    [ ] // 9
    [ ]
    [ ] // Quit Silk Test Classic, restart, then rerun test three times.
    [ ]
    [ ] // First run after restarting:
    [ ] // 0.754649
    [ ] // 2
    [ ]
    [ ] // Second run after restarting:
    [ ] // 0.757908
    [ ] // 10
    [ ]
    [ ] // Third run after restarting:
    [ ] // 0.760702
    [ ] // 9
Parent topic: Random Value Operations
Related reference
RandInt Function
RandPick Function
RandReal Function
RandStr Function


RandStr Function

Action

Returns a random string.

Syntax

sString = RandStr (sPicture)
Variable | Description
sString | A random string derived from sPicture. STRING.
sPicture | A picture clause, which is a string made up of characters with special meaning to RandStr. STRING (maximum of 255 characters).

Notes

RandStr returns a random string with the format you specify in sPicture. Specify the type of random character you want in each position of the output string with one of the following format characters:

  • A, which returns any alphabetic character in the ASCII character set

  • X, which returns any alphanumeric character

  • P, which returns any printable ASCII character

  • 9, which returns any digit (0 to 9)

By default, each format character in sPicture generates a single random character in sString. You can include a length specifier (n) after a format character to specify how many random characters to generate.

The pattern is limited to 4096 characters, including generated characters. If the resulting pattern is longer than 4096 characters, the rest of the characters are ignored, and the resulting string contains: max length 4096

Characters other than the above are not interpreted, and are copied verbatim to the returned string, as in the examples below.

For more information about how random character generation works, see RandSeed Function.

Example

RandSeed (10)

Print (RandStr ("A")) // prints n (one random letter)

Print (RandStr ("AA")) // prints pB (two random letters)

Print (RandStr ("X9")) // prints l3 (one random alphanumeric, one digit)

Print (RandStr ("AC")) // prints kC (one random letter, C returned verbatim)

Print (RandStr ("Hi there")) // prints Hi there (all returned verbatim)

Print (RandStr ("A(5)")) // prints HNuVM (five random letters)

Print (RandStr ("AA(5)")) // prints yYsfsw (one letter followed by five letters)

Print (RandStr ("A(3)9(5)")) // prints Cjv63947 (three letters, five digits)

Print (RandStr ("C(10)")) // prints C(10) (all returned verbatim)
Parent topic: Random Value Operations
Related reference
RandSeed Function


Registry Operations (Classic Agent)

Includes functions for registry operations with the Classic Agent.

  • Reg_CreateKey Function
    Creates a new key, including any ancestors that do not already exist.
  • Reg_CreateValue Function
    Creates a value in a key with the specified data.
  • Reg_DeleteKey Function
    Deletes a registry key.
  • Reg_DeleteKeysAll Function
    Deletes a registry key, including all keys and values below that key.
  • Reg_DeleteValue Function
    Deletes a value in a key.
  • Reg_EnumKeys Function
    Returns the list of subkeys directly beneath the specified key.
  • Reg_EnumKeysAll Function
    Returns the list of all layers of subkeys beneath the specified key.
  • Reg_EnumValues Function
    Returns the list of values belonging to the specified key.
  • Reg_EnumValuesAll Function
    Returns the values of the key and of all subkeys within sPath.
  • SYS_GetRegistryKeyNames Function
    Returns a list of key names in string.
  • SYS_GetRegistryValue Function
    Returns the data value of an item in the Windows registry.
  • SYS_SetRegistryValue Function
    Sets the data value of an item in the Windows registry.
Parent topic: Functions


Reg_CreateKey Function

Action

Creates a new key, including any ancestors that do not already exist.

Syntax

Reg_CreateKey (hRootKey, sKeyPath)
Variable | Description
hRootKey | The constant (from mswconst.inc); e.g., HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE) for the root key (LONG).
sKeyPath | The path to the key to be created (STRING)

Notes

Registry functions work remotely (as well as locally).

Registry functions are shipped in a separate file (Registry.inc) that is not automatically included in the Use Files (as the appropriate extension .inc files are). There is a file named Registry.txt file that contains the library browser content for the registry files. In order to use the Registry functions, you must:

  • explicitly add the .inc file (as for the mswxxx.inc files) to the Use Files field in the Runtime Options dialog.

  • add the Registry.txt file to the Help files for library browser field in the General Options dialog.

Example

Reg_CreateKey (HKEY_LOCAL_MACHINE, "Software\Company\Product\Version")
Parent topic: Registry Operations (Classic Agent)
Related reference
Reg_CreateValue Function
SYS_GetRegistryKeyNames Function


Reg_CreateValue Function

Action

Creates a value in a key with the specified data.

Syntax

Reg_CreateValue (hRootKey, sPath, sValueName, sValueData)
Variable | Description
hRootKey | The constant from mswconst.inc for the root key. For example HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE. LONG.
sPath | The full path of the key that will contain the new value. STRING.
sValueName | The name of the new value. STRING.
sValueData | The data for the value. Supports string, binary, and DWORD values, using the format used by SYS_SetRegistryValue(). STRING.

Notes

Registry functions work remotely (as well as locally).

Registry functions are shipped in the separate file Registry.inc that is not automatically included in the Use Files, as the appropriate extension .inc files are. The Registry.txt file contains the library browser content for the registry files. In order to use the Registry functions:

  • Explicitly add the .inc file (as for the mswxxx.inc files) to the Use Files field in the Runtime Options dialog.
  • Add the Registry.txt file to the Help files for library browser field in the General Options dialog.

Example

Reg_CreateValue (HKEY_LOCAL_MACHINE, "Software\Company\Product", "Directory", "C:\TEMP")
Parent topic: Registry Operations (Classic Agent)
Related reference
Reg_CreateKey Function
SYS_GetRegistryValue Function


Reg_DeleteKey Function

Action

Deletes a registry key.

Syntax

Reg_DeleteKey (hRootKey, sPath)
Variable | Description
hRootKey | The constant (from mswconst.inc; for example, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE) for the root key (LONG).
sPath | The full path of the key to be deleted (STRING)

Notes

Registry functions work remotely (as well as locally).

Registry functions are shipped in a separate file (Registry.inc) that is not automatically included in the Use Files (as the appropriate extension .inc files are). There is a file named Registry.txt file that contains the library browser content for the registry files. In order to use the Registry functions, you must:

  • explicitly add the .inc file (as for the mswxxx.inc files) to the Use Files field in the Runtime Options dialog

  • add the Registry.txt file to the Help files for library browser field in the General Options dialog

Example

Reg_DeleteKey (HKEY_LOCAL_MACHINE, "Software\Company\Product")
Parent topic: Registry Operations (Classic Agent)
Related reference
Reg_DeleteValue Function


Reg_DeleteKeysAll Function

Action

Deletes a registry key, including all keys and values below that key.

Syntax

Reg_DeleteKeysAll (hRootKey, sPath)
Variable | Description
hRootKey | The constant (from mswconst.inc; e.g., HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE) for the root key (LONG).
sPath | The full path of the key to be deleted (STRING)

Notes

Registry functions work remotely (as well as locally).

Registry functions are shipped in a separate file (Registry.inc) that is not automatically included in the Use Files (as the appropriate extension .inc files are). There is a file named Registry.txt file that contains the library browser content for the registry files. In order to use the Registry functions, you must:

  • explicitly add the .inc file (as for the mswxxx.inc files) to the Use Files field in the Runtime Options dialog

  • add the Registry.txt file to the Help files for library browser field in the General Options dialog

Example

Reg_DeleteKeysAll (HKEY_LOCAL_MACHINE, "Software\Company\Product")
Parent topic: Registry Operations (Classic Agent)


Reg_DeleteValue Function

Action

Deletes a value in a key.

Syntax

Reg_DeleteValue (hRootKey, sPath, sValueName)
Variable | Description
hRootKey | The constant (from mswconst.inc; e.g., HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE) for the root key (LONG)
sPath | The full path of the key containing the value to be deleted (STRING)
sValueName | The name of the value to be deleted (STRING)

Notes

Registry functions work remotely (as well as locally).

Registry functions are shipped in a separate file (Registry.inc) that is not automatically included in the Use Files (as the appropriate extension .inc files are). There is a file named Registry.txt file that contains the library browser content for the registry files. In order to use the Registry functions, you must:

  • explicitly add the .inc file (as for the mswxxx.inc files) to the Use Files field in the Runtime Options dialog

  • add the Registry.txt file to the Help files for library browser field in the General Options dialog

Example

Reg_DeleteValue (HKEY_LOCAL_MACHINE, "Software\Company\Product\1.0", "Directory")
Parent topic: Registry Operations (Classic Agent)
Related reference
Reg_DeleteKey Function


Reg_EnumKeys Function

Action

Returns the list of subkeys directly beneath the specified key. The paths of the subkeys are relative to sPath.

Syntax

lsSubKeyPaths = Reg_EnumKeys (hRootKey, sPath)
Variable | Description
hRootKey | The constant (from mswconst.inc; e.g., HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE) for the root key (LONG)
sPath | The full path of the key for which to enumerate the subkeys (STRING)

Notes

Registry functions work remotely (as well as locally).

Registry functions are shipped in a separate file (Registry.inc) that is not automatically included in the Use Files (as the appropriate extension .inc files are). There is a file named Registry.txt file that contains the library browser content for the registry files. In order to use the Registry functions, you must:

  • explicitly add the .inc file (as for the mswxxx.inc files) to the Use Files field in the Runtime Options dialog

  • add the Registry.txt file to the Help files for library browser field in the General Options dialog

Example

Reg_EnumKeys (HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\StartMenu\Programs")
Parent topic: Registry Operations (Classic Agent)
Related reference
Reg_EnumKeysAll Function
Reg_EnumValues Function
Reg_EnumValuesAll Function


Reg_EnumKeysAll Function

Action

Returns the list of all layers of subkeys beneath the specified key. The paths of the subkeys are relative to sPath.

Syntax

lsSubKeyPaths = Reg_EnumKeysAll (hRootKey, sPath)
Variable | Description
hRootKey | The constant (from mswconst.inc; e.g., HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE) for the root key (LONG)
sPath | The full path of the key for which to enumerate the subkeys (STRING)

Notes

Registry functions work remotely (as well as locally).

Registry functions are shipped in a separate file (Registry.inc) that is not automatically included in the Use Files (as the appropriate extension .inc files are). There is a file named Registry.txt file that contains the library browser content for the registry files. In order to use the Registry functions, you must:

  • explicitly add the .inc file (as for the mswxxx.inc files) to the Use Files field in the Runtime Options dialog

  • add the Registry.txt file to the Help files for library browser field in the General Options dialog

Example

Reg_EnumKeysAll (HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\StartMenu\Programs")
Parent topic: Registry Operations (Classic Agent)
Related reference
Reg_EnumKeys Function
Reg_EnumValues Function
Reg_EnumValuesAll Function


Reg_EnumValues Function

Action

Returns the list of values belonging to the specified key. The data for the values can be string, binary or DWORD values.

Syntax

lrValues = Reg_EnumValues (hRootKey, sPath)
Variable | Description
hRootKey | The constant (from mswconst.inc; e.g., HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE) for the root key (LONG)
sPath | The full path of the key for which to enumerate the values, including subkey values (STRING)

Notes

Registry functions work remotely (as well as locally).

Registry functions are shipped in a separate file (Registry.inc) that is not automatically included in the Use Files (as the appropriate extension .inc files are). There is a file named Registry.txt file that contains the library browser content for the registry files. In order to use the Registry functions, you must:

  • explicitly add the .inc file (as for the mswxxx.inc files) to the Use Files field in the Runtime Options dialog

  • add the Registry.txt file to the Help files for library browser field in the General Options dialog

Example

Reg_EnumValues (HKEY_LOCAL_MACHINE, "Software\Company\Product")
Parent topic: Registry Operations (Classic Agent)
Related reference
Reg_EnumKeys Function
Reg_EnumKeysAll Function
Reg_EnumValuesAll Function


Reg_EnumValuesAll Function

Action

Returns the values of the key and of all subkeys within sPath. The names of the values include the path of the containing subkey relative to sPath. The data for the values can be string, binary or DWORD values.

Syntax

lrValues = Reg_EnumValuesAll (hRootKey, sPath)
Variable | Description
hRootKey | The constant (from mswconst.inc; e.g., HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE) for the root key (LONG)
sPath | The full path of the key for which to enumerate the values (STRING)

Notes

Registry functions work remotely (as well as locally).

Registry functions are shipped in a separate file (Registry.inc) that is not automatically included in the Use Files (as the appropriate extension .inc files are). There is a file named Registry.txt file that contains the library browser content for the registry files. In order to use the Registry functions, you must:

  • explicitly add the .inc file (as for the mswxxx.inc files) to the Use Files field in the Runtime Options dialog

  • add the Registry.txt file to the Help files for library browser field in the General Options dialog

Example

Reg_EnumValuesAll (HKEY_LOCAL_MACHINE, "Software\Company\Product\1.0")
Parent topic: Registry Operations (Classic Agent)
Related reference
Reg_EnumKeys Function
Reg_EnumKeysAll Function
Reg_EnumValues Function


Results File Operations

Lists the functions for results file operations.

  • AppError Function
    Places an error with the specified error message, proceeded by *** Error:, into the results file.
  • FuzzyVerify Function
    Verifies that an actual value matches an expected value using fuzzy verification.
  • LogError Function
    Logs an error message to the results file.
  • LogVerifyError Function
    Logs a described error to a results file.
  • LogWarning Function
    Logs a warning to the results file.
  • Print Function
    Prints the values of expressions to the results file.
  • Printf Function
    Prints a formatted expression to the results file.
  • PrintfToString Function
    Returns a formatted expression as a string.
  • RaiseError Function
    Raises an error with the specified exception number and places the specified error message, preceded by *** Error:, into the results file.
  • ResCloseList Function
    Closes a hierarchical level in the results file that was opened with ResOpenList.
  • ResExport Function
    Exports one or more results sets to a results export (.rex) file.
  • ResExportOnClose Function
    Exports the most recent results set from the current results file to a results export (.rex) file when the script/suite/testplan terminates.
  • ResExtract Function
    Extracts information from a results (.res) file to a text (.txt) file.
  • ResOpenList Function
    Creates a new hierarchical level in the results file.
  • ResPrintList Function
    Creates a hierarchy in the results file.
  • SetAgentTrace Function
    Specifies whether 4Test agent calls are logged to the results file.
  • Verify Function
    Verifies that an actual value matches an expected value.
Parent topic: Functions


AppError Function

Action

Places an error with the specified error message, proceeded by *** Error:, into the results file.

Syntax

AppError (sMessage)
Variable | Description
sMessage | The error message string for the results file. STRING.

Notes

AppError halts execution of the script or test case and invokes the recovery system, which attempts to return the application to its last-known base state, close any open windows, and so on.

Example

AppError ("Dialog not dismissed after {TIMEOUT} seconds")

The above syntax results in the following error message being placed in the results file, given that a TIMEOUT value of 15 is established:

*** ERROR: Dialog not dismissed after 15 seconds
Parent topic: Results File Operations
Related reference
Raise Statement


FuzzyVerify Function

This feature is provided as a convenience to you, but it is not supported.

Action

Verifies that an actual value matches an expected value using fuzzy verification. See Fuzzy Verification for more information.

Syntax

FuzzyVerify(aActual, aExpected[, sDesc])
Variable | Description
aActual | The value to verify. ANYTYPE.
aExpected | The expected value. ANYTYPE.
sDesc | Optional: A message describing the comparison. STRING.

Notes

FuzzyVerify is just like the Verify function except that it uses fuzzy verification when determining whether aActual and aExpected match.

Example

// checks the selected value in the text field using fuzzy verification
FuzzyVerify(TextEditor.Document.GetSelText(), "Pagoda", "selected text")
Parent topic: Results File Operations
Related reference
Verify Function


LogError Function

Action

Logs an error message to the results file.

Syntax

LogError (sMsg, [cmd-line])
Variable | Description
sMsg | The text to write to the results file, typically an error message. STRING.
cmd-line | Optional: An expression that contains a command line. If specified, the results file displays an icon on the error line. When you click the icon, the command line executes. STRING.

Notes

LogError writes a string, usually in form of an error message, to the results file. The string, which is created by the LogError function, is marked internally as an error line. This causes the line to display in the results file in red or italics, depending on the platform. The number of errors logged by LogError is also stored in the results file.

Silk Test Classic calls LogError automatically when it raises an exception that you have not handled. Your exception handlers should also call it if you want your error messages to be flagged as real errors in the results file. LogError does not halt the execution of scripts or test cases.

GetTestsFailedCount does not count user-defined errors when using LogError().

Example

LogError ("*** Error: Expected Message Box did not appear")
Parent topic: Results File Operations
Related reference
LogWarning Function


LogVerifyError Function

Action

Logs a described error to a results file.

Syntax

LogVerifyError(aData1, aData2[, sDesc]
Variable | Description
aData1 | The actual data discovered by the test case. ANYTYPE.
aData2 | The data expected by the test case. ANYTYPE.
sDesc | Optional: A description of the failed verification. STRING.

Notes

You can write your own verify routine when a 4Test verify function is not appropriate. When your verify routine discovers an error, use LogVerifyError to write the results of the failure to the results file. The logged message is in the form, "*** ERROR: Verify sDesc failed—expected aData2, got aData1". Therefore, the example below would be, "*** ERROR: Verify Find failed—expected Find, got MessageBox".

Example

[ ] WINDOW wActive = TextEditor.GetActive ()
[-] if (wActive != Find)
        [ ] LogVerifyError (wActive, Find, "Find")
Parent topic: Results File Operations


LogWarning Function

Action

Logs a warning to the results file.

Syntax

LogWarning (sWarning)
Variable | Description
sWarning | The warning to log to the results file. STRING.

Notes

Warnings generated with the LogWarning function are tallied into the warning count, not the error count.

Example

LogWarning("Baseline file is missing")
Parent topic: Results File Operations
Related reference
LogError Function


Print Function

Action

Prints the values of expressions to the results file.

Syntax

Print (vaExprs)
Variable | Description
vaExprs | Any number of expressions. ANYTYPE.

Notes

  • Print prints the values of expressions to the results file. Print inserts a space between expressions.

  • When you pass arrays, lists, and records to Print, it separates the elements or fields with spaces and commas, and encloses the array, list, or record in braces. For example:
    [-] LIST lsDogs = {...}
    [ ] "Greyhound"
    [ ] "Akita"
    [ ] "Borzoi"
[ ] Print (lsDogs) // Prints: {Greyhound, Akita, Borzoi}

  • If you attempt to print an uninitialized element of a list, array, or record, or a variable that has no value, Silk Test Classic prints the text "<unset>".

Example

[-] testcase PrintExample ()
    [ ]
    [ ] Print ("The number", 1, "is in the middle")
    [ ] // Prints: The number 1 is in the middle
    [ ]
    [ ] INTEGER iPercent = 30
    [ ] Print ("Sales are up {iPercent} percent")
    [ ] //Prints: Sales are up 30 percent
    [ ]
    [ ] STRING sVar = "Value"
    [ ] Print ("'{sVar}' is {Len (sVar)} characters long")
    [ ] // Prints: 'Value' is 5 characters long
    [ ]
    [ ] LIST OF STRING lsFruit
    [-] lsFruit = {...}
        [ ] "Apple"
        [ ] "Peach"
        [ ] "Pear"
    [ ] Print (lsFruit)
    [ ] // Prints: {Apple, Peach, Pear}
    [ ]
    [ ] LIST OF POINT lPoint = {}
    [ ] ListAppend (lPoint, {1, 5})
    [ ] ListAppend (lPoint, {4, 8})
    [ ] Print (lPoint)
    [ ] // Prints: {{1, 5}, {4, 8}}
    [ ]
    [ ] INTEGER aiCount[3]
    [ ] aiCount[1] = 4
    [ ] aiCount[3] = 9
    [ ] Print (aiCount)
    [ ] // Prints: {4, <unset>, 9}
Parent topic: Results File Operations
Related reference
Printf Function
PrintfToString Function


Printf Function

Action

Prints a formatted expression to the results file.

Syntax

Printf (sFormat, aArgs, ...)
Variable | Description
sFormat | The format to use. STRING.
aArgs | Any number of arguments to print. ANYTYPE.

Notes

  • Printf prints a formatted value to the results file.

  • The format string you specify describes the format of each argument, in order. The format string can include any Ansi C printf format specifiers, including:

    • %s (if the argument that follows is a string)

    • %d (if the argument that follows is an integer)

    • %o (if the argument that follows is an integer you want formatted in octal format)

    • %x (if the argument that follows is an integer you want formatted in hexadecimal format)

    • %f (if the argument that follows is a real number)

    • You can precede any of these format characters with an integer to specify the width to use in the output. Use an asterisk (*) to determine the width from an argument in the list, for example:
      Printf("%*s", 5, "abc")
// Prints __abc (the underscores represent spaces)

  • By default, the output is right-justified. A negative width causes left-justification.

  • For real numbers, you can also specify a second number, which is the precision of the output, in the form width.precision. You can use an asterisk as the precision to read the precision from the argument list.

  • Printf does not automatically supply a new-line character at the end of the line, as Print does. To output a carriage return at the end of the line, use the text "\n" in the format string. To output a backslash (\), enter two backslashes in the format string, as in the following:
    Printf ("%s\\%s", sMyString, sMyString)
// Prints abc\abc

  • Similarly, to output a percent sign (%), specify two percent signs in the format string.

Example

[-] testcase PrintfExample ()
    [ ] STRING sMyString = "abc"
    [ ] INTEGER iMyInt = 123
    [ ] NUMBER nMyReal = 45.7
    [ ] Printf ("%s", sMyString) // prints abc
    [ ] Printf ("%4d", iMyInt) // prints 123
    [ ] Printf ("%4.2f", nMyReal) // prints 45.70
    [ ] Printf ("%s%d", sMyString, iMyInt) // prints abc123
    [ ] Printf ("%-4s%d", sMyString, iMyInt) // prints abc 123
Parent topic: Results File Operations
Related reference
Print Function
PrintfToString Function


RaiseError Function

Action

Raises an error with the specified exception number and places the specified error message, preceded by *** Error:, into the results file.

Syntax

RaiseError(iExcept, sMessage)
Variable | Description
iExcept | The number of the exception you want to raise. INTEGER.
sMessage | The error message string to associate with the raised error. STRING.

Example

RaiseError (13, "Employee dialog not dismissed after {ACCEPT_TIMEOUT} seconds")
The above example raises exception number 13 and places the following error message in the results file (given that an ACCEPT_TIMEOUT value of 15 had been established):
*** ERROR: Employee dialog not dismissed after 15 seconds
Parent topic: Results File Operations
Related reference
Raise Statement


ResCloseList Function

Action

Closes a hierarchical level in the results file that was opened with ResOpenList.

Syntax

ResCloseList ( )

Notes

  • Use ResOpenList to start a new hierarchical level. The Print commands that follow it are indented until you close the level with ResCloseList.

  • When you view the results file, the item sName is initially collapsed, indicated by the [+] icon next to it. You can expand sName to reveal the indented items under it.

Example

[-] testcase ResCloseListExample ()
    [ ] ResOpenList ("Level 1") // Create a new level
    [ ] Print ("subitem 1") // Add subitems to the level
    [ ] Print ("subitem 2")
    [ ] Print ("subitem 3")
    [ ] ResCloseList () // Close this level
    [ ] // In Results file, you see
    [ ] // [+] Level 1
    [ ] // Clicking on the [+] icon reveals
    [ ] // [-] Level 1
    [ ] // subitem1
    [ ] // subitem2
    [ ] // subitem3
Parent topic: Results File Operations
Related reference
ResOpenList Function
ResPrintList Function


ResExport Function

Action

Exports one or more results sets to a results export (.rex) file.

Syntax

ResExport (sResultsFile [, sREXFile, iStartIndex, iEndIndex ])
Variable | Description
sResultsFile | The name of the results file containing the results set(s) you want to export. It cannot be the current results file. STRING.
sREXFile | Optional. Results export file to save the results set(s) to. If not specified, results are saved in a file with the same name as sResultsFile, in the same directory, with the .rex extension. If only a file name is specified, the file is saved in the same directory as sResultsFile. STRING.
iStartIndex | Optional. Index of the most recent results set to save. 0 represents the most recent results set; 1 the next most recent, and so on. If not specified, saves most recent results set. INTEGER.
iEndIndex | Optional. Index of oldest results set to save. 0 represents the most recent results set; 1 the next most recent, and so on. If not specified, saves most recent results set. INTEGER.

Notes

Use ResExport to save one or more results sets to a .rex file, which is a structured (delimited) text file that is suitable for importing into a spreadsheet or other application for further processing.

ResExport uses export parameters that are specified in the [ResultsExport] section in partner.ini. These parameters specify which fields are exported and the format of the exported file. You can view and set these parameters in the Results Export dialog. To set the parameters, select Results > Export, specify your preferences, then click OK. The preferences are saved in the [ResultsExport] section in partner.ini (if you changed one or more values from the defaults) and are used the next time you call the ResExport function in a script or select the Results > Export command.

Example

The following statement exports the most-recent results set from db.res to db.rex.

ResExport ("d:\mytests\db.res")

The following statement exports the second-most-recent and third-most-recent results sets from db.res to db.rex.

ResExport ("d:\mytests\db.res",NULL,1,2)
Parent topic: Results File Operations
Related reference
ResExportOnClose Function


ResExportOnClose Function

Action

Exports the most recent results set from the current results file to a results export (.rex) file when the script/suite/testplan terminates.

Syntax

ResExportOnClose ( [sREXFile] )
Variable | Description
sREXFile | Optional. Results export file to save the results set to. If not specified, results are saved in a file with the same name as the current results file, in the same directory, with the .rex extension. If only a file name is specified, the file is saved in the same directory as the current results file. STRING.

Notes

Use ResExportOnClose to save the most recent results set from the current results file to a .rex file, which is a structured (delimited) text file that is suitable for importing into a spreadsheet or other application for further processing.

ResExportOnClose uses export parameters that are specified in the [ResultsExport] section in partner.ini. These parameters specify which fields are exported and the format of the exported file. You can view and set these parameters in the Results Export dialog. To set the parameters, select Results > Export, specify your preferences, then click OK. The preferences are saved in the [ResultsExport] section in partner.ini (if you changed one or more values from the defaults) and are used the next time you call the ResExportOnClose function in a script or select the Results > Export command.

Example

The following statement exports the most-recent results set from the current results file to current.rex file when the script terminates.

ResExportOnClose ("current.rex")
Parent topic: Results File Operations
Related reference
ResExport Function


ResExtract Function

Action

Extracts information from a results (.res) file to a text (.txt) file.

Syntax

ResExtract ( [ sTxtFile, IncludeOutputText, IncludeErrorText, IncludeSummaryText, Expand])
Variable | Description
sTxtFile | Optional: If a text file name is passed, the file is saved as exactly that name, without a .txt extension, in the current working directory. If a relative or absolute path is provided with the file name, the file is saved to the specified directory.
IncludeOutputText | Optional: Specifies whether to extract the output of print statements. The default value is TRUE. BOOLEAN.
IncludeErrorText | Optional: Specifies whether to extract text generated by the functions LogError and ExceptLog. The default value is TRUE. BOOLEAN.
IncludeSummaryText | Optional: Specifies whether to extract which tests passed and failed and the number of errors produced by failed tests. The default value is FALSE. BOOLEAN.
Expand Optional: Specifies which units to extract information about. The possible values are:
RX_SCRIPTS
Only scripts.
RX_TESTCASE
Scripts and test cases.
RX_ERRORS
Anything with errors.
The default value is RX_TESTCASE. ENUM.

Notes

When no argument is passed, the text file name is the same as the name of the .t file from which the function is called, with a .txt extension. The file is saved in the current working directory.

Examples

The following statement extracts the most recent results set and saves the information in the specified location as db.txt.
ResExtract ("d:\mytests\db.txt")
The following statement extracts the most recent results set and saves the information in the current working directory as textres1.
ResExtract ("textres1")
The following statement extracts the most recent results set and saves the information in the current working directory as textres2, extracting the output of string statements and which tests passed and failed. Anything with errors is extracted.
ResExtract ("textres2", TRUE, FALSE, TRUE, RX_ERRORS)
Parent topic: Results File Operations


ResOpenList Function

Action

Creates a new hierarchical level in the results file.

Syntax

ResOpenList (sName)
Variable | Description
sName | The name of the level as it will appear in the results file. STRING.

Notes

  • Use ResOpenList to start a new hierarchical level. The Print commands that follow it are indented until you close the level with ResCloseList.

  • When you view the results file, the item sName is initially collapsed, indicated by the [+] icon next to it. You can expand sName to reveal the indented items under it.

Example

[-] testcase ResOpenListExample ()
    [ ] ResOpenList ("Level 1") // Create a new level
    [ ] Print ("subitem 1") // Add subitems to the level
    [ ] Print ("subitem 2")
    [ ] Print ("subitem 3")
    [ ] ResCloseList () // Close this level
    [ ] // In Results file, you see
    [ ] // [+] Level 1
    [ ] // Clicking on the [+] icon reveals
    [ ] // [-] Level 1
    [ ] // subitem1
    [ ] // subitem2
    [ ] // subitem3
Parent topic: Results File Operations
Related reference
ResCloseList Function
ResPrintList Function


ResPrintList Function

Action

Creates a hierarchy in the results file.

Syntax

ResPrintList (sName, lSubItems)
Variable | Description
sName | The name of the item as it will appear in the results file. STRING.
lSubItems | The list of subitems that will be indented under sName in the results file. LIST OF ANYTYPE.

Notes

  • ResPrintList creates a hierarchy in the results file, where sName is the level name, and lSubItems are the subordinate items under sName.

  • ResPrintList is equivalent to the following statements:
    ResOpenList (sName)
ListPrint (laSubItems)
ResCloseList ()

  • When you view the results file, the item sName is initially collapsed, indicated by the [+] icon next to it. You can expand sName to reveal the indented items under it.

Example

[-] testcase ResPrintListExample ()
    [ ]
    [-] LIST OF ANYTYPE lSubitems = {...}
        [ ] "subitem1"
        [ ] "subitem2"
        [ ] "subitem3"
    [ ]
    [ ] ResPrintList ("Level 1", lSubitems)
    [ ]
    [ ] // In Results file, you see
    [ ]
    [ ] // [+] Level 1
    [ ]
    [ ] // Clicking on the [+] icon reveals
    [ ]
    [ ] // [- ] Level 1
    [ ]
    [ ] // subitem1
    [ ]
    [ ] // subitem2
    [ ]
    [ ] // subitem3
Parent topic: Results File Operations
Related reference
ResCloseList Function
ResOpenList Function


SetAgentTrace Function

Action

Specifies whether 4Test agent calls are logged to the results file.

Syntax

bPrevious = SetAgentTrace (bTraceOn)
Variable | Description
bPrevious | The previous value of the agent trace feature. BOOLEAN.
bTraceOn | TRUE to turn on the agent trace feature, FALSE to turn it off. BOOLEAN.

Notes

SetAgentTrace turns the 4Test agent trace feature on or off, and returns the previous setting.

When the agent trace feature is on, Silk Test Classic writes a list of every call made to the agent to the results file. You can also set this feature by selecting the Print Agent Calls check box in the Runtime Options dialog box.

Example

SetAgentTrace (TRUE)
Parent topic: Results File Operations


Verify Function

Action

Verifies that an actual value matches an expected value.

Syntax

Verify(aActual, aExpected[, sDesc])
Variable | Description
aActual | The value to verify. ANYTYPE.
aExpected | The expected value. ANYTYPE.
sDesc | Optional: A message describing the comparison. STRING.

Notes

Verify compares two values of any type, including NULL values. It raises an E_TYPE_MISMATCH if their types do not match, or an E_VERIFY exception if their types match but their values are not equal.

Use Verify to verify that a variable in a script has the value you expect.

If aExpected is not equal to aActual, the exception raised by Verify lists values of both aExpected and aActual in the order they appear when calling the Verify function. If the values are lists or records, the results file contains an icon that invokes the difference viewer to display the differences.

If you include sDesc, the error message is: Verify sDesc failed — got aActual, expected aExpected. Otherwise, the default error message is Verify failed — got aActual, expected aExpected.

Examples

// raises an exception if the window does not exist
Verify(TextEditor.Exists(), TRUE)
// checks the selected value in the text field
Verify(TextEditor.Document.GetSelText (), "59.62", "selected text")
Parent topic: Results File Operations


Runtime Status Messages

Includes functions for runtime status messages.

  • PopTestInfo Function
    Removes a user-defined message from the Runtime Status window.
  • PushTestInfo Function
    Sends a message to the Runtime Status window.
  • SetTestStatus Function
    Sets the title of the Runtime Status window.
Parent topic: Functions


PopTestInfo Function

Action

Removes a user-defined message from the Runtime Status window.

Syntax

bReturn = PopTestInfo ( )
Variable | Description
bReturn | TRUE if a user-defined message was removed from the Runtime Status window; otherwise, FALSE. BOOLEAN.

Notes

Use PopTestInfo to remove from the Runtime Status window user-defined messages you sent with PushTestInfo.

You cannot remove a Silk Test Classic-generated message from the Runtime Status window.

Parent topic: Runtime Status Messages
Related reference
PushTestInfo Function
SetTestStatus Function


PushTestInfo Function

Action

Sends a message to the Runtime Status window.

Syntax

PushTestInfo (sInfo)
Variable | Description
sInfo | Message to appear in the Runtime Status window. STRING.

Notes

When PushTestInfo is called with the string sInfo, a message is displayed in the Runtime Status window:

value of sInfo

Each message you send with PushTestInfo can be removed from the Runtime Status window either by a call to PopTestInfo or when the test completes execution. However if the 4Test code raises an exception then the messages will not be cleared automatically. We recommend that you call PopTestInfo function to clear the messages.

Parent topic: Runtime Status Messages
Related reference
PopTestInfo Function
SetTestStatus Function


SetTestStatus Function

Action

Sets the title of the Runtime Status window.

Syntax

aReturn = SetTestStatus ([sStatus])
Variable | Description
aReturn | The previous title in the Runtime Status window or NULL if the previous title was the default title. ANYTYPE.
sStatus | Optional. Title of the Runtime Status window. If not supplied, SetTestStatus restores the default title. STRING.

Notes

When SetTestStatus is called with the string sStatus, the title of the Runtime Status window is changed to Status: sStatus.

Call SetTestStatus with no argument to restore the default title.

Parent topic: Runtime Status Messages
Related reference
PopTestInfo Function
PushTestInfo Function


Script Information

Includes functions for script information.

  • GetArgs Function
    Returns the arguments passed to a script.
  • GetBaseClass Function
    Returns the base class of the specified class.
  • GetBrowserType Function
    Returns the current browser type.
  • GetDefaultBrowserType Function
    Returns the default browser type, which is used when new Agent connections are made.
  • GetExecutableDir Function
    Returns the location of the Silk Test Classic executable, partner.exe, on the local machine.
  • GetGuiName Function
    Returns the name of the graphical user interface under which the agent on the current machine, or a specified machine, is running.
  • GetGUIType Function
    Returns the current GUI.
  • GetGuiVersion Function
    Returns the version number of the graphical user interface on the current machine.
  • GetParentClass Function
    Returns the parent class of the specified class. Returns NULL if the class has no parent class.
  • GetProgramDir Function
    Returns the directory of the script that is running.
  • GetProgramName Function
    Returns the name of the script that is running.
  • GetRel1ClassLibrary Function
    Returns TRUE if the Use release 1.x version of the class library check box is checked in the Agent Options window.
  • GetStartupDir Function
    Returns the location of the include files that Silk Test Classic uses at startup.
  • GetSubClasses Function
    Returns the immediate descendants of the specified class.
  • GetTestCaseArgs Function
    Returns the list of arguments that were passed to the test case.
  • GetTestCaseErrorCount Function
    Returns the number of application errors discovered by the current test case.
  • GetTestCaseName Function
    Returns the name of the current test case.
  • GetTestCaseState Function
    Returns the state of the current test case.
  • GetTestCaseWarningCount Function
    Returns the number of warnings discovered by the current test case.
Parent topic: Functions


GetArgs Function

Action

Returns the arguments passed to a script.

Syntax

lsArgs = GetArgs()
Variable | Description
lsArgs | The returned script arguments. LIST OF STRING.

Notes

GetArgs returns a copy of the argument list of the script that Silk Test Classic is currently running. GetArgs returns a list of strings whose items correspond to the arguments passed to the current script.

You pass arguments to a 4Test script using the Arguments text box in the Runtime Options dialog box by writing them after the script name in a 4Test suite (.s) file or when you start Silk Test Classic from the command line.

Example

[-] testcase GetArgsExample ()
    [ ] // list of arguments passed to a script
    [ ] LIST OF STRING lsArgs
    [ ] lsArgs = GetArgs()
    [-] ListPrint(lsArgs)
Parent topic: Script Information
Related reference
GetProgramName Function


GetBaseClass Function

Action

Returns the base class of the specified class. The base class is also called the original class.

Syntax

dWinBaseClass = GetBaseClass (dWinClass)
Variable | Description
dWinBaseClass | The name of the base class of dWinClass. DATACLASS.
dWinClass | The name of the class whose original class you want to identify. DATACLASS.

Notes

Normally, GetBaseClass on a window class returns the class itself. However, when you override a class definition, 4Test creates a new class that is a subclass of the original class. Classes that are derived from the original class are not affected. In this case, GetBaseClass returns the overridden class. If it is not clear whether a class definition has been overridden, using GetBaseClass is preferable to the GetClass method or the ClassOf function.

Example

[ ] window MainWin TestApplication
[ ] window DialogBox xCheckBox
[ ]
[ ] winclass MoveableWin : MoveableWin
[ ] Close()
[-] ... print("Moveable is redefined")
    [ ]
[-] main()
    [ ] WINDOW w
    [-] for each w in {TestApplication, xCheckBox}
        [ ] TestClassOfMoveableWin (w)
    [ ]
[-] testcase TestClassOfMoveableWin (WINDOW w) appstate none
    [ ] Print(ClassOf(w))
    [ ] Print(GetBaseClass(ClassOf(w)))
    [ ] // MoveableWin has been redefined, so we use GetBaseClass
    [ ] // to compare to those windows originally derived from the
    [ ] // overridden class. This verification will pass.
    [ ] Verify (ClassOf(w) == GetBaseClass(MoveableWin), TRUE, "GetBaseClassOf({w})==MoveableWin")
    [ ] // This verification will fail because MoveableWin was overridden
    [ ] Verify (ClassOf (w) == MoveableWin, TRUE, "ClassOf({w})==MoveableWin")
Parent topic: Script Information
Related reference
GetParentClass Function
GetClass Function
GetSubClasses Function


GetBrowserType Function

Action

Returns the current browser type.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

Note: When you are using the Open Agent, you can get the browser type by using the GetProperty method of the AnyWin class on the browser application. For example:
browserApplication.getProperty("browsertype")
BrowserType = GetBrowserType ([hMachine])
Variable | Description
BrowserType | The current browser type. BROWSERTYPE.
hMachine | Optional: The handle for a specific machine. Default is the current machine. HMACHINE.

Notes

If the current browser has been set in a script with the SetBrowserType function, GetBrowserType returns that browser type for the current machine or for the specified machine if the optional argument is used.

If the current browser has not been set in a script, GetBrowserType returns the BROWSERTYPE set for Default Browser in Runtime Options; if no browser is specified in Runtime Options, GetBrowserType returns NULL.

Note: When you are using the Open Agent, you can get the browser type by using the GetProperty method of the AnyWin class on the browser application. For example:
browserApplication.getProperty("browsertype")

Example

BROWSERTYPE btType
btType = GetBrowserType ()
Print ("Browser is {btType}")

// Result if Explorer 7.0 is current browser:
// Browser is Internet Explorer 7.0
Parent topic: Script Information
Parent topic: Web Browser
Related reference
GetDefaultBrowserType Function
SetBrowserType Function
SetDefaultBrowserType Function
BROWSERTYPE Data Type


GetDefaultBrowserType Function

Action

Returns the default browser type, which is used when new Agent connections are made.

Syntax

BrowserType = GetDefaultBrowserType()
Variable | Description
BrowserType | The current browser type. BROWSERTYPE.

Notes

The default browser type is the one that is used when a new Agent connection is made.

If the default browser has been set in a script with the SetDefaultBrowserType function, GetDefaultBrowserType returns that browser type.

If the default browser has not been set in a script, GetDefaultBrowserType returns the BROWSERTYPE set for Default Browser in Runtime Options; if no browser is specified in Runtime Options, GetDefaultBrowserType returns NULL.

Example

BROWSERTYPE btType
btType = GetDefaultBrowserType()
Print("Default browser is {btType}")

// Result if Windows Internet Explorer 7 is default browser:
// Default browser is Internet Explorer 7
Parent topic: Script Information
Parent topic: Web Browser
Related reference
GetBrowserType Function
SetBrowserType Function
SetDefaultBrowserType Function
BROWSERTYPE Data Type


GetExecutableDir Function

Action

Returns the location of the Silk Test Classic executable, partner.exe, on the local machine.

Syntax

sDir = GetExecutableDir()
Variable | Description
sDir | Returns the location of the Silk Test Classic executable, partner.exe, on the local machine. STRING.

Notes

GetExecutableDir returns the short form of the directory and appends the appropriate directory delimiter for your platform.

Example

If Silk Test Classic is installed in c:\program files\Silk\Silk Test, then the following Print statement returns c:\ progra~1\Silk\Silk Test\.

const sDir = GetExecutableDir()
print(sDir)
Parent topic: Script Information
Related reference
GetStartupDir Function
SYS_GetExecutableDir Function


GetGuiName Function

Action

Returns the name of the graphical user interface (GUI) under which the agent on the current machine, or a specified machine, is running.

Syntax

sName = GetGuiName ([hMachine])
Variable | Description
sName | The name of the GUI. STRING.
hMachine | Optional. Handle of the machine for which you want the GUI name. When only one machine is connected or when you want the GUI name for the current machine, you can omit this argument. HMACHINE.

Notes

GetGuiName returns the name of the GUI under which the agent on the current or specified machine is running, for example, "Microsoft Windows".

Example

STRING sGUIName = GetGuiName()
Print("The present GUI is {sGUIName}")
Parent topic: Script Information
Related reference
GetGUIType Function
GetGuiVersion Function


GetGUIType Function

Action

The GetGUIType function returns the current GUI. You can test the return value of the function in an if statement or a switch statement. Use a switch statement when there are more than two logic branches.

If Statement Example

Suppose a feature is implemented differently in Windows, compared to all other platforms:

[-] if(GetGUIType() != msw)
    [ ] // test feature on all platforms but Windows
[-] else
    [ ] // test feature on Windows

Switch Statement Example

If your application is deployed on multiple platforms, and each platform implements the same feature slightly different, use the switch statement in a construction like the following:

[-] switch(GetGUIType())
    [-] case mswin7:
        [ ] // code to test feature on Windows 7
    [ ]
    [-] case mswin2008r2 :
        [ ] // code to test feature on Windows 2008 R2
Parent topic: Script Information
Related reference
if Statement
switch Statement


GetGuiVersion Function

Action

Returns the version number of the graphical user interface (GUI) on the current machine.

Syntax

sVersion = GetGuiVersion ([hMachine])
Variable | Description
sVersion | The version number of the GUI. STRING.
hMachine | Optional: Handle of the machine for which you want the GUI version. When only one machine is connected or when you want the GUI version for the current machine, you can omit this argument. HMACHINE.

Notes

GetGuiVersion returns a text string that corresponds to the version number of the GUI, with the major version number to the left of the decimal point, and the minor version number to the right of the decimal point. For example, for Microsoft Windows 3.1, the value is "3.1".

Example

STRING sGUIName, sGUIVersion
sGUIName = GetGuiName()
sGUIVersion = GetGuiVersion()
Print("The present GUI is {sGUIName}{sGUIVersion}")
Parent topic: Script Information
Related reference
GetGuiName Function
GetGUIType Function
SetMachine Function


GetParentClass Function

Action

Returns the parent class of the specified class. Returns NULL if the class has no parent class.

Syntax

dWinParentClass = GetParentClass (dWinClass)
Variable | Description
dWinParentClass | The name of the parent class of dWinClass or NULL, if none. DATACLASS.
dWinClass | The class whose parent class you want to identify. DATACLASS.

Example

[ ] //My declarations
[ ] window MainWin TestApplication
[-] window DialogBox xCheckBox
    [ ]
[-] main ()
    [ ] LIST OF WINDOW lw = {TestApplication, xCheckBox}
    [ ] WINDOW w
    [-] for each w in lw
        [ ] RelatedClasses(w)
    [ ]
[-] testcase RelatedClasses(WINDOW w) appstate none
    [ ] Print ("Class is: {ClassOf(w)}, Parent Class is: {GetParentClass(ClassOf(w))}")
    [ ]
    [ ] // Testcase returns for TestApplication and xCheckBox:
    [ ] // Class is: MainWin, Parent Class is: MoveableWin
    [ ] // Class is: DialogBox, Parent Class is: MoveableWin
Parent topic: Script Information
Related reference
GetBaseClass Function
GetClass Function
GetSubClasses Function


GetProgramDir Function

Action

Returns the directory of the script that is running.

Syntax

sName = GetProgramDir()
Variable | Description
sName | The directory of the script. STRING.
Parent topic: Script Information
Related reference
GetArgs Function
GetProgramName Function


GetProgramName Function

Action

Returns the name of the script that is running. The script name accurately reflects any upper and lower case characters.

Syntax

sName = GetProgramName()
Variable | Description
sName | The name of the script. STRING.

Example

STRING sProgName; // The name of the current script
sProgName = GetProgramName()
Print(sProgName, "is currently running.")
Parent topic: Script Information
Related reference
GetProgramDir Function


GetRel1ClassLibrary Function

Action

Returns TRUE if the Use release 1.x version of the class library check box is checked in the Agent Options window.

Syntax

bUseRel1 = GetRel1ClassLibrary( )
Variable | Description
bUseRel1 | Returns TRUE if the Use release 1.x version of the class library check box is checked in the Agent Options window; returns FALSE if the box is not checked. BOOLEAN.

Notes

Use this function to verify that the Use release 1.x version of the class library check box is appropriately checked in the Agent Options window.

Example

[ ] BOOLEAN bRel1Option
[-] if (GetRel1ClassLibrary () == FALSE)
    [ ] raise 1, "ERROR: Wrong setting for release 1.x option"
Parent topic: Script Information


GetStartupDir Function

Action

Returns the location of the include files that Silk Test Classic uses at startup.

Syntax

sDir = GetStartupDir( )
Variable | Description
sDir | The directory in which the include files of Silk Test Classic reside. STRING.

Notes

GetStartupDir appends the appropriate directory delimiter for your platform.

Example

If Silk Test Classic is installed in c:\myprogs, then the following Print statement returns:"c:\myprogs\exercise".

const sDir
sDir = "{GetStartupDir()}exercise"
print(sDir)
Parent topic: Script Information
Related reference
GetExecutableDir Function


GetSubClasses Function

Action

Returns the immediate descendants of the specified class. This feature is provided as a convenience to you, but it has not yet been thoroughly tested.

Syntax

ldWinSubClass = GetSubClasses (dWinClass)
Variable | Description
ldWinSubClass | The names of the descendent classes of dWinClass or NULL, if none. LIST OF DATACLASS.
dWinClas | The class whose descendant classes you want to identify. DATACLASS.

Example

[ ] //My declarations
[ ] window MainWin TestApplication
[-] window DialogBox xCheckBox
    [ ]
[-] main()
    [ ] LIST OF WINDOW lw = {TestApplication, xCheckBox}
    [ ] WINDOW w
    [-] for each w in lw
        [ ] RelatedClasses(w)
    [ ]
[-] testcase RelatedClasses(WINDOW w) appstate none
    [ ] ResPrintList ("Class is: {ClassOf(w)}, Subclasses are:", GetSubClasses(ClassOf(w)))
    [ ]
    [ ] // Testcase returns for TestApplication and xCheckBox:
    [ ] // Class is: MainWin, Subclasses are: {VBMainForm, VBMDIForm}
    [ ] // Class is: DialogBox, Subclasses are: {MessageBoxClass, VBForm}
Parent topic: Script Information
Related reference
GetParentClass Function
GetBaseClass Function
GetClass Function


GetTestCaseArgs Function

Action

Returns the list of arguments that were passed to the test case.

Syntax

laArgs = GetTestCaseArgs()
Variable | Description
laArgs | The arguments that were passed to the test case. Return value is NULL if not in a test case. LIST OF ANYTYPE.

Example

[-] appstate State1()
    [ ] LIST OF ANYTYPE laArg
    [ ] laArg = GetTestCaseArgs() // Get args passed to test case
    [ ] Print(laArg) // Process the args
[-] testcase T1(INTEGER iValue, STRING sName) appstate State1
    [ ] // test case code here
[ ]
[-] main()
    [ ] T1(1, "My First Test")
Parent topic: Script Information
Related reference
GetTestCaseErrorCount Function
GetTestCaseName Function


GetTestCaseErrorCount Function

Action

Returns the number of application errors discovered by the current test case.

Syntax

iErrCount = GetTestCaseErrorCount()
Variable | Description
iErrCount | The number of errors found by the current test case. INTEGER.
Parent topic: Script Information
Related reference
GetTestCaseWarningCount Function


GetTestCaseName Function

Action

Returns the name of the current test case.

Syntax

sName = GetTestCaseName()
Variable | Description
sName | The name of the current test case. Return value is NULL if not in a test case. STRING.

Example

[-] appstate State1()
    [ ] STRING sName
    [ ] sName = GetTestCaseName() // Get name of testcase
    [-] if (sName == "T2") // Process based on the
        [ ] Print (sName) //testcase name
[-] testcase T1 (INTEGER iValue, STRING sName) appstate State1
    [ ] // test case code here
[-] testcase T2 (STRING sExpectedValue) appstate State1
    [ ] // test case code here
[-] main()
    [ ] T1(1, "My First Test")
Parent topic: Script Information
Related reference
GetTestCaseArgs Function
GetTestCaseState Function


GetTestCaseState Function

Action

Returns the state of the current test case.

Syntax

TestState = GetTestCaseState()
Variable | Description
TestState | The state of the currently running test case. TESTCASESTATE.

Notes

The return value is one of the following values:
Value
Description
NULL
No test case is running.
TCS_ENTERING
The test case is in TestCaseEnter or DefaultTestCaseEnter.
TCS_RUNNING
The test case is currently running.
TCS_EXITING
The test case is in TestCaseExit or DefaultTestCaseExit.
Parent topic: Script Information
Related reference
GetTestCaseArgs Function
GetTestCaseErrorCount Function
GetTestCaseName Function
GetTestCaseWarningCount Function


GetTestCaseWarningCount Function

Action

Returns the number of warnings discovered by the current test case.

Syntax

iWarnCount = GetTestCaseWarningCount()
Variable | Description
iWarnCount | The number of warnings found by the current test case. INTEGER.
Parent topic: Script Information
Related reference
GetTestCaseErrorCount Function
GetTestCaseState Function


Semaphores

Includes functions for semaphores.

  • Acquire Function
    Acquires a semaphore for the calling thread, if it is available.
  • GetThreadData Function
    Gets the named data associated with the current thread.
  • GetThreadId Function
    Returns the ID of the current thread.
  • Release Function
    Releases a semaphore previously acquired by the Acquire function.
  • SetThreadData Function
    Sets the named data to the specified value and associates it with the current thread.
Parent topic: Functions


Acquire Function

Action

Acquires a semaphore for the calling thread, if it is available.

Syntax

Acquire (sSemaphore)
Variable | Description
sSemaphore | The semaphore to acquire. SEMAPHORE.

Notes

When you allocate a semaphore variable, you must initialize it to a value greater than zero before you can invoke Acquire. For example, the following statement creates a binary semaphore that allows you to control access to a single resource.

SEMAPHORE semAlpha = 1

Acquire decrements the value of the semaphore by one if the semaphore’s current value is greater than zero (0) and allows the calling thread to proceed (the semaphore has been "acquired"). If the semaphore’s value is zero, it blocks the calling thread until another thread releases the semaphore. When multiple threads are blocked on the same semaphore, Release unblocks them in the order in which they invoked Acquire.

If your script experiences an exception in the code between acquisition of a semaphore and its release, the script will deadlock unless you use a do-except statement to handle the exception. Place the do statement after the Acquire and before any code that could cause an exception. Place a Release statement in the except block.

Parent topic: Semaphores
Related reference
Release Function


GetThreadData Function

Action

Gets the named data associated with the current thread.

Syntax

aThreadData = GetThreadData (sName)
Variable | Description
aThreadData | Returned data. ANYTYPE.
sName | The name you assigned to the data with the SetThreadData function. STRING.

Example

iClient1_Loops = GetThreadData ("Thread1")
Parent topic: Semaphores
Related reference
GetThreadId Function


GetThreadId Function

Action

Returns the ID of the current thread.

Syntax

iThreadID = GetThreadId()
Variable | Description
iThreadID | The returned ID of the current thread. INTEGER.

Notes

The main thread of a script has an ID of 1. All other thread IDs are unique and begin at 2.

Example

iClient1_ID = GetThreadId()
Parent topic: Semaphores
Related reference
GetThreadData Function


Release Function

Action

Releases a semaphore previously acquired by the Acquire function.

Syntax

Release (sSemaphore)
Variable | Description
sSemaphore | The semaphore to release. SEMAPHORE.

Notes

Use Release to make the specified semaphore available to be "acquired" by a different thread. If a different thread is currently blocked because it issued a call to Acquire for the same semaphore, Release unblocks that thread. If no thread is waiting for the semaphore to be released, Release increments the semaphore’s value by one, thereby making the semaphore available to be "acquired."

If more than one thread was suspended by a call to Acquire for that semaphore, the threads are released in the order in which they were suspended.

Parent topic: Semaphores
Related reference
Acquire Function


SetThreadData Function

Action

Sets the named data to the specified value and associates it with the current thread.

Syntax

SetThreadData (sName, aData)
Variable | Description
sName | The name of this thread data—to be used to retrieve the data. STRING.
aData | The data to be associated with this thread. ANYTYPE.

Notes

You can think of thread data as being a global variable associated with the thread. You provide a name for the variable so you can subsequently retrieve the data and you initialize the variable with data of any type, including a user-defined type. You can set the data or retrieve the data multiple times. You can set multiple pieces of named data for each thread. You can only get the thread data associated with the current thread.

Thread data is freed when the thread that created it is terminated.

Example

Connect ("client1")
Connect ("client2")
spawn
SetThreadData ("Thread1", "Start one")
UpdateDatabase ("client1")
spawn
SetThreadData ("Thread2", "Start two")
UpdateDatabase ("client2")
rendezvous
. . .
Parent topic: Semaphores
Related reference
GetThreadData Function


Set Manipulation

Includes functions for set manipulation.

  • IsInSet Function
    Tests whether an expression evaluates to a member of a particular set.
  • SetAddMember Function
    Adds a member to a set.
  • SetComplement Function
    Returns the complement of a set.
  • SetCount Function
    Returns the number of members in a set.
  • SetDomain Function
    Returns a set which contains all the members in the set domain.
  • SetExclude Function
    Returns the first set after excluding from it any members also contained in the second set.
  • SetIntersection Function
    Returns the intersection of two sets.
  • SetRemoveMember Function
    Removes a member from a set.
  • SetUnion Function
    Returns the union of two sets.
Parent topic: Functions


IsInSet Function

Action

Tests whether an expression evaluates to a member of a particular set.

Syntax

bTest = IsInSet(Set, SetExpr)
Variable | Description
bTest | TRUE if the expression evaluates to a member of Set. BOOLEAN.
Set | The set to test against. SET.
SetExpr | The expression to test. SET.

Notes

IsInSet returns TRUE if SetExpr is a member of Set, or FALSE if it is not.

Example

[-] testcase IsInSetExample()
    [ ] COLORS TrafficLight = {Red, Yellow, Green}
    [ ] Print(IsInSet(TrafficLight,Purple)) // prints: FALSE
Parent topic: Set Manipulation
Related reference
SetAddMember Function
SetCount Function
type ... is set declaration


SetAddMember Function

Action

Adds a member to a set.

Syntax

NewSet = SetAddMember (Set, NewMember)
Variable | Description
NewSet | Set to which a new member is added. SET.
Set | Set which is to receive a new member. SET.
NewMember | Member to be added to a set—one of the values specified in the type...is set declaration for that SET data type. SET.

Notes

All members of a set must be unique; therefore, if SetAddMember determines that the specified new member already exists in the set, the NewSet returned is the same as Set.

You can also use the plus (+) operator for this operation. The following statement is the equivalent of the SetAddMember statement in the example below:

COLORS MyColors = HotColors + Purple

Example

[-] type COLORS is set
    [ ] Red
    [ ] Blue
    [ ] Yellow
    [ ] Green
    [ ] Purple
    [ ] Orange
[ ] COLORS HotColors = {Red, Yellow, Orange}
[ ] COLORS MyColors = SetAddMember (HotColors, Purple)
Parent topic: Set Manipulation
Related reference
SetComplement Function
SetCount Function
SetDomain Function
type ... is set declaration


SetComplement Function

Action

Returns the complement of a set.

Syntax

NewSet = SetComplement (Set)
Variable | Description
NewSet | The complement of a set. SET.
Set | The set to be complemented. SET.

Notes

SetComplement compares the members of the specified set to all possible members for that set, as defined by the type...is set declaration, and returns all members which are not included in the specified set.

Example

[-] type COLORS is set
    [ ] Red
    [ ] Blue
    [ ] Yellow
    [ ] Green
    [ ] Purple
    [ ] Orange
    [ ]
[-] COLORS HotColors = {...}
    [ ] Red
    [ ] Yellow
    [ ] Orange
    [ ]
[ ] COLORS CoolColors = SetComplement (HotColors)
[ ]
[ ] //output of Print(CoolColors) is
[ ]
[ ] //{Blue, Green, Purple}
Parent topic: Set Manipulation
Related reference
IsInSet Function
SetAddMember Function
SetCount Function


SetCount Function

Action

Returns the number of members in a set.

Syntax

iSetCount = SetCount (Set)
Variable | Description
iSetCount | The number of members in the set. INTEGER.
Set | The set for which to count members. SET.

Notes

A SET variable can contain a maximum number of members equal to the values defined for that data type in its type...is set declaration. It can also hold an empty set, in which case iSetCount is zero.

Example

[-] COLORS HotColors = {...}
    [ ] Red
    [ ] Yellow
    [ ] Orange
[ ] Print (SetCount (HotColors)) // prints: 3
Parent topic: Set Manipulation


SetDomain Function

Action

Returns a set which contains all the members in the set domain.

Syntax

Set = SetDomain (SetType)
Variable | Description
Set | The returned set. SET.
SetType | The name of the set data type as defined in a type...is set declaration. TYPE.

Notes

SetDomain initializes a SET variable of a particular SET data type with all of the possible values for that data type.

Example

[-] type PRIMARY_COLORS is set
    [ ] Red
    [ ] Blue
    [ ] Yellow
[ ]
[ ] PRIMARY_COLORS PrimaryColors = SetDomain (PRIMARY_COLORS)
Parent topic: Set Manipulation


SetExclude Function

Action

Returns the first set after excluding from it any members also contained in the second set.

Syntax

SubSet = SetExclude (MainSet, ExcludeSet)
Variable | Description
SubSet | The set returned after excluding all members also contained in ExcludeSet. SET.
MainSet | The set from which you want to exclude some members. SET.
ExcludeSet | The set whose members you want to exclude from the main set. SET.

Notes

The exclusion of set B from set A is equivalent to:

SetIntersection (A, SetComplement (B))

You can also use the minus (-) operator for this operation. The following statement is the equivalent of the SetExclude statement in the example below:

COLORS MyColors = WindowColors - HotColors

Example

COLORS WindowColors, HotColors
// Generate a set of cool window colors
COLORS MyColors = SetExclude (WindowColors, HotColors)
Parent topic: Set Manipulation


SetIntersection Function

Action

Returns the intersection of two sets.

Syntax

Set = SetIntersection (Set1, Set2)
Variable | Description
Set | The resulting intersection set. SET.
Set1 | One set to be combined for the intersection. SET.
Set2 | The other set for the intersection. SET.

Notes

The intersection of two sets is the set consisting of all members that both sets share in common. In the example, SetIntersection returns a set with one member, Blue.

Example

COLORS SamsColors = {Blue, Green}
COLORS PamsColors = {Red, Purple, Blue}
COLORS OurColors = SetIntersection (SamsColors, PamsColors)
Parent topic: Set Manipulation
Related reference
IsInSet Function
SetUnion Function
type ... is set declaration


SetRemoveMember Function

Action

Removes a member from a set.

Syntax

NewSet = SetRemoveMember (Set, SetMember)
Variable | Description
NewSet | The returned set after removing the specified member. SET.
Set | The set from which a member is to be removed. SET.
SetMember | The set member to be removed from Set—one of the values defined for this data type in its type...is set declaration. SET.

Notes

If SetRemoveMember determines that SetMember is not in Set, the NewSet returned is the same as Set. You can also use the minus (-) operator for this operation. The following statement is the equivalent of the SetRemoveMember statement in the following example:

COLORS MyColors = WindowColors - Purple

Example

COLORS WindowColors
COLORS MyColors = SetRemoveMember (WindowColors, Purple)
Parent topic: Set Manipulation
Related reference
SetAddMember Function
SetExclude Function


SetUnion Function

Action

Returns the union of two sets.

Syntax

SetUnion = SetUnion (Set1, Set2)
Variable | Description
SetUnion | The returned union of the specified sets. SET.
Set1 | The first of two sets to be joined. SET.
Set2 | The second of two sets to be joined. SET.

Notes

The union of two sets contains all the members of both sets with no duplicate members.

Note that since either of the specified sets can be a set with one member, the SetUnion function can be used to perform the same operation as the SetAddMember function.

You can also use the plus (+) operator for this operation. The following statement is the equivalent of the SetUnion statement in the following example:

COLORS WindowColors = BackGround + Foreground

Example

COLORS BackGround, ForeGround
COLORS WindowColors = SetUnion (BackGround, Foreground)
Parent topic: Set Manipulation
Related reference
SetIntersection Function


String Manipulation

Includes functions for string manipulation.

  • GetField Function
    Returns a segment (field) of a string.
  • IsAlpha Function
    Tests whether the first character of a string is an alphabetic character.
  • IsDigit Function
    Tests whether the first character of a string is a digit.
  • IsSpace Function
    Tests whether the first character of a string is a whitespace character.
  • Left Function
    Returns the left-most characters of a string.
  • Len Function
    Returns the length of a string.
  • Ltrim Function
    Strips leading whitespace from a string.
  • MatchStr Function
    Looks for a pattern in a string.
  • Replicate Function
    Replicates a string the specified number of times.
  • Right Function
    Returns the right-most characters of a string.
  • Rtrim Function
    Strips trailing whitespace from a string.
  • Space Function
    Returns the specified number of space characters.
  • StrPos Function
    Returns the position of the specified substring.
  • StrTran Function
    Searches for and replaces characters in a string.
  • Stuff Function
    Inserts and deletes characters.
  • SubStr Function
    Returns a substring.
  • Tabs Function
    Returns a specified number of tabs.
  • Trim Function
    Strips leading and trailing whitespace from a string.
Parent topic: Functions
Related reference
STRING Data Type


GetField Function

Action

Returns a segment (field) of a string.

Syntax

sSegment = GetField (sString, sDelim, iField)
Variable | Description
sSegment | The returned segment. STRING.
sString | The string to return a segment from. STRING.
sDelim | The characters to use to separate fields in sString. STRING.
iField | The field to return. INTEGER.

Notes

Use GetField to return segments of strings that have a known, consistent format, like part numbers or telephone numbers. GetField treats a string like a record; it uses the delimiter you specify to logically separate the string into fields. If the string has several segments that are separated by the same delimiter, use iField to get the part you want.

GetField returns an empty string ("") when the field is not found.

Example

STRING sData = "name|rank|serial#"
Print (GetField (sData, "|", 1) ) // prints: name
Print (GetField (sData, "|", 3) ) // prints: serial#
Print (GetField (sData, "|", 4) ) // prints:
Parent topic: String Manipulation


IsAlpha Function

Action

Tests whether the first character of a string is an alphabetic character.

Syntax

bTest = IsAlpha(sString)
Variable | Description
bTest | TRUE if the first character is a letter. BOOLEAN.
sString | The string to test. STRING.

Notes

IsAlpha returns TRUE if the first character of sString is an ASCII alphabetic character (in the range a through z or A through Z); otherwise it returns FALSE.

IsAlpha emulates the application of the C library function iswalpha on the first character of a specified string. IsAlpha is locale sensitive.

Example

Print(IsAlpha("hello")) // prints: TRUE
Print(IsAlpha("123")) // prints: FALSE
Parent topic: String Manipulation
Related reference
IsDigit Function
IsSpace Function


IsDigit Function

Action

Tests whether the first character of a string is a digit.

Syntax

bTest = IsDigit(sString)
Variable | Description
bTest | TRUE if the character is a digit. BOOLEAN.
sString | The string to test. STRING.

Notes

IsDigit returns TRUE if the first character of sString is a digit (0 through 9); otherwise it returns FALSE.

IsDigit emulates the application of the C library function iswdigit on the first character of a specified string.

Example

Print(IsDigit("123")) // prints: TRUE
Print(IsDigit("hello")) // prints: FALSE
Parent topic: String Manipulation
Related reference
IsAlpha Function
IsSpace Function


IsSpace Function

Action

Tests whether the first character of a string is a whitespace character.

Syntax

bTest = IsSpace(sString)
Variable | Description
bTest | TRUE if the character is whitespace. BOOLEAN.
sString | The string to test. STRING.

Notes

IsSpace returns TRUE if the first character of sString is a whitespace character; otherwise it returns FALSE. Whitespace characters are spaces, horizontal tabs, vertical tabs, carriage returns, linefeeds, and formfeeds.

IsSpace emulates the application of the C library function iswspace on the first character of a specified string.

Example

Print(IsSpace(" hello")) // prints: TRUE
Print(IsSpace("world")) // prints: FALSE
Parent topic: String Manipulation
Related reference
IsAlpha Function
IsDigit Function
Trim Function


Left Function

Action

Returns the left-most characters of a string.

Syntax

sSubstring = Left (xString, iNumChars)
Variable | Description
sSubstring | The specified substring. STRING.
sString | The string from which to return characters. STRING.
iNumChars | The number of characters to return, starting with the left-most. INTEGER.

Notes

Left returns the left-most iNumChars characters in sString. If iNumChars is 0, Left returns an empty string (""). If iNumChars is greater than the length of sString, Left returns sString. If iNumChars is negative, an exception is raised.

Example

STRING s = "XYZ Software"
Print (Left (s, 3)) // prints: XYZ
Print (Left (s, 20)) // prints: XYZ Software
Parent topic: String Manipulation
Related reference
Len Function
Right Function


Len Function

Action

Returns the length of a string.

Syntax

iLength = Len (sString)
Variable | Description
iLength | The number of characters in the string. INTEGER.
sString | The string whose length to return. STRING.

Notes

Len returns the number of characters in sString. If sString is an empty string (""), Len returns 0.

Example

STRING sName
sName = "XYZ"
Print (Len (sName)) // prints: 3
Parent topic: String Manipulation


Ltrim Function

Action

Strips leading whitespace from a string.

Syntax

sStripped = Ltrim (sToStrip)
Variable | Description
sStripped | The stripped string. STRING.
sToStrip | The string to strip. STRING.

Notes

  • Ltrim removes leading whitespace characters from a string and returns the rest of the string. If sToStrip is an empty string (""), or contains only whitespace, Ltrim returns an empty string.

  • Whitespace characters are spaces, horizontal tabs, vertical tabs, carriage returns, line feeds, and form feeds.

  • If sToStrip does not begin with whitespace, Ltrim returns sToStrip.

  • Ltrim removes leading whitespace characters as determined by IsSpace from a specified string.

Example

[ ] STRING s = " Has whitespace "
[ ] Print( ">{LTrim (s)}<") // prints: >Has whitespace <
Parent topic: String Manipulation
Related reference
IsSpace Function
Rtrim Function
Trim Function


MatchStr Function

Action

Looks for a pattern in a string.

Syntax

bFound = MatchStr (sPattern, sString [, eCaseSensitivity, eEscapeWildcards])
Variable | Description
bFound | Whether the pattern was found. BOOLEAN.
sPattern | The pattern to search for. STRING.
sString | The string to search. STRING.
eCaseSensitivity Defines whether the pattern is case sensitive or not.
CS_CASE_SENSITIVE
The pattern is case sensitive.
CS_CASE_INSENSITIVE
The pattern is case insensitive.

Default is CS_CASE_INSENSITIVE. ENUM.

eEscapeWildcards Defines whether to enable escaping wildcard characters with a backslash (\) in the pattern to search for.
EW_ENABLE_ESCAPE_WILDCARDS
Wildcard characters in the pattern to search can be escaped with a backslash (\), to enable comparing the actual characters.
EW_DISABLE_ESCAPE_WILDCARDS
Wildcard characters in the pattern to search for cannot be escaped with a backslash (\).

Default is EW_DISABLE_ESCAPE_WILDCARDS. ENUM.

Notes

  • MatchStr looks for sPattern in sString and returns TRUE if the pattern is in the string, or FALSE if it is not.
  • Use wildcard characters in sPattern to account for any characters that might be in the search string and are not to be considered in the match. sPattern can contain any number of the wildcard characters: question mark (?) and asterisk (*). A question mark matches any single character. An asterisk matches any string of zero or more characters. In the following example, the first asterisk accounts for the drive designation and the second asterisk accounts for the rest of the string after the ":\" characters.

  • Use MatchStr to search through a file, a listing of menu contents, or other collection of strings for a pattern.

Example

[-] testcase MatchStrExample()
    [ ] LIST OF STRING lsFileNames // list of file names
    [ ] INTEGER i // loop counter
    [-] lsFileNames = {...}
        [ ] "output.TXT"
        [ ] "c:\windows\partner.ini"
        [ ] "d:\dos\*.txt"
        [ ] "result.out"
        [ ] "test.res"
        [ ] "*.TXT"
    [ ]
    [ ] // Print all file names that don't have a full path associated with them.
    [-] for i = 1 to ListCount(lsFileNames)
        [-] if (!MatchStr ("*:\*", lsFileNames[i]))
            [ ] Print("File has no path: ", lsFileNames[i])
    [ ] Print()
    [ ]
    [ ] // Print all file names with a TXT extension
    [-] for i = 1 to ListCount(lsFileNames)
        [-] if (MatchStr ("*.txt", lsFileNames[i], CS_CASE_INSENSITIVE))
            [ ] Print("Filename with a TXT extension: ", lsFileNames[i])
    [ ] Print()
    [ ]
    [ ] // Print all file names with an uppercase TXT extension
    [-] for i = 1 to ListCount(lsFileNames)
        [-] if (MatchStr("*.TXT", lsFileNames[i], CS_CASE_SENSITIVE))
            [ ] Print("Filename with an uppercase TXT extension: ", lsFileNames[i])
    [ ] Print()
    [ ]
    [ ] // Print all file names that contain an asterisk
    [-] for i = 1 to ListCount(lsFileNames)
        [-] if (MatchStr("*\**", lsFileNames[i], CS_CASE_INSENSITIVE, EW_ENABLE_ESCAPE_WILDCARDS))
            [ ] Print ("Filename contains an asterisk: ", lsFileNames[i])
    [ ] Print()
    [ ]
    [ ] // Print all file names that contain have an uppercase txt extension and contain an asterisk
    [-] for i = 1 to ListCount(lsFileNames)
        [-] if (MatchStr("*\**.TXT", lsFileNames[i], CS_CASE_SENSITIVE, EW_ENABLE_ESCAPE_WILDCARDS))
            [ ] Print ("Filename contains an asterisk and uppercase TXT extension: ", lsFileNames[i])
    [ ] Print()
Parent topic: String Manipulation


Replicate Function

Action

Replicates a string the specified number of times.

Syntax

sNew = Replicate (sOrig, iCopies)
Variable | Description
sNew | The returned copies. STRING.
sOrig | The string to replicate. STRING.
iCopies | The number of copies to concatenate and return. INTEGER.

Notes

Replicate returns a string made up of iCopies copies of the input string sOrig, concatenated. If sOrig is an empty string (""), Replicate returns an empty string.

Example

Print ("Four A's -> {Replicate ("A", 4)}.")
// Prints: Four A's -> AAAA
Parent topic: String Manipulation
Related reference
Space Function


Right Function

Action

Returns the right-most characters of a string.

Syntax

sSubstring = Right (sString, iNumChars)
Variable | Description
sSubstring | The returned substring. STRING.
sString | The string from which to extract a substring. STRING.
iNumChars | The number of characters to extract, starting with the right-most. INTEGER.

Notes

Right returns the right-most iNumChars characters in sString. If iNumChars is zero, Right returns an empty string (""). If iNumChars is greater than the length of sString in characters, Right returns sString. If iNumChars is less than zero, an exception is raised.

Example

STRING s = "Hello World"
Print (Right (s, 5) ) // prints: World
Print (Right (s, 20) ) // prints: Hello World
Parent topic: String Manipulation
Related reference
Left Function
Len Function


Rtrim Function

Action

Strips trailing whitespace from a string.

Syntax

sStripped = Rtrim (sToStrip)
Variable | Description
sStripped | The stripped string. STRING.
sToStrip | The string to strip. STRING.

Notes

Rtrim removes trailing whitespace characters from a string as determined by IsSpace from a specified string.and returns the rest of the string. If sToStrip is an empty string ("") or contains only whitespace, Rtrim returns an empty string.

If sToStrip does not end with whitespace, Rtrim returns sString unmodified.

Whitespace characters are spaces, horizontal tabs, vertical tabs, carriage returns, linefeeds, and formfeeds.

Example

STRING s = " Has whitespace "
Print( ">{RTrim(s)}<") // prints: > Has whitespace<
Parent topic: String Manipulation
Related reference
Ltrim Function
Trim Function


Space Function

Action

Returns the specified number of space characters.

Syntax

sSpaces = Space (iCount)
Variable | Description
sSpaces | The returned space characters. STRING.
iCount | The number of spaces to return. INTEGER.

Notes

Space returns a string iCount spaces long. If iCount is zero, Space returns an empty string (""). Use Space to pad strings or buffers with either leading or trailing spaces. An exception is raised if iCount is less than zero.

Example

Print ("12345678901234567890")
Print ("12345" + Space (10) + "67890")
// Prints:
// 12345678901234567890
// 12345 67890
Parent topic: String Manipulation
Related reference
Replicate Function


StrPos Function

Action

Returns the position of the specified substring.

Syntax

iPos = StrPos (sSubstr, sTarget [, bBackward]))
Variable | Description
iPos | The returned position. INTEGER.
sSubstr | The substring to find. STRING.
sTarget | The string to search. STRING.
bBackward | Optional. If TRUE, searches backward from the end of sTarget and returns the position of sSubstr relative to the first character position in of sTarget, starting from one. If FALSE (default), searches from the beginning of sTarget and returns the position of sSubstr relative to the first character position in sTarget. BOOLEAN.

Notes

Without the bBackward optional argument, StrPos searches sTarget for the specified substring sSubstr. If found, it returns the character position in sTarget of the first character in sSubstr, starting from one (the first character of sTarget). With the optional argument, StrPos searches for sSubstr starting from the last character in sTarget. It returns the character position relative to the first character in sTarget, starting from one.

If the substring is not found, StrPos returns 0 (zero).

Example

STRING s = "now is the time for all the good men"
//search forward to find first occurrence of "the"
Print (StrPos ("the", s)) // prints: 8
//search backward to find second occurrence of "the"
Print (StrPos ("the", s, TRUE)) // prints: 25
Print (StrPos ("x", s)) // prints: 0
Parent topic: String Manipulation


StrTran Function

Action

Searches for and replaces characters in a string.

Syntax

sChanged = StrTran (sOrig, sSearch, sReplace)
Variable | Description
sChanged | The returned string. STRING.
sOrig | The string to search. STRING.
sSearch | The string to search for in sOrig. STRING.
sReplace | The string to substitute for sSearch. STRING.

Notes

StrTran searches sOrig for the string sSearch. When it finds a match, it replaces sSearch with sReplace. All instances of sSubstr in sOrig are replaced.

Example

STRING s = "one and two and three"
Print (StrTran (s, "and", "&" ))
// prints: one & two & three
Parent topic: String Manipulation
Related reference
Stuff Function


Stuff Function

Action

Inserts and deletes characters.

Syntax

sChanged = Stuff (sOrig, iPos, iLen, sReplace)
Variable | Description
sChanged | The returned string. STRING.
sOrig | The string in which characters are inserted or deleted. STRING.
iPos | The character position to start inserting or deleting. INTEGER.
iLen | The number of characters to delete. INTEGER.
sReplace | The string to insert. STRING.

Notes

Stuff deletes iLen characters from sOrig, and then writes the string sReplace into sOrig beginning at the iPos position.

  • If iLen is zero, Stuff inserts sReplace.

  • If iLen is equal to the number of characters in sReplace, Stuff replaces characters starting at iPos. The length of sOrig is unchanged.

  • If sReplace is an empty string (""), Stuff deletes iLen characters starting at iPos.

  • If the number of characters in sReplace is less than iLen, the resulting string is shorter than sOrig.

  • If iLen is greater than or equal to the number of characters in sOrig after iPos, all subsequent characters in sOrig are deleted before Stuff inserts sReplace.

Example

STRING s = "hello there"
Print (Stuff (s,7,0,"OUT ")) // prints: hello OUT there
Print (Stuff (s,7,5,"WORLD")) // prints: hello WORLD
Print (Stuff (s,6,6,"")) // prints: hello
Print (Stuff (s,1,5,"HERE")) // prints: HERE there
Parent topic: String Manipulation
Related reference
StrTran Function


SubStr Function

Action

Returns a substring.

Syntax

sSubString = SubStr (sString, iPos [, iLen])
Variable | Description
sSubString | The returned substring. STRING.
sString | The string to return characters from. STRING.
iPos | The position from which to start returning characters. INTEGER.
iLen | Optional. The number of characters to return. INTEGER.

Notes

SubStr returns iLen characters from sString, starting at iPos. If iLen is not specified, all characters after iPos are returned. If iLen is greater than the number of characters remaining, all characters after iPos are returned and the request for additional characters is ignored.

If iPos is beyond the end of the string or iLen is zero, SubStr returns an empty string (""). An exception is raised if iPos is less than one, or if iLen is negative.

Example

STRING sText // text to work on
STRING sItem // substring to return
sText = "How much wood would a woodchuck chuck?"
sItem = SubStr (sText, 23, 9)
Print ("The critter of the week is the {sItem}.")
Parent topic: String Manipulation


Tabs Function

Action

Returns a specified number of tabs.

Syntax

sTabs = Tabs(iAmount)
Variable | Description
sTabs | A string of tab characters. STRING.
iAmount | The number of tabs to return. INTEGER.

Example

STRING s = "{Tabs(2)}string with leading tabs"
Print (s)
Parent topic: String Manipulation


Trim Function

Action

Strips leading and trailing whitespace from a string.

Syntax

sStripped = Trim (sToStrip)
Variable | Description
sStripped | The stripped string. STRING.
sToStrip | The string to strip. STRING.

Notes

Trim removes leading and trailing whitespace from a string and returns the rest of the string. If sToStrip is an empty string ("") or contains only whitespace, Trim returns an empty string.

Trim removes leading and trailing whitepace characters as determined by IsSpace from a specified string.

Whitespace characters are spaces, horizontal tabs, vertical tabs, carriage returns, linefeeds, and formfeeds.

Example

STRING s = " Has whitespace "
Print( ">{Trim(s)}<") // prints: >Has whitespace<
Parent topic: String Manipulation
Related reference
Ltrim Function
Rtrim Function


SWT

Includes functions for SWT.

  • ActiveMenuSelect Function
    Picks the specified item from a popup menu.
  • FindItemInColumn Function
    Returns the index of a named item.
  • GetContentsOfColumn Function
    Returns the contents of a column from a treeview control.
  • GetItemsOfColumn Function
    Returns the contents of a column from a treeview control.
  • GetSelectedTextOfColumn Function
    Returns the text (full path) of a column from a treeview control.
Parent topic: Functions


ActiveMenuSelect Function

Action

Picks the specified item from a popup menu.

Syntax

ActiveMenuSelect(wWindow, sMenuItem)
Variable | Description
wWindow | The name of the window which triggered the popup menu. WINDOW.
sMenuItem | The popup-menu item to select. STRING.

Notes

This function is supported only in scripts that use the Classic Agent.

Example

The following shows how to select MenuItem "Item 1" from the popup Menu which is triggered by clicking on button "MyButton":

MyButton.Click()
ActiveMenuSelect(MyButton, "Item 1")
Parent topic: SWT


Timer Information

Includes functions for timers.

Among other usages, these functions are used for the timing of test executions that are triggered from Silk Performer. For additional information on integrating Silk Test Classic with Silk Performer, refer to the Silk Performer Help.

  • TimerCreate Function
    Creates a timer with an optional name.
  • TimerDestroy Function
    Destroys a timer.
  • TimerGetHandle Function
    Retrieves the timer handle for the specified timer name.
  • TimerGetName Function
    Retrieves the timer name from the hTimer handle.
  • TimerPause Function
    Pauses a timer.
  • TimerResume Function
    Resumes a paused timer.
  • TimerStart Function
    Starts a timer.
  • TimerState Function
    Queries the current state of a timer.
  • TimerStop Function
    Stops a timer.
  • TimerStr Function
    Returns a timer’s elapsed time as a string.
  • TimerValue Function
    Returns a timer’s elapsed time as a real number.
Parent topic: Functions


TimerCreate Function

Action

Creates a timer with an optional name.

Syntax

hTimer = TimerCreate (sTimerName)
Variable | Description
hTimer | A handle to the new timer. HTIMER.
sTimerName | The name of the timer, stored in the timer structure referenced by hTimer. STRING

Notes

TimerCreate creates a timer, which you can use like a stop watch to measure elapsed time. 4Test timers are accurate to the millisecond (.001 seconds). The value returned is a handle to the new timer, which you use when calling other timer functions.

The optional sTimerName supplies the timer name. If this parameter is not supplied, the default name is TimerXX, where TimerXX is auto-incremented, starting with Timer0. This parameter is provided for interfacing with Silk Performer; it is not used for Silk Test Classic scripts.

The timer scope is from creation (TimerCreate) to either the script completion or the TimerDestroy function, whichever is first. Duplicate timer names are accepted and the first match will be retrieved on name searches.

Example

STRING sOverallTime
HTIMER TotalTimer
TotalTimer = TimerCreate ("MyTimer")
TimerStart (TotalTimer)
// ...
TimerStop (TotalTimer)
sOverallTime = TimerStr (TotalTimer)
Print ("All code executed in {sOverallTime} seconds")
TimerDestroy (TotalTimer)
Parent topic: Timer Information
Related reference
TimerDestroy Function
TimerGetHandle Function
TimerGetName Function
TimerStart Function


TimerDestroy Function

Action

Destroys a timer.

Syntax

TimerDestroy (hTimer)
Variable | Description
hTimer | A handle to the timer to destroy. HTIMER.

Notes

TimerDestroy destroys the specified timer. Call TimerDestroy when you are through using a timer so that Silk Test Classic does not maintain the timer in memory unnecessarily.

When a script exits, Silk Test Classic automatically destroys all timers that were not destroyed.

Example

HTIMER TotalTimer
TotalTimer = TimerCreate () // make a timer handle
// ...
TimerDestroy (TotalTimer)
Parent topic: Timer Information
Related reference
TimerCreate Function


TimerGetHandle Function

Action

Retrieves the timer handle for the specified timer name.

Syntax

TimerGetHandle (sName)
Variable | Description
sName | The timer name. STRING.

Notes

  • TimerGetHandle returns the timer handle, hTimer, for the specified timer name, sName. If the timer handle is invalid, an exception is returned.

  • There is no check if the timer name is used multiple times. TimerGetHandle returns the first timer handle for the matching timer name. This function is provided for interfacing with Silk Performer; it is not needed for Silk Test Classic scripts.

Example

[-] testcase timertest () appstate none
    [ ]
    [ ] HANDLE hTimer
    [ ] HANDLE hTimer2
    [ ] STRING sTimerName
    [ ] STRING sReturnName
    [ ]
    [ ] // Create timer
    [ ] hTimer = TimerCreate ()
    [ ]
    [ ] // Get the default name of the timer
    [ ] sReturnName = TimerGetName (hTimer)
    [ ]
    [ ] // Print returned name "Timer0"
    [ ] print (sReturnName)
    [ ]
    [ ] // Set timer name to "Timer0"
    [ ] sTimerName = "Timer0"
    [ ]
    [ ] // Create timer with name (for SilkPerformer)
    [ ] hTimer2 = TimerCreate ("Timer0")
    [ ]
    [ ] // Get the name of the second timer and print it
    [ ] sReturnName = TimerGetName (hTimer2)
    [ ] Print (sReturnName)
    [ ]
    [ ] // Prints timer name "Timer0"
    [ ] Print (TimerGetHandle (sReturnName))
Parent topic: Timer Information
Related reference
TimerCreate Function
TimerDestroy Function
TimerGetName Function
TimerStart Function


TimerGetName Function

Action

Retrieves the timer name from the hTimer handle.

Syntax

TimerGetName (hTimer)
Variable | Description
hTimer | The timer handle. HTIMER.

Notes

  • TimerGetName returns the timer name if the timer handle, hTimer, is valid. If the timer handle is invalid, an exception is returned.

  • There is no check if the timer name is used multiple times. This function is provided for interfacing with Silk Performer; it is not needed for Silk Test Classic scripts.

Example

[-] testcase timertest () appstate none
    [ ]
    [ ] HANDLE hTimer
    [ ] HANDLE hTimer2
    [ ] STRING sTimerName
    [ ] STRING sReturnName
    [ ] // Create timer
    [ ] hTimer = TimerCreate ()
    [ ] // Get the default name of the timer
    [ ] sReturnName = TimerGetName (hTimer)
    [ ] // Print returned name "Timer0"
    [ ] print (sReturnName)
    [ ] // Set timer name to "Timer0"
    [ ] sTimerName = "Timer0"
    [ ]
    [ ] // Create timer with name (for SilkPerformer)
    [ ] hTimer2 = TimerCreate ("Timer0")
    [ ] // Get the name of the second timer and print it
    [ ] sReturnName = TimerGetName (hTimer2)
    [ ] Print (sReturnName)
    [ ] // Prints timer name "Timer0"
    [ ] Print (TimerGetHandle (sReturnName))
Parent topic: Timer Information
Related reference
TimerCreate Function
TimerDestroy Function
TimerGetHandle Function
TimerStart Function


TimerPause Function

Action

Pauses a timer.

Syntax

TimerPause (hTimer)
Variable | Description
hTimer | A handle to the timer to pause. HTIMER.

Notes

TimerPause pauses the specified timer. When you resume it with TimerResume, the timer will record the time that elapsed since you started it with TimerStart, minus the time it was paused.

An exception is raised if hTimer has not been started.

Example

HTIMER TotalTimer
TotalTimer = TimerCreate () // make a timer handle
TimerStart (TotalTimer) // initialize & start a timer
// ...
TimerPause (TotalTimer) // pause the timer
Parent topic: Timer Information
Related reference
TimerCreate Function
TimerResume Function
TimerStart Function
TimerStop Function


TimerResume Function

Action

Resumes a paused timer.

Syntax

TimerResume (hTimer)
Variable | Description
hTimer | A handle to the timer to resume. HTIMER.

Notes

TimerResume resumes the specified timer, which must have been paused by a previous call to TimerPause.

When you resume a timer with TimerResume, it will record the time that elapsed since you started it with TimerStart, minus the time it was paused.

Example

HTIMER TotalTimer
TotalTimer = TimerCreate () // make a timer handle
TimerStart (TotalTimer) // initialize & start a timer
TimerPause (TotalTimer) // pause the timer
// ...
TimerResume (TotalTimer) // continue timing
Parent topic: Timer Information
Related reference
TimerCreate Function
TimerPause Function
TimerStop Function


TimerStart Function

Action

Starts a timer.

Syntax

TimerStart (hTimer)
Variable | Description
hTimer | A handle to the timer to start. HTIMER.

Notes

TimerStart starts the specified timer. The timer will record the time that elapses until you pause or stop it.

Example

HTIMER TotalTimer
TotalTimer = TimerCreate () // make a timer handle
TimerStart (TotalTimer) // initialize & start a timer
Parent topic: Timer Information
Related reference
TimerCreate Function
TimerPause Function
TimerResume Function
TimerStop Function


TimerState Function

Action

Queries the current state of a timer.

Syntax

state = TimerState (hTimer)
Variable | Description
state | The state of the timer: TS_STARTED, TS_STOPPED, or TS_PAUSED. TIMERSTATE.
hTimer | A handle to the timer to query. HTIMER.

Notes

TimerState is useful when you do not want your script to be sensitive to the state of the timer. For example, you can test whether the state is TS_STARTED, and, if not, start the timer before continuing with the rest of the script.

Example

HTIMER TotalTimer
TotalTimer = TimerCreate () // make a timer handle
TimerStart (TotalTimer) // initialize & start a timer
TimerPause (TotalTimer) // pause the timer
// ...
Print (TimerState (TotalTimer)) // prints: TS_PAUSED
TimerDestroy (TotalTimer) // destroy the timer handle
Parent topic: Timer Information
Related reference
TimerCreate Function


TimerStop Function

Action

Stops a timer.

Syntax

TimerStop (hTimer)
Variable | Description
hTimer | A handle to the timer to stop. HTIMER.

Notes

TimerStop stops the specified timer. The timer will record the time that elapsed since you started it with TimerStart, minus the time (if any) that it was paused.

Example

[ ] STRING sOverallTime
[ ] HTIMER TotalTimer
[ ] TotalTimer = TimerCreate ()
[ ] TimerStart (TotalTimer)
[ ] // ...
[ ] TimerStop (TotalTimer)
[ ] sOverallTime = TimerStr (TotalTimer)
[ ] Print ("All code executed in {sOverallTime} seconds")
[ ] TimerDestroy (TotalTimer)
Parent topic: Timer Information
Related reference
TimerCreate Function
TimerPause Function
TimerStart Function


TimerStr Function

Action

Returns a timer’s elapsed time as a string.

Syntax

sElapsed = TimerStr (hTimer)
Variable | Description
sElapsed | The elapsed time. STRING.
hTimer | A handle to the timer to check. HTIMER.

Notes

TimerStr returns a string that is the elapsed time that the specified timer has been running. The value returned is accurate to the millisecond (.001 seconds).

The elapsed time that TimerStr returns is the time that has elapsed since the timer was started (with TimerStart), minus the time (if any) it was paused.

Example

STRING sOverallTime
HTIMER TotalTimer
TotalTimer = TimerCreate ()
TimerStart (TotalTimer)
// ...
TimerStop (TotalTimer)
sOverallTime = TimerStr (TotalTimer)
Print ("All code executed in {sOverallTime} seconds")
TimerDestroy (TotalTimer)
Parent topic: Timer Information
Related reference
TimerStart Function
TimerValue Function


TimerValue Function

Action

Returns a timer’s elapsed time as a real number.

Syntax

rElapsed = TimerValue (hTimer)
Variable | Description
rElapsed | The elapsed time. REAL.
hTimer | A handle to the timer to query. HTIMER.

Notes

TimerValue returns the elapsed time that the specified timer has been running, in seconds. The value returned is accurate to the millisecond (.001 seconds).

The elapsed time that TimerValue returns is the time that has elapsed since the timer was started (with TimerStart), minus the time (if any) it was paused.

Example

REAL rElapsed
HTIMER ElapsedTimer
ElapsedTimer = TimerCreate ()
TimerStart (ElapsedTimer)
// ...
TimerStop (ElapsedTimer)
// get elapsed time as real number
rElapsed = TimerValue (ElapsedTimer)
Print ("This code executed in {rElapsed}seconds")
Parent topic: Timer Information
Related reference
TimerCreate Function
TimerStart Function
TimerStr Function


Web Browser

Includes functions for Web browsers.

  • ForceActiveXEnum Function
    Enables the user to specify when to enumerate ActiveX objects for the DOM extension.
  • GetBrowserType Function
    Returns the current browser type.
  • GetBrowserTypeName Function
    Returns the short name of the specified browser type.
  • GetDefaultBrowserType Function
    Returns the default browser type, which is used when new Agent connections are made.
  • RunLinkTester Function
    Starts the Link Tester and runs a scan of links using the specified data.
  • SetBrowserType Function
    Sets the current browser type.
  • SetDefaultBrowserType Function
    Sets the default browser type, which is used when new Agent connections are made.
Parent topic: Functions


ForceActiveXEnum Function

Action

Enables the user to specify when to enumerate ActiveX objects for the DOM extension.

Syntax

ForceActiveXEnum()

Notes

An ActiveX object may not initialize when the DOM extension is ready, and there is no indication whether the ActiveX object is ready or not. If the object is not ready, Silk Test Classic cannot enumerate its children. This function enables the user to decide when to do the enumeration. If the timing is correct, Silk Test Classic can get the valid children from the ActiveX object.

Parent topic: Web Browser


GetBrowserTypeName Function

Action

Returns the short name of the specified browser type.

Syntax

sName = GetBrowserTypeName (myBrowser)
Variable | Description
sName | The short name of the browser type. STRING.
myBrowser | Browser type. BROWSERTYPE.

Notes

GetBrowserTypeName returns the short name of the browser type specified in myBrowser.

Example

STRING sName
sName = GetBrowserTypeName (GetBrowserType())
Print (sName)

// Result: if current browser is Internet Explorer 7.0:
// explorer7
Parent topic: Web Browser
Related reference
GetBrowserType Function
BROWSERTYPE Data Type


RunLinkTester Function

Action

Starts the Link Tester and runs a scan of links using the specified data.

Syntax

ls = RunLinkTester (lit)
Variable | Description
lit | Record containing data used by Link Tester. RECORD.
ls | Data returned from Link Tester. LIST OF STRING.

Notes

RunLinkTester assumes that javaw.exe can be found on your path.

Parent topic: Web Browser
Related reference
LINKTESTERINFO Data Type


Windows Information

Includes functions for Windows information.

  • ClassOf Function
    Returns the class of a window.
  • FindWinClass Function
    Returns the data classes, including user-defined classes, for all declared 4Test objects of one GUI type.
  • FindWindow Function
    Returns a list of window identifiers to all objects that match the specified tag and GUI type.
  • WindowChildren Function
    Returns the children of a window, as specified in the declaration.
  • WindowGetAttrList Function
    Returns the values for all the attributes of the specified window.
  • WindowIsDefined Function
    Tests whether a child window, method, variable, or property is defined by a window or its class.
  • WindowIsOfClass Function
    Determines if a particular window is of a particular class.
  • WindowName Function
    Returns the identifier of a window.
  • WindowParent Function
    Returns the parent of a window.
  • WindowTag Function
    Returns the fully qualified tag for a window, where the tag is resolved from the window declaration or from the dynamically instantiated identifier.
Parent topic: Functions


ClassOf Function

Action

Returns the class of a window.

Syntax

class = ClassOf (wWindow)
Variable | Description
class | The class of the window.
wWindow | The window for which to return the class. WINDOW.

Notes

ClassOf returns the window class (from the window declaration) of the specified window. Calling this function is the same as calling the GetClass method.

Example

Print (ClassOf (TextEditor))// prints:MainWin
Parent topic: Windows Information
Related reference
WindowChildren Function
WindowName Function
WindowParent Function
TypeOf Function


FindWinClass Function

Action

Returns the data classes, including user-defined classes, for all declared 4Test objects of one GUI type. The default return value is a list of the classes declared on the current machine. Alternatively, you can specify that the list be for a particular GUI, which might not be the current machine. You can also limit the list returned to the class that matches an optionally specified data class.

Syntax

ldClassList = FindWinClass([sClass, GuiType])
Variable | Description
ldClassList | A list of the classes declared for the current machine or the specified GUI (if a machine with that GUI is currently connected). LIST OF DATACLASS.
sClass | Optional: The tag for a class. When specified, returns a single-entry list containing the data class that matches the tag. If that class is not present on the current or specified GUI, FindWinClass returns an empty list. If you choose to omit this parameter, but include the next one, specify this parameter as NULL. STRING.
GuiType | Optional: When specified, returns classes for this GUI type. If omitted, returns classes for the current machine. If the specified GUI is not present on a currently connected machine, FindWinClass returns an empty list. GUITYPE.

Examples

LIST OF DATACLASS ldClasses
ldClasses = FindWinClass("[MainWin]", mswnt)
Parent topic: Windows Information
Related reference
FindWindow Function


FindWindow Function

Action

Returns a list of window identifiers to all objects that match the specified tag and GUI type.

Syntax

lwWinList = FindWindow([sTag, GuiType])
Variable | Description
lwWinList | A list of handles to windows declared for currently connected machines, as limited by the optional arguments. LIST OF WINDOW.
sTag

Optional: The full tag hierarchy for a class. When specified, returns a list containing the windows that match sTag. If a window with that tag is not present on the current or specified GUI, FindWindow returns an empty list. If you omit sTag, all windows contained in all declarations used, either explicitly or implicitly, are returned. STRING.

To prevent Silk Test Classic from crashing when using the FindWindow function, use 'tag "{sTag}"' instead of 'tag sTag'.

GuiType | Optional: When specified, limits the returned values to those that have a tag that matches sTag and are windows on machines that have the specified GUI type. If you omit sTag, this parameter is ignored. GUITYPE.

Notes

FindWindow works strictly by checking the windows in your declarations; it does not use the Agent to check the windows on the display. To determine which windows are actually open, use the Exist method.

If specified, sTag must be a fully qualified tag. If omitted, you might retrieve more windows than you expect, as FindWindow returns all the windows in all the declarations specified explicitly, in a use statement or in the Runtime Options dialog box, or implicitly. For example, if your script explicitly points to an include file that contains declarations for TestApplication, MessageBox, and xCheckBox, FindWindow called without sTag returns not only these windows but also Agent, Clipboard, Cursor, Desktop, and Taskbar. This behavior occurs because winclass.inc is implicitly pulled in, and this file has declarations for these other windows.

FindWindow does not work with multitags.

FindWindow() is not able to find window declarations using dynamic tags.

Example

LIST OF WINDOW lwWinList
// Get handles to all mswnt "Find" windows
lwWinList = FindWindow("/[MainWin]TextEditor/[DialogBox]Find", mswnt)
Parent topic: Windows Information
Related reference
FindWinClass Function
Exists Method
Tag Statement


WindowChildren Function

Action

Returns the children of a window, as specified in the declaration.

Syntax

lwChildren = WindowChildren (wWindow [, GUIType])
Variable | Description
lwChildren | The children of the window. LIST OF WINDOW.
wWindow | The window whose children you want. WINDOW.
GUIType | Optional: The GUI for which to return child windows. The default is the current GUI. GUITYPE.

Notes

WindowChildren returns the child windows (from the window declaration) of the specified window on the current GUI or on GUIType, if GUIType is specified. The function also returns the window parts of the specified window, as defined in the class. For a list of window parts, see the MoveableWin class.

Open Agent Example

To quickly detect any unwanted structural changes in your application under test (AUT), you can use Silk Test Classic to verify that your AUT correctly displays all included controls. This example describes how you can use the WindowChildren with the GetChildren function of the AnyWin class to compare the actual windows in your AUT with the expected windows. The following code defines a set of windows that are expected to be child windows of Notepad.
        [-] TextField TextField
            [ ] locator "//TextField"
        [-] MenuItem AboutNotepad
            [ ] locator "About Notepad"
        [-]  DialogBox AboutNotepadDialog // This window is only found if the About dialog box is open.
            [ ] locator "About Notepad"
            [-] PushButton OK
                [ ] locator "OK"
The sample script uses the WindowChildren function to retrieve the defined child windows of Notepad, and the GetChildren function to retrieve the actual windows of Notepad. Then the script compares the defined windows with the actual windows and returns the following three lists:
  • Windows that are expected and actually included in Notepad.
  • Windows that were unexpectedly added to Notepad.
  • Windows that are expected but missing from Notepad.
For your application under test, only the first list should include windows.

The entire script looks like the following:

[ ] const wDynamicMainWindow = UntitledNotepad
[ ]
[-] window MainWin UntitledNotepad
    [ ] locator "/MainWin[@caption='Untitled - Notepad']"
    [ ]
    [ ] // The working directory of the application when it is invoked
    [ ] const sDir = "C:\"
    [ ]
    [ ] // The command line used to invoke the application
    [ ] const sCmdLine = "C:\Windows\system32\notepad.exe"
    [ ]
    [ ] // The list of windows the recovery system is to leave open
    [ ] // const lwLeaveOpenWindows = {?}
    [ ] // const lsLeaveOpenLocators = {?}
    [-] TextField TextField
        [ ] locator "//TextField"
    [-] MenuItem AboutNotepad
        [ ] locator "About Notepad"
    [-]  DialogBox AboutNotepadDialog // this won't be found
        [ ] locator "About Notepad"
        [-] PushButton OK
            [ ] locator "OK"
[ ]
[ ]
[-] type WindowVerificationResult is record
    [ ] LIST OF WINDOW verifiedWindows
    [ ] LIST OF STRING newWindows
    [ ] LIST OF WINDOW missingWindows
[ ]
[ ]
[-] WindowVerificationResult VerifyWindowChildren(WINDOW windowToVerify)
    [ ] WindowVerificationResult result
    [ ] LIST OF WINDOW childrenDecls = WindowChildren(windowToVerify)
    [ ] LIST OF WINDOW resolved
    [ ] WINDOW w
    [ ] LIST OF WINDOW missingControls
    [-] for each w in childrenDecls
        [-] do
            [ ] ListAppend(resolved, w.resolve({0, true}))
            [ ] ListAppend(result.verifiedWindows, w)
        [-] except
            [ ] ListAppend(result.missingWindows, w)
    [ ]
    [ ] LIST OF WINDOW actualChildren = windowToVerify.GetChildren()
    [-] for each w in actualChildren
        [ ] INTEGER foundIndex = ListFind(resolved, w)
        [-] if(foundIndex == 0)
            [ ] LIST OF STRING locatorParts = w.GenerateLocator()
            [ ] STRING part
            [ ] STRING combinedLocator = ""
            [-] for each part in locatorParts
                [ ] combinedLocator += part
            [ ] ListAppend(result.newWindows, combinedLocator)
    [ ]
    [ ] return result
    [ ]
[ ]
[-] testcase VerifyNotepad()
    [ ] WindowVerificationResult result = VerifyWindowChildren(UntitledNotepad)
    [ ] Print("Verified Windows: {result.verifiedWindows}")
    [ ] Print("New Windows:      {result.newWindows}")
    [ ] Print("Missing Windows:  {result.missingWindows}")
When replayed, this script returns the following:
[ ] Script windowChildren.t - Passed
[ ] Machine: (local)
[ ] Started: 09:48:37AM on 15-Jul-2015
[ ] Elapsed: 0:00:08
[ ] Passed:  1 test (100%)
[ ] Failed:  0 tests (0%)
[ ] Totals:  1 test, 0 errors, 0 warnings
[ ]
[-] Testcase VerifyNotepad - Passed
    [ ] Verified Windows: {UntitledNotepad.TextField, UntitledNotepad.AboutNotepad}
    [ ] New Windows:      {/MainWin[@caption='Untitled - Notepad']//Menu[@caption='File'],
    [ ]  /MainWin[@caption='Untitled - Notepad']//Menu[@caption='Edit'],
    [ ]  /MainWin[@caption='Untitled - Notepad']//Menu[@caption='Format'],
    [ ]  /MainWin[@caption='Untitled - Notepad']//Menu[@caption='View'],
    [ ]  /MainWin[@caption='Untitled - Notepad']//Menu[@caption='Help']}
    [ ] Missing Windows:  {UntitledNotepad.AboutNotepadDialog}
This result shows that five windows are included in Notepad, which are not included in the expected set. For future testing, we should include these windows in the expected set. The result also shows that one window, which is included in the expected set, is not included in Notepad. This could have two reasons.
  1. Notepad should include this window, but wrongly does not. In this case, we have found an error in the AUT, and we need to take the appropriate actions.
  2. The window has been deliberately removed from the AUT by an application developer. In this case, we need remove the window from the expected window set.

Classic Agent Example

[-] window DialogBox Find
    [ ] tag "Find"
    [ ] parent TextEditor
    [-] StaticText FindWhatText
        [ ] tag "Find What:"
    [-] TextField FindWhat
        [ ] tag "Find What:"
    [-] CheckBox CaseSensitive
        [ ] tag "Case sensitive"
    [-] StaticText DirectionText
        [ ] tag "Direction"
    [-] PushButton FindNext
        [ ] tag "Find Next"
    [-] PushButton Cancel
        [ ] tag "Cancel"
    [-] RadioList Direction
        [ ] tag "Direction"
[-] main ()
    [ ] ListPrint (WindowChildren (Find))
[ ] // this script prints:
[ ] // Find.FindWhatText
[ ] // Find.FindWhat
[ ] // Find.CaseSensitive
[ ] // Find.DirectionText
[ ] // Find.FindNext
[ ] // Find.Cancel
[ ] // Find.Direction
[ ] // Find.BottomEdge
[ ] // Find.LeftEdge
[ ] // Find.RightEdge
[ ] // Find.TopEdge
[ ] // Find.BottomLeftCorner
[ ] // Find.BottomRightCorner
[ ] // Find.TopLeftCorner
[ ] // Find.TopRightCornerNotes
Parent topic: Windows Information
Related reference
ClassOf Function
GetChildren Function
MoveableWin Class
WindowName Function
WindowParent Function


WindowGetAttrList Function

Action

Returns the values for all the attributes of the specified window.

Syntax

laAttrs = WindowGetAttrList (wWindow)
Variable | Description
laAttrs | The attribute values returned for this window. LIST OF ANYTYPE.
wWindow | The window for which you want attributes. WINDOW.

Notes

Use WindowGetAttrList to get the current values for all the attributes of the wWindow object. The available attributes include all those inherited from parent classes. See attribute declaration for the layout of the returned list items.

Example

// Get the attributes for the Find dialog box
LIST OF ANYTYPE laFindWhatAttrs
laFindWhatAttrs = WindowGetAttrList(TextEditor.Search.Find)
Parent topic: Windows Information
Related reference
Attribute Declaration
GetManyProperties Function


WindowIsDefined Function

Action

Tests whether a child window, method, variable, or property is defined by a window or its class.

Syntax

bResult = WindowIsDefined (wWindow, sName [, wcClass, sSource])
Variable | Description
bResult | TRUE if sName is defined by the window or by its class; FALSE if sName is not defined. BOOLEAN.
wWindow | The window that contains the child window, method, variable, or property to test. WINDOW.
sName | The name of the child window, method, variable, or property. STRING.
wcClass | Optional: The window class of sName if it is defined by the window’s class. NULL if sName is defined by the window or not defined. out DATACLASS.
sSource | Optional: The name of the file where sName is defined; this string will include the line number if wWindow is a window instance variable. out STRING.

Notes

In the example below, the Close method is defined for the TextEditor window in the MoveableWin class, so the third argument returns the name of that class. If the Close method were not defined in a window class, the third argument would return NULL.

Example

[ ] use "textedit.inc"
[-] main ()
    [ ] DATACLASS Class
    [ ] Print (WindowIsDefined(TextEditor, "Close", Class))
    [ ] //Prints TRUE
    [ ] Print (Class)
    [ ] //Prints MoveableWin
Parent topic: Windows Information


WindowIsOfClass Function

Action

Determines if a particular window is of a particular class.

Syntax

bTest = WindowIsOfClass (wWindow, dMatchClass [,bExactMatch])
Variable | Description
bTest | Returns TRUE if the specified wWindow is of the class dMatchClass. BOOLEAN.
wWindow | The window of interest. WINDOW.
dMatchClass | The AnyWin class for which you are testing. DATACLASS.
bExactMatch | Optional. If set to TRUE, WindowIsOfClass returns TRUE when dClass is exactly the same as the object’s class. If set to FALSE or omitted, WindowIsOfClass returns TRUE when dClass is either a parent of the object’s class or matches exactly. BOOLEAN.

Notes

Use WindowIsOfClass to test whether a variable of type WINDOW holds a window of a particular class. In the example below, if the active window returned to wWin is of MessageBoxClass, WindowIsOfClass will return TRUE. WindowIsOfClass is the function equivalent of the IsOfClass method.

Example

[ ] // in declarations
[-] window MessageBoxClass MessageBox
    [ ] tag "~ActiveApp/[DialogBox]$MessageBox"
    [ ] ...
[-] window DialogBox Find
    [ ] tag "Find"
    [ ] parent NotePad
    [ ] ...
[-] WINDOW wInvoke = NotePad.Search.Find
    [ ] ...
[ ]
[ ] // in test case script
[ ] WINDOW wWin = NotePad.GetActive ()
[ ]
[ ] DATACLASS dClass = MessageBoxClass
[ ] BOOLEAN bExact = TRUE
[ ] BOOLEAN bTest = WindowIsOfClass (wWin, dClass, bExact)
Parent topic: Windows Information
Related reference
ClassOf Function
GetClass Function
IsOfClass Function


WindowName Function

Action

Returns the identifier of a window.

Syntax

sID = WindowName (wWindow)
Variable | Description
sID | The identifier of the window. STRING.
wWindow | The window whose name you want. WINDOW.

Example

[ ] // in declarations
[-] window MainWin TextEditor
    [ ] tag "Text Editor - *"
[ ] testcase WindowNameExample ()
[ ] // in script
[ ] WINDOW wWnd
[ ] //...
[ ] wWnd = Desktop.GetActive () // assume TextEditor is active
[ ] Print (WindowName (wWnd)) // prints: TextEditor
Parent topic: Windows Information
Related reference
ClassOf Function


WindowParent Function

Action

Returns the parent of a window.

Syntax

wParent = WindowParent (wWindow [, GUIType])
Variable | Description
wParent | The parent of the window. WINDOW.
wWindow | The window whose parent you want. WINDOW.
GUIType | Optional: The GUI of which you want to retrieve the parent window. The default is the current GUI. GUITYPE.

Notes

WindowParent returns the parent window (from the window declaration) of the specified window on the current GUI (or on GUIType, if specified).

Example

[-] window DialogBox Find
    [ ] tag "Find"
    [ ] parent TextEditor
    [-] StaticText FindWhatText
        [ ] tag "Find What:"
    [-] TextField FindWhat
        [ ] tag "Find What:"
    [-] CheckBox CaseSensitive
        [ ] tag "Case sensitive"
    [-] StaticText DirectionText
        [ ] tag "Direction"
    [-] PushButton FindNext
        [ ] tag "Find Next"
    [-] PushButton Cancel
        [ ] tag "Cancel"
    [-] RadioList Direction
        [ ] tag "Direction"
[-] testcase WindowParentExample ()
    [ ] Print (WindowParent (Find)) // prints: TextEditor
Parent topic: Windows Information
Related reference
WindowChildren Function
WindowName Function


WindowTag Function

Action

Returns the fully qualified tag for a window, where the tag is resolved from the window declaration or from the dynamically instantiated identifier. Note that since it uses the declaration of the window rather than the window itself, WindowTag returns a tag even if the window does not exist. If the declaration (or dynamically instantiated identifier) includes a multitag, all portions of the multitag are returned.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

sTag = WindowTag (wWindow [, iGuiType])
Variable | Description
sTag | The window tag for the window. STRING.
wWindow | The window whose window tag to return. WINDOW.
iGuiType | Optional: The GUI you want the tag to be valid for. INTEGER.

Example

[-] window MainWin ProgMan
    [ ] tag "Program Manager"
[-] testcase WindowTagExample ()
    [ ] Print (WindowTag (ProgMan))
[ ] // prints: /[MainWin]Program Manager
Parent topic: Windows Information


Year 2000 Date Transformations

Includes functions for date transformations.

  • ParseDateFormat Function
    Parses a string containing a date and validates each component of the date by comparing it to a specified format.
Parent topic: Functions


Keywords

  • ArgListCall Keyword
    Equivalent to a function or method call.
  • CurrentFile Keyword
    Name of the file.
  • CurrentPath Keyword
    Path name of the file.
  • Typeinfo Keyword
    A class method modifier for 4Test methods that are members of winclasses associated with .NET classes.
  • Alias Keyword in Type Declarations for Recording .NET Classes
    Describes the syntax and rules for using the alias keyword in type declarations when recoding .NET classes.
Parent topic: The 4Test Language


ArgListCall Keyword

Description

Equivalent to a function or method call.

Syntax

Ret=ArgListCall (sName, argList)
Variable | Description
Ret | The return value of the function or method called.
sName | The name of the function or method to be called. STRING.
argList | The list of arguments that the function or method takes. LIST.

Notes

  • You can use ArgListCall to call a function or method by specifying the function or method name and its arguments as arguments to ArgListCall. This allows you to define fully data-driven tests, where you can pass in the names of the functions and methods you want to be called.

  • ArgListCall (sName,argList) is equivalent to sName (argList). For example:

    • ArgListCall ("Min", {1,2}) is equivalent to Min (1,2)

    • myWin.ArgListCall ("GetChildren", {}) is equivalent to myWin.GetChildren ( )

  • As with standard method calls, you can use the operator to specify a class to act upon. For example:

    AnyWin::ArgListCall ("GetChildren", {}) is equivalent to AnyWin::GetChildren ( )

Example 1

ArgListCall is most useful when you have data-driven tests and want to pass the name of the methods and/or functions to call in particular runs of the tests.

The following example uses one test to compare two numbers. You can pass in the function to use to compare the numbers at runtime:

[-] testcase NumCompare (STRING sFunc, LIST argList) appstate none
    [ ] INTEGER iRes
    [ ] iRes = ArgListCall (sFunc,argList)
    [ ] Print ("{sFunc}: {iRes}")
    [ ]
    [ ] // Results:
    [ ] // Testcase NumCompare ("min", {3, 4}) - Passed
    [ ] // min: 3
 [ ] // Testcase NumCompare ("max", {3, 4}) - Passed
 [ ] // max: 4

Example 2

Assume you have a test for a text field. Instead of hard coding the name of the method to call, such as:
myTextField.SetMultiText ("1", "2", "3")
you would like to generalize the test so that you can pass in the name of the method. Use ArgListCall.

Instead of directly calling SetMultiText in the test, specify the following:

myTextField.ArgListCall (sName, myList)
Now you can set the name of the method and its arguments externally to the test and pass them in at runtime. To call SetMultiText with the arguments shown above, define the following:
STRING sName = "SetMultiText"
LIST myList = {"1", "2", "3"}
and reference sName, myList in the test. You can either define sName and myList as global variables and use them directly in a test or define the test as a data-driven test that takes arguments and pass the values as arguments to the test, such as:
[-] testcase SampleTest (STRING sName, LIST myList)
    [ ] ...
    [ ] myTextField.ArgListCall (sName, myList)
Parent topic: Keywords
Related concepts
Data-Driven Test Cases
Related reference
Calling Methods and Functions
Scope Resolution Operator


CurrentFile Keyword

Description

Name of the file.

Notes

CurrentFile is a keyword whose value is the name of the file (not including the path) containing the reference to CurrentFile.

Example

Print (CurrentFile) // in file c:\beta\smoketst\baseline.t

// Result:
// baseline.t
Parent topic: Keywords
Related reference
CurrentPath Keyword


CurrentPath Keyword

Description

Path name of the file.

Notes

CurrentPath is a keyword whose value is the path (not including the file name) of the file containing the reference to CurrentPath. You can use this keyword to locate files at runtime.

To get the path and the name of a file, use this:

CurrentPath + "\" + CurrentFile

Example

Consider this situation: You have a directory named Tests, which has two subdirectories: Scripts and Data. The Scripts directory contains script files. The Data directory contains supporting files used by the scripts. So that your scripts can always locate the Data directory, you could define the following function in an include file in the Tests directory:

STRING GetDataDir () return
(CurrentPath + "\data")

Any script calling the GetDataDir function can locate the Data directory, even if a parent directory moves or is renamed. For example, if the Tests directory is c:\rel2\tests, GetDataDir returns

C:\rel2\tests\data

The CurrentPath keyword gets its value based on the file containing the reference to CurrentPath, in this case, the include file in the Tests directory.

If the parent directory is renamed to rel21 and moved to the e: drive, GetDataDir still locates the Data directory correctly, as

E:\rel21\tests\data
Parent topic: Keywords
Related reference
CurrentFile Keyword


Typeinfo Keyword

Description

The __typeinfo keyword is a class method modifier for 4Test methods that are members of winclasses associated with .NET classes. The winclasses can be generated either by hand or by using the Record Class dialog box. In the latter case, Silk Test Classic automatically inserts the __typeinfo keyword in front of any method that has parameters that are either:

  • Of type POINT or RECT.
  • Of a type that has been declared explicitly in 4Test and uses the alias mechanism.

If you are creating the winclass declaration by hand, then you must remember to insert the __typeinfo keyword for the method declarations that fit the above criteria.

Notes

This modifier applies only to winclass declarations that are associated with .NET classes.

Though Record Class can be used with VB, ActiveX and Java, those Silk Test Classic extensions do not support the type declaration mechanism and aliasing in order to extend the list of 4Test compatible data types.

In the Visual 4Test editor, __typeinfo appears in color as set on the Editor Colors dialog box.

Example

// winclass SystemWindowsFormsMonthCalendar : AnyWin
  // tag "[System.Windows.Forms.MonthCalendar]"
  // obj __typeinfo MyClientSize get_ClientSize ( )
Parent topic: Keywords
Related concepts
Testing .NET Applications with the Open Agent
Related reference
Alias Keyword in Type Declarations for Recording .NET Classes


Alias Keyword in Type Declarations for Recording .NET Classes

Syntax for 4Test Enum Data Type

[scope] TYPE type-name IS ENUM ALIAS classname

where classname is the .NET class name enumeration-values

Syntax for 4Test Record Data Type

[scope] TYPE type-name IS RECORD ALIAS classname

where classname is the .NET class name

Syntax for Record-Fields Using Alias Keyword

type-name field-name alias "fieldname"

where fieldname is the .NET class property name; fieldname must be in quotation marks

Syntax for Record-Fields Not Using Alias Keyword

type-name field-name

where field-name matches exactly the .NET class property name

Description

If you are using Record Class against .NET WinForms controls, you may be able to extend the list of properties and methods that are declared in the resulting winclass declaration.

Property and method declaration is directly related to whether or not there is a 4Test compatible data type for the property type or for a method's parameter type(s). By declaring new 4Test data types that are aliased from types used in the .NET WinForms application, you can extend the list of 4Test compatible data types. Specifically, enumeration types and record types declared in the .NET WinForms application are candidates for aliasing. See Rules for details.

For example, the sample Silk Test Classic .NET application uses the Microsoft .NET framework MonthCalendar control. Without any type aliasing, Record Class against the MonthCalendar control excludes a property declaration for the ClientSize property, as well as a method declaration for both set_ClientSize and get_ClientSize. However, with the following 4Test type declaration, these class members are included in the winclass definition:
type MyClientSize is record alias "System.Drawing.Size"
INTEGER myWidth alias "Width" // or, alternatively, INTEGER Width
INTEGER myHeight alias "Height" // or, alternatively, INTEGER Height

Rules

Regardless of the property type or the method parameter types and any aliasing you may introduce, STATIC member properties and methods will be EXCLUDED from the winclass declaration generated by Record Class.

When declaring a new 4Test data type using the alias keyword, your choice for type-name does not have to match the name of the type in the .NET WinForms application.

If you are declaring a record data type, you can either have the field names match exactly with the corresponding field names in the .NET WinForms application, or you can use the alias keyword to define your own field names; in this case, the string used within the "" must match exactly (including capitalization) with the corresponding field names in the .NET WinForms application.

If you are declaring an enum data type, the enumeration values must match exactly with the enumeration values in the .NET WinForms application; you do not have the choice of using your own enumeration values and the alias keyword.

The .NET class must use a public constructor (in the example above, System.Drawing.Size)

The .NET class must be inherited from the .NET ValueType.

Parent topic: Keywords
Related concepts
Testing .NET Applications with the Open Agent


Statements

  • Access Statement
    Requests access to shared variables.
  • Break Statement
    Transfers control of the script out of the innermost nested for, for each, while, switch, or select statement.
  • Const Statement
    Declares a constant.
  • Continue Statement
    Begins the next iteration of a for, for each, or while statement without completing the current iteration.
  • Critical Statement
    Guarantees that no other thread executes until a specified statement or indented block of code has executed and passed control to the next statement at the level of the critical statement.
  • do ... except Statement
    Handles (ignores) an exception without halting a script.
  • exit Statement
    Exits from a script.
  • for Statement C Style
    Uses C-style iteration to control the number of times a statement executes.
  • for Statement Numeric Iteration
    Uses numeric iteration to control the number of times a statement executes.
  • For Each Statement
    Iterates over the elements of a list or a set.
  • goto Statement
    Bypasses the usual flow of control and passes control to the statement prefixed by a specified label.
  • if Statement
    Executes particular statements depending on the value of a condition.
  • Multitag Statement
    In a window declaration, defines one or more tags that the Agent uses internally to uniquely identify the object at runtime.
  • Parallel Statement
    Each of the statements within the parallel block creates a separate thread and these threads are executed in parallel until the end of the block.
  • Parent Statement
    In a window declaration, specifies the parent window of the window being declared.
  • Raise Statement
    Generates an exception and either transfers control to an exception handler or halts the script.
  • Recording Statement
    Specifies a block of recorded 4Test statements in a script.
  • Rendezvous Statement
    Blocks execution of the calling thread until all threads that were spawned by the calling thread have completed.
  • Reraise Statement
    Raises an exception again and passes control to the next exception handler.
  • Return Statement
    Returns control from a function to its calling function or from a child thread to its parent thread.
  • Select Statement
    Executes statements associated with a particular case from a group of cases.
  • Setting Statement
    Define class-specific use of multiple tags and other features.
  • spawn Statement
    Begins execution of the specified statement in a new thread.
  • switch Statement
    Executes a particular statement depending on the value of an expression.
  • Tag Statement
    In a window declaration, defines one or more tags that the Agent uses internally to uniquely identify the object at runtime.
  • use Statement
    Causes a specified file or files to be included in the compilation of a test case as though the contents of the file(s) were part of the test case file.
  • while Statement
    Executes a statement zero or more times under control of a test condition.
  • with Statement
    Use to nest statements that reference the same window or record data type object.
  • withoptions Statement
    Opens a block of code in which agent options can be set for the duration of the block.
Parent topic: The 4Test Language


Access Statement

Action

Requests access to shared variables.

Syntax

access share-var [,share-var]... statements
Variable | Description
share-var | The identifier of a shared variable. More than one shared variable can be requested by separating them with commas.
statement | One or more statements to be executed when access to all specified share-vars is granted.

Notes

At any point in the execution of a script, a shared variable can be accessed only from within the block of code that has explicitly been granted access to it. Request access to shared variables by using the access statement.

If no other thread currently has access to any of the shareable variables listed, 4Test executes the specified statements. Otherwise, 4Test blocks the thread where the access statement occurs until access can be granted to all the shareable variables listed. At that point, 4Test blocks competing threads and executes the blocked thread.

Example

share integer iTestNum = 0
public share string as WeekDay [7]
share anytype aWhoKnows
void IncrementTestNum
access iTestNum
iTestNum = iTestNum + 1
Parent topic: Statements
Related reference
Critical Statement
Parallel Statement
Rendezvous Statement
spawn Statement
Variable Declaration


Break Statement

Action

Transfers control of the script out of the innermost nested for, for each, while, switch, or select statement.

Syntax

break

Notes

Use a break statement to terminate another statement early if specific conditions occur.

Example

[-] main ()
    [ ] INTEGER I = 1
    [-] while (TRUE)
        [ ] Print (I)
        [-] if (I>= 5)
            [ ] break
        [ ] I = I + 1
    [ ] // This script prints:
    [ ] //1
    [ ] //2
    [ ] //3
    [ ] //4
    [ ] //5
Parent topic: Statements
Related reference
for Statement Numeric Iteration
For Each Statement
Select Statement
switch Statement
while Statement


Const Statement

Action

Declares a constant.

Syntax

[scope] const [data-type] const-name = expr [, const-name = expr]...
Variable | Description
scope | Optional: Either public (the default) or private. Private declaration are available only in the file in which they occur. Public declarations can be accessed from other files via a use statement. You can specify scope only if the declaration is global, which means that the declaration does not appear within a function, window, or winclass declaration.
data-type | Optional: Any data type. If omitted, the constant has the same type as the type of expr.
const-name | An identifier that names the constant being declared.
expr | An expression that evaluates to the value you want to give the constant.

Notes

You use a constant to represent a fixed value. There are several types of constants. Some examples include:

  • Integer, such as 123 and 0xD7 (hexadecimal).

  • Floating-point, such as 123.45 and 4.39e-10.

  • Strings, such as "Now is the time".

  • Boolean (TRUE and FALSE).

Examples

[ ] const TEST_LEVEL = 1
[-] const LIST OF STRING lsTestName = {...}
    [ ] "TestA"
    [ ] "TestX"
[ ] const INTEGER iMaxName = 8, iMaxScript = 50
[ ] const BOOLEAN bDone = FALSE
[-] const LIST OF ANYTYPE laXYZ = {...}
    [ ] "foo"
    [ ] 1
    [ ] TRUE
    [ ] 1.47
[ ] const REAL r = 1.234
[ ] const INTEGER iHex = 0x1A // Hexadecimal notation
[-] public const aiVersion[3] = {...}
    [ ] 1.0
    [ ] 1.5
    [ ] 2.0
Parent topic: Statements
Parent topic: Declarations
Related reference
Declarations


Continue Statement

Action

Begins the next iteration of a for, for each, or while statement without completing the current iteration.

Syntax

continue

Notes

The continue statement passes control back to the top of the loop it controls.

Example

[-] main ()
    [ ] INTEGER I
    [-] for I = 2 to 8
        [-] if (I % 2) != 0
            [ ] continue
        [ ] Print (I)
    [ ] //This script prints:
    [ ] //2
    [ ] //4
    [ ] //6
    [ ] //8
Parent topic: Statements
Related reference
for Statement Numeric Iteration
For Each Statement
while Statement


Critical Statement

Action

Guarantees that no other thread executes until a 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.

Syntax

critical
statement
Variable | Description
statement | Code to be run without interruptions; either a single statement, or a series of statements.

Notes

To create, or "spawn," multiple threads, use the statements parallel, spawn, rendezvous, and critical.

Parent topic: Statements
Related reference
Access Statement
Parallel Statement
Rendezvous Statement
spawn Statement
Variable Declaration


do ... except Statement

Action

Handles (ignores) an exception without halting a script.

Syntax

do
statements1
except
statements2
Variable | Description
statements1 | A single statement or series of statements that may generate an exception.
statements2 | A single statement or series of statements (executed only if exception is raised in statements1).

Example

[-] TestVerification (STRING sExpectedValue, STRING sTestValue)
    [-] if ( sExpectedValue == sTestValue )
        [ ] Print ("Test was successful")
    [-] else
        [ ] raise 1, "ERROR: Test verification failed"
    [ ] return
    [ ]
    [ ]
[-] ErrorHandler ()
    [ ] Print (ExceptData())
    [ ] // This script prints:
    [ ] // ERROR: Test verification failed
    [ ] return
    [ ]
    [ ]
[-] testcase do_except_example ()
    [ ] STRING sTestValue = "xxx"
    [ ] STRING sExpectedValue = "yyy"
    [-] do
        [ ] TestVerification (sExpectedValue, sTestValue)
    [-] except
        [ ] ErrorHandler ()
    [ ] // Continue with testcase
    [ ] ...

Notes

  • The do...except statement allows a possible exception to be handled by the test case instead of automatically terminating the test case. If an exception is raised while the do clause (statements1) has control of the script, control immediately jumps to the first statement in statements2 in the except clause, which often is a call to one of the built-in 4Test functions that gets information on exceptions.

  • If no exception is raised while statements1 has control of the script, control jumps to the first statement beyond the do ... except statement. The statements in statements2 are not executed.

Parent topic: Statements


exit Statement

Action

Exits from a script.

Syntax

exit

Example

[-] main()
    [ ] INTEGER i
    [ ] i = 1
    [ ] NonNegative(i)
    [ ] i = -1
    [ ] NonNegative(i)
    [ ] i = 0
    [ ] NonNegative(i)
    [ ] NonNegative(INTEGER i)
    [-] if(i < 0)
        [ ] exit
    [-] else
        [ ] Print(i, "is not negative")
    [ ] //This script prints:
    [ ] //1 is not negative

Notes

  • If the script is part of a suite, 4Test runs the next script in the suite.

  • The exit statement exits from a script without invoking the recovery system, that is, without calling DefaultTestcaseExit, DefaultScriptExit, TestcaseExit, or ScriptExit.

Parent topic: Statements


for Statement C Style

Action

Uses C-style iteration to control the number of times a statement executes.

Syntax

for([init-stmt]; [boolean-expr]; [incr-stmt])
  statements
Variable | Description
init-stmt | Optional: An assignment or function call that initializes the index of the loop.
boolean-expr | Optional: An assignment or function call that tests the termination condition of the loop.
incr-stmt | Optional: A relational expression specifying the loop increment. If you omit boolean-expr, the relational expression is interpreted as permanently TRUE.
statements | Code to be executed in the loop; either a single statement or a series of statements.

Notes

You can omit one, two, or all three of the expressions, but you cannot omit the semicolons.

Example

[-] testcase ForCExample()
    [ ] INTEGER i
    [-] for(i = 1; i < 5; ++i)
        [ ] Print(i)
    [ ] // This script prints:
    [ ] // 1
    [ ] // 2
    [ ] // 3
    [ ] // 4
Parent topic: Statements


for Statement Numeric Iteration

Action

Uses numeric iteration to control the number of times a statement executes.

Syntax

for loop-var = start-expr to end-expr [step step-expr] statement
Variable | Description
loop-var | A loop variable to hold the current value of the for loop.
start-expr | A number which specifies the starting value of loop-var.
end-expr | A number which specifies the end value of loop-var.
step-expr

Optional for incrementing loop-var by a value other than 1. Specify a positive number to increment, a negative number to decrement.

Note: You must specify an explicit step-expr to decrement a loop. For example, to decrement a loop by 1, specify step -1. If you fail to do this, the for statement skips the loop but does not generate an error.
statement | Code to be executed a specified number of times until loop-var is outside the range start-expr to end-expr; either a single statement or a series of statements.

Note

If you set the Step value in a "for" loop as a real, Silk Test Classic will use reals as the increments if the loop control counter is also declared as a real.

Example

[-] testcase ForExample()
    [ ] INTEGER i = 0
    [-] for i = 2 to 9 step 2
        [ ] Print(i)
    [ ] // This script prints:
    [ ] // 2
    [ ] // 4
    [ ] // 6
    [ ] // 8
Parent topic: Statements
Related reference
Break Statement
For Each Statement


For Each Statement

Action

Iterates over the elements of a list or a set.

Syntax

for each item in expr statement
Variable | Description
item | A variable name.
expr | An expression that evaluates to a list or a set.
statement | A single statement or a series of statements.

Notes

The for each iterator executes once for each element in the list or set specified by expr. Each time it executes, the iterator sets item to the value of another list or set element, the statement section executes for that value, and then control passes back to the iterator to check for another item. When every element in the list or set has been processed, control passes to the next statement in the script.

Example

[-] testcase foreachExample()
    [-] LIST OF STRING lsFruit = {...}
        [ ] "apple"
        [ ] "mango"
        [ ] "kiwi"
    [ ] STRING sFruit
    [-] for each sFruit in lsFruit
        [ ] Print(sFruit)
    [ ] // This script prints:
    [ ] // apple
    [ ] // mango
    [ ] // kiwi
Parent topic: Statements
Related reference
Break Statement
for Statement Numeric Iteration


goto Statement

Action

Bypasses the usual flow of control and passes control to the statement prefixed by a specified label.

Syntax

goto label
Variable | Description
label | A label name, a valid 4Test identifier.

Notes

4Test interprets any valid identifier followed by a colon as a label. You can put a label anywhere in the code for a function.

Example

[-] testcase goto_example()
    [ ] INTEGER i = 1
    [-] while(TRUE)
        [-] if(i > 3)
            [ ] goto Done
    [ ] Print(i)
    [ ] i = i + 1
    [-] Done:
        [ ] Print("All done")
    [ ] // This script prints:
    [ ] // 1
    [ ] // 2
    [ ] // 3
    [ ] // All done
Parent topic: Statements


if Statement

Action

Executes particular statements depending on the value of a condition.

Syntax

if boolean-expr
  statement
else
  statement
Variable | Description
boolean-expr | A boolean expression.
statement | A single statement, or a series of statements.

Notes

If the value of the boolean expression is TRUE, the statement immediately below it is executed. If the value of the boolean expression is FALSE, control passes to the else clause, if any. If there is no else clause in an if statement, and if boolean-expr is FALSE, statement is not executed, and control passes to the next statement in the script, which could be another if statement. If you are trying to test multiple conditions, then you should use a select or switch statement. You could use nested if..else statements, but if you have more than two or three conditions, the levels of indentation will become cumbersome. Micro Focus recommends that you avoid using if..else if..else statements. Using 'else if' will make it difficult to troubleshoot exceptions that occur in the code block because the results file will always point to the first 'if' statement even if it was actually a subsequent 'if' statement that raised the exception.

Example

[-] testcase ifExample()
    [ ] INTEGER i = 1, j = 2
    [ ] BOOLEAN b = TRUE
    [-] if(i == j)
        [ ] Print("Equal")
    [-] else
        [ ] Print("Not Equal")
    [ ] Print("Not even in the ballpark!")
    [-] if(b)
        [ ] Print("TRUE")
    [ ] // Prints:
    [ ] // Not Equal
    [ ] // Not even in the ballpark!
    [ ] // TRUE
Parent topic: Statements


Multitag Statement

Action

In a window declaration, defines one or more tags that the Agent uses internally to uniquely identify the object at runtime. By default, the Agent generates multitag statements for GUI objects when you record window declarations.

Note: Never use the tag in your scripts to refer to an object; always use the object's identifier.

Syntax

[gui-specifier] multitag tag-string
  [tag-string] …
Variable | Description
gui-specifier | Optional. Specifies the GUIs that the statement applies to. See window declaration. If omitted, the statement applies to all GUIs.
tag-string | A STRING expression that evaluates to the object's tag. You can specify as many tag-strings as you want. The tag can be expressed in several ways, as described below.

Forms for the tag-string Argument

The tag-string argument can express the object's tag in one of several ways. Use the arguments in the order listed.

Tag Type | Description
Window ID | GUI-specific ID. You must use the $ character to preface a window ID tag. Always unique.
Caption | The caption or label as it appears to the user. Note that multiple windows may contain the same caption.
Prior text | The nearest previous static text above or to the left of the object. You must use the ^ character to preface a prior text tag.
Index | The order (from top left to bottom right) in relation to its sibling objects of the same class. Index tags must begin with the # character. Use for statically-presented Visual Basic and C/C++ applications.
Location | The physical location, expressed as a pair of (x, y) coordinates. You must use the @ character to preface a location tag. The location tag is always relative to the parent control. Use only if Prior text and Index fail. Use for static applications; consider using WindowID instead.
Attributes | The attribute name(s) of the Html object. If the object is not an Html object, nothing is recorded.

Example

The check box in the Find dialog in the Text Editor has these possible tags (displayed in the Record Window Declarations dialog):

Tag Type | Value | Comment
Caption | Case sensitive | The label for the check box.
Prior text | ^Find What: | The closest static text above the check box.
Index | #1 | It is the first check box in the dialog.
Window ID | $1041 | GUI-specific tag.
Location | @(57,65) | (x, y) location of the check box in the dialog.
Attributes | [blank] | Attributes are only recorded for Html objects.

What is Recorded by Default

By default, when you generate window declarations, the Agent generates tags based on the object's caption (if it has one) and window ID (if it has one).

Example

The default generated tag for the Case Sensitive check box is:

CheckBox CaseSensitive
multitag "Case sensitive"
"$1041"

The string "Case sensitive" is its caption. The string "$1041" is its Window ID.

Specifying Additional tag-strings

You can specify as many tag-strings as you want in a multitag statement. You can even specify more than one value for each tag type. For example, if a control's caption can change dynamically, specify each valid caption in its tag, such as:

PushButton Confirm
multitag "Yes"
"OK"

The Agent would find the pushbutton if it had either caption.

How to Choose a tag-string Form

The caption form for the window tag is the most portable. Along with the windowID, this is the form that the Agent uses by default when it creates tags for recorded declarations.

The Agent automatically generates valid, unique tags. However, in some situations you might want to edit the tags. The following table describes which form of the tag to use in specific situations:

In This Situation | Use This Form for the Tag
The GUI object’s label contains dynamic text. For example the third text string in a dialog is labeled with the path c:\myapp.

The index, for example: "#3".

Note: Avoid using the index format for objects of the MoveableWin class. This syntax may result in your choosing a window at random in cases where there are multiple windows.
The GUI object’s parent can vary at runtime. For example, the Open dialog can have more than one application as a parent at runtime.

Specify that the parent is the currently active application, for example:

"~ActiveApp/[DialogBox]Open"
You want to assign the tag dynamically at runtime.

Replace the tag with a function call. For example, where CreateTag is a user-defined function that returns a string:

MenuItem CheckBox
tag CreateTag(this)
…

STRING CreateTag (WINDOW
wWindowIdentifier)

switch (wWindowIdentifier)
case TestApp.Control.CheckBox
return "Check box|$200"

…
Two dialogs have the same label or caption, but do not have identical contents. For example, one Open dialog has a Name text field and the other Open dialog has a Search pushbutton.

Specify the tag of a unique child in each tag. You may use any unambiguous tag form for the child, but do not use the window identifier of the child. For example,

"[DialogBox]Open/[TextField]First Name/.."

"[DialogBox]Open/[PushButton]New Search/.."

"[DialogBox]Open/[ComboBox] #2/.."

"[BrowserChild]ThePage/[BrowserChild]One
of several frames with the same caption/
[HtmlHeading]Unique heading/..": tag of
the browser frame (BrowserChild with
caption "One of several frames with the
 same caption")

"[BrowserChild]ThePage/[BrowserChild]One
of several frames with the same /
[HtmlHeading]Unique heading/../..": tag of
the browser page (BrowserChild with
caption "ThePage")
Note: Include an "/.." at the end of each tag for each level the child is below the parent. For example, if the child object is one level below the parent, include "/.." at the end of the tag. If the child object is two levels below the parent, include "/../.." at the end of the tag.
The GUI object has no label or caption and the position (and hence the index) can change dynamically at runtime. | The window ID.
The GUI object has a label or caption, but you don't want to use it as the tag because it is changeable for this object. | The index or prior text.
You need to internationalize your application. | The window ID, or replace the tag with a variable.
The GUI object is a graphical control like a tool bar. | The location.
You want to invoke a dialog, not the main window, when your application starts. For example, you want to invoke a dialog named Login.

Change the class of the dialog from DialogBox to MainWin, and then specify the real class in the tag, for example:

"[DialogBox]Login"
More than one instance of the window might be displayed at one time

Use the instance syntax, which takes the form tag-string[n], where [n] refers to the instance. [1] refers to the instance of the window that is closest to the top on the desktop, [2] refers to the instance that is next highest to the top, and so on.

For example, you could have one declaration for the window whose tag is "My Window[1]" and another declaration whose tag is "My Window[2]". With these declarations, you can record and play back tests against two instances of the same window. Note that when an instance of the window becomes active, it automatically becomes MyWindow[1].

The Agent automatically accounts for dynamic strings in the caption of a main window (for example, file names) and replaces these dynamic strings with the wildcard character "*".

Tag Syntax

The examples in the table above use these syntactic elements:

This Syntactic Element | Is Used in a Tag to
/ | Separate a parent from a child object.
[ ] | Delimit the class or instance of a GUI object.
.. | Specify that the Agent should use the parent of the child object in the tag.
~ActiveApp | Specify that the top-level parent of a GUI object is the currently active application at runtime. Do not use ~ActiveApp in any window declaration that will be used with SilkBean.
* | Act as a placeholder for 0 or more characters in a string. Can be used for dynamic strings in the caption of a main window (for example, file names).
? | Act as a placeholder for one character in a string.
| | Delimit segments of a multiple tag. Use this element to create and/or statements.
~ | Match everything. It can be described as the equivalent to [AnyWin]* which means "any window with any caption."

How Parent Specifiers Work

You can specify the parent of a GUI object in the tag-string by using a slash ( / ), as in:

multitag "parent/tag1"
"tag2"

A parent specifier on the first tag in a multitag statement is duplicated in all the remaining tags within the statement. It is not necessary, for example, to specify:

multitag "parent/tag1"
"parent/tag2"

Both of these statement produce the tag parent/tag1|tag2. It is up to you whether to include the parent again. However, an error will result if you use a different specifier on a later tag, or if the first tag does not have a parent specifier and a later tag does.

Note: '|' has precedence over '/' in the tag statement. If a window can have different parents where the parents are at different levels in the window hierarchy, then you must use a tag function in order to specify both parents in a single tag.

Alternative Syntax

Instead of using a multitag statement, you can use a tag statement and concatenate all the tag forms with the pipe character ( | ). For example, the following two statements are equivalent:

multitag "Case sensitive"
"$1041"
tag "Case sensitive|$1041"

Use of the pipe separator will make code much easier to read where you have multiple tags.

How Multiple Tags are Resolved at Runtime

The Agent attempts to resolve each segment of a multiple tag, from left to right, until it finds a match that is unique. If an error occurs when resolving a tag, an exception is raised and the process is immediately halted—unless the error is Window Not Found or Window Not Unique, in which case the Agent continues evaluating other tag segments. Here are some examples:

Tag | What Happens at Runtime
"#xyz|MyWin" | A syntax error results, because #xyz is an illegal tag. The MyWin tag is never evaluated.
"Yes|OK" | Yes is used when both Yes and OK exist and are unique.
"Yes|OK" | OK is used when only OK exists.
"Yes|OK" | OK is used when both Yes and OK exist, but Yes is not unique.

Fully Qualified Window Tag Syntax

The term fully qualified window tag refers to a tag that uniquely and unambiguously identifies a GUI object. A fully qualified window tag is composed of the class and tag of the object joined with the class and tag of each of the object’s ancestors in the GUI hierarchy. This is how, for example, the Agent can distinguish the OK button in one dialog from the OK buttons in other dialogs.

Parent topic: Statements
Related reference
Parent Statement
Tag Statement
window Declaration


Parallel Statement

Action

Each of the statements within the parallel block creates a separate thread and these threads are executed in parallel until the end of the block. At the end of the parallel block, all running threads are held until the last thread completes its execution within the block. When all threads have completed within the block, the script continues.

Syntax

parallel
statements
Variable | Description
statements | One or more statements to be executed in a new thread.

Notes

Unlike the spawn command, the parallel statement does not require a rendezvous statement to synchronize threads.

You create, or "spawn," multiple threads using combinations of the 4Test statements parallel, spawn, rendezvous, and critical.

The parallel statement is shorthand for a series of spawn and rendezvous statements:

This Statement... Is Equivalent To These Statements...
parallel
statement-1
statement-2

spawn statement-1
spawn statement-2
rendezvous

Example

The following example is functionally equivalent to the one shown for spawn and rendezvous.
[-] main ()
    [ ] HMACHINE client1_handle
    [ ] HMACHINE client2_handle
    [ ] HMACHINE server_handle
    [ ] server_handle = Connect ("server")
    [ ] client1_handle = Connect ("client1")
    [ ] client2_handle = Connect ("client2")
    [ ] DoSomeSetup (server_handle)
    [ ]
    [-] parallel
        [ ] UpdateDatabase (client1_handle)
        [ ] UpdateDatabase (client2_handle)
    [ ]
    [ ] Disconnect (server_handle)
    [ ] Disconnect (client1_handle)
    [ ] Disconnect (client2_handle)
Parent topic: Statements
Related reference
Access Statement
Critical Statement
Rendezvous Statement
spawn Statement
Variable Declaration


Parent Statement

Action

In a window declaration, specifies the parent window of the window being declared.

Syntax

[gui-specifier] parent window
Variable | Description
gui-specifier | Optional: Specifies the GUIs that the declaration applies to. If omitted, the specification applies to all GUIs.
window | Identifier specifying the name of the parent window.

Notes

See the window declaration for an example of the parent statement in context.

The parent statement specifies the parent window of the window being declared.

Silk Test Classic automatically includes a valid parent statement when you generate window declarations. In some instances, you might want to edit a parent statement. For example, you can add a GUI specifier to indicate that the statement applies only to a particular platform, such as Windows. For more information, see window declaration.

Portability

Different GUIs do not always build their internal window hierarchies in the same way, and the parent of a window may change when an application is ported. In particular, a window whose parent is the desktop on one GUI may have a different parent on another GUI.

Parent topic: Statements
Related reference
window Declaration


Raise Statement

Action

Generates an exception and either transfers control to an exception handler or halts the script.

Syntax

raise[integer-expr[, expr[, cmd-line]]]
Variable | Description
integer-expr | Optional: The number of the exception you want to raise in the Error Handler.
expr | Optional: An expression of any type that contains information about the exception. You can specify a string containing an explanation of the error, or you can get this information from Silk Test Classic by calling the built-in 4Test function, ExceptData, inside the Error Handler.
cmd-line | Optional: An expression that contains a command line. If specified, the results file displays an icon on the error line. When you click the icon, the command line executes.

Notes

The 11th line of raise.t is the line containing the raise function call and is therefore the location of the error and that the 5th line contains the call to the test case function in which the error occurred.

All implicit exceptions, which are those raised automatically by Silk Test Classic, contain an error message string as data and print this message to the error log and the Results window.

Example

[-] testcase raiseExample()
    [ ] STRING sTestValue = "xxx"
    [ ] STRING sExpected = "yyy"
    [ ] TestVerification(sExpected, sTestValue)
    [ ]
[-] TestVerification(STRING sExpected, STRING sTestValue)
    [-] if(sExpected == sTestValue)
        [ ] Print("Test was successful")
    [-] else
        [ ] raise 1, "ERROR: Test verification failed"
    [ ] // This script prints:
    [ ] // ERROR: Test verification failed
    [ ] // Occurred in TestVerification at raise.t(11)
    [ ] // Called from raiseExample at raise.t(5)
Parent topic: Statements
Related reference
AppError Function
ExceptData Function
Reraise Statement
RaiseError Function


Recording Statement

Action

Specifies a block of recorded 4Test statements in a script.

Syntax

recording statement[statement]…

Notes

When you record actions using Record Testcase, Record Actions, and so on, Silk Test Classic pastes the actions to the editor as a block identified by the recording statement. You can cause Silk Test Classic to omit the recording statement by setting the following value in the [Runtime] section of your option set, Partner.ini or project .ini file:

UseRecordingStatement=FALSE

The default value of UseRecordingStatement is TRUE.

The recording statement provides two advantages:

  • It allows you to easily see which statements were recorded and which were hand-coded.
  • It allows the Agent to play back recorded statements differently than hand-coded statements.

During playback, when the Agent enters a block delimited by the recording statement, it turns off the requirement that windows be verified as active, exposed, or closed (that is, it implicitly sets OPT_REQUIRE_ACTIVE, OPT_VERIFY_ACTIVE, OPT_VERIFY_CLOSED, and OPT_VERIFY_EXPOSED to FALSE). This makes the play back less strict. You need less strict playback for statements that were originally recorded because you know that they were valid. When the Agent leaves a recording block, it restores the Agent options to their previous states.

If you want to override the Agent turning off these options in a Recording block, add the following statements to your partner.ini file:

[PlaybackOptions]
OPT_REQUIRE_ACTIVE=TRUE
OPT_VERIFY_ACTIVE=TRUE
OPT_VERIFY_CLOSED=TRUE
OPT_VERIFY_EXPOSED=TRUE

Example

If you record actions to open a new document in the TextEditor, the following is pasted into the editor:

recording
TextEditor.SetActive()
TextEditor.File.New.Pick()
Parent topic: Statements
Related reference
Agent Options


Rendezvous Statement

Action

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.

Syntax

rendezvous

Notes

  • To create, or "spawn," multiple threads, use the statements parallel, spawn, rendezvous, and critical.

  • When the last child thread exits, rendezvous unblocks the parent thread. If the calling thread has no child threads, rendezvous does nothing.

Example

[-] main ()
    [ ] HMACHINE client1_handle
    [ ] HMACHINE client2_handle
    [ ] HMACHINE server_handle
    [ ] server_handle = Connect ("server")
    [ ] client1_handle = Connect ("client1")
    [ ] client2_handle = Connect ("client2")
    [ ] DoSomeSetup (server_handle)
    [ ] spawn
    [ ] UpdateDatabase (client1_handle)
    [ ] spawn
    [ ] UpdateDatabase (client2_handle)
    [ ] rendezvous
    [ ] Disconnect (server_handle)
    [ ] Disconnect (client1_handle)
    [ ] Disconnect (client2_handle)
Parent topic: Statements
Related tasks
Testing Applications in Multiple UI Sessions on a Single Machine
Related reference
Access Statement
Critical Statement
Parallel Statement
spawn Statement
Variable Declaration


Reraise Statement

Action

Raises an exception again and passes control to the next exception handler.

Syntax

reraise

Notes

  • Use reraise to raise an exception again, after an exception handler has trapped the original exception, but you want control to pass to the next exception handler, if any.

  • reraise passes control to the next exception handler in the current block, or in any block in which the function that caused the exception is called. If no other exception handler is found, the script halts.

Example

[ ] // This script is stored in a file called reraise.t
[-] testcase reraiseExample ()
    [ ] LIST OF INTEGER liXcept
    [-] do
        [ ] BuildList (liXcept)
    [-] except
        [ ] Print (liXcept)
    [ ] reraise
    [ ]
[-] BuildList (out LIST OF INTEGER liXcept)
    [-] const LIST OF INTEGER liNum = {...}
        [ ] 20
        [ ] 10
        [ ] 0
        [ ] 5
    [ ] INTEGER i
    [ ] liXcept = {}
    [-] for each i in liNum
        [ ] ListAppend (liXcept, 100 / i)
    [ ] // This script prints:
    [ ] // Testcase reraiseExample - 1 error
    [ ] // { 5, 10 }
    [ ] // *** Error: Divide by zero
    [ ] // Occurred in BuildList at reraise.t(18)
    [ ] // Called from reraiseExample at reraise.t(5)
Parent topic: Statements
Related reference
Raise Statement


Return Statement

Action

Returns control from a function to its calling function or from a child thread to its parent thread.

Syntax

return [expr]
Variable | Description
expr | Optional: An expression whose value is returned to the calling function. The type of the value returned must match the declaration for the function.

Notes

  • Use a return statement to return control from the function that currently has control to the function that called it. You can also use it to return a value to the calling function.

  • There is a return statement implied at the end of all 4Test functions, because when a 4Test function exits it automatically returns control to the function that called it.

Example

[-] testcase returnExample ()
    [ ] INTEGER i
    [ ] i = 5
    [ ] Print (Square (i))
    [ ] i = -1
    [ ] NonNegative (i)
    [ ]
[-] INTEGER Square (INTEGER i)
    [ ] return i * i
    [ ]
[-] void NonNegative (INTEGER i)
    [-] if (i < 0)
        [ ] return
    [-] else if (i == 0)
        [ ] Print ("i is zero")
    [-] else
        [ ] Print ("i =", i)
    [ ] // This script prints: 25
Parent topic: Statements


Select Statement

Action

Executes statements associated with a particular case from a group of cases.

Syntax

select
  case boolean-expr
    statements
  [ case boolean-expr
    statements ]
  ...
  [ default
  statements ]
Variable | Description
statements | One or more statements.
boolean-expr | A boolean expression. If TRUE, control passes to the first statement in the clause. See the Notes below.

Notes

  • Use a select statement to execute at most one case from a group.

  • Once the first boolean-expr in the list evaluates to TRUE, its statement is executed and then control passes to the first statement after the select statement.

  • If no boolean-expr evaluates to TRUE, and there is a default label, then control passes to the statement immediately following it. There can be only one default label, and it must be the last label.

Example

[-] testcase selectExample ()
    [ ] INTEGER I = 0, j = 1
    [-] select
        [-] case I == 0 || j == 0
            [ ] Print ("Either I or j is 0")
        [-] case I == 0
            [ ] Print ("Only I is 0")
        [-] default
            [ ] Print ("Default case")
    [ ] // This script prints:
    [ ] // Either I or j is 0
Parent topic: Statements
Related reference
Break Statement


Setting Statement

Action

The setting statement is used in the winclass declaration to define class-specific use of multiple tags and other features.

Parent topic: Statements
Related reference
winclass Declaration


spawn Statement

Action

Begins execution of the specified statement in a new thread.

Syntax

spawn
statement
Variable | Description
statement | Code to run in a new thread. statement can be a single statement or a series of statements.

Notes

To create, or "spawn," multiple threads, you can use the parallel, spawn, rendezvous, and critical statements. You can use these statements to call a test case, or various test cases, on different Agents. The test cases will launch at the same time and run on their own. Note that calling multitestcase would not continue after the rendezvous statement until the last test case has finished running, meaning that the Disconnect() would not occur for any Agent until the last Agent finished.

You can spawn only one thread for a particular Agent (that is, on a particular machine).

To use a spawn statement in tests that use TrueLog Explorer, use the OPT_PAUSE_TRUELOG option to disable TrueLog Explorer. Otherwise, issuing a spawn statement when TrueLog Explorer is enabled causes Silk Test Classic to hang or crash.

Example

The following example demonstrates how you can use the spawn statement to create multiple threads. Note that UpdateDatabase could be either a test case or a function.

[-] multitestcase ()
    [ ] HMACHINE client1_handle
    [ ] HMACHINE client2_handle
    [ ] HMACHINE server_handle
    [ ] server_handle = Connect ("server")
    [ ] client1_handle = Connect ("client1")
    [ ] client2_handle = Connect ("client2")
    [ ] DoSomeSetup (server_handle)
    [ ] spawn
    [ ] UpdateDatabase (client1_handle)
    [ ] spawn
    [ ] UpdateDatabase (client2_handle)
    [ ] rendezvous
    [ ] Disconnect (server_handle)
    [ ] Disconnect (client1_handle)
    [ ] Disconnect (client2_handle)
Parent topic: Statements
Related concepts
Using a Spawn Statement
Related reference
Access Statement
Critical Statement
Parallel Statement
Rendezvous Statement
Variable Declaration


switch Statement

Action

Executes a particular statement depending on the value of an expression.

Syntax

switch (expr)
  case case-value(s)
    statements
  [case case-value(s)
    statements ]
  ...
  [default
    statements ]
Variable | Description
expr | An expression.
statements | One or more statements.
case-value(s) | One or more expressions, separated with commas. If the value of expr equals one of the case-values, control passes to the first statement in the case-values clause. See the Notes below.

Notes

  • A switch statement can take the place of a series of if statements. Your script evaluates expr once and compares this value to the value of each of the expressions in case-value(s). If the value equals one of the expressions, control passes to the statement that follows. Otherwise control transfers to the statement following the default label, if one exists. There can be only one default label, and it must be the last.

  • Although C requires a break statement in each case to explicitly transfer control out of the switch, 4Test does not require it. Once the last statement in the case has been executed, control automatically passes to the next statement after the switch statement.

Example

The following example illustrates all of the ways you can specify case-value(s).

[-] testcase switchExample ()
    [ ] INTEGER i
    [-] for i = 1 to 12
        [-] switch (i)
            [-] case 1 // Compares i to 1
                [ ] Print (i, "Case 1")
            [-] case 2, 4 // Compares i to 2 and 4
                [ ] Print (i, "Case 2, 4")
            [-] case 5 to 7 // Compares i to 5, 6, and 7
                [ ] Print (i, "Case 5 to 7")
            [-] case 8 to 9, 11 to 12 // Compares i to 8,9,11,12
                [ ] Print (i, "Case 8 to 9 and 11 to 12")
            [-] default // If i is none of the above
                [ ] Print (i, "Default Case")
    [ ]
    [ ] // This script prints:
    [ ] // 1 Case 1
    [ ] // 2 Case 2, 4
    [ ] // 3 Default Case
    [ ] // 4 Case 2, 4
    [ ] // 5 Case 5 to 7
    [ ] // 6 Case 5 to 7
    [ ] // 7 Case 5 to 7
    [ ] // 8 Case 8 to 9 and 11 to 12
    [ ] // 9 Case 8 to 9 and 11 to 12
    [ ] // 10 Default Case
    [ ] // 11 Case 8 to 9 and 11 to 12
    [ ] // 12 Case 8 to 9 and 11 to 12
Parent topic: Statements
Related reference
Break Statement


Tag Statement

Action

In a window declaration, defines one or more tags that the Agent uses internally to uniquely identify the object at runtime. The Agent generates tag statements for GUI objects when you record window declarations if you have turned off multiple tag recording (in Recorder Options).

Note: You never use the tag in your scripts to refer to an object; you always use the object's identifier.

Syntax

[ gui-specifier ] tag tag-string [ | tag-string ]…
Variable | Description
gui-specifier | Optional. Specifies the GUIs that the statement applies to. See window declaration. If omitted, the statement applies to all GUIs.
tag-string | A STRING expression that evaluates to the object's tag. You can specify as many tag-strings as you want; separate them with the pipe character ( | ). The tag can be expressed in several ways. For more information about tag-string formats, see multitag statement.

Notes

The tag statement is functionally equivalent to the multitag statement. It specifies one or more tags that the Agent should use when identifying objects at runtime. The only difference is syntax: With the tag statement, all segments of the tag are in one string and are delimited by the pipe character ( | ), such as:

tag "Case sensitive|$1041"

With the multitag statement, different segments are on their own lines, such as:

multitag "Case sensitive"
"$1041"
Parent topic: Statements
Related reference
Multitag Statement
Parent Statement
window Declaration


use Statement

Action

Causes a specified file or files to be included in the compilation of a test case as though the contents of the file(s) were part of the test case file. The use statement is functionally equivalent to a C include statement. It takes a string parameter which can be supplied in several ways, as shown below.

Syntax

use "FileName"
or
use sVar
or
use UseConstant
Variable | Description
FileName | A file name or path name string. STRING.
sVar | A string constant that has been declared and set in a file that is included in this file prior to this use statement. STRING.
UseConstant | A compiler constant that you have defined and set with the Silk Test Classic Compiler Constants window. The compiler constant value must resolve to a string.

Notes

Window declarations and helper functions can be placed in a separate include file. This allows code that is used in many test cases to be placed in one file and then reused multiple times. A compiler constant allows you to customize a test case before using it. For example, a test case can be written that depends on the value of a constant that specifies the language to use. Before running the test you set the compiler constant to specify the language for this test run.

When you call a use statement against a file, you can reference all variables and constants within that file without calling additional use statements.

Example

// ccmail.t
use "ccmail.inc"
use sSmallSet // This constant is defined in ccmail.inc
use LangConst // Set this constant before running test
Parent topic: Statements


while Statement

Action

Executes a statement zero or more times under control of a test condition.

Syntax

while boolean-expr statement
Variable | Description
boolean-expr | A boolean expression that usually tests some state or relationship.
statement | A single statement, or a series of statements.

Notes

A while statement executes zero or more times while boolean-expr is true. Each time statement executes, control returns to the evaluation of the boolean expression. If the value of the boolean expression is false initially, the while statement never executes and control passes to the next statement in the script.

Example

[-] testcase whileExample ()
    [ ] INTEGER i = 5
    [-] while (i > 0)
        [ ] Print (i)
        [ ] i = i - 1
    [ ] // This script prints:
    [ ] // 5
    [ ] // 4
    [ ] // 3
    [ ] // 2
    [ ] // 1
Parent topic: Statements
Related reference
Break Statement


with Statement

Action

Use to nest statements that reference the same window or record data type object. An object reference that starts with a dot ( . ) is understood to refer to the window argument.

Syntax

with window
.statement
Variable | Description
window | A window.
statement | A single statement or a series of statements.

Notes

Use with to make your code easier to read.

Modifications of a record object within a with block do not persist outside the block, because the with statement works with a copy of the record object, rather than with the original record object.

with statements can be nested; however, you can only refer to the innermost window. For example, the following fragment:

with abc
with .def
.ghi

is equivalent to:

abc.def.ghi

Example 1

The Click and DragMouse methods operate on the same child window:

with MainWin("Draw Prog*").ChildWin("c:\pix\pic2.bmp")
.Click (1, 530, 272)
.DragMouse (1, 529, 268, 509, 265)

Example 2

abc-window is a common parent of def-window and jkl-window:

with abc-window
.def-window.ghi-method
.jkl-window.mno-method
Parent topic: Statements


withoptions Statement

Action

Opens a block of code in which agent options can be set for the duration of the block.

Syntax

withoptions
statement

where statement is a single statement or a series of statements.

Notes

User-defined functions cannot be called on block entry or exit. The previous values of the agent options are restored on block exit, even if an error occurs. The error will be re-raised after the options are restored.

Use the BindAgentOption function to set an agent option for the duration of a block, because the withoptions statement does not work with the SetOption method of the AgentClass class.

Example

[-] testcase Test2() appstate none
    [ ] TestApplication.SetActive()
    [-] withoptions
        [ ] // slow down the mouse and keyboard
        [ ] BindAgentOption(OPT_KEYBOARD_DELAY,500)
        [ ] BindAgentOption(OPT_MOUSE_DELAY,500)
        [ ] TestApplication.Control.CheckBox.Pick()
        [ ] xCheckBox.TheCheckBox.Check()
        [ ] xCheckBox.TheCheckBox.Uncheck()
        [ ] xCheckBox.TheCheckBox.Check()
        [ ] xCheckBox.Close()
    [ ]
    [ ] //back to my usual settings, outside withoptions
    [ ] TestApplication.Control.CheckBox.Pick()
    [ ] xCheckBox.TheCheckBox.Check()
    [ ] xCheckBox.TheCheckBox.Uncheck()
    [ ] xCheckBox.TheCheckBox.Check()
    [ ] xCheckBox.Close()
Parent topic: Statements
Related reference
BindAgentOption Function
SetOption Method


Declarations

The following rules apply to 4Test declarations:
Scoping Rules
Scope applies to the declarations of constants, variables, data types, functions, windows, and window classes. The scope of a declaration is either public or private:

  • A private declaration is available only in the file where it is declared.

  • A public declaration is available in any file that accesses it through a use statement.

Note: You can specify the scope of a declaration only if the declaration is global, not if it appears within a function, window, or winclass declaration.
Constant Declarations

You can use a constant to represent a fixed value. There are several types of constants. Some examples include integer, floating-point, string, and boolean.

To declare constants, use the const statement. For a summary of the constants provided in Silk Test Classic, see Built-in Constants.

Variable Declarations
For information on declaring variables using 4Test, see the following:
  • ARRAY Data Type
  • LIST Data Type
  • Variable Declaration
Data Type Declarations

You can define three kinds of data types.

Alias | An alias data type is a new name for an existing type or declares variables that can be assigned values of more than one type (called overloading). Use the type ... is declaration to declare alias data types.
Enumerated | An enumerated data type groups together a set of values and orders them sequentially from 1 to n. You declare an enumerated type when you want a variable to hold only a limited number of distinct values. Use the type ... is enum declaration to declare enumerated data types.
Record | A record groups a fixed number of randomly accessible items of different types. The fields in a record can each have a different data type. Use the type ... is record declaration to declare record data types.
Function Declarations
For information on declaring functions, see Function declaration.
Window Declarations

You can declare new windows using the window declaration keyword. Within the window declaration you can define the methods and properties that are associated with this window.

Winclass Declarations
You can also declare new window classes using the winclass declaration keyword. Within the window class declaration you can define the methods and properties that are associated with this class.
  • type ... is Declaration
    Declares an alias data type.
  • Appstate Declaration
    Declares an application state.
  • Attribute Declaration
    Declares an attribute for a window class.
  • Const Statement
    Declares a constant.
  • Multitestcase Declaration
    Indicates to the 4Test compiler that the function preceded by this keyword is a test case that operates correctly in a multi-application, distributed environment.
  • DLL Declaration
    Declares functions in a DLL so that they can be called from a 4Test script.
  • type ... is enum Declaration
    Declares an enumerated data type.
  • Function Declaration
    Declares a function or a test case function.
  • Property Declaration
    Within a window or window class declaration, declare a property.
  • type ... is record Declaration
    Declares a record data type.
  • Method Declaration
    Within a window or window class declaration, declares a method.
  • type ... is set declaration
    Declares a set data type. Data type declarations must appear outside of any function.
  • Testcase Declaration
    The syntax for declaring a test case function is similar to the syntax for other function declarations, but is preceded by the testcase keyword.
  • Variable Declaration
    Declares a variable.
  • winclass Declaration
    Declares a window class for an application-specific window or control.
  • window Declaration
    Uniquely identifies an object in the graphical user interface.
  • C Data Types for DLL Functions
    Lists the supported C data types for use in calling functions in DLLs.
Parent topic: The 4Test Language
Related reference
Built-in Constants
Data Types


type ... is Declaration

Action

Declares an alias data type.

Note: Data type declarations must appear outside of any function.

Syntax

[scope] type type-name is data-type [, data-type]...
Variable | Description
scope | Optional: Either public (the default) or private. Private declarations are available only in the file in which they occur. Public declarations can be accessed from other files by means of a use statement.
type-name | An identifier that names the type being declared.
data-type | Any legal data type. If you specify only one data-type, variables of type-name can hold only data of that data type. If you specify multiple type names, objects with the new data type can hold data of any of the types you specify. This is called overloading and is described below.

Notes

  • Declare aliases to create new data types that are specific to the needs of your scripts, or the application you are testing. An alias can simply be a new name for an existing type, or can be used to declare variables that can be assigned values of more than one type. This is called overloading.

  • In the following example, a variable with type ManyItems can hold data with either of the user-defined types MyEnumType or MyRecordType:
    type ManyItems is MyEnumType, MyRecordType

  • Overloading is useful when you want variables or function parameters to hold data of multiple types, like a string from a dialog box or its index value, which is an INTEGER. You could use type ANYTYPE for this purpose, but declaring an overloaded alias makes your code more robust.

  • To test the type of the data that an overloaded variable actually holds, and then perform different operations based on the result, use a switch statement in combination with the TypeOf function:
    [ ] type MyType is INTEGER, STRING
[-] MyType ShiftyVar
    [ ]
[-] switch (TypeOf (ShiftyVar))
    [-] case INTEGER:
        [ ] // If the value TypeOf returns is INTEGER
        [ ] // do whatever...
    [-] case STRING:
        [ ] // if value is string...
        [ ] // do something else...

Examples

[ ] type int is INTEGER // For people accustomed to C
[ ] type FILE is LIST OF STRING
[ ] type MATRIX is ARRAY [4][4] OF NUMBER
[ ] type MATRIX_LIST is LIST OF MATRIX
[-] public type ITEM is INTEGER, STRING
    [ ] //holds integers or strings
Parent topic: Declarations


Appstate Declaration

Action

Declares an application state.

Syntax

appstate appstate1() [basedon appstate2] statements
Variable | Description
appstate1 | An identifier that specifies the name of the application state being declared.
appstate2 | Optional: An identifier that specifies an application state upon which to base the definition of appstate1 or none. Statements in appstate2 are executed before those in appstate1 when the application state function is called. If omitted, none is assumed.
statements | The 4Test statements that define the application state.

Notes

An application state is typically used to put an application into the state it should be in at the start of a test case.

You can define the application state from scratch or base the definition on another application state, which in turn can be based on another application state, and so on. The base state is the lowest level of application state in this chain of inheritance. The application state DefaultBaseState is predefined for your use by Silk Test Classic.

To associate an application state with a test case, use the appstate keyword when you define the test case. The second example below associates the application state MyAppState, which is based on MyBaseState, with the test case MyTestCase.

  • By default, Silk Test Classic calls the SetAppState function when you enter a test case, in the DefaultTestCaseEnter function.
  • The SetAppState function executes the statements defined in the application state and in each of the application states upon which it is based, starting with the statements in the base state and working up to the application state chain.
  • By default, Silk Test Classic calls the SetBaseState function when you exit a test case, in the DefaultTestCaseExit function.
  • The SetBaseState function executes the statements defined in the lowest level application state only (the base state). For example, suppose a test case uses the application state AppState3, based on AppState2, based on AppState1. Calling the SetBaseState function executes only the statements in AppState1.

Example

appstate MyAppState () basedon MyBaseState
//...
testcase MyTestCase () appstate MyAppState
//...
Parent topic: Declarations
Related reference
Function Declaration
SetAppState Function
SetBaseState Function
Overview of Application States


Attribute Declaration

Action

Declares an attribute for a window class.

Syntax

attribute sAttribute,VerifyFunc, GetFunc
Variable | Description
sAttribute | The name of the attribute. STRING.
VerifyFunc | An identifier specifying the name of the function used to verify the value of this attribute.
GetFunc | An identifier specifying the name of the function used to get the value of this attribute.

Notes

The attributes associated with a window class are used by the GetEverything and VerifyEverything methods to get and verify information about a window. You can use the attribute keyword in a winclass declaration to declare new attributes for user-defined classes. For a list of the attributes defined for the built-in classes, see the file winclass.inc.

Example of Built-In Attributes

attribute "Contents", VerifyContents, GetContents
attribute "Text", VerifyText, GetText
attribute "Selected item by text", VerifyValue,GetSelText

Example of Defining a New Attribute

To add a new attribute to the DialogBox class that verifies the number of children in the dialog, you can add code like this to your test frame (or other include file):

[-] winclass DialogBox:DialogBox
    [ ] attribute "Number of children", VerifyNumChild, GetNumChild
    [ ]
    [-] integer GetNumChild()
        [ ] return ListCount (GetChildren ()) // return count of children of dialog
    [ ]
    [-] hidecalls VerifyNumChild (integer iExpectedNum)
        [ ] Verify (GetNumChild (), iExpectedNum, "Child number test")

As this example shows, you use the hidecalls keyword when defining the verification method for the new attribute.

About the Hidecalls Keyword

The keyword hidecalls hides the method from the call stack listed in the results. Using hidecalls allows you to update the expected value of the verification method from the results. If you do not use hidecalls in a verification method, the results file will point to the frame file, where the method is defined, instead of to the script. We recommend that you use hidecalls in all verification methods so you can update the expected values. The Number of Children attribute is listed in the Verify Window dialog when you do an attribute verification.

Parent topic: Declarations
Related reference
winclass Declaration


Multitestcase Declaration

A function preceded by the multitestcase keyword indicates to the 4Test compiler that the function is a test case that operates correctly in a multi-application, distributed environment. A test case defined with this keyword starts by automatically executing the DefaultMultiTestCaseEnter function and ends with the automatic execution of DefaultMultiTestCaseExit. As a result, the test case correctly handles recovery operations for a script that drives multiple applications. This contrasts with the function declaration that uses the testcase keyword and which can only recover a single application, because it executes DefaultTestCaseEnter and DefaultTestCaseExit.

A function defined with the multitestcase keyword can invoke any number of functions defined with the testcase keyword. A function cannot call multitestcase functions and a testcase function cannot call other testcase functions.

Note: If you choose to write your own functions for automatic execution at the beginning and/or the end of your test case, name them MultiTestCaseEnter and MultiTestCaseExit.
Parent topic: Declarations
Related reference
SetUpMachine Function
SetMultiAppStates Function
SetMachine Function


DLL Declaration

Action

Declares functions in a DLL so that they can be called from a 4Test script.

Syntax

dll dllname.dll
prototype
[prototype]...
Variable | Description
dllname | The name of the DLL file that contains the functions you want to call.
prototype | The function prototype of a DLL function you want to call. Each prototype has the syntax shown below.

Prototype Syntax

[return-type] func-name ( [arg-list]) [alias dll-fname]
Variable | Description
return-type | Optional: The data type of the return value, if there is one.
func-name | An identifier that specifies the name of the function.
dll-fname | Optional: A string that specifies the name of the function within the DLL. If specified, func-name is the alias name to be used in 4Test. See the example below.
arg-list | Optional: A comma-delimited list of arguments. Each argument in arg-list has the syntax shown below.

Argument Syntax

[pass-mode] data-type arg-name
Variable | Description
pass-mode | Optional: Whether the argument is passed into the function, passed out of the function, or both. pass-mode can be in, out, or inout. The default is in. See Function Declaration for a description of pass modes.
data-type | The C data type of the argument. See the information on C data types below.
arg-name | An identifier specifying the name of the argument.

Notes

Alias Names

If a DLL function has the same name as a 4Test reserved word, or the function does not have a name but an ordinal number, rename the function within your 4Test declaration and use the alias keyword to map the declared name to the actual name. The second example below defines an alias name for the DLL function exit.

C Data Types

Since DLL functions are written in C, the arguments you pass to these functions must have C data types or be records containing fields of these types. For a list of these data types, see C data types for DLL functions.

Copying and Freeing DLL Memory

When a DLL function uses a string as the return type, Silk Test Classic does not assume ownership of that string. The reason for this is that buffers must be de-allocated in the same C-Runtime as they were allocated. Otherwise, the application might crash. Therefore, Silk Test Classic looks for a function called FreeDllMemory which accepts a pointer in the DLL's interface. If available, Silk Test Classic calls that function with the buffer as argument, and gives the DLL a chance to clean up its memory. Otherwise, Silk Test Classic leaves the buffer as it is (leaking memory) because it has no way of freeing the memory without risking a crash.

Output String Buffer

If the user calls a DLL function with an output string buffer that is less then the minimum size of 256 characters, the original string buffer is resized to 256 characters and a warning is printed. This warning, "String buffer size was increased from x to 256 characters" (where x is the length of the given string plus one) alerts the user to a potential problem where the buffer used might be shorter than necessary.

Passing Arguments

The table below provides additional information about passing certain types of arguments to DLL functions:

Variable Type | How to Pass
Pointer to a character | Pass a 4Test string variable to a DLL which requires a pointer to a character (null terminated).
Pointer to a numerical array | Pass a 4Test array or list of the appropriate type to a DLL which requires a pointer to a numerical array.
Pointer to a record | Pass a 4Test record to a DLL which requires a pointer to a record. If the record has a dwSize field, then you must set it to the size of the record. 4Test records are always passed by reference to a DLL.
Pointer to a function | You cannot pass a pointer to a function to a DLL function.
Null string pointer | To pass a null pointer to a string, use the null keyword in 4Test.
Window handle | Use the hWnd property or the GetHandle method of the AnyWin class to get the window handle you need.

Arguments Passed by Reference by the DLL Function

A few special rules apply for declaring arguments that can be passed by reference by the DLL function:

  • Declare an argument whose value will be passed by reference by a DLL function using the out keyword.

  • Declare an argument that is sometimes passed by reference and sometimes not using the in keyword. In the call to the DLL function, preface the argument with the out keyword, enclosed in brackets.

inprocess Keyword

Typically, when you make a DLL function call, the DLL gets loaded into the Agent and called from there. However, if you specify that a function is "inprocess", it uses the first argument (which has to be a window handle - not the window id) and loads the DLL into that application's process. If the DLL's function's first argument is not a window handle, you must write a wrapper so that it is. For example, your DLL declaration might say: inprocess SendMessage(HWND ......

and then when you call SendMessage, it is loaded into the application that contains the window handle you provided.

If there is a return type, the return type comes after the inprocess keyword.

You can have DLL functions that are both inprocess and not inprocess by using aliases.

ansicall Keyword

The ansicall keyword converts all string parameters (return type, string arguments, strings in record structures that are used as arguments) from W (wide-character, Unicode) to A (ANSI) character format before calling the DLL function internally. Return values and pass-mode variables set to inout that are strings or contain strings within record structures get converted back from A (ANSI) format to W (wide-character) format after calling the DLL. Using the ansicall keyword makes an ANSI call transparent, as the conversion is done internally.

Note: The DLL calling stack does not support return values that are pointers to a record structure. To determine if the function succeeded, use the inout or out pass-mode variable and use the return-type variable as a flag.
Important: If you use DLL functions where you specify string sizes in bytes, remember that W (wide-character) strings are assigned 2 bytes per character, and A (ANSI) strings are assigned 1 byte per character. If you pass a buffer of 1000 characters via an ANSI call, you use 1000 bytes of space, not 2000 bytes. But if you return a string of 1000 characters from a DLL, the W (wide-character) buffer will have 2000 bytes.

Example

You can use the inprocess and ansicall keywords together in the same DLL call:

inprocess ansicall INT MessageBoxIPA (HWND hWndParent, LPCSTR sText, LPCSTR sTitle, UINT fuFlags) alias "MessageBoxA"
Parent topic: Declarations
Related reference
C Data Types for DLL Functions
hWnd Property
GetHandle Function
Agent Options Dialog Box


type ... is enum Declaration

Action

Declares an enumerated data type.

Note: Data type declarations must appear outside of any function.

Syntax

[scope] type type-name is enum
enum-values
Variable | Description
scope | Optional: Either public (the default) or private. Private declarations are available only in the file in which they occur. Public declarations can be accessed from other files by means of a use statement.
type-name | An identifier that names the type being declared.
enum-values | One or more of values on separate lines. By default, the first value in the list of enumerated values is assigned sequence value 1, and each subsequent value is incremented by 1. If you explicitly assign an INTEGER sequence value, as shown in the example below, the values that follow it are incremented by 1.

Notes

An enumerated data type is a data type that groups together a set of values and orders them sequentially from 1 to n. You declare an enumerated type when you want a variable to hold only a limited number of distinct values. For example, you can define an enumerated type named colors whose legal values are "red" and "green" and "yellow".

Examples

[-] type COLOR is enum
    [ ] red
    [ ] green
    [ ] // red = 1, green = 2
[-] type YESNO is enum
    [ ] NO = 0
    [ ] YES
    [ ] // NO = 0, YES = 1
Parent topic: Declarations


Function Declaration

Action

Declares a function or a test case function.

Syntax

[scope] [testcase] [return-type] function-id([arguments])
  statements [appstate]
Variable | Description
scope | Optional: Either public (the default) or private. Private declarations are available only in the file in which they occur. Public declarations can be accessed from other files through the use statement.
testcase | Optional: Indicates that this function definition is a logical sub-component within a Silk Test Classic script. See Exception Handling in Test Cases below.
return-type | Optional: The data type of the value returned by the function, or void (the default) if the function does not return a value.
function-id | An identifier that specifies the name of the function.
arguments | Optional: A list of the arguments that the function expects. See Specifying Arguments below.
statements | The statements that make up the body of the function; they tell the compiler what actions you want the function to perform.
appstate | Optional: Indicates an application state, which is typically used to put an application into the state it should be in at the start of a test case. Followed by an identifier that specifies the name of the application state being declared. See Appstate Declaration for an example and more information.

Notes

A function is a group of 4Test statements that accomplish a discrete task. You can optionally pass arguments to a function and it can optionally pass back a return value.

4Test lets you use a function before you declare it.

In addition to declaring functions, you can call functions in DLL files using the dll declaration.

Exception Handling in Test Cases

Silk Test Classic automatically performs special exception handling in test cases. If your code does not explicitly handle an exception, Silk Test Classic logs the error in the results file and exits the test case, but does not halt the script. You can also specify your own exception handling behavior for a test case, which overrides the default Silk Test Classic exception handling behavior.

Specifying Arguments

When you write the argument list for a function, the required arguments appear first in the list, followed by the optional arguments. Separate arguments with a comma.

Each argument is specified in the following order:
[pass-mode] data-type identifier [null] [optional]
Variable | Description
pass-mode | Optional: Either in (default), out, or inout. Specifies whether the argument is passed into the function, passed out of the function, or both. See Argument Pass Modes for more information.
data-type | The data type of the argument.
identifier | The name of the argument.
null | Optional: Indicates that the argument can contain a NULL value. If omitted, the default is that the argument cannot be NULL. If an argument is NULL and you have not explicitly allowed it to be NULL, Silk Test Classic raises an exception.
optional | Optional: Indicates that the argument is optional. If an optional argument has not been passed in, its value will be null on entry to the function. If you omit an optional argument, you may also omit any arguments that follow the optional argument.
Parent topic: Declarations
Related reference
Argument Pass Modes
Appstate Declaration
DLL Declaration


Property Declaration

Action

Within a window or window class declaration, declare a property.

Syntax

[gui-specifier] property property-id
  data-type Get ( )
    code-for-Get-routine
  void Set (data-type value)
    code-for-Set-routine
Variable | Description
gui-specifier | Optional: Specifies the GUIs that the property applies to. See window declaration. If omitted, the property applies to all GUIs.
property-id | An identifier that specifies the name of the property. Properties are in scope for the window class declaration only; this means that different classes can have properties with the same names.

Notes

See the winclass declaration for examples of declaring properties.

When you declare a property within a window class declaration, the property is available for use in all windows of that class.

When you declare a property within a window declaration, the property is available for use only by that window. The property declaration within a window overrides any property of the same name in the window’s class

Properties allow information associated with a window to be accessed as if it were stored in a variable.

  • When a property name appears to the right of an assignment (=) operator, Silk Test Classic calls the Get function for the property to get the information.
  • When a property name appears on the left side of the assignment operator, Silk Test Classic calls the property's Set function to change the information.

A Get function must take no arguments and must return a value whose type is not void.

A Set function must take one and only one argument and must be declared void.

A property need not have both a Get and a Set function. For example, a Caption property to access a window's caption would only have a Get function.

Referring to a Window with the Keyword "this"

When defining properties within a window class declaration, you use the keyword this to refer to the window that the method or property will refer to at runtime.

Parent topic: Declarations
Related reference
winclass Declaration
window Declaration


type ... is record Declaration

Action

Declares a record data type.

Note: Data type declarations must appear outside of any function.

Syntax

[scope] type type-name is record
record-fields
Variable | Description
scope | Optional: Either public (the default) or private. Private declarations are available only in the file in which they occur. Public declarations can be accessed from other files by means of a use statement.
type-name | An identifier that names the type being declared.
record-fields | The fields that make up the record. See the example and notes below.

Notes

  • A record data type is a compound data type that is made up of fields. It groups together a fixed number of randomly accessible items of different types.

  • The fields in a record can each have a different data type (including the record type itself). For example, you can declare a record type which holds all the values in the "Find" dialog box, including strings, integers, or other kinds of data.

Examples

[-] type PERSON is record
    [ ] STRING sFirstName
    [ ] STRING sLastName
    [ ] INTEGER iAge
Parent topic: Declarations


Method Declaration

Action

Within a window or window class declaration, declares a method.

Syntax

[gui-specifier] [return-type] method-id ([arguments])
statements
Variable | Description
gui-specifier | Optional: Specifies the GUIs that the declaration applies to. See window declaration. If omitted, the method applies to all GUIs.
return-type | Optional: The data type of the value returned by the method, or void (the default) if the method does not return a value.
method-id | An identifier that specifies the name of the method. You can use the same method name in different window or window class declarations.
arguments | Optional: A list of the arguments that the method expects. The syntax for method arguments is the same as that of function arguments. See Function declaration.
statements | The statements that make up the body of the method; they tell the compiler what actions you want the method to perform.

Notes

  • When you declare a method within a window class declaration, the method is available for use in all windows of that class.

  • When you declare a method within a window declaration, the method is available for use only by that window. The method declaration within a window overrides any method of the same name in the window’s class.

  • For examples of declaring methods, see winclass Declaration.

Referring to a Window with the Keyword "this"

When defining methods within a window class declaration, you use the keyword this to refer to the window that the method or property will refer to at runtime.

Deriving a New Method from an Existing Method

To derive a new method from an existing method, you can use the derived keyword followed by the scope resolution operator (::).

The following example defines a GetCaption method for DialogBox that prints the string "Dialog" before calling the built-in GetCaption method (defined in the AnyWin class) and printing its return value:

[-] winclass DialogBox : DialogBox
    [-] GetCaption ()
        [ ] Print ("Dialog")
        [ ] Print (derived::GetCaption ())

Defining "Virtual" Methods

You can define a method as being virtual, which means that the version of the method that is executed is determined at runtime, not at compile time (4Test virtual methods are analogous to virtual member functions in C++). You would want to define a method as virtual if, in a derived class, you want to override a method of a parent class that will be called by another method of the parent class.

You use the virtual keyword to define a virtual method for a class. You only need to use the virtual keyword with the top-level method definition. A derived class can provide its own instance of a virtual method or it can inherit the virtual method from its parent class.

Example

[-] winclass MyWin : AnyWin
    [-] WhatAmI ()
        [ ] Print ("I am a MyWin")
    [ ]
    [-] GetInfo ()
        [ ] WhatAmI ()
    [ ]
[-] winclass MySubWin : MyWin
    [-] WhatAmI ()
        [ ] Print ("I am a MySubWin")
    [ ]
[ ] window MySubWin WinInstance
[-] main ()
    [ ] WinInstance.GetInfo ( )

This prints I am a MyWin, because the call to WhatAmI in GetInfo is resolved at compile time to the implementation of WhatAmI in the MyWin class.

By making WhatAmI a virtual method, resolution of WhatAmI calls are deferred until runtime, as shown in the following example:

[-] winclass MyWin : AnyWin
    [-] virtual WhatAmI ()
        [ ] Print ("I am a MyWin")
    [ ]
    [-] GetInfo ()
        [ ] WhatAmI ()
    [ ]
[-] winclass MySubWin : MyWin
    [-] WhatAmI ()
        [ ] Print ("I am a MySubWin")
    [ ]
[ ] window MySubWin WinInstance
[-] main ()
    [ ] WinInstance.GetInfo ( )

This prints I am a MySubWin because the version of WhatAmI is determined at runtime, when the class of object calling WhatAmI can be identified as a MySubWin, so the MySubWin version of WhatAmI is used.

Parent topic: Declarations
Related reference
Function Declaration
AnyWin Class


type ... is set declaration

Action

Declares a set data type. Data type declarations must appear outside of any function.

Syntax

[scope] type set-name is set
set-value-list
Variable | Description
scope | Optional: Either public (the default) or private. Private declarations are available only in the file in which they occur. Public declarations can be accessed from other files via a use statement.
set-name | An identifier that names the set type being declared.
set-value-list | All the possible values that can make up a set object. See the example and notes below.

Notes

  • A SET data type is an enumeration of all the values that can be held in a variable of type SET. Thus variables of type COLORS, the SET data type declared in the example below, can hold any of six values plus other variables of type COLORS. The word "SET" is a generic name for all the data types you declare with the type...is set declaration. A SET variable never holds duplicate values. A LIST variable can be converted to and from a SET variable; please see Type cast operator for more information.

  • The SET data type is case sensitive; that is, "red" and "RED" are distinct and can both be valid members of a single set.

Example

[-] type COLORS is set
    [ ] Red
    [ ] Blue
    [ ] Yellow
    [ ] Green
    [ ] Purple
    [ ] Orange
Parent topic: Declarations
Related reference
type ... is Declaration
type ... is enum Declaration
type ... is record Declaration
Set Operator
List/Array/Set Constructor Operator


Testcase Declaration

The syntax for declaring a test case function is similar to the syntax for other function declarations, but is preceded by the testcase keyword. For additional information, see Function Declaration.

Parent topic: Declarations
Related reference
Function Declaration


Variable Declaration

Action

Declares a variable.

Syntax

[scope] [share] data-type variable-id [ = expr ] [, variable-id [ = expr]] ...
Variable | Description
scope | Optional: Either public (the default) or private. Private declarations are available only in the file in which they occur. Public declarations can be accessed from other files through a use statement. You can specify the scope only if the declaration is global, which means that the declaration is not located within a function, a window, or a winclass declaration.
share | Optional: Indicates that the variable is shared by multiple threads. Access to shared variables is controlled with the access statement.
data-type | The data type of the variable.
variable-id | An identifier that specifies the name of the variable.
expr | Optional: An expression that evaluates the initial value of the variable. The value must be compatible with the type of the variable. If you try to use a variable before the value of the variable is set, 4Test raises an exception.

Notes

  • To pass global variables between .t files in a project, declare the variables in the frame.inc file of the project.
  • If your scripts spawn multiple threads for parallel processing, keep in mind that all threads have equal access to global variables. To prevent multiple threads modifying a variable at the same time, declare the variable as shared, using the share keyword. A thread can request access to shared variables using the access statement.
  • Concurrent access to a local variable or a non-shared global variable by parallel threads might generate unpredictable results. Use shared variables wherever the potential for conflict exists.

Examples

[ ] INTEGER iTestNum = 0
[-] LIST OF STRING lsTerriers = {...}
    [ ] "Airedale"
    [ ] "Irish"
[ ] BOOLEAN bDone = FALSE, bFound = FALSE
[ ] public ARRAY[7] OF STRING asWeekDay
[ ] ANYTYPE aWhoKnows
[-] type NAME is record
    [ ] STRING sFirst
    [ ] STRING sLast
[-] NAME Name = {...}
    [ ] "Maxwell"
    [ ] "Smart"
Parent topic: Declarations
Related reference
Access Statement
ARRAY Data Type
LIST Data Type


winclass Declaration

Action

Declares a window class for an application-specific window or control.
Note: Window class declarations must appear outside of any function.

Syntax

[scope] winclass wclass-id [ : derived-class]
statements
Variable | Description
scope | Optional: Either public (the default) or private. Public declarations can be accessed from other files via a use statement. Private declarations are available only in the file in which they occur; you typically do not declare private window classes.
wclass-id | An identifier specifying the name of the window class. This is the name you use to identify the class when you declare windows of that class.
derived-class | Optional: An identifier specifying an existing window class on which you want to base the new class. The new class inherits all the window tags, variables, child window declarations, methods, and properties from the derived-class. Alternatively, if derived-class is the same as wclass-id and specifies an existing class, the statements extend the existing class definition.
statements | Can include specification of a default window tag, and declarations for child windows, attributes, variables, methods, and properties.

Notes

  • Window classes for all the standard GUI objects are declared in the window class library, located in the file winclass.inc.

  • By declaring child windows in the window class declaration, all instances of that class are created with those child windows. Similarly, by declaring methods, properties, and variables in the window class declaration, you can use those methods, properties, and variables on all instances of that class.

  • You cannot extend a winclass that is defined in the same file, or in a file that is explicitly included in your file through the use statement. The original winclass definition must be in a separate .inc file that is included in the Runtime Options Use Files text box, or that is shipped with Silk Test Classic. You cannot extend AnyWin, Control or MoveableWin classes. They are logical (virtual) classes that do not correspond to any actual GUI objects, but instead define methods common to the classes that derive from them. For additional information, see Cannot extend AnyWin, Control, or MoveableWin Classes.

Derived Class

You have the option of deriving your new class from built-in classes or other user-defined classes. When you declare a class that is derived from another class, your class inherits the other class’s properties and methods. However, those methods and properties were implemented for the original class, and may not work with your new class. The custom class must truly be derived from, or at least must respond to the messages of, the derived from class in order for the derivation to be beneficial. Otherwise you will have to override the inherited methods and properties by reimplementing them in the new class declaration. You can also add additional methods and properties to your new class.

If you derive a class in one environment from a class for another environment, then the derived methods and properties may not work for the new class. For example, if you have a custom ActiveX or Java textfield, deriving it from TextField may work for SetText() if SetText() uses keystrokes (TypeKeys()), but probably will not work for GetText().

Declaring Child Windows

The syntax for declaring a child window within a window class declaration is the same as that used within a window declaration. See window Declaration.

Declaring Variables

The syntax for declaring variables within a window class declaration is the same as that used within a window declaration. See window Declaration.

Declaring Methods and Properties

You declare methods and properties for a new class within the class declaration. See Method Declaration and Property Declaration.

Declaring Attributes

The attributes associated with a window class are used by the GetEverything and VerifyEverything methods to get and verify information about a window. For additional information, see attribute Declaration.

Using Class-Specific Multiple-Tag Recording Options

By default, the Agent uses the multiple tags specified in the Record Declarations dialog box for all classes when recording and playing back. You can override which tags the Agent uses for a particular class using the setting statement. Anywhere within the winclass declaration for the class, include the following statement:
setting MultiTags = { tag-type[, tag-type]…}
where tag-type can be TAG_CAPTION, TAG_PRIOR_LABEL, TAG_INDEX, TAG_WINDOW_ID, or TAG_LOCATION.
For example, the following code fragment:
[-] winclass MyList : RadioList
    [ ] setting MultiTags = {TAG_CAPTION}
tells the agent to use only the Caption tag for the MyList class.

Controlling Which Window Class is Recorded

The default behavior of Silk Test Classic is to tag all instances of the parent class as the new class. So, if you record a window declaration against a standard object from which you have defined a new class, Silk Test Classic records that standard object’s class as the new class.

As long as there is no tag included in the declaration of the new class, you can have all instances declared by default as the original class. To do so, add the following statement to the declaration of your new class:

setting DontInheritClassTag = TRUE

Since the presence of a tag for the class will override the DontInheritClassTag setting, however, the following declaration would cause a dialog box to be declared as a FileDialog, not a DialogBox:

[-] winclass FileDialog : DialogBox
    [ ] tag "[DialogBox]"
    [ ] setting DontInheritClassTag = TRUE
If the base class of a new winclass is itself declared in a winclass declaration, then the same criteria will apply. For example, the addition of the following declaration to the example above would cause a dialog box to be declared as FileDialog:
[-] winclass SpecialFileDialog : FileDialog
    [ ] setting DontInheritClassTag = TRUE
Adding the following line:
tag "[DialogBox]"
to the declaration of SpecialFileDialog would cause a dialog box to be declared as SpecialFileDialog.

For example, assume you define a new class called FileDialog and derive it from the DialogBox class. Then you record a window declaration against a dialog box. Silk Test Classic records the dialog box to be of the new FileDialog class, instead of the DialogBox class.

To have Silk Test Classic declare the dialog box’s class as DialogBox, in the FileDialog definition, set DontInheritClassTag to TRUE. For example:
[-] winclass FileDialog : DialogBox
    [ ] setting DontInheritClassTag = TRUE

Examples

[-] winclass NewPushButton : PushButton
    [ ] property sLabel
    [-] STRING Get ()
        [ ] return (GetCaption ())
[-]   STRING GetLabel ()
        [ ] return (GetCaption ())
    [ ]
[-] winclass NewDialogBox : DialogBox
    [-] NewPushButton OK
        [ ] tag "OK"
    [-] NewPushButton Cancel
        [ ] tag "Cancel"
    [-] NewPushButton No
        [ ] tag "No"
    [-] NewPushButton Yes
        [ ] tag "Yes"
    [-] NewPushButton FindNext
        [ ] tag "Find Next"
    [-] void Tab (INTEGER iTimes optional)
        [ ] // declare method that tabs x times in dialog box
        [-] if (iTimes == NULL)
            [ ] iTimes = 1
        [ ] TypeKeys ("<tab {iTimes}>")
Parent topic: Declarations
Related reference
Attribute Declaration
Parent Statement
Multitag Statement
window Declaration
Cannot Extend AnyWin, Control, or MoveableWin Classes


window Declaration

Action

Uniquely identifies an object in the graphical user interface.

Note: Window declarations must appear outside of any function.

Syntax

[scope] window win-class win-id
statements
Variable | Description
scope | Optional: Either public (the default) or private. Private declarations are available only in the file in which they occur. Public declarations can be accessed from other files by means of a use statement.
win-class | An identifier specifying the name of a 4Test window class (defined in winclass.inc) or a user-defined window class.
win-id | An identifier specifying the name you want to use to refer to the window.
statements | The statements that make up the window declaration. These include a required tag statement, and optional variable declarations, parent statements, declarations for child windows, method definitions, and property definitions.

Notes

  • Window declarations uniquely identify each window in a graphical user interface. You need not write window declarations yourself, because Silk Test Classic generates them for you. However, you are free to make changes to the window declarations that Silk Test Classic generates.

  • Commands you use in a 4Test script to manipulate GUI objects are of the form:
    TextEditor.File.New.Pick ()

  • To find the correct object to Pick, Silk Test Classic must be able to construct a unique path to the object at runtime, by using information contained in the window declarations for the application.

Components of a Window Declaration

A window declaration uniquely identifies an object by providing this information:

  • The class of the object.

  • The identifier of the object; this is the name you use to refer to the object in your 4Test scripts.

  • The tag of the object; this is the name which 4Test uses internally to refer to the object.

  • Optional: The parent window of the window.

  • Optional: The child windows of the window.

  • Optional: The methods and properties of the window. They are unique to the window; that is, they are not inherited from the class.

Declaring Child Windows

You declare a child window by writing its declaration as one of the statements inside the parent window's declaration. A child window declaration has this form:

[gui-specifier] class-id window-id
statements
Variable | Description
gui-specifier | Optional: Specifies the GUIs that the child window applies to. See "GUI specifiers" below. If omitted, the child window applies to all GUIs.
class-id | An identifier specifying the name of a 4Test window class, which is defined in winclass.inc, or a user-defined window class.
window-id | An identifier specifying the name of the child window.
statements | The statements that define the child window. These include a required tag statement, and optional variable declarations, method definitions, and property definitions

You cannot use a parent statement within a the declaration of a child window. The parentage of the window is implicitly known to Silk Test Classic because the declaration is physically contained within the declaration for the parent window.

Declaring Methods and Properties

You can declare methods and properties for a new window within the window declaration or within its window class declaration. See Method declaration and the property declaration.

GUI Specifiers

You have the option to use a GUI specifier with any statement in a window declaration. The GUI specifier indicates that the specified statement applies only when the application is running under the indicated GUI or GUIs.

The syntax for GUI specifiers is of the following form:
[ [gui-type [, gui-type]]| [! gui-type]]
Variable | Description
gui-type | A GUI type. If you do not specify gui-type, the specified portion of the window declaration applies to all GUIs.
For example, the following are two mutually-exclusive ways to specify GUI types for a tag statement:
  • The tag statement applies to one or more GUIs, separated by commas:
    msw2003, mswnt tag "my-tag-string"
  • The tag statement applies to all but one GUI:
    ! mswnt tag "my-tag-string"
Note: The reference entry for the GUITYPE data type lists the available GUI types.

Declaring Variables

You can place variable declarations inside window declarations. The variables can be used anywhere an expression is allowed.

The syntax of a variable declaration in a window declaration is of the following form:
[gui-specifier] data-type var-id [ = expr ] [, var-id [ = expr ]]...
Variable | Description
gui-specifier | Optional: Specifies the GUIs that the variable declaration applies to. For additional information, see GUITYPE Data Type. If omitted, the declaration applies to all GUIs.
data-type | The data type.
var-id | An identifier that refers to the variable.
expr | An optional expression that evaluates to the initial value you want to give the variable. The value must be compatible with the type of the variable. You must initialize the variable either in the window declaration or before you use it in your script. If you try to reference the value of a variable before its value is set, 4Test raises an exception.

The following example shows how you can declare variables within a window declaration:

[-] window DialogBox Find
    [ ] INTEGER x = 0
    [ ] BOOLEAN bDone = FALSE, bFound = FALSE
    [ ] // ...

You reference the value of the variables of a window by using the member of operator (.). For example, here are two ways of referencing the window variable x of the Find dialog box:

Find.x = 5 // Assigns INTEGER value 5 to variable x
foo = Find.x // Assigns to foo the value of x

Example

[-] window DialogBox Find
    [ ] tag "Find"
    [ ] parent TextEditor
    [ ] WINDOW wInvoke = TextEditor.Search.Find
    [-] StaticText FindWhatText
        [ ] tag "Find What:"
    [-] TextField FindWhat
        [ ] tag "Find What:"
    [-] CheckBox CaseSensitive
        [ ] tag "Case sensitive"
    [-] StaticText DirectionText
        [ ] tag "Direction"
    [-] PushButton FindNext
        [ ] tag "Find Next"
    [-] PushButton Cancel
        [ ] tag "Cancel"
    [-] RadioList Direction
        [ ] tag "Direction"
Parent topic: Declarations
Related reference
Invoke Method (ChildWin DialogBox MainWin)
Parent Statement
Tag Statement
GUITYPE Data Type


C Data Types for DLL Functions

In addition to the 4Test data types, Silk Test Classic supports the following C data types for use in calling functions in DLLs:
Correspond to 4Test INTEGER data type |  | Correspond to REAL data type
char | unsigned char | float
int | unsigned int | double
short | unsigned short |
long | unsigned long |

The first two columns above show data types that correspond to the 4Test INTEGER data type. The third column corresponds to the REAL data type.

Parent topic: Declarations


Web Application Window Declarations

Lists the Web application window declarations.

  • Browser Window Declaration
    Browser is a window declaration that declares objects that are shared by all Web browsers, for example the Back button on the toolbar.
  • BrowserAuthentication Window Declaration
    A Silk Test Classic window declaration that declares the dialog used by all Web browsers to solicit a user name and password before the user of the Web application can continue.
  • BrowserErrorPage Window Declaration
    A Silk Test Classic window declaration that declares the error message page that displays in your Web browser when there is an error accessing a page and you are going through a proxy server.
  • BrowserMessage Window Declaration
    A Silk Test Classic window declaration that declares the standard message box used by all Web browsers.
  • BrowserPage Window Declaration
    A Silk Test Classic window declaration that you can use to identify a browser page that has not been specifically declared.
  • BrowserPageNotFound Window Declaration
    A Silk Test Classic window declaration that declares the page that displays in your Web browser when the browser cannot find a page and you are going through a proxy server.
  • BrowserSecurityInfo Window Declaration
    A Silk Test Classic window declaration that declares the dialog box used by Web browsers to indicate a security issue.
  • BrowserWarning Window Declaration
    A Silk Test Classic window declaration that declares the message box used by Web browsers to display a warning.
  • Explorer Window Declaration
    A Silk Test Classic window declaration that declares objects that are unique to the Internet Explorer browser.
Parent topic: The 4Test Language


Browser Window Declaration

Description

Browser is a Silk Test Classic window declaration that declares objects that are shared by all Web browsers, for example the Back button on the toolbar. Objects that are unique to each browser are declared in a separate window declaration.

Class

Browser is in the MainWin class.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Declared Objects

The Browser window declaration in browser.inc in the Extend directory includes the following objects:

  • Cut, Copy, Paste, and Select All items on the Edit menu.
  • The following toolbar buttons:
    • Back
    • Forward
    • Home
    • Reload
    • Stop
  • The Location combo box, which lists the current URL.
  • The Web browser's status bar, which is an object of class StatusBar named Status. It contains a DynamicText object named Message. So to access the status bar, you use the object Browser.Status.Message.

Property

The Browser window declares one property:

Property | Type | Description
sCmdLine | STRING | The command line used to start the browser.

Methods

The window declaration declares the following methods:

  • ClearCache Method (BrowserChild)
    Clears both disk memory and memory from the currently loaded page.
  • CloseOthers Method
    Closes all instances of the current browser except the topmost one.
  • CloseOtherTabs Method
    Tries to close all tabs in the browser window except the active one.
  • GetActive Function (Browser)
    Returns the window identifier of the currently loaded page (BrowserChild).
  • GetReadyTime Function
    Returns the number of seconds it took the application to become ready.
  • GetRealBrowser Function
    Returns the window identifier of the browser-specific declaration.
  • Invoke Method (Browser)
    Invokes the browser.
  • LoadPage Method
    Loads the specified page.
  • Navigate Method (BrowserWindow)
    Navigates the main document to a URL.
  • SetBrowserSize Method
    Sizes the browser window.
  • SetDefaultFont Method
    Sets the fonts to the shipped defaults for the browser.
  • SetRequiredOptions Method
    Configures browsers appropriately for testing with Silk Test Classic.
  • StopLoading Method
    Stops the browser from loading the current page.
  • WaitForReady Method
    Waits the specified amount of time for the browser to become ready.
Parent topic: Web Application Window Declarations
Related reference
DynamicText Class
MainWin Class
StatusBar Class
Explorer Window Declaration


ClearCache Method (BrowserChild)

Class

BrowserChild.

Action

Clears both disk memory and memory from the currently loaded page.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

ClearCache ()

Notes

For Internet Explorer, ClearCache() clears temporary internet files. It does not clear or delete cookies.

Example

ClearCache(PREFOPT_CLEARDISK)
Parent topic: Browser Window Declaration


CloseOthers Method

Window

CloseOthers is declared for the Browser window.

Action

Closes all instances of the current browser except the topmost one.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

browser.CloseOthers ( )

Example

 Browser.CloseOthers ()
Parent topic: Browser Window Declaration


CloseOtherTabs Method

Window

CloseOtherTabs is declared for the Browser window.

Action

Tries to close all tabs in the browser window except the active one.

Availability

This class is supported only on the Classic Agent.

Syntax

browser.CloseOtherTabs ( )

Example

Browser.CloseOtherTabs ()
Parent topic: Browser Window Declaration


GetActive Function (Browser)

Window

GetActive is declared for the Browser window.

Action

Returns the window identifier of the currently loaded page (BrowserChild).

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

window = browser.GetActive ()
Variable | Description
window | The window identifier. WINDOW.

Notes

GetActive returns "BrowserPage" if there is no window declaration for the page.

Example

This example uses the home page of the GMO Web application, which is declared with the identifier GMO.

WINDOW myWin
myWin = Browser.GetActive ()
Print (myWin)

// Result:
// GMO
Parent topic: Browser Window Declaration


GetReadyTime Function

Class

GetReadyTime is declared for the Browser window.

Action

Returns the number of seconds it took the application to become ready.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

rSeconds = object.GetReadyTime ( )
Variable | Description
rSeconds | The number of seconds. REAL.

Notes

For this function to have any effect, the Agent must be able to determine when your application is ready. With Web applications, the Agent considers the application ready when the current page has completed loading, which the Agent can determine.

Example

REAL rSec
Browser.LoadPage ("http://www.borland.com")
rSec = Browser.GetReadyTime ()
Print ("Ready time: {rSec} seconds")

// Result:
// Ready time: 2.002000 seconds
Parent topic: Browser Window Declaration


GetRealBrowser Function

Class

GetRealBrowser is declared for the browser window.

Action

Returns the window identifier of the browser-specific declaration; uses the current browser type.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

window = browser.GetRealBrowser ( )
Variable | Description
window | The window identifier. WINDOW.

Example

WINDOW myWin
myWin = Browser.GetRealBrowser ()
Print (myWin)

// Result if Windows Internet Explorer is currently being used:
// Explorer
Parent topic: Browser Window Declaration


Invoke Method (Browser)

Window

Invoke is declared for the Browser window.

Action

Invokes the browser.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

browser.Invoke ( )

Notes

The Invoke method invokes the currently defined browser, either the browser specified in Runtime options or the browser specified by SetBrowserType or SetDefaultBrowserType.

On 32-bit platforms, Invoke gets the path of the browser executable from the Registry.

Example

The following invokes the currently defined browser.

Browser.Invoke ()
Parent topic: Browser Window Declaration


LoadPage Method

Class

LoadPage is declared for the Browser window.

Action

Loads the specified page.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

browser.LoadPage (blLocation [, sUser, sPassword])
Variable | Description
blLocation | The URL of the page to load. BROWSERLOCATION.
sUser | Optional. The user name. STRING.
sPassword | Optional. The password. STRING.

Notes

As part of its normal operation, LoadPage calls the OnLoadPage method, which checks for and handles windows invoked by LoadPage operations, for example, authentication dialogs, security dialogs, and browser messages and warnings.

BROWSERLOCATION is the union of the STRING and WINDOW data types.

Passing in a string as blLocation

If blLocation is a string, LoadPage calls the OnLoadpage method and passes the string to it as the first argument, sLocation, along with values for sUser and sPassword, if these were specified.

Passing in a window as blLocation

The main benefit of passing in a window to the LoadPage method is that it gives you the opportunity to customize the loading of a browser page. You accomplish this by defining your own OnLoadPage method for the window. You might want to redefine OnLoadPage, for example, to bypass unwanted windows that pop up before the desired page appears, such as sound clips or videos.

Note that in order to pass in a window as the value of blLocation, the window declaration must define a member or property, sURL, which specifies the URL to load. In this sense, passing in a window is equivalent to passing in a string as the value of blLocation.

The LoadPage method calls your custom OnLoadPage method and passes to it the definition of the window’s sURL as the first argument, sLocation. In addition, LoadPage passes for sUser and sPassword if these were specified.

If the page cannot be loaded, the AppError function is called.

Example

To display the Micro Focus home page, you can pass in a string.

Browser.LoadPage ("www.microfocus.com")

or pass in a window:

Browser.LoadPage (MicroFocusMain)
Parent topic: Browser Window Declaration


SetBrowserSize Method

Window

SetBrowserSize is declared for the browser window.

Action

Sizes the browser window.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

browser.SetBrowserSize (iWidth, iHeight)
Variable | Description
iWidth | The new width of the browser window, in pixels. INTEGER.
iHeight | The new height of the browser window, in pixels. INTEGER.

Notes

SetBrowserSize sizes the browser window, moving it if necessary to establish the specified size. If the window cannot be sized as specified, Silk Test Classic issues a warning, but lets the test case proceed.

This method is called automatically by the recovery system (in the DefaultBaseState function) if the main page of your application has the constant BrowserSize defined and set, in which case the width and height defined for BrowserSize are passed automatically to SetBrowserSize.

By default, when you generate a test frame, the declaration for BrowserSize is commented out. If you want the recovery system to resize the browser window, un-comment the declaration in your test frame and provide appropriate values. Having the recovery system set the size of the browser window ensures maximum portability of your window declarations in different testing sessions and between browsers.

You can also call SetBrowserSize manually in a test case.

Example

The following code fragment sets the browser to take up about half the width and most of the height on the desktop on a screen with resolution set at 1280 by 1024.

Browser.SetActive ()
Browser.SetBrowserSize (650, 900)
Parent topic: Browser Window Declaration


SetDefaultFont Method

Window

SetDefaultFont is declared for the Browser window.

Action

Sets the fonts to the shipped defaults for the browser.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

browser.SetDefaultFont ( )

Notes

SetDefaultFont sets the fonts to the defaults that are shipped with the browser, as follows:

Browser | Action by SetDefaultFont
Internet Explorer | Sets the font size to Medium.
Mozilla Firefox | For the variable-width font, sets the serif font to 16-point Times New Roman and sets the Sans Serif font to 16-point Tahoma. Sets the fixed-width font to 10-point Courier New.

This method is called automatically by the recovery system (in DefaultBaseState) if your application’s main page has the constant bDefaultFont declared and set to TRUE.

By default, when you generate a test frame, the declaration for bDefaultFont is commented out. If you want the recovery system to set the fonts, uncomment the declaration and assign it the value TRUE. Having the recovery system set the fonts to the defaults ensures maximum portability of your window declarations in different testing sessions and between browsers.

You can also call the method manually.

Example

Browser.SetActive ()
Browser.SetDefaultFont ()

// Result:
// Fonts are set to the defaults.
Parent topic: Browser Window Declaration


SetRequiredOptions Method

Window

SetRequiredOptions is declared for the Browser window.

Action

Configures browsers appropriately for testing with Silk Test Classic.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

browser.SetRequiredOptions ( )

Silk Test Classic requires that browsers be configured as follows:

  • Disable "friendly URLs" (for Internet Explorer only).
  • Enable underlining of links.
  • Display toolbar.
  • Display address bar.

SetRequiredOptions() sets:

  • For Internet Explorer: All of the options.
  • For Mozilla Firefox: only the option to enable underlining of links.

Other options must be set manually, since they are required for Silk Test Classic to operate properly.

The method is called automatically by the recovery system (in DefaultBaseState). You do not need to call this method manually unless you are not using the recovery system and want to ensure that your browser is configured correctly.

Example

Browser.SetActive ()
Browser.SetRequiredOptions ()

// Result:
// Browser is configured correctly for Silk Test Classic.
Parent topic: Browser Window Declaration


StopLoading Method

Window

StopLoading is declared for the browser window.

Action

Stops the browser from loading the current page.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

browser.StopLoading ( )

Notes

The method works by clicking the Stop button on the toolbar. The method will fail if the tool bar is not displayed.

If you start a search and then use the StopLoading method it may appear as if the StopLoading method is not working as it should. This is because the browser runs in a separate process from the search process and the search results can return faster than the mouse click occurs.

Example

Browser.StopLoading ()
Parent topic: Browser Window Declaration


WaitForReady Method

Class

WaitForReady is declared for the browser window.

Action

Waits the specified amount of time for the browser to become ready. The WaitForReady method is needed only before Browser or BrowserChild methods are called.

Availability

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Syntax

rSeconds = object.WaitForReady ([rTimeout])
Variable | Description
rSeconds | The number of seconds the application took to be ready. REAL.
rTimeout | Optional. The number of seconds to wait. If not specified, uses the value set in OPT_APPREADY_TIMEOUT. REAL.

Notes

The browser is considered ready when all of the components in the page have been downloaded. Note that the WaitForReady method is needed only before Browser or BrowserChild methods are called. All methods on HTML classes automatically wait for the document to be completely downloaded.

Although Browser.WaitForReady() waits for page components to be downloaded, it does not necessarily wait for them to be rendered. Therefore if your page is slow to render (for example, due to slow JavaScript execution) and you receive Window not found exceptions, it is recommended that you call w.Exists(n) before trying to manipulate objects on the page, where w is a slow-loading object on the page, and n is a timeout at least as long as it should ever take to load that object. Note that w.Exists(n) will return when w is detected, even if that is long before the timeout specified by n, so there is no penalty in setting a large n unless w is never actually rendered.

Do not set the timeout lower than 3. If you set the timeout too low, then Silk Test Classic will not raise an exception. If you need to enforce a short timeout for the browser to become ready, then check the return value (rSeconds) and raise an exception if it is too large.

Example

BrowserPage.HtmlLink{"Go to next page").Click()
Browser.WaitForReady()
ResPrintList ("Links on page '{BrowserPage.GetCaption ()}'", BrowserPage.GetLinks ())
Parent topic: Browser Window Declaration


BrowserAuthentication Window Declaration

Description

BrowserAuthentication is a Silk Test Classic window declaration that declares the dialog used by all Web browsers to solicit a user name and password before the user of the Web application can continue.

Class

BrowserAuthentication is of class DialogBox.

Declared Objects

See browser.inc in the Extend directory.

Example

The following code fragment checks to see whether a BrowserAuthentication window is displaying; if so the user name and password is entered and the window is dismissed.

[-] if (BrowserAuthentication.Exists ())
    [ ] BrowserAuthentication.UserName.SetText (sUserName)
    [ ] BrowserAuthentication.Password.SetText (sPassword)
    [ ] BrowserAuthentication.OK.Click ()
Parent topic: Web Application Window Declarations
Related reference
BrowserMessage Window Declaration
BrowserSecurityInfo Window Declaration


BrowserErrorPage Window Declaration

Description

BrowserErrorPage is a Silk Test Classic window declaration that declares the error message page that displays in your Web browser when there is an error accessing a page and you are going through a proxy server. Such a page is typically displayed when you specify a URL that cannot be accessed.

Note: This window is only used if you are going through a proxy server. If you are not going through a proxy server, the browser displays its own dialog if an error occurs.

By default, Silk Test Classic recognizes any page, whose title contains the string "Error", as a BrowserErrorPage. This means that Silk Test Classic recognizes a window, whose tag is *Error*, as a BrowserErrorPage. If you have valid Web pages whose title contains "Error", you can change the definition of BrowserErrorPage in the browser.inc file in the Extend directory of your Silk Test Classic installation folder. For example, you could change the tag for BrowserErrorPage to be "Error*", in which case Silk Test Classic would only see as a BrowserErrorPage a page whose title begins with "Error".

Class

BrowserErrorPage is of class BrowserChild.

Example

The following checks to see whether a BrowserErrorPage window is displaying; if so, the AppError function is called.

[-] if (BrowserErrorPage.Exists ())
    [ ] AppError ("Unable to load '{sLocation}' -- {BrowserErrorPage.sCaption}")
Parent topic: Web Application Window Declarations
Related reference
BrowserPage Window Declaration
BrowserPageNotFound Window Declaration
AppError Function


BrowserMessage Window Declaration

Description

BrowserMessage is a Silk Test Classic window declaration that declares the standard message box used by all Web browsers.

Class

BrowserMessage is of class DialogBox.

Declared Objects

See browser.inc in the Extend directory.

Example

The following checks to see whether a BrowserMessage window is displaying; if so, the message in the window is printed and the AppError function is called.

[-] if (BrowserMessage.Exists ())
    [ ] BrowserMessage.PrintMessage ()
    [ ] AppError ("Unable to load '{sLocation}'")

Method

The window declaration declares the following method:

  • PrintMessage Method
    Prints the message in the message box.
Parent topic: Web Application Window Declarations
Related reference
AppError Function
BrowserSecurityInfo Window Declaration
BrowserWarning Window Declaration
BrowserAuthentication Window Declaration


PrintMessage Method

Window

PrintMessage is declared for the BrowserMessage window.

Action

Prints the message in the message box.

Syntax

dialog.PrintMessage ( )

Example

BrowserMessage.PrintMessage ()

 // Result if the "OK to overwrite" message box is displayed:
 // d:\htm\ord.htm
 // This file already exists.
 //
 // Replace existing file?
Parent topic: BrowserMessage Window Declaration


BrowserPage Window Declaration

Description

BrowserPage is a Silk Test Classic window declaration that you can use to identify a browser page that has not been specifically declared.

Class

BrowserPage is of class BrowserChild.

Notes

Typically you will declare pages in your application that you test a lot so you can customize the identifiers, perhaps write some methods for those pages, and so on. To reference these pages, you use the identifier you gave to the page.

However, there will also be pages that you do not feel the need to declare. To reference these pages, use BrowserPage as the identifier.

Example

The following prints all child objects of the current browser page, regardless of whether the specific page has a window declaration or not.

ListPrint (BrowserPage.GetChildren ())
Parent topic: Web Application Window Declarations
Related reference
Browser Window Declaration
BrowserErrorPage Window Declaration


BrowserPageNotFound Window Declaration

Description

BrowserPageNotFound is a Silk Test Classic window declaration that declares the page that displays in your Web browser when the browser cannot find a page and you are going through a proxy server. Such a page is typically displayed when you specify a URL that cannot be accessed.

Note: This window is only used if you are going through a proxy server. If you are not going through a proxy server, the browser displays its own dialog if such an error occurs.

By default, Silk Test Classic sees as a BrowserPageNotFound any page whose title contains the string "Not Found", which means a window whose tag is *Not Found*. If you have valid Web pages whose title contains "Not Found", you can change the definition of BrowserPageNotFound in the browser.inc file in the Extend directory of your Silk Test Classic installation folder.

Class

BrowserPageNotFound is of class BrowserChild.

Example

The following checks to see whether a BrowserPageNotFound window is displaying; if so, the AppError function is called.

[-] if (BrowserPageNotFound.Exists ())
    [ ] AppError ("Unable to load '{sLocation}' -- {BrowserPageNotFound.sCaption}")
Parent topic: Web Application Window Declarations
Related reference
BrowserErrorPage Window Declaration
BrowserPage Window Declaration


BrowserSecurityInfo Window Declaration

Description

BrowserSecurityInfo is a Silk Test Classic window declaration that declares the dialog box used by Web browsers to indicate a security issue. Most commonly this dialog box is displayed when the user of a Web application is about to send information over the Internet and is warned about the security implications.

Class

BrowserSecurityInfo is of class DialogBox.

Declared Objects

See browser.inc in the Extend directory.

Example

The following code checks to see whether a BrowserSecurityInfo window is displaying; if so, the Continue button of the window, Yes in Internet Explorer, is clicked.

[-] if (BrowserSecurityInfo.Exists ())
    [ ] BrowserSecurityInfo.Continue.Click ()
Parent topic: Web Application Window Declarations
Related reference
BrowserAuthentication Window Declaration
BrowserMessage Window Declaration


BrowserWarning Window Declaration

Description

BrowserWarning is a Silk Test Classic window declaration that declares the message box used by Web browsers to display a warning. For Silk Test Classic, that means any dialog whose caption contains the word "Warning".

Class

BrowserWarning is of class DialogBox.

Declared Objects

BrowserWarning contains two buttons: Continue and Cancel. For more information, see browser.inc in the Extend directory.

Example

The following checks to see whether a BrowserWarning window is displaying; if so, it clicks the Continue button.

[-] if (BrowserWarning.Exists ())
    [ ] BrowserWarning.Continue.Click ()
Parent topic: Web Application Window Declarations
Related reference
BrowserAuthentication Window Declaration
BrowserMessage Window Declaration
BrowserSecurityInfo Window Declaration


Explorer Window Declaration

Description

Explorer is a Silk Test Classic window declaration that declares objects that are unique to the Internet Explorer browser. It excludes objects that are shared by all browsers; those objects are declared in the Browser window declaration.

Class

Explorer is of class MainWin.

Declared Objects

The Explorer window declaration, located in explorer.inc in the Extend directory of Silk Test Classic, includes the following objects:

  • Menus specific to Internet Explorer.
  • The sCmdLine property, which specifies how to start Internet Explorer.
  • Toolbar buttons specific to Internet Explorer.
  • StatusBar with text areas specific to Internet Explorer.
  • Implementations of the Browser window's methods that are specific to Internet Explorer, such as ClearCache, Invoke, SetRequiredOptions, and SetDefaultFont.
  • Dialog boxes specific to Internet Explorer; all the dialog box names begin with IE_.

For additional information, refer to the explorer.inc file.

Example

The following sample code clicks the Favorites toolbar button, which is specific to Internet Explorer.

Explorer.FavoritesMenu.Click ()

Notes for Silk Test Classic Support of Internet Explorer

  • On Internet Explorer 7.1, if you make a selection from an HtmlPopupList twice in a row, Silk Test Classic does not record the first selection, but records the second selection twice.
  • On Internet Explorer 7.x, when recording a new frame file using Set Recovery System, by default Silk Test Classic does not explicitly state that the parent of the window is a browser. To resolve this issue, add the parent Browser line to the frame file.
  • JavaJFCRadioButton.HasFocus() does not work properly on Internet Explorer 7.
  • DoubleSelect() does not work properly with Internet Explorer 7.
  • If you notice a performance decrease with the browser when Silk Test Classic is not running, click Tools > Manage AddOns in Internet Explorer. Choose QAPHlprObjClass from the Enabled list and click the Disabled option button in the Settings group box. Click OK to save the change.
Parent topic: Web Application Window Declarations
Related reference
MainWin Class
ClearCache Method (BrowserChild)
Invoke Method (Browser)
SetRequiredOptions Method
SetDefaultFont Method


Data Types

This section lists the data types that are available in 4Test.
  • Core Data Types
    Includes the core data types used by 4Test.
  • .Net Data Types
    Includes the data types specific for .NET
Parent topic: The 4Test Language
Related reference
Declarations
Built-in Constants


Core Data Types

This section includes the core data types used by 4Test.

  • Data Type Ranges
    This topic describes the range of valid values for the core built-in 4Test data types.
  • AGENTOPTION Data Type
    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.
  • AGENTSWITCH Data Type
    Describes the AGENTSWITCH data type.
  • ALIGNMENT Data Type
    Defines the alignment for a label or text field.
  • ANYTYPE Data Type
    Describes the ANYTYPE data type.
  • APPID Data Type
    An identification code that uniquely identifies a process.
  • ARRAY Data Type
    Used to declare an array variable.
  • BOOLEAN Data Type
    A variable of type BOOLEAN stores either TRUE or FALSE.
  • BROWSERLOCATION Data Type
    The alias data type for the string or window that identifies a browser page.
  • BROWSERTYPE Data Type
    Lists the most commonly used browser specifiers.
  • CALL Data Type
    One entry in a CALL_LIST data type.
  • CALL_LIST Data Type
    The data type returned by the ExceptCalls function.
  • CLICKTYPE Data Type
    Describes the CLICKTYPE data type.
  • COLOR Data Type
    Describes the RGB values of a color, as returned by the GetBackgroundColor method.
  • CURSOR Data Type
    A data type that identifies the kind of cursor represented by an instance of the CursorClass class.
  • DATACLASS Data Type
    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.
  • DATASETSIZES Data Type
    Describes the units for a byte-based size value, such as for disk free space or file size.
  • DATATYPE Data Type
    The legal values of the DATATYPE type are the names of data types, for example INTEGER and BOOLEAN.
  • DATE Data Type
    A variable of type DATE holds values for a calendar year, month, and day.
  • DATETIME Data Type
    A variable of type DATETIME stores a date plus a time calculated to microseconds.
  • DATETIMEPART Data Type
    Describes the DATETIMEPART data type.
  • DIRECTION Data Type
    Defines the direction for a basic arrow button.
  • DLL_CALL_PRECEDENCE_TYPE Data Type
    Defines whether the DLL is 32bit or 64bit.
  • EKSERVICE Data Type
    Explains how this enumerated data type is defined.
  • EXCEPTION Data Type
    Defines this enumerated data type.
  • EXECUTIONMODE Data Type
    Defines whether a function waits for the call to finish before executing a command.
  • FILEINFO Data Type
    Describes a particular file by providing its attributes.
  • FILEINFO_LIST Data Type
    A list containing instances of the FILEINFO data type.
  • FILEMODE Data Type
    Describes the file mode for a file.
  • FILEPOS Data Type
    Describes how the FileSetPointer function should set the read/write position in an open file.
  • FILESHARE Data Type
    Describes the file-sharing behavior of a file.
  • FILETYPE Data Type
    Describes the file type of a file.
  • FINDOPTIONS Data Type
    Specifies options for the Find and FindAll operations.
  • FONTSTYLE Data Type
    FONTSTYLE identifies the style of a font.
  • FUZZYVERIFY Data Type
    FUZZYVERIFY identifies the values that the optional argument to VerifyProperties can have.
  • GETWINDOWFLAG Data Type
    Defines the GETWINDOWFLAG data type.
  • GUITYPE Data Type
    Lists the 4Test GUI specifiers.
  • HANDLE Data Type
    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.
  • HDATABASE Data Type
    The handle that identifies a database.
  • HDRIVER Data Type
    The handle for a driver.
  • HEAPSTATS Data Type
    Shows statistics of a heap.
  • HFILE Data Type
    The handle for an open file.
  • HINIFILE Data Type
    The handle for an open INI file.
  • HMACHINE Data Type
    The handle for a machine that is connected to the 4Test Agent.
  • HSQL Data Type
    The handle that identifies the SQL.
  • HTIMER Data Type
    The handle that identifies a 4Test timer.
  • INTEGER Data Type
    A variable of type INTEGER stores integral values.
  • JAVAAWTCOLOR Data Type
    Describes the RGB values of a color.
  • JAVAAWTCURSOR Data Type
    A data type that identifies the kind of cursor represented by an instance of the CursorClass class.
  • JAVAAWTFONT Data Type
    Identifies a font.
  • LBSTYLE Data Type
    Describes the style of a list box: single, extended, or multiple.
  • LINKTESTERINFO Data Type
    Defines this record data type that specifies data passed to the Link Tester tool.
  • LIST Data Type
    Used to declare a list variable.
  • LISTCOLUMN Data Type
    Identifies a column in a table.
  • LISTITEM Data Type
    Identifies a specific item in a list that is implemented by a control such as a ListBox, ComboBox, or ListView.
  • LOCALECATEGORY Data Type
    Identifies a category.
  • LONG Data Type
    Use a variable of type LONG to store integers that require four bytes.
  • LVSTYLE Data Type
    Describes the style of a listview: single, extended, or multiple.
  • LVVIEW Data Type
    Stores information about the means available for viewing elaborated list box controls.
  • MEMINFO Data Type
    Describes the Windows 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.
  • MODIFIERKEYSTATE Data Type
    This enumeration contains key modifiers that the Open Agent typically uses as arguments for click functions.
  • MULTITAG_ITEM Data Type
    Defines this enumerated data type.
  • MULTITAG_LIST Data Type
    Defines this alias data type.
  • NODE Data Type
    A NODE represents one element in a tree. NODE data contains the text of the corresponding tree element.
  • NUMBER Data Type
    A variable of type NUMBER stores either integers or real numbers.
  • 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.
  • POINT Data Type
    Position coordinates typically used to specify a screen or window location.
  • PROPINFO Data Type
    Stores the name, current value, and data type for one class property
  • REAL Data Type
    A variable of type REAL stores floating point numbers in this format.
  • RECORD Data Type
    A record data type is a compound data type that is made up of fields.
  • RECT Data Type
    Lists the information necessary to specify a rectangle relative to a window, the entire screen, or some other coordinate space.
  • REGISTRYTYPE Data Type
    Describes the REGISTRYTYPE data type.
  • SBRANGE Data Type
    Holds the minimum and maximum values to which a ScrollBar or UpDown object can be set.
  • SCLRANGE Data Type
    Holds the minimum and maximum values to which a Scale object can be set.
  • SEMAPHORE Data Type
    Use the SEMAPHORE data type to create semaphore variables, which are used in concurrent scripts to mutually exclude competing threads or control access to a resource.
  • SET Data Type
    The generic name for any data type that is declared with the type...is set declaration.
  • SIZE Data Type
    The dimensions of an object without regard to position.
  • STRING Data Type
    Describes how to store character strings using quotation marks in strings.
  • SYSMETRIC Data Type
    Defines the SYSMETRIC data type.
  • TABLECELL Data Type
    Identifies a cell in a table by specifying the cell’s row and column.
  • TABLECOL Data Type
    TABLECOL identifies a column in a table.
  • TABLERANGE Data Type
    Specifies the beginning and ending addresses of a particular range—for example, the currently selected cells.
  • TABLEROW Data Type
    Identifies a row in a table and is defined as follows.
  • TABLEVALUETYPE Data Type
    The TABLEVALUETYPE data type is a flag with two values.
  • TBLOC Data Type
    The location of the Windows taskbar.
  • TESTCASESTATE Data Type
    To report the state of a running test case or that the test case is not running.
  • TEXTPOS Data Type
    Specifies a position within the text of an instance of the TextField class.
  • TEXTRANGE Data Type
    Specifies the location of a portion of text within an instance of the TextField class.
  • TIME Data Type
    A variable of type TIME holds values for a hours, minutes, seconds, and microseconds.
  • TIMERSTATE Data Type
    Reveals the current state of a particular 4Test timer.
  • TRACKOBJECT Data Type
    Defines the TRACKOBJECT data type.
  • TREE Data Type
    The TREE data type is a LIST OF NODE.
  • TVSTYLE Data Type
    TVSTYLE describes the style of a treeview.
  • TVVIEW Data Type
    This data type stores information about the various views of items organized into a graphical hierarchy
  • WINATTR Data Type
    Defines the WINATTR data type.
  • WINATTR_LIST Data Type
    Defines the WINATTR_LIST.
  • WINDOW Data Type
    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.
  • WINDOWDEFINEDHOW Data Type
    Use WindowDefinedHow as optional parameter for the IsDefined method to see how a particular string definition has been defined.
  • WINDOWINTERACTIONSTATE Data Type
    Contains values that specify the current state of the window for purposes of user or programmatic interaction.
  • WINDOWVISUALSTATE Data Type
    Contains values that specify the visual state of a window.
  • WININFO Data Type
    Defines the WININFO data type.
  • WINPROP Data Type
    Defines the WINPROP data type.
  • WINPROPLIST Data Type
    Defines the WINPROPLIST data type.
  • 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.
  • WINSTATE Data Type
    The data type returned by the GetState function to report the current state of a MoveableWin object.
  • WNDTAG Data Type
    The data type of the WndTag property, which is the window tag of a window.
  • WndTag Property
    The window tag of a window.
Parent topic: Data Types


Data Type Ranges

This topic describes the range of valid values for the core built-in 4Test data types.

4Test Data Type | Range of Values
INTEGER | Minimum: -2147483648 Maximum: 2147483647
REAL | Machine-dependent, though on most systems a REAL is 8 bytes. Range on x86 architectures: the value zero and the range 2.23E-308 to 1.79E308, positive and negative
NUMBER | Covers the range of both INTEGER and REAL.
DATE | Minimum: -4713-01-01 [negative numbers for dates B.C.E. (B.C.)] Maximum: 19999-12-31 [positive numbers for dates C.E. (A.D.)]
TIME | Minimum: 00:00:00.000000 Maximum: 23:59:59.999999
STRING | Minimum: Zero characters (the empty string) Maximum: 16,383 characters
STRING constant | (Unevaluated characters inside quotation marks) Minimum: Zero characters (the empty string) Maximum: 4096 characters
Identifiers | Minimum: One character Maximum: 2048 characters
Parent topic: 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 a complete list of the agent options, see Agent Options.

Parent topic: Core Data Types
Related reference
GetOption Function
SetOption Method
Agent Options


AGENTSWITCH Data Type

4Test defines this enumerated data type as follows:

    [-] type AGENTSWITCH is enum
        [ ] AS_SHOW_ALL_CLASSES
        [ ] AS_SHOW_ALL_METHODS
Parent topic: Core Data Types


ALIGNMENT Data Type

Defines the alignment for a label or text field. 4Test defines this enumerated data type as follows:
[-] type ALIGNMENT is enum
    [ ] AM_LEFT
    [ ] AM_RIGHT
    [ ] AM_CENTER
    [ ] AM_LEADING
    [ ] AM_TRAILING
Each field is defined as follows:
AM_LEFT | Indicates that the label should be left justified.
AM_RIGHT | Indicates that the label should be right justified.
AM_CENTER | Indicates that the label should centered.
AM_LEADING | Indicates that the text is used in left-to-right languages.
AM_TRAILING | Indicates that the text is used in right-to-left languages.
Parent topic: Core Data Types


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.
Parent topic: Core Data Types


APPID Data Type

Description

An identification code that uniquely identifies a process.

4Test defines this alias data type as follows:

type APPID is INTEGER
Parent topic: Core Data Types
Related reference
AppId Property
GetAppId Function


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.
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 sub-arrays 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 sub-array 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
    [ ] 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"}
Parent topic: Core Data Types
Related reference
ArrayFind Function
ArraySize Function
ArraySort Function
IsArray Function
LIST Data Type
List/Array/Set Constructor Operator


BOOLEAN Data Type

Description

A variable of type BOOLEAN stores either TRUE or FALSE.

Parent topic: Core Data Types


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
Parent topic: Core Data Types


BROWSERTYPE Data Type

Description

This functionality is supported only if you are using the Classic Agent. For additional information, refer to the Silk Test Classic Classic Agent Help.

Silk Test Classic 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.

For information about new features, supported platforms, and tested versions, refer to the Release Notes.

Browser Specifier | Browser
explorer Set that includes the following browser versions:
  • Internet Explorer 6
  • Internet Explorer 7
  • Internet Explorer 8
explorer6_DOM | Internet Explorer 6
explorer7 | Internet Explorer 7
explorer8_0 | Internet Explorer 8
explorer_DOM Set that includes the following browser versions:
  • Internet Explorer 6
  • Internet Explorer 7
  • Internet Explorer 8
Note: "explorer_DOM" is identical with "explorer" and exists only for backward compatibility.
firefox Set that includes the following browser versions:
  • Mozilla Firefox 1.5
  • Mozilla Firefox 2.0
firefox1_5 | Mozilla Firefox 1.5
firefox2_0 | Mozilla Firefox 2.0

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 firefox this way.)

You set the browser in the Runtime Options dialog box or by calling the SetBrowserType or SetDefaultBrowserType function, each of which takes an argument of type BROWSERTYPE. If you do not set a browser type explicitly in a script, Silk Test Classic uses the browser specified in the Runtime Options dialog box.

If you try to use a browser specifier instead of a GUI specifier to specify a window, Silk Test Classic generates 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.

Note: When you are using the Open Agent, you can get or set the browser type by using the GetProperty and SetProperty methods of the AnyWin class on the BrowserApplication. For example:
browserApplication.getProperty("browsertype")

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:

firefox, explorer

You can also specify all but one browser, such as the following, which indicates that what follows applies to all browsers except Firefox:

! firefox

Example 1

In the following code fragment, Mozilla Firefox and Internet Explorer browser specifiers are used to indicate that the tag for the BrowserAuthentication window differs in the two browsers.

Note: Browser specifiers can be used in conjunction with GUI specifiers as well.
[-] window DialogBox BrowserAuthentication
    [ ] explorer, msw2000 tag "Enter Network Password"
    [ ] explorer, mswxp tag "Authentication"
    [ ] explorer, msw2003 tag "Basic Authentication"

Example 2

The test case in the next example (GetItemCount) takes an argument of type BROWSERTYPE, allowing you to pass browser specifiers at runtime. (The test case 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 test case, see the example on generalizing test cases.

[-]  main ()
    [ ]  LIST OF BROWSERTYPE lbtType
    [ ]  BROWSERTYPE btType
    [ ]  lbtType = {explorer7, firefox1_5}
    [-]  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 (explorer7) - Passed
    [ ] // Internet Explorer 7.0
    [ ] // Item count: 9
    [ ] // Testcase GetItemCount (firefox1_5) - Passed
    [ ] // Mozilla Firefox 1.5
    [ ] // Item count: 9
Note: In the preceding test case, you do not have to call SetBrowserType to set the browser type. If a BROWSERTYPE argument is passed to a test case, the recovery system automatically calls SetBrowserType with the argument.
Parent topic: Core Data Types
Related reference
GetBrowserType Function
SetBrowserType Function
GetDefaultBrowserType Function
SetDefaultBrowserType Function


CALL Data Type

One entry in a CALL_LIST data type. 4Test defines this enumerated data type as follows:
[-] type CALL is record
    [ ] STRING sFunction
    [ ] STRING sModule
    [ ] INTEGER iLine
Parent topic: Core Data Types
Related reference
CALL_LIST Data Type


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
Parent topic: Core Data Types
Related reference
ExceptCalls Function


CLICKTYPE Data Type

4Test defines this enumerated data type as follows:

[-] type CLICKTYPE is enum
    [ ] CT_LEFT
    [ ] CT_RIGHT
    [ ] CT_MIDDLE
    [ ] CT_LEFTDOUBLE
    [ ] CT_PRESS
    [ ] CT_RELEASE
Parent topic: Core Data Types
Related reference
TextClick Method (AnyWin)


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
Parent topic: Core Data Types
Related reference
GetBackgroundColor Function


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
Parent topic: Core Data Types


DATACLASS Data Type

Description

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.

Parent topic: Core Data Types
Related reference
ClassOf Function


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.
Parent topic: Core Data Types
Related reference
SYS_GetFreeDiskSpace Function
SYS_GetDirContents Function


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.

The following data types are available:
  • NULL

    User defined Types (enums, records, etc.)

  • DATATYPE
  • DATACLASS
  • BOOLEAN
  • INTEGER, INT
  • CHAR
  • SHORT
  • LONG
  • UNSIGNED CHAR
  • UNSIGNED SHORT
  • UNSIGNED INT
  • UNSIGNED LONG
  • REAL
  • FLOAT
  • DOUBLE
  • STRING
  • HANDLE
  • SEMAPHORE
  • GUITYPE
  • BROWSER
  • DATETIME
  • DATE
  • TIME
  • ANYTYPE
  • NUMBER
  • WINDOW
  • LIST OF <type>, for example LIST OF STRING.
    Note: LIST OF LIST OF <type> is treated as LIST OF ANYTYPE.
  • User defined types, for example enums, records, and so on.

For additional information, see Type Cast Operator.

Parent topic: Core Data Types
Related reference
TypeOf Function


DATE Data Type

Description

A variable of type DATE holds values for a calendar year, month, and day. The DATE data type represents values from 4713 B.C.E (B.C.) to 19999 C.E. (A.D.).

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

Notes

You can use relational operators between two variables of type DATE. You can cast a variable of type DATE to or from a type DATETIME. If you cast from a type DATETIME to a DATE, you lose the time information. If you cast from a DATE to a DATETIME, the time portion of the value defaults to midnight.

You can generate a DATE constant by specifying a date as a string and then casting the string as a DATE data type. The string must have the following format:

"YYYY-MM-DD"

This is an implicit type cast and so does not require the type cast operator (the square brackets). You can truncate the string at any point, as long as the last field is complete.

See DATETIME Data Type for a summary of the rules that govern the various ways in which you can convert dates and times using casting.

Parent topic: Core Data Types
Related reference
AddDateTime Function
DATETIME Data Type
MakeDateTime Function
TIME Data Type
Data Type Ranges


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.

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.MSMSMS

You 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 = "2006-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, 2007 12:00 AM."
Print ("Grand Opening on {sOpening}.")
Parent topic: Core Data Types
Related reference
DATE Data Type
AddDateTime Function
DiffDateTime Function
MakeDateTime Function
TIME Data Type
TimerStr Function


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
Parent topic: Core Data Types


DIRECTION Data Type

Defines the direction for a basic arrow button. 4Test defines this enumerated data type as follows:
[-] type DIRECTION is enum
    [ ] D_WEST
    [ ] D_SOUTH
    [ ] D_EAST
    [ ] D_NORTH
Parent topic: Core Data Types


DLL_CALL_PRECEDENCE_TYPE Data Type

This functionality is supported only if you are using the Open Agent.

The DLL_CALL_PRECEDENCE_TYPE data type defines whether a DLL is 32bit or 64bit. 4Test defines this enumerated data type as follows:
[-] type DLL_CALL_PRECEDENCE_TYPE is enum
    [ ] DCP_32BIT
    [ ] DCP_64BIT
Parent topic: Core Data Types
Related reference
GetDllCallPrecedence Function (AgentClass)
SetDllCallPrecedence Method (AgentClass)


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
Parent topic: Core Data Types


EXCEPTION Data Type

4Test defines this enumerated data type as follows:

[-] type EXCEPTION is enum
    [ ] // 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
    [ ] 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
    [ ] 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
    [ ]
    [ ] 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
    [ ]
    [ ] // Flex specific exceptions
    [ ]
    [ ] E_FLEX_REPLAY = -60000
    [ ] E_FLEX_REPLAY_EVENT = -60100
    [ ] E_FLEX_REPLAY_METHOD = -60200
    [ ] E_FLEX_REPLAY_READ_PROPERTY = -60300
    [ ] E_FLEX_REPLAY_WRITE_PROPERTY = -60400
    [ ] E_FLEX_REPLAY_STYLE_NOT_SET = -60500
    [ ] E_FLEX_REPLAY_SUPPORTS_TABLUAR = -60600
    [ ] E_FLEX_REPLAY_INVALID_FLEX_SDK_VERSION = -60700
    [ ]
    [ ] // MSuia specific exceptions
    [ ] E_MSUIA_BASE = -70000
    [ ] E_MSUIA_CONTROLPATTERN_NOT_SUPPORTED = -70100
    [ ]
    [ ] // General Open Agent
    [ ] E_INVALID_PARAMETER = -80000
    [ ] E_INVALID_XPATH = -80100
    [ ] E_WINDOW_INVALIDATED = -80200
Parent topic: Core Data Types
Related reference
Exception Values
Apache Flex Exception Values
DataGrid Exceptions


EXECUTIONMODE Data Type

Defines whether a function waits for the call to finish before executing a command. 4Test defines this enumerated data type as follows:
[-] type EXECUTIONMODE is enum
    [ ] EM_WAIT_UNTIL_FINISHED
    [ ] EM_CONTINUE_RUNNING
Parent topic: Core Data Types
Related reference
SYS_Execute Function


FILEINFO Data Type

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_COMPRESSED
  • FILE_ATTRIBUTE_DIRECTORY
  • FILE_ATTRIBUTE_ENCRYPTED
  • FILE_ATTRIBUTE_HIDDEN
  • FILE_ATTRIBUTE_NORMAL
  • FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
  • FILE_ATTRIBUTE_OFFLINE
  • FILE_ATTRIBUTE_READONLY
  • FILE_ATTRIBUTE_REPARSE_POINT
  • FILE_ATTRIBUTE_SPARSE_FILE
  • FILE_ATTRIBUTE_SYSTEM
  • FILE_ATTRIBUTE_TEMPORARY

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.

Parent topic: Core Data Types


FILEINFO_LIST Data Type

A list containing instances of the FILEINFO data type. 4Test defines this alias data type as follows:
type FILEINFO_LIST is list of FILEINFO
Parent topic: Core Data Types


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. Silk Test Classic 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.
Parent topic: Core Data Types
Related reference
FileOpen Function


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
Parent topic: Core Data Types
Related reference
FileSetPointer Function


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
    [ ] 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.
Parent topic: Core Data Types
Related reference
FileOpen Function
IniFileOpen Function
ListWrite Function


FILETYPE Data Type

Describes the file type of a file. The file type is an optional parameter for the FileOpen and IniFileOpen functions. 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.
Parent topic: Core Data Types
Related reference
FileOpen Function
IniFileOpen Function


FINDOPTIONS Data Type

This data type is supported only on the Open Agent in tests that use dynamic object recognition.

Specifies options for the Find and FindAll operations. Use to override the default timeout value or to specify whether an exception or null is thrown if the object is not found.

4Test defines this record data type as follows:
[-] type FINDOPTIONS is record
    [ ] NUMBER timeout
    [ ] BOOLEAN throwWindowNotFoundException

The throwWindowNotFoundException value determines whether the Find method throws an E_WINDOW_NOT_FOUND exception if no object is found or NULL is returned if no object is found. The throwWindowNotFoundException value is only relevant for Find methods. It is ignored in FindAll methods. The default value is TRUE.

The timeout value is the timeout in seconds for the Find and FindAll operations. By default, the value of the OPT_WINDOW_TIMEOUT option is used.

Example

To find the dialog Information with a timeout of three seconds, and to return NULL if the dialog is not found, instead of throwing an E_WINDOW_NOT_FOUND exception, you can use code that is similar to the following:
WINDOW informationDialog = Desktop.Find("//Dialog[@caption=’Information’]", {3,FALSE})
When using object maps, if the corresponding object map identifier is Information, the previous code samples look like the following:
WINDOW informationDialog = Desktop.Find("Information", {3,FALSE})
Parent topic: Core Data Types
Related concepts
Open Agent
Dynamic Object Recognition
Related reference
Find Method
Overview of the Locator Keyword
FindAll Function


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
Parent topic: Core Data Types


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
Parent topic: Core Data Types
Related reference
FuzzyVerify Function


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
Parent topic: Core Data Types


GUITYPE Data Type

List of Available GUI Specifiers

The following table lists the 4Test GUI specifiers. You can use these for input arguments of type GUITYPE and you will receive these constants as return values or output arguments of type GUITYPE. You can place these identifiers in front of an Agent command to direct the Agent to execute that command only on the indicated GUIs.

GUI Specifier | Includes These Platforms
msw | Microsoft Windows
msw32 | Microsoft Win32
msw9x | Microsoft Windows 9x (msw98 for Microsoft Windows 98)
msw2000 | Microsoft Windows 2000
msw2003 | Microsoft Windows Server 2003
msw2003_64 | Microsoft Windows Server 2003 - 64bit
mswxp | Microsoft Windows XP
mswxp64 | Microsoft Windows XP - 64bit
mswvista | Microsoft Windows Vista
mswvista_64 | Microsoft Windows Vista - 64bit
mswin2008 | Microsoft Windows Server 2008
mswin2008_64 | Microsoft Windows Server 2008 - 64bit
mswin2008r2 | Microsoft Windows Server 2008 R2
mswin2008r2_64 | Microsoft Windows Server 2008 R2 - 64bit
mswin7 | Microsoft Windows 7
mswin7_64 | Microsoft Windows 7 - 64bit
mswin8 | Microsoft Windows 8
mswin8_64 | Microsoft Windows 8 - 64bit
mswin2012_64 | Microsoft Windows Server 2012 - 64bit
mswin2012r2_64 | Microsoft Windows Server 2012 R2 - 64bit
mswin81 | Microsoft Windows 8.1
mswin81_64 | Microsoft Windows 8.1 - 64bit
mswin10 | Microsoft Windows 10
mswin10_64 | Microsoft Windows 10 - 64bit
GUI Set | Includes These Platforms
msw | msw32 and msw64
msw32 | mswnt32 and msw9x
mswnt | mswnt32 and msw64
msw64 | msw2003_64, mswxp64, mswvista_64, mswin2008_64, mswin7_64, mswin2008r2_64, mswin8_64, mswin81_64, mswin2012_64, mswin2012r2_64, mswin10_64
mswnt32 | msw2000, msw2003, mswxp, mswvista, mswin2008, mswin7, mswin2008r2, mswin8, mswin81, mswin10

Syntax

A GUI specifier has the following syntax:

[[gui-type[, gui-type]] | [! gui-type]]

gui-type is the GUI. You can express this in one of two mutually-exclusive ways. For example, you can specify one or more GUIs separated by commas, as in:

msw2003, msw2000

Or you can specify all but one GUI, as in the following, which indicates that what follows applies to all environments except mswnt:

! mswnt
Parent topic: Core Data Types
Related reference
Invoke Method (ChildWin DialogBox MainWin)
Parent Statement
Tag Statement
FindWinClass Function
FindWindow Function
GetGUIType Function
if Statement
LIST Data Type
SetGuiType Function
WindowChildren Function
WindowParent Function


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
Parent topic: Core Data Types


HDATABASE Data Type

The handle that identifies a database. 4Test defines this alias data type as follows:
type HDATABASE is HANDLE
Parent topic: Core Data Types


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
Parent topic: Core Data Types


HEAPSTATS Data Type

4Test defines this record data type as follows:

[-] type HEAPSTATS is record
    [ ] INTEGER iHeapSize
    [ ] INTEGER iHeapCommitted
    [ ] INTEGER iHeapAllocated
    [ ] INTEGER iHeapFree
    [ ] INTEGER iHeapOverhead
Parent topic: Core Data Types


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
Parent topic: Core Data Types
Related reference
FileOpen Function
FileReadLine Function


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. Silk Test Classic 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
Parent topic: Core Data Types
Related reference
IniFileOpen Function
IniFileSetValue function


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)
Parent topic: Core Data Types
Related reference
Connect Function


HSQL Data Type

4Test defines this alias data type as follows:
type HSQL is HANDLE
Parent topic: Core Data Types


HTIMER Data Type

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
Parent topic: Core Data Types
Related reference
TimerCreate Function


INTEGER Data Type

Description

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

For the range of valid values, see Data Type Ranges.

Parent topic: Core Data Types
Related reference
LONG Data Type
NUMBER Data Type
Data Type Ranges


JAVAAWTCOLOR Data Type

Describes the RGB values of a color. 4Test defines this record data type as follows:
[-] type JavaAwtColor is record
    [ ] INTEGER Red
    [ ] INTEGER Green
    [ ] INTEGER Blue
    [ ]
[ ] const JavaAwtColor WHITE = {255, 255, 255}
[ ] const JavaAwtColor LIGHTGRAY = {192, 192, 192}
[ ] const JavaAwtColor GRAY = {128, 128, 128}
[ ] const JavaAwtColor DARKGRAY = { 64, 64, 64}
[ ] const JavaAwtColor BLACK = { 0, 0, 0}
[ ] const JavaAwtColor RED = {255, 0, 0}
[ ] const JavaAwtColor PINK = {255, 175, 175}
[ ] const JavaAwtColor ORANGE = {255, 200, 0}
[ ] const JavaAwtColor YELLOW = {255, 255, 0}
[ ] const JavaAwtColor GREEN = { 0, 255, 0}
[ ] const JavaAwtColor MAGENTA = {255, 0, 255}
[ ] const JavaAwtColor CYAN = { 0, 255, 255}
[ ] const JavaAwtColor BLUE = { 0, 0, 255}
Parent topic: Core Data Types


JAVAAWTCURSOR Data Type

A data type that identifies the kind of cursor represented by an instance of the CursorClass class. 4Test defines this record data type as follows:
[-] type JavaAwtCursor is record
    [ ] INTEGER cursorType
Parent topic: Core Data Types


JAVAAWTFONT Data Type

Identifies a font. 4Test defines this record data type as follows:
[-] type JavaAwtFont is record
    [ ] STRING Name
    [ ] INTEGER Style
    [ ] INTEGER Size
Parent topic: Core Data Types


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
Parent topic: Core Data Types


LINKTESTERINFO Data Type

Specifies data passed to the Link Tester tool. 4Test defines this record data type as follows:

[-] type LINKTESTERINFO is record
    [ ] STRING sBaseURL
    [ ] STRING sIncludeDomains
    [ ] INTEGER iDepth
Parent topic: Core Data Types
Related reference
RunLinkTester Function


LIST Data Type

Description

Used to declare a list variable.

Syntax

LIST [ OF data-type ] list-id [= elements]
Variable | Description
data-type | An identifier specifying the data type you want the elements in the list to have. If omitted, the data type is ANYTYPE. In addition to ANYTYPE, you can use the following data types: BOOLEAN, BROWSERTYPE, CHAR, DATACLASS, DATATYPE, DATE, DATETIME, DOUBLE, FLOAT, GUITYPE, HANDLE, INT, INTEGER, LONG, NUMBER, REAL, SEMAPHORE, SHORT, STRING, TIME, UNSIGNED CHAR, UNSIGNED INT, UNSIGNED LONG, UNSIGNED SHORT, WINDOW
list-id | An identifier that specifies the name of the list.
elements | The elements of the list, specified using the list constructor operator.

Notes

Use the LIST and ARRAY compound data types to group together several pieces of data of the same data type.

A list contains elements you can access randomly by referring to them relative to their position in the list. As in an array, all the elements in a list must have the same type. Lists differ from arrays in that you do not need to specify their initial size when you declare them.

List Constructor

To specify the elements of a list, use the list constructor operator. The list constructor has three variants, summarized below:

Format Description Example
{ a , b } The elements of the list, separated by commas and enclosed in braces.
LIST MyList = {"a","b"}
{...} The literal characters {...} followed by indented lines, each containing one element of the list
[-] LIST MyList = {...}
    [ ] "a"
 [ ] "b"
<text>

For lists of string elements only. The literal characters <text> followed by indented lines each containing one element of the list.

Each element is treated as the literal text of a string. Do not use quotes to indicate strings.

4Test interprets indentation levels on the lines as tabs in the string.

[-] LIST MyList = <text>
    [ ] a
    [ ] "b"
    [ ] 	c
Note: In this example, the three elements of the list are the strings "a", ""b"" and "<tab>c".

Referring to List Elements

You refer to specific elements in a list the same way you refer to elements in an array. For example, LIST [2] of the list {"a", "b", "c"} refers to "b". Silk Test Classic raises an exception if you refer to a list item using an index that is out of bounds.

Examples

[ ] // Declare and construct a list
[ ] STRING sSomeString = "hello"
[ ] INTEGER i = 1
[-] LIST OF ANYTYPE NewList = {...}
    [ ] "a"
    [ ] sSomeString
    [ ] "cde"
    [ ] i + 1
[ ] // Declare an empty list
[ ] LIST OF STRING lsFruit
[ ] // Add to empty list
[-] testcase list_example ()
    [ ] ListAppend (lsFruit, "apples")
    [ ] ListAppend (lsFruit, "oranges")
Parent topic: Core Data Types
Related concepts
List Manipulation
Related reference
ARRAY Data Type
GUITYPE Data Type
ANYTYPE Data Type
C Data Types for DLL Functions
List/Array/Set Constructor Operator


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.)

Parent topic: Core Data Types


LISTITEM Data Type

LISTITEM identifies a specific 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.)

Parent topic: Core Data Types


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
Parent topic: Core Data Types


LONG Data Type

Description

Use a variable of type LONG to store integers that require four bytes, for example, a return value from a Microsoft Windows Dynamic Link Library (DLL).

Parent topic: Core Data Types
Related reference
INTEGER Data Type
NUMBER Data Type


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
Parent topic: Core Data Types


LVVIEW Data Type

This data type stores information about the means available for viewing elaborated list box controls: 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
Parent topic: Core Data Types
Related reference
ListViewEx Class


MEMINFO Data Type

MEMINFO describes the Windows 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
Parent topic: Core Data Types


MODIFIERKEYSTATE Data Type

Description

This enumeration contains key modifiers that the Open Agent typically uses as arguments for click functions, such as AnyWin::ExtendedClick. For example, the value MOD_CTRL_ALT means that the keys Ctrl and Alt are pressed.

4Test defines this enumerated data type as follows:
[-] type MODIFIERKEYSTATE is enum
    [ ] MOD_CTRL
    [ ] MOD_ALT
    [ ] MOD_SHIFT
    [ ] MOD_CTRL_SHIFT
    [ ] MOD_CTRL_ALT
    [ ] MOD_SHIFT_ALT
    [ ] MOD_CTRL_SHIFT_ALT
    [ ] MOD_NONE

Availability

This data type is supported only for the Open Agent.

Parent topic: Core Data Types
Related reference
TextClick Method (AnyWin)
Differences in the Classes Supported by the Silk Test Agents
Overview of the Methods Supported by the Silk Test Agents


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
Parent topic: Core Data Types
Related reference
MULTITAG_LIST Data Type


MULTITAG_LIST Data Type

4Test defines this alias data type as follows:

type MULTITAG_LIST is LIST OF MULTITAG_ITEM
Parent topic: Core Data Types
Related reference
MULTITAG_ITEM Data Type


NODE Data Type

Description

A NODE represents one element in a tree. NODE data contains the text of the corresponding tree element. 4Test defines this record data type as follows:
[-] type NODE is record
    [ ] STRING data
    [ ] LIST OF NODE children

Availability

This data type is supported only on the Open Agent.

Parent topic: Core Data Types
Related reference
TreeView Class
TREE Data Type


NUMBER Data Type

Description

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.

For information on ranges for other data types, see Data Type Ranges.

Parent topic: Core Data Types
Related reference
INTEGER Data Type
REAL Data Type
Data Type Ranges


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 Silk Test Classic; however, the pointer can be processed further by passing it to a method or property that accepts a pointer.

Parent topic: Core Data Types


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
Parent topic: Core Data Types


PROPINFO Data Type

This data type stores the name, current value, and data type for one class property as follows:

[-] type PROPINFO is record
    [ ] STRING sName // name of property
    [ ] ANYTYPE aValue // value of property
    [ ] DATATYPE PropType // data type of property
Parent topic: Core Data Types
Related reference
WINPROPTREE Data Type


REAL Data Type

Description

A variable of type REAL stores floating point numbers in this format:

ddd.ddd[e[-]ddd]

The following values may be stored in a REAL variable:

  • 8.12
  • 499.0
  • -6.7511
  • 1e30
  • 1.45e-10

Variables of type REAL can have a value from 2.0 – 32. If the value is outside the range, the data type returns a value of zero.

For information on ranges for other data types, see Data Type Ranges.

Parent topic: Core Data Types
Related reference
NUMBER Data Type
Data Type Ranges


RECORD Data Type

Description

A record data type is a compound data type that is made up of fields. For additional information, see type ... is record Declaration.

Parent topic: Core Data Types
Related reference
type ... is record Declaration


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. INTEGER.
Parent topic: Core Data Types


REGISTRYTYPE Data Type

The REGISTRYTYPE defines whether the registry uses a 32-bit view or a 64-bit view. 4Test defines this enumerated data type as follows:

[-] type REGISTRYTYPE is enum
    [ ] REG_TYPE_32BIT
    [ ] REG_TYPE_64BIT
Parent topic: Core Data Types


SBRANGE Data Type

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
Parent topic: Core Data Types


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
Parent topic: Core Data Types


SEMAPHORE Data Type

Description

Use the SEMAPHORE data type to create semaphore variables, which are used in concurrent scripts to mutually exclude competing threads or control access to a resource.

Values of type SEMAPHORE can only be assigned a value once. The value must be an INTEGER greater than zero. Once it is set, your code can get the semaphore's value, but cannot set it.

When you allocate a semaphore variable, you must initialize it before you can invoke Acquire. For example, the following statement creates a binary semaphore that allows you to control access to a single resource.

SEMAPHORE semAlpha = 1

Use a semaphore to control the access of competing threads to a resource as follows:

  1. Before using a semaphore-protected resource of any description, invoke Acquire (semA), where semA is the semaphore assigned to this resource.

  2. When you have completed use of the resource protected by semA, invoke Release (semA) to make the semaphore, and therefore the resource, available to another thread.

Note: If your script experiences an exception in the code between acquisition of a semaphore and its release, the script will deadlock unless you use a do-except statement to handle the exception. Place the do statement after the Acquire and before any code that could cause an exception. Place a Release statement in the except block.
Parent topic: Core Data Types
Related reference
Acquire Function
Release Function


SET Data Type

Description

The generic name for any data type that is declared with the type...is set declaration. For example, if you declare a COLORS data type with a type COLORS is set declaration, you can declare variables of type COLORS. A SET variable can hold one or more of the values declared for its data type. It cannot hold duplicate values. In addition to its defined values, a SET element can be another SET variable, as shown below.

Example

In the example, the COLORS set is defined and then two set instances are declared and initialized. The initialization uses the list constructor operator ({}) to specify the members of the sets. When you use braces in a declaration of a set object, 4Test implicitly casts the generated list as a set (in this example, a COLORS set). You cannot modify an existing set using braces—you can only initialize a new set.

[-] type COLORS is set
    [ ] red
    [ ] yellow
    [ ] navy
    [ ] wedgewood
    [ ] royal
    [ ] green
    [ ] purple
    [ ] orange
[ ]
[ ] COLORS Blue = {navy, wedgewood, royal}
[ ] COLORS CoolColors = {purple, green, Blue}
Parent topic: Core Data Types
Related reference
SetAddMember Function


SIZE Data Type

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

The following table explains the fields.

Field | Description
iWidth | The width of the object. INTEGER.
iHeight | The height of the object. INTEGER.
Parent topic: Core Data Types


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.

Including Quotation Marks in Strings

To include a quotation mark as part of a string delimited by the same kind of quotation mark, "escape" it by typing two quotation marks in succession:

  • "This string contains a double quotation mark " " ."
  • "This string contains a single quotation mark '."

Evaluating in-string Expressions

4Test can evaluate an expression within a quoted string, and convert its value to the string representation of the value. This feature provides an alternative to using lengthy sequences of string concatenation in order to put values into strings.

To have 4Test evaluate an expression inside a string, enclose it in braces ({}). The braces act as a typecast operator to explicitly cast the result of the evaluated expression as a string. To include literal braces in a quoted string, you need to escape each open brace using either the single quotation mark or the double quotation mark, whichever you used to delimit the string. See the first example below.

Accessing Characters in Strings

4Test lets you get or replace the individual characters in strings, as if they were one-dimensional arrays of characters. See the second example below.

Examples

[ ] // Example of evaluating in-string expressions
[-] type NAME is record
    [ ] STRING sFirst
    [ ] STRING sLast
[-] testcase String1 ()
    [ ] INTEGER iTestNum = 1, iNum = 2
    [ ] STRING sTest = "TestMenu"
    [ ] // Automatically converts list "Name" to a record
    [-] NAME Name = {...}
        [ ] "Beenie"
        [ ] "Cecil"
    [ ] Print ("Test number: {iTestNum} - {sTest}")
    [ ] Print ("Tester: {Name.sFirst} {Name.sLast}")
    [ ] Print ("Square ({iNum}) = {Square(iNum)}")
    [ ] Print ("String with "{braces} in it")
[-] INTEGER Square (INTEGER I)
    [ ] return I * I
[ ] // This script prints:
[ ] // Test number: 1 - TestMenu
[ ] // Tester: Beenie Cecil
[ ] // Square(2) = 4
[ ] // String with {braces} in it
[ ]
[ ] // Example of accessing characters in strings
[-] testcase String2 ()
    [ ] STRING sfruit = "peach"
    [ ] Print (sfruit[3]) // Prints 'a'
    [ ] sfruit[2] = 'o'
    [ ] Print (sfruit) // Prints "poach"
    [ ] // You can also delete, insert, or replace characters:
    [ ] sfruit = "pear"
    [ ] sfruit[3] = ""
    [ ] Print (sfruit) // Prints "per"
    [ ] sfruit[3] = "ace"
    [ ] Print (sfruit) // Prints "peace"
    [ ] // You can index one character beyond the end
    [ ] // of the string; result is an empty string ("").
    [ ] // If you attempt to go more than one character
    [ ] // beyond the end of the string, 4Test raises an
    [ ] // exception. For example:
    [ ] sfruit = "orange"
    [ ] Print (sfruit[7]) // Prints ""
    [ ] sfruit[7] = "s"
    [ ] Print (sfruit) // Prints "oranges"
Parent topic: Core Data Types
Related concepts
String Manipulation
Character and String Conversions
Related reference
Data Type Ranges


SYSMETRIC Data Type

4Test defines this enumerated data type as follows:

[-] type SYSMETRIC is enum
    [ ] SM_CXSCREEN = 0
    [ ] SM_CYSCREEN = 1
    [ ] SM_CXVSCROLL = 2
    [ ] SM_CYHSCROLL = 3
    [ ] SM_CYCAPTION = 4
    [ ] SM_CXBORDER = 5
    [ ] SM_CYBORDER = 6
    [ ] SM_CXDLGFRAME = 7
    [ ] SM_CYDLGFRAME = 8
    [ ] SM_CYVTHUMB = 9
    [ ] SM_CXHTHUMB = 10
    [ ] SM_CXICON = 11
    [ ] SM_CYICON = 12
    [ ] SM_CXCURSOR = 13
    [ ] SM_CYCURSOR = 14
    [ ] SM_CYMENU = 15
    [ ] SM_CXFULLSCREEN = 16
    [ ] SM_CYFULLSCREEN = 17
    [ ] SM_CYKANJIWINDOW = 18
    [ ] SM_MOUSEPRESENT = 19
    [ ] SM_CYVSCROLL = 20
    [ ] SM_CXHSCROLL = 21
    [ ] SM_DEBUG = 22
    [ ] SM_SWAPBUTTON = 23
    [ ] SM_RESERVED1 = 24
    [ ] SM_RESERVED2 = 25
    [ ] SM_RESERVED3 = 26
    [ ] SM_RESERVED4 = 27
    [ ] SM_CXMIN = 28
    [ ] SM_CYMIN = 29
    [ ] SM_CXSIZE = 30
    [ ] SM_CYSIZE = 31
    [ ] SM_CXFRAME = 32
    [ ] SM_CYFRAME = 33
    [ ] SM_CXMINTRACK = 34
    [ ] SM_CYMINTRACK = 35
    [ ] SM_CMETRICS = 36
Parent topic: Core Data Types


TABLECELL Data Type

TABLECELL identifies a cell in a table by specifying the cell’s row and column. It is defined as follows:

[-] type TABLECELL is record
    [ ] TABLEROW Row
    [ ] TABLECOL Col

Example

TABLECELL CurCell = {"2", "ship_date"}
Parent topic: Core Data Types
Related reference
TABLECOL Data Type
TABLEROW Data Type


TABLECOL Data Type

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

type TABLECOL is INTEGER, STRING

The interpretation of a value of type TABLECOL 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.)

Parent topic: Core Data Types


TABLERANGE Data Type

A TABLERANGE value specifies the beginning and ending addresses of a particular range—for example, the currently selected cells. The start cell denotes the upper left hand corner and the end cell denotes the lower right hand corner. A cell address is the row and column for that table cell. The address can be either a string giving the names of the row and column, or integers giving the indexes of the cell.

4Test defines this data type as follows:

[-] type TABLERANGE is record
    [ ] TABLECELL StartCell
    [ ] TABLECELL EndCell
[-] type TABLECELL is record
    [ ] TABLEROW Row
    [ ] TABLECOL Col
[ ] type TABLEROW is string, integer
[ ] type TABLECOL is string, integer

Example

TABLERANGE StrRange = {{"1","id"}, {"2", "ship_date"}}
TABLERANGE IntRange = {{1,1}, {2,2}}
Parent topic: Core Data Types


TABLEROW Data Type

TABLEROW identifies a row in a table and is defined as follows.

type TABLEROW is INTEGER, STRING

The interpretation of a TABLEROW value depends on whether the type is an integer or a string.

  • An integer value specifies the 1-based index of the row.
  • A string value specifies the value of a column. The row is then obtained by searching for that value in the first column of the table. To search a column other than the first, the value should be preceded by the column name and an equal sign: "column-name = value". The value can contain wildcard characters. (You can also specify the index of the row as a string, in the form "#n" where n is the numerical index of the row.)
Parent topic: Core Data Types


TABLEVALUETYPE Data Type

The TABLEVALUETYPE data type is a flag with two values: TVT_TEXT specifies that the values of a table are expressed as text strings and TVT_TYPED specifies that the values of a table are expressed in their native data types.

4Test defines this data type as follows:

[-] type TABLEVALUETYPE is enum
    [ ] TVT_TEXT
    [ ] TVT_TYPED
Parent topic: Core Data Types


TBLOC Data Type

The location of the Windows taskbar. The taskbar can be either at the left, top, right, or bottom of the screen. 4Test defines this enumerated data type as follows:

[-] type TBLOC is enum
    [ ] LOC_LEFT = 1
    [ ] LOC_TOP = 2
    [ ] LOC_RIGHT = 3
    [ ] LOC_BOTTOM = 4
Parent topic: Core Data Types


TESTCASESTATE Data Type

The data type returned by the GetTestCaseState function to report the state of a running test case or that the test case is not running. 4Test defines this enumerated data type as follows:

[-] type TESTCASESTATE is enum
    [ ] TCS_ENTERING
    [ ] TCS_RUNNING
    [ ] TCS_EXITING

The following table describes each of the values a TESTCASESTATE variable may hold:

Value | Test Case State
TCS_ENTERING | In TestCaseEnter or DefaultTestCaseEnter.
TCS_RUNNING | Currently running.
TCS_EXITING | In TestCaseExit or DefaultTestCaseExit.
NULL | No test case is running.
Parent topic: Core Data Types
Related reference
GetTestCaseState Function


TEXTPOS Data Type

Specifies a position within the text of an instance of the TextField class. 4Test defines this record data type as follows:

[-] type TEXTPOS is record
    [ ] INTEGER iLine
    [ ] INTEGER iCol
Parent topic: Core Data Types


TEXTRANGE Data Type

Specifies the location of a portion of text within an instance of the TextField class. 4Test defines this record data type as follows:

[-] type TEXTRANGE is record
    [ ] INTEGER iStartLine
    [ ] INTEGER iStartCol
    [ ] INTEGER iEndLine
    [ ] INTEGER iEndCol

All parameters are zero-based.

Note: Tabs count as a single character.
Parent topic: Core Data Types


TIME Data Type

Description

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

Notes

You can use relational operators between two variables of type TIME. You can cast a variable of type TIME to or from a type DATETIME. If you cast from a type DATETIME to a TIME, you lose the date information. If you cast from a TIME to a DATETIME, the DATE portion defaults to the current date.

You can generate a TIME constant by specifying a time as a string and then casting the string as a TIME data type. The string must have the ISO format, as follows:

"HH:MM:SS.MSMSMS"

This is an implicit type cast and so does not require the type cast operator (the square brackets). You can truncate the string at any point, as long as the last field is complete.

See the DATETIME data type for a summary of the rules that govern the various ways in which you can convert dates and times using casting.

Parent topic: Core Data Types
Related reference
DATE Data Type
DATETIME Data Type
TimeStr Function
Data Type Ranges
DATETIME Data Type


TIMERSTATE Data Type

The data type returned by the TimerState function to reveal the current state of a particular 4Test timer. 4Test defines this enumerated data type as follows:

[-] type TIMERSTATE is enum
    [ ] TS_STARTED
    [ ] TS_STOPPED
    [ ] TS_PAUSED
Parent topic: Core Data Types


TRACKOBJECT Data Type

4Test defines this enumerated data type as follows:

[-] type TRACKOBJECT is enum
    [ ] TO_DECLARATION
    [ ] TO_DECLARATION
    [ ] TO_IDENTIFIER
    [ ] TO_LOCATION
    [ ] TO_TAG
Parent topic: Core Data Types


TREE Data Type

This functionality is supported only if you are using the Open Agent.

The TREE data type is a LIST OF NODE. It is used in the function TreeView::GetItems.

Parent topic: Core Data Types
Related reference
NODE Data Type
TreeView Class


TVSTYLE Data Type

TVSTYLE describes the style of a treeview: single selection, extended selection, or multiple selection. 4Test defines this enumerated data type as follows:

[-] type TVSTYLE is enum
    [ ] TVS_SINGLE
    [ ] TVS_EXTEND
    [ ] TVS_MULTIPLE
Parent topic: Core Data Types


TVVIEW Data Type

This data type stores information about the various views of items organized into a graphical hierarchy: icon, caption, and normal text. 4Test defines this enumerated data type as follows:

[-] type TVVIEW is enum
    [ ] TVV_ICON
    [ ] TVV_NAME
    [ ] TVV_TEXT
Parent topic: Core Data Types
Related reference
TreeView Class


WINATTR Data Type

4Test defines this record data type as follows:

[-] type WINATTR is record
    [ ] STRING sName
    [ ] STRING sVerifyMethod
    [ ] STRING sGetMethod
Parent topic: Core Data Types
Related reference
WINATTR_LIST Data Type


WINATTR_LIST Data Type

4Test defines this record data type as follows:

type WINATTR_LIST is LIST OF WINATTR
Parent topic: Core Data Types
Related reference
WINATTR Data Type


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 ()
Parent topic: Core Data Types


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.

  • 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.

Parent topic: Core Data Types
Related reference
IsDefined Function


WINDOWINTERACTIONSTATE Data Type

Contains values that specify the current state of the window for purposes of user or programmatic interaction. 4Test defines this enum data type as follows:

[-] type WINDOWINTERACTIONSTATE  is enum
    [ ] WIS_RUNNING
    [ ] WIS_CLOSING
    [ ] WIS_READYFORUSERINTERACTION
    [ ] WIS_BLOCKEDBYMODALWINDOW
    [ ] WIS_NOTRESPONDING
Parent topic: Core Data Types


WINDOWVISUALSTATE Data Type

Contains values that specify the visual state of a window. 4Test defines this enum data type as follows:

[-] type WINDOWVISUALSTATE  is enum
    [ ] WVS_NORMAL
    [ ] WVS_MAXIMIZED
    [ ] WVS_MINIMIZED
Parent topic: Core Data Types


WININFO Data Type

4Test defines this record data type as follows:

[-] type WININFO is record
    [ ] WINDOW w
    [ ] BOOLEAN bEnabled
    [ ] BOOLEAN bChecked
Parent topic: Core Data Types


WINPROP Data Type

4Test defines this record data type as follows:

[-] type WINPROP is record
    [ ] WINDOW w
    [ ] INTEGER iLevel
    [ ] LIST OF PROPINFO lPropInfo
Parent topic: Core Data Types
Related reference
WINPROPLIST Data Type


WINPROPLIST Data Type

4Test defines this list data type as follows:

type WINPROPLIST is LIST OF WINPROP
Parent topic: Core Data Types
Related reference
WINPROP Data Type


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
Parent topic: Core Data Types
Related reference
PROPINFO Data Type


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
    [ ] WS_MAXIMIZED
    [ ] WS_MINIMIZED
Parent topic: Core Data Types


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
Parent topic: Core Data Types


.Net Data Types

  • COLUMNSTYLE Data Type
    Describes the COLUMNSTYLE data type.
  • DATAGRIDCELL Data Type
    Identifies a cell in a DataGrid by specifying the cell’s row and column.
  • DATAGRIDCOL Data Type
    Identifies a column in a grid.
  • DATAGRIDROW Data Type
    Identifies a row in a DataGrid.
  • DataGrid Exceptions
    Lists the exceptions that might occur when DataGridCell, DataGridRow, or DataGridCol is used as a parameter.
Parent topic: Data Types


COLUMNSTYLE Data Type

COLUMNSTYLE data type is an ENUM with 10 values starting at 0:

type COLUMNSTYLE is ENUM
Value | Columnstyle
0 | DEFAULT
1 | EDIT
2 | EDITBUTTON
3 | CHECKBOX
4 | TRISTATECHECKBOX
5 | DROPDOWN
6 | DROPDOWNLIST
7 | DROPDOWNVALIDATE
8 | BUTTON
9 | DROPDOWNCALENDAR

Note

Default indicates that the columnstyle is not set within the application.

Parent topic: .Net Data Types


DATAGRIDCELL Data Type

DATAGRIDCELL identifies a cell in a DataGrid by specifying the cell’s row and column. It is defined as follows:

[-] type DATAGRIDCELL is record
    [ ] DATAGRIDROW Row
    [ ] DATAGRIDCOL Col
Parent topic: .Net Data Types
Related reference
DATAGRIDROW Data Type
DATAGRIDCOL Data Type


DATAGRIDCOL Data Type

DATAGRIDCOL identifies a column in a grid and is defined as follows:

type DATAGRIDCOL is INTEGER, STRING

Example

To identify the column with the cell value of "Last_Name", type the following:

DATAGRIDCELL CurCell = {{1,1,2}, "Last_Name"}

In this example, {1,1,2} is the value for DATAGRIDROW. The DATAGRIDROW value can have several integer values depending on the hierarchy of the data grid. In this example, the DATAGRIDROW navigates to the first row in the data grid followed by the first row in the subgrid and then goes to the second row in this subgrid.

"Last_Name" is the value for DATAGRIDCOL. In the preceding example, the DATAGRIDCOL value is the column with the string header "Last_Name". Alternatively, you can use an integer instead of a string for the column value. In the following example, 3 is the column cell value and {1,1,2} is the row location:

DATAGRIDCELL CurCell = {{1,1,2}, 3}
Parent topic: .Net Data Types
Related reference
DATAGRIDCELL Data Type
DATAGRIDROW Data Type


DATAGRIDROW Data Type

DATAGRIDROW identifies a row in a DataGrid and is defined as follows:

type DATAGRIDROW is LIST OF INTEGER

Notes

Row zero represents the column header.

Parent topic: .Net Data Types
Related reference
DATAGRIDCELL Data Type
DATAGRIDCOL Data Type


DataGrid Exceptions

All DataGrid methods that use DataGridCell, DataGridRow, or DataGridCol as a parameter may see this exceptions raised.

Exception Value | Description
E_COLUMN_INDEX_INVALID | The specified index is not a valid column index.
E_COLUMN_NAME_INVALID | The specified name is not a valid column name.
E_ROW_INDEX_INVALID | The specified index is not a valid row index.
Parent topic: .Net Data Types


Operators

  • Operator Overview
    Provides an overview of the operators and operands that are included in 4Test expressions.
  • Arithmetic Operators
    The arithmetic operators perform addition, subtraction, multiplication, division, exponentiation, and modulus operations.
  • Bitwise Operators
    The bitwise operators perform bitwise AND, bitwise inclusive OR, left shift, right shift, and one’s complement (unary).
  • Concatenation Operator
    The concatenation operator (+) combines two strings or two lists.
  • Conditional Operator
    The conditional operator provides an alternative to using the if statement for conditional logic structures.
  • Increment and Decrement Operators
    The ++ (increment) and -- (decrement) operators take a single argument.
  • List/Array/Set Constructor Operator
    Describes how you can use the list constructor operator to specify the elements of a list, array, or a set.
  • Logical Operators
    Explains that logical operators perform and, or, and not operations.
  • Machine Handle Operator
    Lets you specify the target machine for a function to be executed by the Agent in a distributed testing environment.
  • Member-of Operator
    Use the member-of operator (.) to separate parts of fully qualified object names, separate method names from object names in method calls, get and set properties of objects, and refer to fields in records
  • Reference Operator
    Lets you refer to functions and variables indirectly, by name.
  • Relational Operators
    Compares the first operand to the second, to test the condition that the operator specifies.
  • Set Operator
    Use the set operator (in) to test whether an expression evaluates to a member of a specified set.
  • Scope Resolution Operator
    Describes the situations where you use the scope resolution (::) operator.
  • Shorthand Assignment Syntax
    Lists the assignment operators, where an arithmetic operator is combined with the "equals" sign.
  • Type Cast Operator
    Use the type cast operator to perform explicit type conversions.
  • Unary + and - Operators
    The unary + and - operators each take a single operand.
Parent topic: The 4Test Language


Operator Overview

4Test Expressions

Each 4Test expression is made up of operators and operands.

  • An operator specifies what operation to perform on its operand(s).
  • An operand can be a literal value, constant, identifier, or another expression (such as a function call).

Default Order of Precedence

If you do not use parentheses to make explicit the order of precedence you want, Silk Test Classic evaluates your expressions according to the following table. The table lists the operators in order from highest to lowest precedence.

Operators | Order of evaluation
:: | Left to Right
@ | Right to Left
-> | Left to Right
() [] . | Left to Right
[type] ! ~ unary - unary + ++ - - | Right to Left
* / % ** | Left to Right
+ - | Left to Right
<< >> | Left to Right
< <= > >= | Left to Right
== != | Left to Right
& | Left to Right
^ | Left to Right
| | Left to Right
&& | Left to Right
|| | Left to Right
? : | Left to Right

Overriding Precedence with Parentheses

To override the default order of precedence and tell the compiler exactly how you want it to group operators and operands, use parentheses. For example:

// Without parenthesis, multiplies a by 2, adds result to b
a * 2 + b
// With parenthesis, adds 2 to b, multiplies result by a
a * (2 + b)
Parent topic: Operators


Arithmetic Operators

Definition

The arithmetic operators perform addition, subtraction, multiplication, division, exponentiation, and modulus operations.

Addition | + | Adds one operand to the other
Subtraction | - | Subtracts the second operand from the first
Multiplication | * | Multiplies one operand by the other
Division | / | Divides the first operand by the second
Modulo | % | Divides the first INTEGER operand by the second, and returns the remainder
Exponentiation | ** | Lets you refer to a number in terms of a base value and an exponent

Operand Type

Operands for the arithmetic operators can be integers or real numbers.

Arithmetic Operators with Sets

The plus (+) and minus (-) operators are valid operators for sets. The plus operator is the equivalent of the SetUnion and SetAddMember functions; it performs the union of two sets:

SuperSet = SubSetA + SubSetB

SuperSet contains all members of both subsets with no duplicates. If either of the subsets is a single member, then the plus operator is the equivalent of the SetAddMember function.

The minus operator is the equivalent of the SetExclude and SetRemoveMember functions; it performs the exclusion of two sets, either of which could be a single member:

SubSet = SuperSetA - SuperSetB
SubSet is the set containing all members of SuperSetA that are not also contained in SuperSetB.
Note: The exclusion of set B from set A is equivalent to: SetIntersection (A, SetComplement (B)).

The following examples should make the behavior of set exclusion operations more clear:

Operation | Resulting set
Red - [COLORS]{Green, Blue} | Red
Red - [COLORS]{Red, Green, Blue} | empty set
[COLORS]{Red, Green, Blue} - Red | {Green, Blue}

In the third example above, the specification of a single member as the right operand works like the SetRemove function to remove that member from the left operand set.

Parent topic: Operators


Bitwise Operators

Definition

The bitwise operators perform bitwise AND, bitwise inclusive OR, left shift, right shift, and one’s complement (unary).

Bitwise AND | & | Masks off the specified bits
Bitwise inclusive OR | | | Turns on the specified bits
Bitwise exclusive OR | ^ | Sets to 1 each bit position where the operands have different bits, and sets to 0 each bit position where the operands have the same bits.
Bitwise 1’s complement | ~ | Changes each 1-bit into a 0-bit and vice-versa.
Left Shift | << | Shifts to the left the left operand by the number of bit positions indicated by the right operand.
Right Shift | >> | Shifts to the right the left operand by the number of bit positions indicated by the right operand.

Operand Type

These operators apply to integers.

Result Type

The following table shows each of the possible results for bitwise AND, OR, and exclusive OR (XOR).

 |  | 0 | 1
AND (&) | 0 1 | 0 0 | 0 1
OR ( | ) | 0 1 | 0 1 | 1 1
XOR ( ^ ) | 0 1 | 0 1 | 1 0
Parent topic: Operators


Concatenation Operator

Definition

The concatenation operator (+) combines two strings or two lists.

Operand Type

Both operands must be strings or lists.

Result Type

The operator returns a string or list that consists of the first operand followed by the second.

Example

[ ] // string concatenation
[ ] STRING sFirstName = "Bullwinkle"
[ ] STRING sLastName = "Moose"
[ ] // " " writes a space
[ ] STRING sFullName = sFirstName + " " +sLastName
[ ]
[ ]
[ ] // Prints: Bullwinkle Moose
[ ] Print (sFullName)
[ ]
[ ]
[ ] // list concatenation
[-] LIST lsMelon = {...}
    [ ] "watermelon"
    [ ] "cantaloupe"
[ ]
[-] LIST lsBerry = {...}
    [ ] "strawberry"
    [ ] "raspberry"
[ ]
[ ] LIST lsFruit = lsMelon + lsBerry
[ ] Print (lsFruit)
[ ]
[ ]
[ ] // Prints:
[ ] // {watermelon, cantaloupe, strawberry, raspberry}
Parent topic: Operators


Conditional Operator

Definition

The conditional operator provides an alternative to using the if statement for conditional logic structures.

This statement ... Is equivalent to this statement ...
if (BOOLEAN-expr)

expr3
else
expr4

(BOOLEAN-expr) ? expr3 : expr4

If BOOLEAN-expr is TRUE, then expr3 is evaluated. Otherwise, expr4 is evaluated.

Example

// If x is greater than y, assign value of a to my_var.
// If y is greater than x, assign value of b to my_var.
my_var = (x > y) ? a : b
Parent topic: Operators


Increment and Decrement Operators

Definition

The ++ (increment) and -- (decrement) operators take a single argument.

  • ++ adds one to its operand.

  • -- subtracts one from its operand.

In an assignment statement, the operand’s placement before or after the operand determines whether the increment/decrement operation takes place before or after the assignment.

  • If the operator appears before the operand (++n), the increment or decrement operation occurs before the assignment

  • If the operator appears after the operand (n++), the increment or decrement operation occurs after the assignment

Examples

// The following three statements are equivalent:
i++
i = i + 1
i += 1

// Increment n before assignment.
// Afterwards, both x and n have the value 11.
n = 10
x = ++n

// Increment n after assignment.
// Afterwards, x is 10 and n is 11.
n = 10
x = n++
Parent topic: Operators


List/Array/Set Constructor Operator

Use the list constructor operator to specify the elements of a list, array, or set. The constructor operator has the following three variants:
Format Description Example
{ a , b } The elements of the list, separated by commas and enclosed in braces.
LIST MyList = {"a","b"}
{...} The literal characters {...} followed by indented lines, each containing one element of the list
[-] SET Colors = {...}
    [ ] red
    [ ] green
<text>

For lists of string elements only. The literal characters <text> followed by indented lines each containing one element of the list.

Each element is treated as the literal text of a string. Quotation marks are not needed to indicate the strings.

Additional indentation levels on the lines are interpreted as tabs in the string.

[-] LIST MyList = <text>
    [ ] a
    [ ] "b"
    [ ] 	c
Note: In this example, the three elements of the list are the strings "a" and ""b"" and "<tab>c".

You can find more elaborate examples in the LIST and ARRAY data type topics, the type...is set declaration, and the various LIST, ARRAY, and SET functions.

Parent topic: Operators
Related reference
LIST Data Type
ARRAY Data Type
type ... is set declaration


Logical Operators

Definition

Logical operators perform and, or, and not operations. They work by evaluating the first operand and then, if necessary the second. The second operand is evaluated only if its value is needed to determine the result.

Logical and | && | Returns TRUE if both operands evaluate to TRUE; returns FALSE if either operand is FALSE.
Logical or | || | Returns TRUE if either operand evaluates to TRUE; returns FALSE if both operands are FALSE.
Logical not | ! | Takes only one operand. If the operand evaluates to TRUE, ! makes the resulting value FALSE. If the operand evaluates to FALSE, ! makes the resulting value TRUE.

Operand Type

Operands to logical operators must all have type BOOLEAN.

Result Type

The logical operators return one of the BOOLEAN values TRUE or FALSE.

Parent topic: Operators


Machine Handle Operator

The machine handle operator lets you specify in a convenient, readable way the target machine for a function to be executed by the Agent in a distributed testing environment. Use it to override the default machine specified for the current thread.

For more information about the SYS_File functions that work with target machines, see Functions by Programming Task and About File Handles.

There are two forms for the machine handle operator: arrow (hMachine->) and bracket ([hMachine]).

Arrow Form

To specify a machine handle for a function with the arrow form, type:

hMachine -> distrib_func
Argument | Description
hMachine | The machine handle.
distrib_func | A call to a SYS_ function or a user-defined function. It can be a method call if the hMachine -> syntax starts the line (that is, it is not embedded in a statement). A simple function can be embedded in a statement.

Bracket Form

To specify a machine handle for a function with the bracket form, type:

[hMachine] distrib_func
Argument | Description
hMachine | The machine handle.
distrib_func | A call to a SYS_ function, to a 4Test function that is not being used to return a value, or to an object-oriented method. The bracket form machine handle operator must be at the beginning of the 4Test statement line.

Examples

[ ] hMachine -> SYS_SetDir ()
[-] [hMachine] SYS_SetDir ()
    [ ]
[-] for each sMachine in lsMachine
    [ ] [sMachine] TextEditor.Search.Find.Pick
    [ ]
[ ] ARRAY[20] of STRING machArray
[ ] // Initialize array
[ ] ...
[-] for INTEGER I = 2 to 5
    [ ] [machArray[i]] TextEditor.Search.Find.Pick
The machine handle operator is useful when a thread driving one machine needs to drive something on a different machine. For example:
[-] for each sMachine in lsMachine
    [ ] spawn // start thread for each sMachine
    [ ] SetMachine (sMachine)
    [ ] // ... code executed on sMachine
[ ]
[ ] ["server"]doThis() // code executed on "server"
[ ]
[ ] // ... continue with code for sMachine
[ ] rendezvous

Comparing Bracket and Arrow Forms

The bracket form has the advantage over the arrow form because it allows any expression to supply the machine handle. The arrow form requires the machine handle to be addressable.

Type casting is valid within the machine operator. This means you can specify the string form of the machine name instead of the handle form. Thus the following four statements accomplish the same thing if hMachine is the handle returned by Connect ("MyMachine"):

hMachine -> SYS_SetDir ()
[hMachine] SYS_SetDir ()
"MyMachine" -> SYS_SetDir ()
["MyMachine"] SYS_SetDir ()
Parent topic: Operators
Related concepts
Overview of File Handles and Remote File Input and Output
Related tasks
Testing Applications in Multiple UI Sessions on a Single Machine
Related reference
Functions by Programming Task


Member-of Operator

Ways to Use Member-of

Use the member-of operator (.) to perform the following operations:

  • Separating parts of fully qualified object names.
  • Separating method names from object names in method calls.
  • Getting and setting properties of objects.
  • Referring to fields in records.

Fully Qualifying Object Names

To call methods or properties to manipulate an object, you specify the object’s fully qualified name. The complete name is composed of the name of the object itself and the names of each of its ancestors. Separate each ancestor name with the member-of operator:

parent-window-name.child-window-name
For example, you might refer to the Find item on the Text Editor’s Search menu as follows:
TextEditor.Search.Find

Calling Methods

To call a method by name, you precede its name with the fully qualified name of the object you want the method to act upon. Separate the object name from the method name with the member-of operator:

full-wname.method (arguments)
Argument | Description
full-wname | The name of the window itself and the names of each of its ancestors, separated with the member-of operator.
method | A Silk Test Classic method or user-defined method.
argument | The appropriate arguments to the method, if any.
For example, you might pick the Find item on the Text Editor’s Search menu as follows:
TextEditor.Search.Find.Pick ()

Getting and Setting Properties

To get and set an object's properties, precede its name with the complete name of a window. Separate the property name and the window name with the member-of (.) operator:

To get the value of a property, use this format:

variable = complete-window-name.property

To set the value of a property, use this format:

complete-window-name.property = value

For example, you might get the current selection in the Filename list box of the File Open dialog box as follows:

STRING x = FileOpen.Filename.sValue

And to set the selection string in the Filename list box in the File Open dialog box:

FileOpen.Filename.sValue = "test.txt"

Referring to Fields in Records

You refer to a field in a record with an expression of the form record.field. For example, if the record MyEmployee contains a field sPhone, you might refer to the field as follows:
MyEmployee.sPhone = "123-4567"
Parent topic: Operators


Reference Operator

The reference operator (@expression) lets you refer to functions and variables indirectly, by name. It uses the value of its operand to refer to variable, the fields in a record, function, method, property or child window.

Example

INTEGER i = RandInt (1,32)
@("Test{i}") ()

This invokes a randomly selected test from the set Test1, Test2,...Test32.

Parent topic: Operators


Relational Operators

Definition

The relational operators compare the first operand to the second, to test the condition that the operator specifies.

Equality | == | Tests whether the operands are equal; returns TRUE if they are equal and FALSE otherwise. For lists and arrays, each element must be equal to its corresponding element; for records, each field must compare equal to its corresponding field to evaluate to TRUE. For data classes, the operator evaluates to TRUE if the classes are compatible, meaning that the classes are the same, or that one of the classes is a subclass of the other.
Inequality | != | Tests whether the operands are not equal; returns TRUE if they are unequal, FALSE otherwise. For lists, arrays, and records, if one set of corresponding elements or fields is not equal, returns TRUE.
Greater Than | > | Tests whether the value of the first operand is greater than the value of the second; returns TRUE if it is, and FALSE otherwise.
Greater Than or Equal | >= | Tests whether the value of the first operand is greater than or equal to the value of the second; returns TRUE if it is, and FALSE otherwise
Less Than | < | Tests whether the value of the first operand is less than the value of the second; returns TRUE if it is, and FALSE otherwise.
Less Than or Equal | <= | Tests whether the value of the first operand is less than or equal to the value of the second; returns TRUE if it is, and FALSE otherwise.

Operand Type

The operands to relational operators can have any of the base 4Test simple types. The equality and inequality operators can also take compound types, such as lists, arrays, and records.

Result Type

Relational operators all return BOOLEAN values.

Caveat

The following code compiles in C, but not in 4Test:

if ((i=5) == TRUE)

This difference is intentional. Because this construct can lead to unreadable code, 4Test does not allow it.

Parent topic: Operators


Set Operator

You can use the set operator (in) to test whether an expression evaluates to a member of a specified set. The syntax is:

set-member-expr in set-expr

For example:

COLORS HotColors = {Red, Yellow, Orange}
Print (Purple in HotColors) // Prints FALSE
Parent topic: Operators


Scope Resolution Operator

Use the scope resolution (::) operator inside a window or class declaration to refer to a method, property, child window, or variable that is inherited by the window or class, rather than the method, property, child window, or variable of the same name which the class itself defines.

Parent topic: Operators


Shorthand Assignment Syntax

4Test supports the following assignment operators, where an arithmetic operator is combined with the "equals" sign:

+= | ^=
-= | &=
*= | |=
/= | <<=
%= | >>=
**= | ~=
This Shorthand Syntax... | Is Equivalent to This Syntax...
referent operator = expr | referent = referent operator expr
i += 5 | i = i + 5
xyz %= 10 | xyz = xyz % 10
LongName *= 2 | LongName = LongName * 2

The referent is any data object that resolves to a specific location in memory where data is stored, such as an identifier, an index for a list element, or a record field.

This shorthand is useful whenever you need to increment or decrement an object. If a referent's name is long, you may find it easier to read and type than the conventional assignment syntax.

Parent topic: Operators


Type Cast Operator

Definition

Use the type cast operator to perform explicit type conversions. The type cast operator converts the data type of expr to the type specified by type-name:

[type-name] expr
  • Explicit type conversions require the type cast operator.
  • Implicit type conversions are performed automatically by 4Test and do not require explicit type casting.

The following table summarizes type conversions:

Explicit Type Conversions | Implicit Type Conversions
BOOLEAN to INTEGER INTEGER to enum BOOLEAN to enum non-string to STRING record to LIST STRING to INTEGER STRING to GUITYPE ** DATETIME to DATE ** DATETIME to TIME ** DATE to DATETIME ** TIME to DATETIME SET to LIST SET to INTEGER INTEGER to SET INTEGER to SEMAPHORE | INTEGER to REAL INTEGER to BOOLEAN **** REAL to INTEGER enum to INTEGER LIST to record LIST to ARRAY ARRAY to LIST * LIST OF type-1 to LIST OF type-2 * ARRAY of type-1 to ARRAY OF type-2 GUITYPE to INTEGER enum to BOOLEAN *** STRING to DATETIME STRING to HMACHINE LIST to SET
* Applies conversion rules to the built-in types in the list or array ** See DATETIME data type description for more information. *** If string is ISO format: YYY-MM-DD HH.MM.SS.MSMSMS **** Casting a REAL to an INTEGER will truncate the REAL number.

Example

[-] main ()
    [ ] CastIntToBOOLEAN()
    [ ] CastStringToGUITYPE()
    [ ] CastStringToDATETIME()
    [ ] CastStringToInt()
[ ]
[-] testcase IntToBOOLEAN()
    [ ] Print([BOOLEAN]0 == FALSE) // prints: TRUE
    [ ] Print([BOOLEAN]1 == TRUE) // prints: TRUE
    [ ]
[-] testcase CastStringToGUITYPE()
    [ ] STRING sName = "msw"
    [ ] Print([GUITYPE]sName == msw) // prints: TRUE
[ ]
[-] testcase CastStringToDATETIME()
    [ ] DATETIME GrandOpening = "2006-12-02 09:00"
    [ ] sGrandOpening = FormatDateTime (GrandOpening,"mm/dd/yy")
    [ ] Print (sGrandOpening) // prints "12/02/06"
[ ]
[-] testcase CastStringToInt()
    [ ] STRING sName = "SilkTest"
    [ ] Print([INTEGER]sName == 83) // prints: TRUE
Note: The result of casting a string to an integer is the numeric value of the first character in the string. Thus in the CastStringToInt example above the result is 83, which is the decimal value of the ASCII character S.

SET <___> INTEGER Example

The first 32 members of a SET variable can be implicitly cast as an INTEGER variable. The result is a bit mask with each set bit corresponding to a value in that SET data type that is contained in this SET variable.

[ ] // Establish a COLORS data type with 6 possible colors
[-] type COLORS is set
    [ ] Red
    [ ] Blue
    [ ] Yellow
    [ ] Green
    [ ] Purple
    [ ] Orange
    [ ]
[ ] // Create a COLORS object
[ ] COLORS CoolColors = {Blue, Green, Purple}
[ ] Print ([INTEGER] CoolColors) // prints: 26 (explicit cast)
[ ] Print (CoolColors == 26) // prints: TRUE (implicit cast)

The bit mask representing CoolColors is 0000 0000 0001 1010, which is the hexadecimal value 0x001A, or the decimal value 26.

Parent topic: Operators


Unary + and - Operators

Definition

The unary + and - operators each take a single operand.

  • The + operator has no effect on its operand.

  • The - operator negates its operand.

Examples

x = -5 // assigns negative five to x
x = +5 // assigns five to x
Parent topic: Operators


Understanding the Recovery System for the Classic Agent

The built-in recovery system is one of the most powerful features of Silk Test Classic because it allows you to run tests unattended. When your application fails, the recovery system restores the application to a stable state, known as the BaseState, so that the rest of your tests can continue to run unattended.

The recovery system can restore your application to its BaseState at any point during test case execution:

  • Before the first line of your test case begins running, the recovery system restores the application to the BaseState even if an unexpected event corrupted the application between test cases.
  • During a test case, if an application error occurs, the recovery system terminates the execution of the test case, writes a message in the error log, and restores the application to the BaseState before running the next test case.
  • After the test case completes, if the test case was not able to clean up after itself, for example it could not close a dialog box it opened, the recovery system restores the application to the BaseState.
  • The recovery system cannot recover from an application crash that produces a modal dialog box, such as a General Protection Fault (GPF).

Silk Test Classic uses the recovery system for all test cases that are based on DefaultBaseState or based on a chain of application states that ultimately are based on DefaultBaseState.

  • If your test case is based on an application state of none or a chain of application states ultimately based on none, all functions within the recovery system are not called. For example, SetAppState and SetBaseState are not called, while DefaultTestCaseEnter, DefaultTestCaseExit, and error handling are called.

Such a test case will be defined in the script file as:

testcase Name () appstate none

Silk Test Classic records test cases based on DefaultBaseState as:

testcase Name ()

How the default recovery system is implemented

The default recovery system is implemented through several functions.

Function | Purpose
DefaultBaseState | Restores the default BaseState, then call the application’s BaseState function, if defined.
DefaultScriptEnter | Executed when a script file is first accessed. Default action: none.
DefaultScriptExit | Executed when a script file is exited. Default action: Call the ExceptLog function if the script had errors.
DefaultTestCaseEnter | Executed when a test case is about to start. Default action: Set the application state.
DefaultTestCaseExit | Executed when a test case has ended. Default action: Call the ExceptLog function if the script had errors, then set the BaseState.
DefaultTestPlanEnter | Executed when a test plan is entered. Default action: none.
DefaultTestPlanExit | Executed when a test plan is exited. Default action: none.

You can write functions that override some of the default behavior of the recovery system.

Related concepts
Overview of Application States
Overriding the Default Recovery System


AllowDeselection Property (SparkButtonBarButton)

Class

SparkButtonBarButton class

Action

Gets a value whether the user click on a currently selected button deselects it.

Data Type

BOOLEAN

Access

Read only


AllowDisjointSelection Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets whether non-contiguous selection is allowed in the DateChooser control.

If true, non-contiguous selection is allowed in the DateChooser control. This property has an effect only if the allowMultipleSelection property is true. Setting this property changes the appearance of the DateChooser control.

The default value is true.

Data Type

BOOLEAN

Access

Read only


AllowDragSelection Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets whether drag-selection is enabled. Drag-Selection is the ability to select an item by dragging into it as opposed to normal selection where you can't have the mouse button down when you mouse over the item you want to select.

This feature is used in ComboBox dropdowns to support pressing the mouse button when the mouse is over the dropdown button then dragging the mouse into the dropdown to select an item.

The default value is false.

Data Type

BOOLEAN

Access

Read only


AllowMultipleSelection Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets whether multiple selection is allowed in the DateChooser control.

If true, specifies that multiple selection is allowed in the DateChooser control.

The default value is false.

Data Type

BOOLEAN

Access

Read only


AllowMultipleSelection Property (FlexListBase)

Class

FlexListBase class

Action

Gets whether you can allow more than one item to be selected at the same time.

If true, users can select multiple items. There is no option to disallow noncontiguous selection. Standard complex selection options are always in effect (Shift-click, Ctrl-click).

The default value is false.

Data Type

BOOLEAN

Access

Read only


AllowMultipleSelection Property (SparkList)

Class

SparkList class

Action

Gets a value if multiple selection is enabled.

Data Type

BOOLEAN

Access

Read only


AllowValueWrap Property (SparkSpinner)

Class

SparkSpinner class

Action

Gets the behavior of the control for a step when the current value is either the maximum or minimum value.

Data Type

BOOLEAN

Access

Read only


Alpha Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets the alpha transparency value of the object specified.

Valid values are 0 (fully transparent) to 1 (fully opaque). The default value is 1. Display objects with alpha set to 0 are active, even though they are invisible.

Data Type

REAL

Access

Read only


AlternatingItemColors Property (FlexComboBox)

Class

FlexComboBox class

Action

Gets the set of BackgroundColors for drop-down list rows in an alternating pattern.

Value can be an Array of two of more colors. If undefined then the rows will use the drop-down list's backgroundColor style. The default value is undefined.

Data Type

LIST OF COLOR

Access

Read only


AlternatingItemColors Property (FlexListBase)

Class

FlexListBase class

Action

Gets the colors to use for the backgrounds of the items in the list.

The value is an array of two or more colors. The backgrounds of the list items alternate among the colors in the array. Used only if the backgroundColor property is not specified. The default value is undefined.

Data Type

LIST OF COLOR

Access

Read only


AlternatingItemColors Property (FlexMenu)

Class

FlexMenu class

Action

Gets the colors used for menu or submenu menu items in an alternating pattern.

The value can be an Array of two or more colors. This style is only used if backgroundColor is not specified. The default value is undefined.

Data Type

LIST OF COLOR

Access

Read only


AlwaysInFront Property (FlexWindow)

Class

FlexWindow class

Action

Gets a value whether the underlying NativeWindow is always in front of other windows.

Data Type

BOOLEAN

Access

Read only


AlwaysInFront Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets a value whether the underlying NativeWindow is always in front of other windows.

Data Type

BOOLEAN

Access

Read only


AlwaysInFront Property (SparkWindow)

Class

SparkWindow class

Action

Gets a value whether the underlying NativeWindow is always in front of other windows.

Data Type

BOOLEAN

Access

Read only


AlwaysInFront Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets a value whether the underlying NativeWindow is always in front of other windows.

Data Type

BOOLEAN

Access

Read only


ApplicationID Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets the identifier that AIR uses to identify the application.

Data Type

STRING

Access

Read only


ApplicationID Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets the identifier that AIR uses to identify the application.

Data Type

STRING

Access

Read only


AutoDisplayFirstFrame Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets whether the video is loaded when the source is set.

Data Type

BOOLEAN

Access

Read only


AutoExit Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets a value whether the AIR application will quit when the last window closes or will continue running in the background.

Data Type

BOOLEAN

Access

Read only


AutoExit Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets a value whether the AIR application will quit when the last window closes or will continue running in the background.

Data Type

BOOLEAN

Access

Read only


AutoLayout Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets a value whether measurement and layout are done when the position or size of a child is changed.

Data Type

BOOLEAN

Access

Read only


AutoLayout Property (SparkSkinnableContainer)

Class

SparkSkinnableContainer class

Action

Gets whether measurement and layout are done when the position or size of a child is changed.

Data Type

BOOLEAN

Access

Read only


AutoLayout Property (SparkSkinnableDataContainer)

Class

SparkSkinnableDataContainer class

Action

Gets the measurement and layout are done when the position or size of a child is changed.

Data Type

BOOLEAN

Access

Read only


AutomationClassName Property (FlexListLabel)

Class

FlexListLabel class

Action

Gets a string containing the automation class name for the element.

Data Type

STRING

Access

Read only


AutomationClassName Property (FlexObject)

Class

FlexObject class

Action

Gets a string containing the automation class name for the element.

Data Type

STRING

Access

Read only


AutomationClassName Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets a string containing the automation class name for the element.

Data Type

STRING

Access

Read only


AutomationClassName Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets a string containing the automation class name for the element.

Data Type

STRING

Access

Read only


AutomationIndex Property (FlexListLabel)

Class

FlexListLabel class

Action

Gets a string containing the automation index for the element.

Data Type

STRING

Access

Read only


AutomationIndex Property (FlexObject)

Class

FlexObject class

Action

Gets a string containing the automation index for the element.

Data Type

STRING

Access

Read only


AutomationIndex Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets a string containing the automation index for the element.

Data Type

STRING

Access

Read only


AutomationIndex Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets a string containing the automation index for the element.

Data Type

STRING

Access

Read only


AutomationName Property (FlexListLabel)

Class

FlexListLabel class

Action

Gets the name that can be used as an identifier for this object.

Data Type

STRING

Access

Read only


AutomationName Property (FlexObject)

Class

FlexObject class

Action

Gets the name that can be used as an identifier for this object.

Data Type

STRING

Access

Read only


AutomationName Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets the name that can be used as an identifier for this object.

Data Type

STRING

Access

Read only


AutomationName Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the name that can be used as an identifier for this object.

Data Type

STRING

Access

Read only


AutomationValue Property (FlexListLabel)

Class

FlexListLabel class

Action

Gets the value that generally corresponds to the rendered appearance of the object and should be usable for correlating the identifier with the object as it appears visually within the application.

Data Type

STRING

Access

Read only


AutomationValue Property (SparkDataGridLabel)

Class

SparkDataGridLabel class

Action

Gets a value which can be used to uniquely identify this item.

Data Type

STRING

Access

Read only


AutomationValue Property (SparkListLabel)

Class

SparkListLabel class

Action

Gets a value which can be used to uniquely identify this item.

Data Type

STRING

Access

Read only


AutoPlay Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets whether the video starts playing immediately when the source property is set.

Data Type

BOOLEAN

Access

Read only


AutoRepeat Property (SparkButtonBase)

Class

SparkButtonBase class

Action

Gets whether to dispatch repeated buttonDown events if the user holds down the mouse button.

Data Type

BOOLEAN

Access

Read only


AutoRewind Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets whether the FLV file should rewind to the first frame when play stops.

Data Type

BOOLEAN

Access

Read only


BackgroundAlpha Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the alpha level of the color defined by the backgroundColor property, of the image or SWF file defined by the backgroundImage style.

Valid values range from 0.0 to 1.0.

For most controls, the default value is 1.0, but for ToolTip controls, the default value is 0.95 and for Alert controls, the default value is 0.9. The default value is 1.0.

Data Type

REAL

Access

Read only


BackgroundAlpha Property (FlexContainer)

Class

FlexContainer class

Action

Gets the alpha level of the color defined by the backgroundColor property, of the image or SWF file defined by the backgroundImage style. Valid values range from 0.0 to 1.0.

For most controls, the default value is 1.0, but for ToolTip controls, the default value is 0.95 and for Alert controls, the default value is 0.9. The default value is 1.0.

Data Type

REAL

Access

Read only


BackgroundColor Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the background color of a component.

You can have both a backgroundColor and a backgroundImage set. Some components do not have a background. The DataGrid control ignores this style. The default value is undefined, which means it is not set. If both this style and the backgroundImage style are undefined, the component has a transparent background.

For the Application container, this style specifies the background color while the application loads, and a background gradient while it is running. Flex calculates the gradient pattern between a color slightly darker than the specified color, and a color slightly lighter than the specified color.

The default skins of most Flex controls are partially transparent. As a result, the background color of a container partially shows through to controls that are in that container. You can avoid this by setting the alpha values of the control's fillAlphas property to 1.

Data Type

COLOR

Access

Read only


BackgroundColor Property (FlexContainer)

Class

FlexContainer class

Action

Gets the background color of a component.

You can have both a backgroundColor and a backgroundImage set. Some components do not have a background. The DataGrid control ignores this style. The default value is undefined, which means it is not set. If both this style and the backgroundImage style are undefined, the component has a transparent background.

For the Application container, this style specifies the background color while the application loads, and a background gradient while it is running. Flex calculates the gradient pattern between a color slightly darker than the specified color, and a color slightly lighter than the specified color.

The default skins of most Flex controls are partially transparent. As a result, the background color of a container partially shows through to controls that are in that container. You can avoid this by setting the alpha values of the control's fillAlphas property to 1.

Data Type

COLOR

Access

Read only


BackgroundColor Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the background color of the component.

The default value is undefined, which means it is not set and the component has a transparent background.

The default skins of most Flex controls are partially transparent. As a result, the background color of a container partially shows through to controls that are in that container. You can avoid this by setting the alpha values of the control's fillAlphas property to 1.

Data Type

COLOR

Access

Read only


BackgroundDisabledColor Property (FlexContainer)

Class

FlexContainer class

Action

Gets the background color of the component when it is disabled. The global default value is undefined.

The default value for List controls is 0xDDDDDD (light gray). If a container is disabled, the background is dimmed, and the degree of dimming is controlled by the disabledOverlayAlpha style.

Data Type

COLOR

Access

Read only


BackgroundDisabledColor Property (FlexListBase)

Class

FlexListBase class

Action

Gets the color of text in the component if it is disabled. The default value is 0xAAB3B3.

Data Type

COLOR

Access

Read only


BackgroundImage Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the background image of a component.

This can be an absolute or relative URL or class.

You can either have both a backgroundColor and a backgroundImage set at the same time. The background image is displayed on top of the background color. The default value is undefined, meaning "not set." If this style and the backgroundColor style are undefined, the component has a transparent background.

The default skins of most Flex controls are partially transparent. As a result, the background image of a container partially shows through to controls that are in that container. You can avoid this by setting the alpha values of the control's fillAlphas property to 1.

Data Type

STRING

Access

Read only


BackgroundImage Property (FlexContainer)

Class

FlexContainer class

Action

Gets the background image of a component. This can be an absolute or relative URL or class.

You can either have both a backgroundColor and a backgroundImage set at the same time. The background image is displayed on top of the background color. The default value is undefined, meaning "not set." If this style and the backgroundColor style are undefined, the component has a transparent background.

The default skins of most Flex controls are partially transparent. As a result, the background image of a container partially shows through to controls that are in that container. You can avoid this by setting the alpha values of the control's fillAlphas property to 1.

Data Type

STRING

Access

Read only


BackgroundSize Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the percentage to change the image size to for the specified backgroundImage.

A value of 100% stretches the image to fit the entire component. To specify a percentage value, you must include the percent sign (%). The default for the Application container is 100%. The default value for all other containers is auto, which maintains the original size of the image.

Data Type

STRING

Access

Read only


BackgroundSize Property (FlexContainer)

Class

FlexContainer class

Action

Gets the percentage to change the image size to for the specified backgroundImage.

A value of 100% stretches the image to fit the entire component. To specify a percentage value, you must include the percent sign (%). The default for the Application container is 100%. The default value for all other containers is auto, which maintains the original size of the image.

Data Type

STRING

Access

Read only


BarColor Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the color of a ProgressBar.

A ProgressBar is filled with a vertical gradient between this color and a brighter color computed from it. This style has no effect on other components, but can be set on a container to control the appearance of all progress bars found within. The default value is undefined, which means it is not set. In this case, the themeColor style property is used.

Data Type

COLOR

Access

Read only


BarWidthRatio Property (FlexBarChart)

Class

FlexBarChart class

Action

Gets how wide to draw the bars relative to the category width, as a percentage in the range of 0 to 1.

A value of 1 uses the entire space, while a value of 0.6 uses 60% of the bar's available space. The actual bar width used is the smaller of the barWidthRatio property and the maxbarWidth property Clustered bars divide this space proportionally among the bars in each cluster. The default value is 0.65.

Data Type

REAL

Access

Read only


BarWidthRatio Property (FlexBarSeries)

Class

FlexBarSeries class

Action

Gets the width to render the bars relative to the category width.

A value of 1 uses the entire space, while a value of .6 uses 60% of the bar's available space. You typically do not set this property directly. The actual bar width used is the smaller of barWidthRatio and the maxbarWidth property

The default value is .65.

Data Type

REAL

Access

Read only


BlendMode Property (SparkGroup)

Class

SparkGroup class

Action

Gets a value from the BlendMode class that specifies which blend mode to use.

Data Type

STRING

Access

Read only


BorderColor Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the black section of a three-dimensional border, or the color section of a two-dimensional border. The default value is 0xB7BABC.

Data Type

COLOR

Access

Read only


BytesLoaded Property (SparkImage)

Class

SparkImage class

Action

Gets the number of bytes of the image already loaded.

Data Type

REAL

Access

Read only


BytesLoaded Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets the number of bytes of data that have been downloaded into the application.

Data Type

REAL

Access

Read only


BytesTotal Property (SparkImage)

Class

SparkImage class

Action

Gets the total image data in bytes loaded or pending load.

Data Type

REAL

Access

Read only


BytesTotal Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets the total size in bytes of the data being downloaded into the application.

Data Type

REAL

Access

Read only


CalloutGap Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets how much space, in pixels, to insert between the edge of the pie and the labels when rendering callouts. The default value is 10.

Data Type

REAL

Access

Read only


CanDropLabels Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets whether the AxisRenderer should drop labels as necessary to lay out correctly.

Set to true to cause the AxisRenderer to drop overlapping labels when rendering. Labels are always rendered at regular intervals. If necessary, the AxisRenderer will render every other label, or every third label, but never drop two or more consecutive labels.

Set to false to cause the AxisRenderer to use other schemes (rotation, scaling) to lay out the labels.

If you do not explicitly set this style, the AxisRenderer defaults to an appropriate value based on the type of axis being rendered.

Data Type

BOOLEAN

Access

Read only


CanStagger Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets whether to stagger labels on two label rows. Use this setting to minimize the space required for the labels. The default value is true, which staggers the labels.

Data Type

BOOLEAN

Access

Read only


CaretIndex Property (SparkListBase)

Class

SparkListBase class

Action

Gets the item that is currently in focus.

Data Type

REAL

Access

Read only


ChangeFocus Method (FlexObject)

Class

FlexObject class

Action

Changes the current focus.

Syntax

object.ChangeFocus([shiftKey, keyCode])
Variable | Description
shiftKey | Optional.true to activate the shift key modifier. BOOLEAN.
keyCode | Optional.the key code value of the key pressed or released. STRING.


ChangeFocus Method (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Defines the value of the type property of a keyFocusChange event object.

Syntax

uIMovieClip.ChangeFocus([shiftKey, keyCode])
Variable | Description
shiftKey | Optional.True if the Shift key modifier is activated; false otherwise. BOOLEAN.
keyCode | Optional.The key code value of the key pressed to trigger a keyFocusChange event. STRING.


Change Method (FlexAccordion)

Class

FlexAccordion class

Action

Dispatched when the selected child container changes.

The IndexChangedEvent.CHANGE constant defines the value of the type property of the event object for a change event, which indicates that an index has changed, such as when an Accordion control changes the displayed panel or a ViewStack changes views.

Syntax

accordion.Change([relatedObject])
Variable | Description
relatedObject | Optional.Contains a reference to the child object that corresponds to the new index. STRING.


Change Method (FlexColorPicker)

Class

FlexColorPicker class

Action

Dispatched when the selected color changes as a result of user interaction.

Syntax

colorPicker.Change(color)
Variable | Description
color | The RGB color that was selected. COLOR.


Change Method (FlexDateChooser)

Class

FlexDateChooser class

Action

Dispatched when a date is selected or changed.

Syntax

dateChooser.Change(newDate)
Variable | Description
newDate | The date selected in the control. DATETIME.


Change Method (FlexDateField)

Class

FlexDateField class

Action

Dispatched when a date is selected or changed, and the DateChooser control closes.

Syntax

dateField.Change(newDate)
Variable | Description
newDate | The date selected in the control. DATETIME.


Change Method (FlexNavigationBar)

Class

FlexNavigationBar class

Action

Defines the value of the type property of the event object for an itemClick event.

Syntax

navigationBar.Change(relatedObject)
Variable | Description
relatedObject | The child object that generated the event. STRING.


Change Method (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Dispatched when the value of the NumericStepper control changes as a result of user interaction.

Syntax

numericStepper.Change(value)
Variable | Description
value | The value of the NumericStepper control when the event was dispatched. REAL.


Change Method (FlexSlider)

Class

FlexSlider class

Action

Dispatched when the slider changes value due to mouse or keyboard interaction.

Syntax

slider.Change(value, [thumbIndex, clickTarget, triggerEvent, keyCode])
Variable | Description
value | The new value of the slider. REAL.
thumbIndex | Optional.The zero-based index of the thumb whose position has changed. INTEGER.
clickTarget | Optional.Whether the slider track or a slider thumb was pressed. STRING.
triggerEvent | Optional.The event, such as a mouse or keyboard event, that triggered the action. FLEXTRIGGEREVENT.
keyCode | Optional.The key code value of the key pressed or released. STRING.


Change Method (FlexTabNavigator)

Class

FlexTabNavigator class

Action

Defines the value of the type property of the event object for an itemClick event.

Syntax

tabNavigator.Change(relatedObject)
Variable | Description
relatedObject | The child object that generated the event. STRING.


Change Method (SparkSpinner)

Class

SparkSpinner class

Action

Dispatched when the value of the NumericStepper changes as a result of user interaction.

Syntax

spinner.Change(value)
Variable | Description
value | The value of the NumericStepper when the change occured. REAL.


Change Method (SparkTrackBase)

Class

SparkTrackBase class

Action

Dispatched when the value of the NumericStepper changes as a result of user interaction.

Syntax

trackBase.Change(value)
Variable | Description
value | The value of the NumericStepper when the change occured. REAL.


ClassName Property (FlexListLabel)

Class

FlexListLabel class

Action

Gets the name of this instance's class, such as "Button".

Data Type

STRING

Access

Read only


ClassName Property (FlexObject)

Class

FlexObject class

Action

Gets the name of this instance's class, such as Button.

Data Type

STRING

Access

Read only


ClassName Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets a string containing the class name of the element as assigned by the control developer.

Data Type

STRING

Access

Read only


ClassName Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the name of this instance's class, such as "Button".

Data Type

STRING

Access

Read only


ClearOnLoad Property (SparkImage)

Class

SparkImage class

Action

Gets whether or not to clear previous image content prior to loading new content.

Data Type

BOOLEAN

Access

Read only


ClipAndEnableScrolling Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets a value whether to clip the children to the boundaries of the viewport.

Data Type

BOOLEAN

Access

Read only


ClipAndEnableScrolling Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets whether to clip the children to the boundaries of the viewport.

Data Type

BOOLEAN

Access

Read only


ClipContent Property (FlexChart)

Class

FlexChart class

Action

Gets whether Flex clips the chart to the area bounded by the axes. Set to false to clip the chart. Set to true to avoid clipping when the data is rendered.

Data Type

BOOLEAN

Access

Read only


Closed Property (FlexWindow)

Class

FlexWindow class

Action

Gets a value whether the underlying window has been closed.

Data Type

BOOLEAN

Access

Read only


Closed Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets a value whether the underlying window has been closed.

Data Type

BOOLEAN

Access

Read only


Closed Property (SparkWindow)

Class

SparkWindow class

Action

Gets a value whether the underlying window has been closed.

Data Type

BOOLEAN

Access

Read only


Closed Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets a value whether the underlying window has been closed.

Data Type

BOOLEAN

Access

Read only


Close Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Closes or collapses a AdvancedDataGrid branch.

Syntax

advancedDataGrid.Close(itemRenderer, [triggerEvent])
Variable | Description
itemRenderer | The ListItemRenderer for the node that closed. STRING.
triggerEvent | Optional.If the node closed in response to a user action, identifies it as a keyboard action or a mouse action. FLEXTRIGGEREVENT.


Close Method (FlexComboBase)

Class

FlexComboBase class

Action

Defines the value of the type property of the event object for a close event.

Syntax

comboBase.Close([triggerEvent])
Variable | Description
triggerEvent | Optional.A value indicating the type of input action that triggered the event. FLEXTRIGGEREVENT.


Close Method (FlexPopUpButton)

Class

FlexPopUpButton class

Action

Dispatched when the specified UIComponent closes.

The DropdownEvent.CLOSE constant defines the value of the type property of the event object for a close event.

Syntax

popUpButton.Close([triggerEvent])
Variable | Description
triggerEvent | Optional.A value indicating the type of input action that triggered the event. FLEXTRIGGEREVENT.


Close Method (FlexTree)

Class

FlexTree class

Action

Closes or collapses a tree branch.

Syntax

tree.Close(itemRenderer, [triggerEvent])
Variable | Description
itemRenderer | The ListItemRenderer for the node that closed. STRING.
triggerEvent | Optional.If the node closed in response to a user action, identifies it as a keyboard action or a mouse action. FLEXTRIGGEREVENT.


ColorCorrection Property (SparkApplication)

Class

SparkApplication class

Action

Gets the value of the stage's colorCorrection property.

Data Type

STRING

Access

Read only


Color Property (FlexButton)

Class

FlexButton class

Action

Gets the color of text in the component, including the component label. The default value is 0x0B333C.

Data Type

COLOR

Access

Read only


Color Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the color of text in the component, including the component label.

Data Type

COLOR

Access

Read only


Color Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the color of text in the component, including the component label. The default value is 0x0B333C.

Data Type

COLOR

Access

Read only


Color Property (FlexLabel)

Class

FlexLabel class

Action

Gets the color of text in the component, including the component label. The default value is 0x0B333C.

Data Type

COLOR

Access

Read only


Color Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the color of text in the component, including the component label. The default value is 0x0B333C.

Data Type

COLOR

Access

Read only


Color Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the color of text in the component, including the component label. The default value is 0x0B333C.

Data Type

COLOR

Access

Read only


Color Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the color of text in the component, including the component label. The default value is 0x0B333C.

Data Type

COLOR

Access

Read only


Color Property (FlexRule)

Class

FlexRule class

Action

Gets the color of the line.

Data Type

COLOR

Access

Read only


Color Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the color of text in the component, including the component label. The default value is 0x0B333C.

Data Type

COLOR

Access

Read only


ColumnCount Property (FlexColorPicker)

Class

FlexColorPicker class

Action

Gets the number of columns in the swatch grid. The default value is 20.

Deprecated Since 3.0: Use swatchPanelStyleName

Data Type

INTEGER

Access

Read only


ColumnCount Property (FlexListBase)

Class

FlexListBase class

Action

Gets the number of columns to be displayed in a TileList control or items in a HorizontalList control.

For the DataGrid it is the number of visible columns. Note: Setting this property has no effect on a DataGrid control, which bases the number of columns on the control width and the individual column widths.

The default value is 4.

Data Type

INTEGER

Access

Read only


ColumnGroupedADGHeaderShift Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Dispatched when the user releases the mouse button on a column header after having dragged the column to a new location resulting in shifting the column to a new index.

Syntax

advancedDataGrid.ColumnGroupedADGHeaderShift(movingColumnIndex, newColumnIndex, oldColumnIndex, [triggerEvent])
Variable | Description
movingColumnIndex | The data provider index of the item to be selected. INTEGER.
newColumnIndex | The zero-based index after the change. INTEGER.
oldColumnIndex | The zero-based index before the change. INTEGER.
triggerEvent | Optional.The event, such as a mouse or keyboard event, that triggered the selection action. FLEXTRIGGEREVENT.


ColumnNames Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (FlexChart)

Class

FlexChart class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (FlexChartSeries)

Class

FlexChartSeries class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (FlexComboBox)

Class

FlexComboBox class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (FlexContainer)

Class

FlexContainer class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (FlexListBase)

Class

FlexListBase class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (FlexMenu)

Class

FlexMenu class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets a list containing the names of all columns.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (SparkSkinnableContainerBase)

Class

SparkSkinnableContainerBase class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets a list containing the names of all columns in the data.

Data Type

LIST OF STRING

Access

Read only


ColumnsLength Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the count of the columns.

Data Type

INTEGER

Access

Read only


ColumnStretch Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Dispatched when a user changes the width of a column, indicating that the amount of data displayed in that column may have changed.

Syntax

advancedDataGrid.ColumnStretch(columnIndex, localX)
Variable | Description
columnIndex | The zero-based index of the item's column in the DataGrid object's columns array. INTEGER.
localX | The x position of the mouse. REAL.


ColumnStretch Method (FlexDataGrid)

Class

FlexDataGrid class

Action

Dispatched when a user changes the width of a column, indicating that the amount of data displayed in that column may have changed.

If horizontalScrollPolicy is "off", other columns shrink or expand to compensate for the columns' resizing, and they also dispatch this event.

Syntax

dataGrid.ColumnStretch(columnIndex, localX)
Variable | Description
columnIndex | The zero-based index of the item's column in the DataGrid object's columns array. INTEGER.
localX | The x position of the mouse. REAL.


ColumnStretch Method (SparkDataGrid)

Class

SparkDataGrid class

Action

Stretches the given column of the data grid.

Syntax

dataGrid.ColumnStretch(columnIndex, localX)
Variable | Description
columnIndex | The zero-based index of the selected column in the DataGrid object's columns array. INTEGER.
localX | The size of the column relative to the data grid. REAL.


ColumnWidth Property (FlexListBase)

Class

FlexListBase class

Action

Gets the width of the control's columns.

This property is used by TileList and HorizontalList controls. It has no effect on DataGrid controls, where you set the individual DataGridColumn widths.

The default value is 50.

Data Type

REAL

Access

Read only


ColumnWidthRatio Property (FlexCandlestickChart)

Class

FlexCandlestickChart class

Action

Gets a ratio of how wide to draw the candlesticks relative to the horizontal axis's category widths, as a percentage in the range of 0 to 1.

A value of 1 uses the entire space, while a value of 0.6 uses 60% of the column's available space. The actual candlestick width used is the smaller of the columnWidthRatio property and the maxColumnWidth property. Multiple candlestick series divide this space proportionally. The default value is 0.65.

Data Type

REAL

Access

Read only


ColumnWidthRatio Property (FlexColumnChart)

Class

FlexColumnChart class

Action

Gets a ratio of wide to draw the columns relative to the category width, as a percentage in the range of 0 to 1.

A value of 1 uses the entire space, while a value of 0.6 uses 60% of the column's available space. The actual column width used is the smaller of the columnWidthRatio property and the maxColumnWidth property. Clustered columns divide this space proportionally among the columns in each cluster. The default value is 0.65.

Data Type

REAL

Access

Read only


ColumnWidthRatio Property (FlexColumnSeries)

Class

FlexColumnSeries class

Action

Gets the width of columns relative to the category width.

A value of 1 uses the entire space, while a value of .6 uses 60% of the column's available space. You typically do not set this property directly. The actual column width used is the smaller of columnWidthRatio and the maxColumnWidth property. The default value is 0.65.

Data Type

REAL

Access

Read only


ColumnWidthRatio Property (FlexHLOCChart)

Class

FlexHLOCChart class

Action

Gets a ratio of how wide to draw the HLOC lines relative to the horizontal axis's category widths, as a percentage in the range of 0 to 1.

A value of 1 uses the entire space, while a value of 0.6 uses 60% of the category's available space. The actual element width used is the smaller of the columnWidthRatio property and the maxColumnWidth property. Multiple element series divide this space proportionally. The default value is 0.65.

Data Type

REAL

Access

Read only


ColumnWidthRatio Property (FlexHLOCSeriesBase)

Class

FlexHLOCSeriesBase class

Action

Gets the width of elements relative to the category width.

A value of 1 uses the entire space, while a value of 0.6 uses 60% of the element's available space. You typically do not set this property directly. The actual element width used is the smaller of the columnWidthRatio and maxColumnWidth properties.

The default value is 0.65.

Data Type

REAL

Access

Read only


ContentHeight Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the height of the viewport's content.

Data Type

REAL

Access

Read only


ContentHeight Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the height of the text.

Data Type

REAL

Access

Read only


ContentLoaderGrouping Property (SparkImage)

Class

SparkImage class

Action

Gets the optional content grouping identifier to pass to the an associated IContentLoader instance's load() method.

Data Type

STRING

Access

Read only


ContentWidth Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the width of the viewport's contents.

Data Type

REAL

Access

Read only


ContentWidth Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the width of the text.

Data Type

REAL

Access

Read only


ControlBarVisible Property (SparkApplication)

Class

SparkApplication class

Action

Gets whether the control bar is visible.

Data Type

BOOLEAN

Access

Read only


ControlBarVisible Property (SparkPanel)

Class

SparkPanel class

Action

Gets a value whether the control bar is visible.

Data Type

BOOLEAN

Access

Read only


Conversion Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the number used to convert incoming current bytes loaded value and the total bytes loaded values.

Flex divides the current and total values by this property and uses the closest integer that is less than or equal to each value in the label string. A value of 1 does no conversion.

The default value is 1.

Data Type

REAL

Access

Read only


Count Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets the number of times this Repeater should execute.

Data Type

INTEGER

Access

Read only


CreationIndex Property (FlexContainer)

Class

FlexContainer class

Action

Gets the order to instantiate and draw the children of the container.

This property can only be used when the creationPolicy property is set to ContainerCreationPolicy.QUEUED. Otherwise, it is ignored.

The default value is -1.

Data Type

INTEGER

Access

Read only


CreationPolicy Property (FlexContainer)

Class

FlexContainer class

Action

Gets the child creation policy for this Container.

ActionScript values can be ContainerCreationPolicy.AUTO, ContainerCreationPolicy.ALL, ContainerCreationPolicy.NONE, or ContainerCreationPolicy.QUEUED. MXML values can be auto, all, none, or queued.

If no creationPolicy is specified for a container, that container inherits its parent's creationPolicy. If no creationPolicy is specified for the Application, it defaults to ContainerCreationPolicy.AUTO.

A creationPolicy of ContainerCreationPolicy.AUTO means that the container delays creating some or all descendants until they are needed, a process which is known as deferred instantiation. This policy produces the best startup time because fewer UIComponents are created initially. However, this introduces navigation delays when a user navigates to other parts of the application for the first time. Navigator containers such as Accordion, TabNavigator, and ViewStack implement the ContainerCreationPolicy.AUTO policy by creating all their children immediately, but wait to create the deeper descendants of a child until it becomes the selected child of the navigator container.

A creationPolicy of ContainerCreationPolicy.ALL means that the navigator containers immediately create deeper descendants for each child, rather than waiting until that child is selected. For single-view containers such as a VBox container, there is no difference between the ContainerCreationPolicy.AUTO and ContainerCreationPolicy.ALL policies.

A creationPolicy of ContainerCreationPolicy.QUEUED means that the container is added to a creation queue rather than being immediately instantiated and drawn. When the application processes the queued container, it creates the children of the container and then waits until the children have been created before advancing to the next container in the creation queue.

A creationPolicy of ContainerCreationPolicy.NONE means that the container creates none of its children. In that case, it is the responsibility of the MXML author to create the children by calling the createComponentsFromDescriptors method.

Data Type

STRING

Access

Read only


CreationPolicy Property (SparkSkinnableContainer)

Class

SparkSkinnableContainer class

Action

Gets the content creation policy for this component.

Data Type

STRING

Access

Read only


CurrentState Property (FlexObject)

Class

FlexObject class

Action

Gets the current view state of the component.

Set to "" or null to reset the component back to its base state.

Data Type

STRING

Access

Read only


CurrentState Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the current state of this component.

For UIMovieClip, the value of the currentState property is the current frame label.

Data Type

STRING

Access

Read only


CurrentTime Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets the current time of the playhead, measured in seconds, since the video starting playing.

Data Type

REAL

Access

Read only


DataTipField Property (FlexListBase)

Class

FlexListBase class

Action

Gets the name of the field in the data provider items to display as the data tip.

By default, the list looks for a property named label on each item and displays it. However, if the data objects do not contain a label property, you can set the dataTipField property to use a different property in the data object.

The default value is null.

Data Type

STRING

Access

Read only


DataTipMode Property (FlexChart)

Class

FlexChart class

Action

Gets how Flex displays DataTip controls for the chart.

DataTip controls are similar to ToolTip controls, except that they display an appropriate value that represents the nearest chart data point under the mouse pointer.

Possible values include single and multiple. Use single to show the data point closest to the mouse. Use multiple to show the data tips within the range of the mouse cursor.

Data Type

STRING

Access

Read only


DataTipPrecision Property (FlexSlider)

Class

FlexSlider class

Action

Gets the number of decimal places to use for the data tip text.

A value of 0 means to round all values to an integer. The default value is 2.

Data Type

REAL

Access

Read only


DefaultButtonFlag Property (FlexAlert)

Class

FlexAlert class

Action

Gets a bitflag that contains either Alert.OK, Alert.CANCEL, Alert.YES, or Alert.NO to specify the default button. The default value is Alert.OK.

Data Type

REAL

Access

Read only


DefaultCellString Property (FlexOLAPDataGrid)

Class

FlexOLAPDataGrid class

Action

Gets the String displayed in a cell when the data for that cell returned by the IOLAPResult instance is null or NaN.

The default value is NaN.

Data Type

STRING

Access

Read only


DeferredContentCreated Property (SparkSkinnableContainer)

Class

SparkSkinnableContainer class

Action

Gets whether deferred content has been created.

Data Type

BOOLEAN

Access

Read only


DepthColors Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the array of colors used for the rows of each level of the navigation tree of the AdvancedDataGrid control, in descending order. The default value is undefined.

Data Type

LIST OF COLOR

Access

Read only


DepthColors Property (FlexTree)

Class

FlexTree class

Action

Gets the array of colors used in the Tree control, in descending order. The default value is undefined.

Data Type

LIST OF COLOR

Access

Read only


Description Property (FlexChart)

Class

FlexChart class

Action

Gets a short description of the data in the chart.

When accessibility is enabled, screen readers use this property to describe the chart. This string defaults to an empty string.

Data Type

STRING

Access

Read only


Deselect Method (FlexListBase)

Class

FlexListBase class

Action

Defines the value of the type property of the event object for an event that is dispatched when a previously selected item is deselected.

Syntax

listBase.Deselect(itemRenderer, [triggerEvent, keyModifier])
Variable | Description
itemRenderer | The item renderer object for the item. STRING.
triggerEvent | Optional.The event, such as a mouse or keyboard event, that triggered the action. FLEXTRIGGEREVENT.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when clicking the controls. MODIFIERKEYSTATE.


Direction Property (FlexBox)

Class

FlexBox class

Action

Gets whether to use vertical (default) or horizontal layout.

Data Type

STRING

Access

Read only


Direction Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the direction in which the fill of the ProgressBar expands toward completion. Valid values in MXML are "right" and "left".

In ActionScript, you use use the following constants to set this property: ProgressBarDirection.RIGHT and ProgressBarDirection.LEFT.

The default value is ProgressBarDirection.RIGHT.

Data Type

STRING

Access

Read only


Direction Property (FlexSlider)

Class

FlexSlider class

Action

Gets the orientation of the slider control.

Data Type

STRING

Access

Read only


DisabledColor Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the color of text in the component if it is disabled.

Data Type

LIST OF COLOR

Access

Read only


DisabledColor Property (FlexButton)

Class

FlexButton class

Action

Gets the color of text in the component if it is disabled. The default value is 0xAAB3B3.

Data Type

COLOR

Access

Read only


DisabledColor Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the background color of the component when it is disabled.

The global default value is undefined. The default value for List controls is 0xDDDDDD (light gray). If a container is disabled, the background is dimmed, and the degree of dimming is controlled by the disabledOverlayAlpha style.

Data Type

COLOR

Access

Read only


DisabledColor Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the color of text in the component if it is disabled. The default value is 0xAAB3B3.

Data Type

COLOR

Access

Read only


DisabledColor Property (FlexLabel)

Class

FlexLabel class

Action

Gets the color of text in the component if it is disabled. The default value is 0xAAB3B3.

Data Type

COLOR

Access

Read only


DisabledColor Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the color of text in the component if it is disabled. The default value is 0xAAB3B3.

Data Type

COLOR

Access

Read only


DisabledColor Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the color of text in the component if it is disabled. The default value is 0xAAB3B3.

Data Type

COLOR

Access

Read only


DisabledColor Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the color of text in the component if it is disabled. The default value is 0xAAB3B3.

Data Type

COLOR

Access

Read only


DisabledColor Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the background color of a component.

You can have both a backgroundColor and a backgroundImage set. Some components do not have a background. The DataGrid control ignores this style. The default value is undefined, which means it is not set. If both this style and the backgroundImage style are undefined, the component has a transparent background.

Data Type

COLOR

Access

Read only


DisabledColor Property (FlexTree)

Class

FlexTree class

Action

Gets the disabled color of a list item. The default value is 0xDDDDDD.

Data Type

COLOR

Access

Read only


DisabledDays Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the days to disable in a week.

All the dates in a month, for the specified day, are disabled. This property changes the appearance of the DateChooser control. The elements of this array can have values from 0 (Sunday) to 6 (Saturday).

Data Type

LIST OF STRING

Access

Read only


DisabledDays Property (FlexDateField)

Class

FlexDateField class

Action

Gets the days to disable in a week.

Data Type

LIST OF STRING

Access

Read only


DisabledRanges Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the single and multiple days to disable.

Data Type

LIST OF STRING

Access

Read only


DisabledRanges Property (FlexDateField)

Class

FlexDateField class

Action

Gets the disabled single and multiple days.

Data Type

LIST OF STRING

Access

Read only


DisplayAsPassword Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets whether this control is used for entering passwords.

If true, the field does not display entered text, instead, each text character entered into the control appears as the character *. The default value is false.

Data Type

BOOLEAN

Access

Read only


DisplayAsPassword Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets whether the text field is a password text field.

Data Type

BOOLEAN

Access

Read only


DisplayAsPassword Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets whether the text field is a password text field.

Data Type

BOOLEAN

Access

Read only


DisplayedMonth Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the month displayed in the DateChooser control.

Month numbers are zero-based, so January is 0 and December is 11. Setting this property changes the appearance of the DateChooser control.

The default value is the current month.

Data Type

INTEGER

Access

Read only


DisplayedMonth Property (FlexDateField)

Class

FlexDateField class

Action

Gets the month that is displayed in the DateChooser control.

Data Type

INTEGER

Access

Read only


DisplayedYear Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the year displayed in the DateChooser control. The default value is the current year.

Data Type

INTEGER

Access

Read only


DisplayedYear Property (FlexDateField)

Class

FlexDateField class

Action

Gets the year that is displayed in the DateChooser control.

Data Type

INTEGER

Access

Read only


DisplayItemsExpanded Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets whether the navigation tree is expanded to show all items.

If true, expand the navigation tree to show all items. If a new branch is added, it is shown expanded. The default value is false.

Data Type

BOOLEAN

Access

Read only


DisplayPopUp Property (SparkPopUpAnchor)

Class

SparkPopUpAnchor class

Action

Gets whether the popUp is visible.

Data Type

BOOLEAN

Access

Read only


DoubleSelect Method (FlexListBase)

Class

FlexListBase class

Action

Defines the value of the type property of the ListEvent object for an itemDoubleClick event, which indicates that the user double-clicked the mouse over a visual item in the control.

To receive itemDoubleClick events, you must set the component's doubleClickEnabled property to true.

Syntax

listBase.DoubleSelect(itemRenderer)
Variable | Description
itemRenderer | The item renderer that was double-clicked. STRING.


DragCancel Method (FlexChart)

Class

FlexChart class

Action

Defines the value of the type property of the event object for a dragComplete event.

Syntax

chart.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


DragCancel Method (FlexContainer)

Class

FlexContainer class

Action

Defines the value of the type property of the event object for a dragComplete event.

Syntax

container.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when completing the drop. MODIFIERKEYSTATE.


DragCancel Method (FlexListBase)

Class

FlexListBase class

Action

Defines the value of the type property of the event object for a dragComplete event.

Syntax

listBase.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when completing the drop. MODIFIERKEYSTATE.


DragCancel Method (SparkCheckBox)

Class

SparkCheckBox class

Action

The event triggered when a drag operation is cancelled.

Syntax

checkBox.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragCancel Method (SparkGroupBase)

Class

SparkGroupBase class

Action

Dispatched when a drag operation is cancelled.

Syntax

groupBase.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragCancel Method (SparkRadioButton)

Class

SparkRadioButton class

Action

The event triggered when a drag operation is cancelled.

Syntax

radioButton.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragCancel Method (SparkRichEditableText)

Class

SparkRichEditableText class

Action

The event triggered when a drag operation is cancelled.

Syntax

richEditableText.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragCancel Method (SparkSkinnableContainerBase)

Class

SparkSkinnableContainerBase class

Action

Dispatched when a drag operation is cancelled.

Syntax

skinnableContainerBase.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragCancel Method (SparkTextArea)

Class

SparkTextArea class

Action

The event triggered when a drag operation is cancelled.

Syntax

textArea.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragCancel Method (SparkTextBase)

Class

SparkTextBase class

Action

The event triggered when a drag operation is cancelled.

Syntax

textBase.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragCancel Method (SparkTextInput)

Class

SparkTextInput class

Action

The event triggered when a drag operation is cancelled.

Syntax

textInput.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragCancel Method (SparkToggleButton)

Class

SparkToggleButton class

Action

The event triggered when a drag operation is cancelled.

Syntax

toggleButton.DragCancel([keyModifier])
Variable | Description
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragDrop Method (FlexChart)

Class

FlexChart class

Action

Defines the value of the type property of the event object for a dragDrop event.

Syntax

chart.DragDrop(draggedItem, [localX, localY, keyModifier])
Variable | Description
draggedItem | The item being dragged. STRING.
localX | Optional.The horizontal coordinate at which the event occurred relative to the containing sprite. REAL.
localY | Optional.The vertical coordinate at which the event occurred relative to the containing sprite. REAL.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


DragDrop Method (FlexContainer)

Class

FlexContainer class

Action

Defines the value of the type property of the event object for a dragDrop event.

Syntax

container.DragDrop([draggedItem, keyModifier])
Variable | Description
draggedItem | Optional.The item being dragged. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when dropping the object. MODIFIERKEYSTATE.


DragDrop Method (FlexContainerMovieClip)

Class

FlexContainerMovieClip class

Action

Defines the value of the type property of the event object for a dragDrop event.

Syntax

containerMovieClip.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The action that caused the event. STRING.
draggedItem | Optional.The item being dragged. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


DragDrop Method (FlexListBase)

Class

FlexListBase class

Action

Defines the value of the type property of the event object for a dragDrop event.

Syntax

listBase.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The action that caused the event: DragManager.COPY, DragManager.LINK, DragManager.MOVE, or DragManager.NONE. STRING.
draggedItem | Optional.The item being dragged. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when dropping the control. MODIFIERKEYSTATE.


DragDrop Method (SparkCheckBox)

Class

SparkCheckBox class

Action

The event triggered when the dragged item is dropped.

Syntax

checkBox.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The requested action. One of DragManager.COPY, DragManager.LINK, DragManager.MOVE, DragManager.NONE. STRING.
draggedItem | Optional.List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragDrop Method (SparkGroupBase)

Class

SparkGroupBase class

Action

Dispatched when the dragged item is dropped.

Syntax

groupBase.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The requested action. One of DragManager.COPY, DragManager.LINK, DragManager.MOVE, DragManager.NONE. STRING.
draggedItem | Optional.The object being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragDrop Method (SparkRadioButton)

Class

SparkRadioButton class

Action

The event triggered when the dragged item is dropped.

Syntax

radioButton.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The requested action. One of DragManager.COPY, DragManager.LINK, DragManager.MOVE, DragManager.NONE. STRING.
draggedItem | Optional.List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragDrop Method (SparkRichEditableText)

Class

SparkRichEditableText class

Action

The event triggered when the dragged item is dropped.

Syntax

richEditableText.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The requested action. One of DragManager.COPY, DragManager.LINK, DragManager.MOVE, DragManager.NONE. STRING.
draggedItem | Optional.List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragDrop Method (SparkSkinnableContainerBase)

Class

SparkSkinnableContainerBase class

Action

Dispatched when the dragged item is dropped.

Syntax

skinnableContainerBase.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The requested action. One of DragManager.COPY, DragManager.LINK, DragManager.MOVE, DragManager.NONE. STRING.
draggedItem | Optional.The object being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragDrop Method (SparkTextArea)

Class

SparkTextArea class

Action

The event triggered when the dragged item is dropped.

Syntax

textArea.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The requested action. One of DragManager.COPY, DragManager.LINK, DragManager.MOVE, DragManager.NONE. STRING.
draggedItem | Optional.List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragDrop Method (SparkTextBase)

Class

SparkTextBase class

Action

The event triggered when the dragged item is dropped.

Syntax

textBase.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The requested action. One of DragManager.COPY, DragManager.LINK, DragManager.MOVE, DragManager.NONE. STRING.
draggedItem | Optional.List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragDrop Method (SparkTextInput)

Class

SparkTextInput class

Action

The event triggered when the dragged item is dropped.

Syntax

textInput.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The requested action. One of DragManager.COPY, DragManager.LINK, DragManager.MOVE, DragManager.NONE. STRING.
draggedItem | Optional.List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragDrop Method (SparkToggleButton)

Class

SparkToggleButton class

Action

The event triggered when the dragged item is dropped.

Syntax

toggleButton.DragDrop(action, [draggedItem, keyModifier])
Variable | Description
action | The requested action. One of DragManager.COPY, DragManager.LINK, DragManager.MOVE, DragManager.NONE. STRING.
draggedItem | Optional.List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragEnabled Property (FlexChart)

Class

FlexChart class

Action

Gets whether you can drag items out of this chart and drop them on other controls.

If true, dragging is enabled for the chart. If the dropEnabled property is also true, you can drag items and drop them in the chart to reorder the items. The default value is false.

Data Type

BOOLEAN

Access

Read only


DragEnabled Property (SparkList)

Class

SparkList class

Action

Gets a flag that indicates whether you can drag items out of this control and drop them on other controls.

Data Type

BOOLEAN

Access

Read only


Dragged Method (FlexDividedBox)

Class

FlexDividedBox class

Action

Dispatched multiple times as the user drags any divider. The dividerDrag event is dispatched after the dividerPress event and before the dividerRelease event.

Syntax

dividedBox.Dragged(dividerIndex, delta)
Variable | Description
dividerIndex | Contains the zero-based index of the divider being dragged. The leftmost or topmost divider has a dividerIndex of 0. INTEGER.
delta | Contains the number of pixels that the divider has been dragged. Positive numbers represent a drag toward the right or bottom, negative numbers toward the left or top. REAL.


Dragging Property (SparkListLabel)

Class

SparkListLabel class

Action

Gets a value whether the SparkListLabel is in dragging mode.

Data Type

BOOLEAN

Access

Read only


DragMoveEnabled Property (SparkList)

Class

SparkList class

Action

Gets a flag that indicates whether items can be moved instead of just copied from the control as part of a drag-and-drop operation.

Data Type

BOOLEAN

Access

Read only


DragStart Method (FlexChart)

Class

FlexChart class

Action

Defines the value of the type property of the event object for a dragStart event.

Syntax

chart.DragStart(draggedItem, [localX, localY])
Variable | Description
draggedItem | The item being dragged. STRING.
localX | Optional.The horizontal coordinate at which the event occurred relative to the containing sprite. REAL.
localY | Optional.The vertical coordinate at which the event occurred relative to the containing sprite. REAL.


DragStart Method (FlexContainer)

Class

FlexContainer class

Action

Defines the value of the type property of the event object for a dragStart event.

Syntax

container.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | The item being dragged. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when dragging the object. MODIFIERKEYSTATE.


DragStart Method (FlexListBase)

Class

FlexListBase class

Action

Defines the value of the type property of the event object for a dragStart event.

Syntax

listBase.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | The item being dragged. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when dragging the control. MODIFIERKEYSTATE.


DragStart Method (SparkCheckBox)

Class

SparkCheckBox class

Action

The event triggered when the drag/drop operation begins.

Syntax

checkBox.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragStart Method (SparkGroupBase)

Class

SparkGroupBase class

Action

Dispatched when the drag/drop operation begins.

Syntax

groupBase.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | The object being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragStart Method (SparkRadioButton)

Class

SparkRadioButton class

Action

The event triggered when the drag/drop operation begins.

Syntax

radioButton.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragStart Method (SparkRichEditableText)

Class

SparkRichEditableText class

Action

The event triggered when the drag/drop operation begins.

Syntax

richEditableText.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragStart Method (SparkSkinnableContainerBase)

Class

SparkSkinnableContainerBase class

Action

Dispatched when the drag/drop operation begins.

Syntax

skinnableContainerBase.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | The object being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragStart Method (SparkTextArea)

Class

SparkTextArea class

Action

The event triggered when the drag/drop operation begins.

Syntax

textArea.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragStart Method (SparkTextBase)

Class

SparkTextBase class

Action

The event triggered when the drag/drop operation begins.

Syntax

textBase.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragStart Method (SparkTextInput)

Class

SparkTextInput class

Action

The event triggered when the drag/drop operation begins.

Syntax

textInput.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DragStart Method (SparkToggleButton)

Class

SparkToggleButton class

Action

The event triggered when the drag/drop operation begins.

Syntax

toggleButton.DragStart(draggedItem, [keyModifier])
Variable | Description
draggedItem | List item that's being dragged. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


DropEnabled Property (FlexChart)

Class

FlexChart class

Action

Gets whether dragged items can be dropped onto the chart.

If you set this property to true, the chart accepts all data formats, and assumes that the dragged data matches the format of the data in the data provider. To explicitly check the data format of the data being dragged, you must handle one or more of the drag events, such as dragOver, and call the preventDefault() method of the DragEvent to customize the way the list class accepts dropped data. When dropEnabled is set to true, Flex automatically calls the showDropFeedback() and hideDropFeedback() methods to display the drop indicator. The default value is false.

Data Type

BOOLEAN

Access

Read only


DropEnabled Property (SparkList)

Class

SparkList class

Action

Gets a flag that indicates whether dragged items can be dropped onto the control.

Data Type

BOOLEAN

Access

Read only


DropShadowEnabled Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets whether the ComboBase container's drop shadow is visible. The default value is true.

Data Type

BOOLEAN

Access

Read only


DropShadowEnabled Property (FlexPanel)

Class

FlexPanel class

Action

Gets whether the Panel container's drop shadow is visible. The default value is true.

Data Type

BOOLEAN

Access

Read only


Duration Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets the duration of the video's playback, in seconds.

Data Type

REAL

Access

Read only


Editable Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets whether the user can edit items in the data provider.

If true, the item renderers in the control are editable. The user can click on an item renderer to open an editor.

You can turn off editing for individual columns of the DataGrid control using the DataGridColumn.editable property, or by handling the itemEditBeginning and itemEditBegin events

The default value is false.

Data Type

BOOLEAN

Access

Read only


Editable Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets whether the control is editable, which lets the user directly type entries that are not specified in the dataProvider, or not editable, which requires the user select from the items in the dataProvider.

If true keyboard input will be entered in the editable text field; otherwise it will be used as shortcuts to select items in the dataProvider.

The default value is false. This property is ignored by the DateField control.

Data Type

BOOLEAN

Access

Read only


Editable Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets whether the user can edit items in the data provider.

If true, the item renderers in the control are editable. The user can click on an item renderer to open an editor.

You can turn off editing for individual columns of the DataGrid control using the DataGridColumn.editable property, or by handling the itemEditBeginning and itemEditBegin events

The default value is false.

Data Type

BOOLEAN

Access

Read only


Editable Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets whether the user can edit the text in this control.

If true, the user can edit the text. The default value is true.

Data Type

BOOLEAN

Access

Read only


Editable Property (FlexTree)

Class

FlexTree class

Action

Gets whether the user can edit items in the data provider.

Data Type

BOOLEAN

Access

Read only


Editable Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets a flag indicating whether the user is allowed to edit the text in this control.

Data Type

BOOLEAN

Access

Read only


Editable Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets a flag indicating whether the user is allowed to edit the text in this control.

Data Type

BOOLEAN

Access

Read only


Edit Method (FlexDataGrid)

Class

FlexDataGrid class

Action

Defines the value of the type property of the event object for a itemEditBegin event, which indicates that an item is ready to be edited.

Syntax

dataGrid.Edit(itemRenderer, rowIndex, columnIndex)
Variable | Description
itemRenderer | The item renderer for the item that is being edited. STRING.
rowIndex | The zero-based index of the item in the data provider. INTEGER.
columnIndex | The zero-based index of the item's column in the DataGrid object's columns array. INTEGER.


Edit Method (FlexList)

Class

FlexList class

Action

Defines the value of the type property of the event object for a itemEditBegin event, which indicates that an item is ready to be edited.

Syntax

list.Edit(itemRenderer, rowIndex, columnIndex)
Variable | Description
itemRenderer | The item renderer for the item that is being edited. STRING.
rowIndex | The zero-based index of the item associated with the event. INTEGER.
columnIndex | The zero-based index of the column associated with the event. INTEGER.


EditNext Method (SparkDataGrid)

Class

SparkDataGrid class

Action

Sets the following data grid cell in the edit mode.

Syntax

dataGrid.EditNext()


Emphasized Property (SparkButton)

Class

SparkButton class

Action

Gets whether the default button as requested by the focus manager.

Data Type

BOOLEAN

Access

Read only


Enabled Property (FlexObject)

Class

FlexObject class

Action

Gets whether the component can accept user interaction.

After setting the enabled property to false, some components still respond to mouse interactions such as mouseOver. As a result, to fully disable UIComponents, you should also set the value of the mouseEnabled property to false. If you set the enabled property to false for a container, Flex dims the color of the container and of all of its children, and blocks user input to the container and to all of its children.

Data Type

BOOLEAN

Access

Read only


Enabled Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets whether a movie clip is enabled.

The default value is true. If enabled is set to false, the movie clip's Over, Down, and Up frames are disabled. The movie clip continues to receive events (for example, mouseDown, mouseUp, keyDown, and keyUp).

Data Type

BOOLEAN

Access

Read only


EnableIME Property (SparkNumericStepper)

Class

SparkNumericStepper class

Action

Gets a value whether the IME should be enabled when the component receives focus.

Data Type

BOOLEAN

Access

Read only


EnableIME Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets a flag that indicates whether the IME should be enabled when the component receives focus.

Data Type

BOOLEAN

Access

Read only


EnableIME Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets a flag that indicates whether the IME should be enabled when the component receives focus.

Data Type

BOOLEAN

Access

Read only


ErrorColor Property (FlexObject)

Class

FlexObject class

Action

Gets the color of the component highlight when validation fails.

Flex also sets the borderColor style of the component to this errorColor on a validation failure. The default value is 0xFF0000.

Data Type

COLOR

Access

Read only


ErrorColor Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the color of the component highlight when validation fails.

Data Type

COLOR

Access

Read only


ErrorString Property (FlexObject)

Class

FlexObject class

Action

Gets the text that will be displayed by a component's error tip when a component is monitored and validation fails.

Data Type

STRING

Access

Read only


ErrorString Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the text that is displayed by a component's error tip when a component is monitored and validation fails.

Data Type

STRING

Access

Read only


ExplodeRadius Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets a number from 0 to 1, specifying how far all wedges of the pie series should be exploded from the center of the chart as a percentage of the total radius.

This value explodes all wedges in the pie series uniformly.

Data Type

REAL

Access

Read only


Field Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets the field of the data provider that determines the data for each wedge of the PieChart control. The default value is null.

Data Type

STRING

Access

Read only


FillAlphas Property (FlexButton)

Class

FlexButton class

Action

Gets the alphas used for the background fill of controls.

Use [1, 1] to make the control background opaque. The default value is [ 0.6, 0.4 ].

Data Type

LIST OF REAL

Access

Read only


FillAlphas Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the alphas used for the background fill of controls.

Use [1, 1] to make the control background opaque. The default value is [ 0.6, 0.4 ].

Data Type

LIST OF REAL

Access

Read only


FillAlphas Property (FlexContainer)

Class

FlexContainer class

Action

Gets the alpha transparency values used for the background fill of components.

Set this to an Array of either two or four numbers. Elements 0 and 1 specify the start and end values for an alpha gradient. If elements 2 and 3 exist, they are used instead of elements 0 and 1 when the component is in a mouse-over state. The global default value is [ 0.60, 0.40, 0.75, 0.65 ]. Some components, such as the ApplicationControlBar container, have a different default value. For the ApplicationControlBar container, the default value is [ 0.0, 0.0 ].

Deprecated Since 3.0: Use headerStyleName

Data Type

LIST OF REAL

Access

Read only


FillColors Property (FlexButton)

Class

FlexButton class

Action

Gets the colors used to tint the background of the control.

Pass the same color for both values for a flat-looking control. The default value is [ 0xFFFFFF, 0xCCCCCC ].

Data Type

LIST OF COLOR

Access

Read only


FillColors Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the colors used to tint the background of the control.

Pass the same color for both values for a flat-looking control. The default value is [ 0xFFFFFF, 0xCCCCCC ].

Data Type

LIST OF COLOR

Access

Read only


FillColors Property (FlexContainer)

Class

FlexContainer class

Action

Gets the colors used to tint the background fill of the component.

Set this to an Array of either two or four uint values that specify RGB colors. Elements 0 and 1 specify the start and end values for a color gradient. If elements 2 and 3 exist, they are used instead of elements 0 and 1 when the component is in a mouse-over state. For a flat-looking control, set the same color for elements 0 and 1 and for elements 2 and 3, The default value is [ 0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE ].

Some components, such as the ApplicationControlBar container, have a different default value. For the ApplicationControlBar container, the default value is [ 0xFFFFFF, 0xFFFFFF ].

Deprecated Since 3.0: Use headerStyleName

Data Type

LIST OF COLOR

Access

Read only


FillColors Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the colors used to tint the background of the control.

Deprecated Since 3.0: Use nextMonthStyleFilters, prevMonthStyleFilters

Pass the same color for both values for a flat-looking control. The default value is [ 0xFFFFFF, 0xCCCCCC ].

Data Type

LIST OF COLOR

Access

Read only


FillColors Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the colors used to tint the background of the control.

Pass the same color for both values for a flat-looking control. The default value is [ 0xFFFFFF, 0xCCCCCC ].

Data Type

LIST OF COLOR

Access

Read only


FillColors Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the colors used to tint the background of the control. Pass the same color for both values for a flat-looking control. The default value is [ 0xFFFFFF, 0xCCCCCC ].

Data Type

LIST OF COLOR

Access

Read only


FillColors Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the colors used to tint the background fill of the component.

Set this to an Array of either two or four unit values that specify RGB colors. Elements 0 and 1 specify the start and end values for a color gradient. If elements 2 and 3 exist, they are used instead of elements 0 and 1 when the component is in a mouse-over state. For a flat-looking control, set the same color for elements 0 and 1 and for elements 2 and 3, The default value is [ 0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE ].

Some components, such as the ApplicationControlBar container, have a different default value. For the ApplicationControlBar container, the default value is [ 0xFFFFFF, 0xFFFFFF ].

Deprecated Since 3.0: Use headerStyleName

Data Type

LIST OF COLOR

Access

Read only


FillColors Property (FlexScrollBar)

Class

FlexScrollBar class

Action

Gets the colors used to tint the background of the control.

Pass the same color for both values for a flat-looking control. The default value is [ 0xFFFFFF, 0xCCCCCC ].

Data Type

LIST OF COLOR

Access

Read only


FillColors Property (FlexSlider)

Class

FlexSlider class

Action

Gets the colors used to tint the background of the control.

Pass the same color for both values for a flat-looking control. The default value is [ 0xFFFFFF, 0xCCCCCC ].

Data Type

LIST OF COLOR

Access

Read only


FillMode Property (SparkImage)

Class

SparkImage class

Action

Gets a value how the bitmap fills in the dimensions.

Data Type

STRING

Access

Read only


FirstDayOfWeek Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the number representing the day of the week to display in the first column of the DateChooser control.

The value must be in the range 0 to 6, where 0 corresponds to Sunday, the first element of the dayNames Array.

Setting this property changes the order of the day columns. For example, setting it to 1 makes Monday the first column in the control.

The default value is 0 (Sunday).

Data Type

INTEGER

Access

Read only


FirstDayOfWeek Property (FlexDateField)

Class

FlexDateField class

Action

Gets the day of the week (0-6, where 0 is the first element of the dayNames Array) to display in the first column of the DateChooser control.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexChart)

Class

FlexChart class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexChartSeries)

Class

FlexChartSeries class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexComboBox)

Class

FlexComboBox class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexContainer)

Class

FlexContainer class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexListBase)

Class

FlexListBase class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexMenu)

Class

FlexMenu class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the index of the first visible row.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (SparkSkinnableContainerBase)

Class

SparkSkinnableContainerBase class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets the index of the first visible child.

Data Type

INTEGER

Access

Read only


FocusAlpha Property (FlexButton)

Class

FlexButton class

Action

Gets the alpha transparency value of the focus skin. The default value is 0.4.

Data Type

REAL

Access

Read only


FocusAlpha Property (FlexListBase)

Class

FlexListBase class

Action

Gets the alpha transparency value of the focus skin. The default value is 0.4.

Data Type

REAL

Access

Read only


FocusEnabled Property (FlexObject)

Class

FlexObject class

Action

Gets whether the component can receive focus when tabbed to.

You can set focusEnabled to false when a UIComponent is used as a subcomponent of another component so that the outer component becomes the focusable entity. If this property is false, focus will be transferred to the first parent that has focusEnable set to true.

Data Type

BOOLEAN

Access

Read only


FocusEnabled Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets whether the component can receive focus when selected.

Data Type

BOOLEAN

Access

Read only


FontFamily Property (FlexButton)

Class

FlexButton class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontFamily Property (FlexChart)

Class

FlexChart class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontFamily Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontFamily Property (FlexContainer)

Class

FlexContainer class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontFamily Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontFamily Property (FlexLabel)

Class

FlexLabel class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontFamily Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontFamily Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontFamily Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontFamily Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the name of the font to use.

Unlike in a full CSS implementation, comma-separated lists are not supported. You can use any font family name. If you specify a generic font name, it is converted to an appropriate device font. The default value is Verdana.

Data Type

STRING

Access

Read only


FontSize Property (FlexButton)

Class

FlexButton class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

REAL

Access

Read only


FontSize Property (FlexChart)

Class

FlexChart class

Action

Gets the height of the text, in pixels. The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

INTEGER

Access

Read only


FontSize Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

REAL

Access

Read only


FontSize Property (FlexContainer)

Class

FlexContainer class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

REAL

Access

Read only


FontSize Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

REAL

Access

Read only


FontSize Property (FlexLabel)

Class

FlexLabel class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

REAL

Access

Read only


FontSize Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

REAL

Access

Read only


FontSize Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

REAL

Access

Read only


FontSize Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

INTEGER

Access

Read only


FontSize Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

REAL

Access

Read only


FontSize Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the height of the text, in pixels.

The default value is 10 for all controls except the ColorPicker control. For the ColorPicker control, the default value is 11.

Data Type

REAL

Access

Read only


FontStyle Property (FlexButton)

Class

FlexButton class

Action

Gets whether the text is italic font.

Recognized values are normal and italic. The default value is normal.

Data Type

STRING

Access

Read only


FontStyle Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets whether the text is italic font.

Recognized values are normal and italic. The default value is normal.

Data Type

STRING

Access

Read only


FontStyle Property (FlexContainer)

Class

FlexContainer class

Action

Gets whether the text is italic font.

Recognized values are normal and italic. The default value is normal.

Data Type

STRING

Access

Read only


FontStyle Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets whether the text is italic font.

Recognized values are normal and italic. The default value is normal.

Data Type

STRING

Access

Read only


FontStyle Property (FlexLabel)

Class

FlexLabel class

Action

Gets whether the text is italic font.

Recognized values are normal and italic. The default value is normal.

Data Type

STRING

Access

Read only


FontStyle Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets whether the text is italic font.

Recognized values are normal and italic. The default value is normal.

Data Type

STRING

Access

Read only


FontStyle Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets whether the text is italic font.

Recognized values are normal and italic. The default value is normal.

Data Type

STRING

Access

Read only


FontStyle Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets whether the text is italic font.

Recognized values are normal and italic. The default value is normal.

Data Type

STRING

Access

Read only


FontStyle Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets whether the text is italic font.

Recognized values are normal and italic. The default value is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexButton)

Class

FlexButton class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexContainer)

Class

FlexContainer class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexLabel)

Class

FlexLabel class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets whether the text is boldface. Recognized values are normal and bold.

The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FontWeight Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


FooterColors Property (FlexPanel)

Class

FlexPanel class

Action

Gets the array of two colors used to draw the footer (area for the ControlBar container) background.

The first color is the top color. The second color is the bottom color. The default values are null, which makes the control bar background the same as the panel background. The default value is null.

Data Type

LIST OF COLOR

Access

Read only


Form Property (FlexAreaSeries)

Class

FlexAreaSeries class

Action

Gets the boundary type for the area.

Possible values include:
  • curve - Draws curves for the boundary between data points.
  • horizontal - Draws only the boundary from the x-coordinate of the first point to the x-coordinate of the second point at the y-coordinate of the second point. Repeats this for each data point.
  • reverseStep - Draws boundaries of the area as horizontal segments. At the first data point, draws a vertical boundary line and then a horizontal boundary line to the second point, and repeats for each data point.
  • segment - Draws boundaries of the area as connected segments that are angled to connect at each data point in the series.
  • step - Draws boundaries of the area as horizontal segments. At the first data point, draws a horizontal boundary line and then a vertical boundary line to the second point, and repeats for each data point.
  • vertical - Draws only the boundary from the y-coordinate of the first point to the y-coordinate of the second point at the x-coordinate of the second point. Repeats this for each data point.

The default value is segment.

Data Type

STRING

Access

Read only


Form Property (FlexLineSeries)

Class

FlexLineSeries class

Action

Gets the line type for the chart.

Possible values include:
  • curve - Draws curves between data points.
  • horizontal - Draws only the vertical line from the x-coordinate of the first point to the x-coordinate of the second point at the y-coordinate of the second point. Repeats this for each data point.
  • reverseStep - Draws lines as horizontal segments. At the first data point, draws a vertical line and then a horizontal line to the second point, and repeats for each data point.
  • segment - Draws lines as connected segments that are angled to connect at each data point in the series.
  • step - Draws lines as horizontal segments. At the first data point, draws a horizontal line and then a vertical boundary line to the second point, and repeats for each data point.
  • vertical - Draws only the vertical line from the y-coordinate of the first point to the y-coordinate of the second point at the x-coordinate of the second point. Repeats this for each data point.

The default value is segment.

Data Type

STRING

Access

Read only


GetCellData Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Returns data for a cell in the grid.

Syntax

sCellData = advancedDataGrid.GetCellData(RowIndex, ColumnIndex, [RestoreOriginalPosition])
Variable | Description
sCellData | STRING.
RowIndex | Returns the zero-based index of the specified row. INTEGER.
ColumnIndex | Returns the zero-based index of the specified column. INTEGER.
RestoreOriginalPosition | Optional.Returns a cell in the grid to its previous position. BOOLEAN.


GetGroupedItemChildrenCount Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Returns the number of children within the first item of a group.

Syntax

iGroupedItemChildrenCount = advancedDataGrid.GetGroupedItemChildrenCount(RowIndex, [RestoreOriginalPosition])
Variable | Description
iGroupedItemChildrenCount | INTEGER.
RowIndex | Returns the zero-based index of the specified row. INTEGER.
RestoreOriginalPosition | Optional.Returns the children within the first item of a group to their previous position. BOOLEAN.


GetItemsCount Method (SparkListBase)

Class

SparkListBase class

Action

Gets the number of items in the ComboBox.

Syntax

iItemsCount = listBase.GetItemsCount()
Variable | Description
iItemsCount | INTEGER.


GetRowData Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Returns data for the row of the item in the data provider.

Syntax

sRowData = advancedDataGrid.GetRowData(RowIndex, [RestoreOriginalPosition])
Variable | Description
sRowData | STRING.
RowIndex | Returns the zero-based index of the item in the data provider. INTEGER.
RestoreOriginalPosition | Optional.Returns a row in the grid to its previous position. BOOLEAN.


GetStyle Method (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Returns the style value for the given style. For available styles consider the Apache Flex sdk documentation.

Syntax

sStyle = displayObject.GetStyle(name)
Variable | Description
sStyle | STRING.
name | The name of the style. STRING.


GetValues Method (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = axisRenderer.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (FlexChart)

Class

FlexChart class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = chart.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (FlexChartLegend)

Class

FlexChartLegend class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = chartLegend.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (FlexChartSeries)

Class

FlexChartSeries class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = chartSeries.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (FlexComboBox)

Class

FlexComboBox class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = comboBox.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (FlexContainer)

Class

FlexContainer class

Action

Returns a matrix containing the automation values of all parts of the components. The return value is an array of rows, each of which is an array of items.

Syntax

liValues = container.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (FlexListBase)

Class

FlexListBase class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = listBase.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (FlexMenu)

Class

FlexMenu class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = menu.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (FlexMenuBar)

Class

FlexMenuBar class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = menuBar.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (FlexRepeater)

Class

FlexRepeater class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = repeater.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (SparkDataGrid)

Class

SparkDataGrid class

Action

Returns a matrix containing the automation values of all parts of the components.

The return value is an array of rows, each of which is an array of items.

Syntax

liValues = dataGrid.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (SparkGroupBase)

Class

SparkGroupBase class

Action

Returns a matrix containing the automation values of all parts of the components.

Syntax

liValues = groupBase.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Returns a matrix containing the automation values of all parts of the components.

Syntax

liValues = richEditableText.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (SparkSkinnableContainerBase)

Class

SparkSkinnableContainerBase class

Action

Returns a matrix containing the automation values of all parts of the components.

Syntax

liValues = skinnableContainerBase.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GetValues Method (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Returns a matrix containing the automation values of all parts of the components.

Syntax

liValues = skinnableTextBase.GetValues(start, end)
Variable | Description
liValues | LIST OF LIST OF STRING.
start | The index of the starting child. The default value is 0. INTEGER.
end | The index of the ending child. The default value is 0. INTEGER.


GroupName Property (FlexRadioButton)

Class

FlexRadioButton class

Action

Gets the name of the group to which this RadioButton control belongs, or specifies the value of the id property of a RadioButtonGroup control if this RadioButton is part of a group defined by a RadioButtonGroup control.

The default value is undefined.

Data Type

STRING

Access

Read only


GroupName Property (SparkRadioButton)

Class

SparkRadioButton class

Action

Gets the name of the group to which this RadioButton component belongs, or specifies the value of the id property of a RadioButtonGroup component if this RadioButton is part of a group defined by a RadioButtonGroup component.

Data Type

STRING

Access

Read only


GutterBottom Property (FlexCartesianChart)

Class

FlexCartesianChart class

Action

Gets the size of the region, in pixels, between the bottom of the chart data area and the bottom of the chart control.

Data Type

INTEGER

Access

Read only


GutterLeft Property (FlexCartesianChart)

Class

FlexCartesianChart class

Action

Gets the size of the region, in pixels, between the left of the chart data area and the left of the chart control.

Data Type

INTEGER

Access

Read only


GutterRight Property (FlexCartesianChart)

Class

FlexCartesianChart class

Action

Gets the size of the region, in pixels, between the right side of the chart data area and the outside of the chart control.

Data Type

INTEGER

Access

Read only


GutterTop Property (FlexCartesianChart)

Class

FlexCartesianChart class

Action

Gets the size of the region, in pixels, between the top of the chart data area and the top of the chart control.

Data Type

INTEGER

Access

Read only


HeaderClick Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Dispatched when the user releases the mouse button on a column header to request the control to sort the grid contents based on the contents of the column.

Syntax

advancedDataGrid.HeaderClick(columnIndex, [dataField, keyModifier])
Variable | Description
columnIndex | The zero-based index of the item's column in the DataGrid object's columns array. INTEGER.
dataField | Optional.The name of the field or property in the data associated with the column. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


HeaderClick Method (FlexDataGrid)

Class

FlexDataGrid class

Action

Dispatched when the user releases the mouse button on a column header to request the control to sort the grid contents based on the contents of the column.

Only dispatched if the column is sortable and the data provider supports sorting.

Syntax

dataGrid.HeaderClick(columnIndex)
Variable | Description
columnIndex | The zero-based index of the item's column in the DataGrid object's columns array. INTEGER.


HeaderClick Method (SparkDataGrid)

Class

SparkDataGrid class

Action

Clicks on the specified column header.

Syntax

dataGrid.HeaderClick(columnIndex)
Variable | Description
columnIndex | The index of the column header. INTEGER.


HeaderColors Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets an array of two colors used to draw the header background gradient.

The first color is the top color. The second color is the bottom color.

Data Type

LIST OF COLOR

Access

Read only


HeaderColors Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets an array of two colors used to draw the header background gradient.

The first color is the top color. The second color is the bottom color. The default value is [0xFFFFFF, 0xE6E6E6].

Data Type

LIST OF COLOR

Access

Read only


HeaderColors Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the colors of the band at the top of the DateChooser control. The default value is [ 0xE6EEEE, 0xFFFFFF ].

Deprecated Since 3.0: Use dateChooserStyleName

Data Type

LIST OF COLOR

Access

Read only


HeaderColors Property (FlexDateField)

Class

FlexDateField class

Action

Gets the colors of the band at the top of the DateChooser control. The default value is [ 0xE6EEEE, 0xFFFFFF ].

Deprecated Since 3.0: Use dateChooserStyleName

Data Type

LIST OF COLOR

Access

Read only


HeaderColors Property (FlexPanel)

Class

FlexPanel class

Action

Gets the array of two colors used to draw the header.

The first color is the top color. The second color is the bottom color. The default values are null, which makes the header background the same as the panel background. The default value is null.

Data Type

LIST OF COLOR

Access

Read only


HeaderHeight Property (FlexAccordion)

Class

FlexAccordion class

Action

Gets the height of each accordion header, in pixels.

The default value is automatically calculated based on the font styles for the header.

Data Type

INTEGER

Access

Read only


HeaderHeight Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the height of the header cell of the column, in pixels.

Data Type

REAL

Access

Read only


HeaderHeight Property (FlexPanel)

Class

FlexPanel class

Action

Gets the height of the header. The default value is based on the style of the title text.

Data Type

INTEGER

Access

Read only


HeaderShift Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Dispatched when the user releases the mouse button on a column header after having dragged the column to a new location resulting in shifting the column to a new index.

Syntax

advancedDataGrid.HeaderShift(newIndex, oldIndex, [triggerEvent])
Variable | Description
newIndex | The zero-based index of the header after the change. INTEGER.
oldIndex | The zero-based index of the header before the change. INTEGER.
triggerEvent | Optional.The event that triggered this event. FLEXTRIGGEREVENT.


HeaderShift Method (FlexDataGrid)

Class

FlexDataGrid class

Action

Dispatched when the user releases the mouse button on a column header after having dragged the column to a new location resulting in shifting the column to a new index.

Syntax

dataGrid.HeaderShift(newIndex, oldIndex, [triggerEvent])
Variable | Description
newIndex | The zero-based index of the header after the change. INTEGER.
oldIndex | The zero-based index of the header before the change. INTEGER.
triggerEvent | Optional.The event, such as a mouse or keyboard event, that triggered the action. FLEXTRIGGEREVENT.


HeaderStyleName Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets the name of a CSS style declaration for controlling other aspects of the appearance of the column headers. The default value is dataGridStyles.

Data Type

STRING

Access

Read only


HeightInLines Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the default height of the control, measured in lines.

Data Type

REAL

Access

Read only


HeightInLines Property (SparkTextArea)

Class

SparkTextArea class

Action

Gets the default height of the control, measured in lines.

Data Type

REAL

Access

Read only


HeightLimit Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the maximum amount of space, in pixels, that an axis renderer will take from a chart.

Data Type

REAL

Access

Read only


Height Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets the height of the display object, in pixels.

The height is calculated based on the bounds of the content of the display object. When you set the height property, the scaleY property is adjusted accordingly.

Data Type

REAL

Access

Read only


Hide Method (FlexMenu)

Class

FlexMenu class

Action

Dispatched when a menu or submenu is dismissed.

Syntax

menu.Hide()


Hide Method (FlexMenuBar)

Class

FlexMenuBar class

Action

Dispatched when a menu or submenu is dismissed.

Syntax

menuBar.Hide()


HighlightColor Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the highlight color of the drop-down list.

Data Type

COLOR

Access

Read only


HorizontalAlign Property (FlexBox)

Class

FlexBox class

Action

Gets the horizontal alignment of children in the container.

Possible values are: left, center, and right. The default value is left, but some containers, such as ButtonBar and ToggleButtonBar, have different default values.

Data Type

STRING

Access

Read only


HorizontalAlign Property (FlexFormItem)

Class

FlexFormItem class

Action

Gets the horizontal alignment of children in the container.

Possible values are: left, center, and right. The default value is left.

Data Type

STRING

Access

Read only


HorizontalAlign Property (FlexTabNavigator)

Class

FlexTabNavigator class

Action

Gets the horizontal positioning of tabs at the top of this TabNavigator container.

Possible values are: left, center, and right. The default value is left.

If the value is left, the left edge of the first tab is aligned with the left edge of the TabNavigator container. If the value is right, the right edge of the last tab is aligned with the right edge of the TabNavigator container. If the value is center, the tabs are centered on the top of the TabNavigator container.

To see a difference between the alignments, the total width of all the tabs must be less than the width of the TabNavigator container.

Data Type

STRING

Access

Read only


HorizontalAlign Property (SparkImage)

Class

SparkImage class

Action

Gets the horizontal alignment of the content when it does not have a one-to-one aspect ratio and scaleMode is set to BitmapScaleMode.LETTERBOX.

Data Type

STRING

Access

Read only


HorizontalAxisRatio Property (FlexCartesianChart)

Class

FlexCartesianChart class

Action

Gets the height limit of the horiztonal axis.

The limit is the width of the axis times this ratio. The default value is 0.33.

Data Type

REAL

Access

Read only


HorizontalGap Property (FlexAccordion)

Class

FlexAccordion class

Action

Gets the number of pixels between children in the horizontal direction. The default value is 8.

Data Type

REAL

Access

Read only


HorizontalGap Property (FlexTabNavigator)

Class

FlexTabNavigator class

Action

Gets the separation between tabs, in pixels. The default value is -1, so that the borders of adjacent tabs overlap.

Data Type

REAL

Access

Read only


HorizontalGridLineColor Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the color of the horizontal grid lines.

Data Type

COLOR

Access

Read only


HorizontalGridLineColor Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets the color of the horizontal grid lines.

Data Type

COLOR

Access

Read only


HorizontalGridLines Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets whether to show horizontal grid lines between the rows.

If true, the data grid shows horizontal grid lines. If false, the data grid hides horizontal grid lines. The default value is false.

Data Type

BOOLEAN

Access

Read only


HorizontalScrollPolicy Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets whether the horizontal scroll bar is always on (ScrollPolicy.ON), always off (ScrollPolicy.OFF), or turns on when needed (ScrollPolicy.AUTO).

The default value is ScrollPolicy.AUTO.

Data Type

STRING

Access

Read only


HorizontalScrollPosition Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the x coordinate of the origin of the viewport in the component's coordinate system, where the default value is (0,0) corresponding to the upper-left corner of the component.

Data Type

REAL

Access

Read only


HorizontalScrollPosition Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the number of pixels by which the text is scrolled horizontally.

Data Type

REAL

Access

Read only


HtmlText Property (FlexLabel)

Class

FlexLabel class

Action

Gets the text displayed by the Label control, including HTML markup that expresses the styles of that text.

When you specify HTML text in this property, you can use the subset of HTML tags that is supported by the Flash TextField control.

Data Type

STRING

Access

Read only


HtmlText Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the text displayed by the TextInput control, including HTML markup that expresses the styles of that text.

When you specify HTML text in this property, you can use the subset of HTML tags that is supported by the Flash TextField control.

Data Type

STRING

Access

Read only


IconField Property (FlexListBase)

Class

FlexListBase class

Action

Gets the name of the field in the data provider object that determines what to display as the icon.

By default, the list class does not try to display icons with the text in the rows. However, by specifying an icon field, you can specify a graphic that is created and displayed as an icon in the row. This property is ignored by DataGrid.

The default value is null.

Data Type

STRING

Access

Read only


Id Property (FlexObject)

Class

FlexObject class

Action

Gets the ID of the component.

This value becomes the instance name of the object and should not contain any white space or special characters. Each component throughout an application should have a unique id.

Data Type

STRING

Access

Read only


Id Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets a string containing the automation identifier (ID) for the element.

Data Type

STRING

Access

Read only


Id Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the ID of the component.

This value becomes the instance name of the object and should not contain any white space or special characters. Each component throughout an application should have a unique name. Assigning a meaningful name can make scripts more readable. For example, set the value of a button to close_button rather than b1 or button1.

Data Type

STRING

Access

Read only


ImeMode Property (SparkNumericStepper)

Class

SparkNumericStepper class

Action

Gets the IME (Input Method Editor) mode.

Data Type

STRING

Access

Read only


ImeMode Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the IME (input method editor) mode.

Data Type

STRING

Access

Read only


ImeMode Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets the IME (input method editor) mode.

Data Type

STRING

Access

Read only


Indentation Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the indentation for each node of the navigation tree, in pixels. The default value is 17.

Data Type

INTEGER

Access

Read only


Indentation Property (FlexTree)

Class

FlexTree class

Action

Gets the indentation for each tree level, in pixels. The default value is 17.

Data Type

REAL

Access

Read only


Indeterminate Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets whether the ProgressBar control has a determinate or indeterminate appearance.

Use an indeterminate appearance when the progress status cannot be determined. If true, the appearance is indeterminate. The default value is false.

Data Type

BOOLEAN

Access

Read only


InnerRadius Property (FlexPieChart)

Class

FlexPieChart class

Action

Gets the size of the hole in the center of the pie chart.

This property is a percentage value of the center circle's radius compared to the entire pie's radius. The default value is 0 percent. Use this property to create a doughnut-shaped chart.

Data Type

REAL

Access

Read only


InnerRadius Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets a number from 0 to 1 specifying the distance from the center of the series to the inner edge of the rendered wedges, as a percentage of the total radius assigned to the series.

This property is assigned directly to the series.

Data Type

REAL

Access

Read only


Input Method (FlexComboBase)

Class

FlexComboBase class

Action

Creates an Event object that contains information about text events. Event objects are passed as parameters to event listeners.

Syntax

comboBase.Input(text)
Variable | Description
text | One or more characters of text entered by the user. Event listeners can access this information through the text property. STRING.


Input Method (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Creates an Event object that contains information about text events. Event objects are passed as parameters to event listeners.

Syntax

numericStepper.Input(text)
Variable | Description
text | One or more characters of text entered by the user. Event listeners can access this information through the text property. STRING.


Input Method (FlexTextArea)

Class

FlexTextArea class

Action

Dispatched when the user types, deletes, or pastes text into the control.

Syntax

textArea.Input(text)
Variable | Description
text | The character or sequence of characters entered by the user. STRING.


Input Method (SparkComboBox)

Class

SparkComboBox class

Action

Dispatched when the user types, deletes, or pastes text into the control.

Syntax

comboBox.Input(text)
Variable | Description
text | The character or sequence of characters entered by the user. STRING.


Input Method (SparkNumericStepper)

Class

SparkNumericStepper class

Action

Dispatched when the user types, deletes, or pastes text into the control.

Syntax

numericStepper.Input(text)
Variable | Description
text | The character or sequence of characters entered by the user. STRING.


Input Method (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Dispatched when the user types, deletes, or pastes text into the control.

Syntax

richEditableText.Input(text)
Variable | Description
text | The character or sequence of characters entered by the user. STRING.


Input Method (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Dispatched when the user types, deletes, or pastes text into the control.

Syntax

skinnableTextBase.Input(text)
Variable | Description
text | The character or sequence of characters entered by the user. STRING.


InsideLabelSizeLimit Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets the font size threshold, in points, below which inside labels are considered illegible.

Below this threshold, Flex either removes labels entirely or renders them as callouts based on the setting of the labelPosition property.

Data Type

REAL

Access

Read only


IsAIRWindow Property (FlexWindow)

Class

FlexWindow class

Action

Gets a value whether this window is an AIR window.

Data Type

BOOLEAN

Access

Read only


IsAIRWindow Property (SparkWindow)

Class

SparkWindow class

Action

Gets a value whether this window is an AIR window.

Data Type

BOOLEAN

Access

Read only


IsDropDownOpen Property (SparkDropDownListBase)

Class

SparkDropDownListBase class

Action

Gets a value whether the drop down is open.

Data Type

BOOLEAN

Access

Read only


IsDropDownOpen Property (SparkVolumeBar)

Class

SparkVolumeBar class

Action

Gets a value whether the volumebar is open.

Data Type

BOOLEAN

Access

Read only


IsGroupedItem Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Returns a value that specifies whether the item is a member of a group.

Syntax

bGroupedItem = advancedDataGrid.IsGroupedItem(RowIndex, [RestoreOriginalPosition])
Variable | Description
bGroupedItem | BOOLEAN.
RowIndex | The row index of the selected item. INTEGER.
RestoreOriginalPosition | Optional.Returns an item of a group to its previous position. BOOLEAN.


IsOpen Property (SparkSkinnablePopUpContainer)

Class

SparkSkinnablePopUpContainer class

Action

Gets whether the container is open.

Data Type

BOOLEAN

Access

Read only


IsTruncated Property (SparkTextBase)

Class

SparkTextBase class

Action

Gets whether the text has been truncated.

Data Type

BOOLEAN

Access

Read only


LabelField Property (FlexListBase)

Class

FlexListBase class

Action

Gets the name of the field in the data provider items to display as the label.

By default the list looks for a property named label on each item and displays it. However, if the data objects do not contain a label property, you can set the labelField property to use a different property in the data object.

The default value is label.

Data Type

STRING

Access

Read only


LabelField Property (SparkListBase)

Class

SparkListBase class

Action

Gets the name of the field in the data provider items to display as the label.

Data Type

STRING

Access

Read only


LabelGap Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the gap between the end of the tick marks and the top of the labels, in pixels. The default value is 3.

Data Type

REAL

Access

Read only


LabelPlacement Property (FlexButton)

Class

FlexButton class

Action

Gets the orientation of the label in relation to a specified icon.

Valid MXML values are: right, left, bottom, and top.

In ActionScript, you can use the following constants to set this property: ButtonLabelPlacement.RIGHT, ButtonLabelPlacement.LEFT, ButtonLabelPlacement.BOTTOM, and ButtonLabelPlacement.TOP.

The default value is ButtonLabelPlacement.RIGHT.

Data Type

STRING

Access

Read only


LabelPlacement Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the label placement of the legend element. Valid values include: top, bottom, right, and left.

Data Type

STRING

Access

Read only


LabelPlacement Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the placement of the label.

Valid values in MXML are: right, left, bottom, center, and top.

In ActionScript, you can use use the following constants to set this property: ProgressBarLabelPlacement.RIGHT, ProgressBarLabelPlacement.LEFT, ProgressBarLabelPlacement.BOTTOM, ProgressBarLabelPlacement.CENTER, and ProgressBarLabelPlacement.TOP.

The default value is ProgressBarLabelPlacement.BOTTOM.

Data Type

STRING

Access

Read only


LabelPosition Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets how to render value labels.

Valid values include:
  • none - Do not draw labels.
  • outside - Draw labels around the boundary of the pie.
  • callout - Draw labels in two vertical stacks on either side of the pie. The pie is shrunk if necessary to make room for the labels (see maxLabelRadius). Draw key lines from each label to the associated wedge. Shrink labels as necessary to fit the space provided.
  • inside - Draw labels inside the chart, centered approximately seven tenths of the way along each wedge. Shrink labels to ensure that they do not interfere with each other. If labels are shrunk below the calloutPointSize property, remove them. When two labels overlap, Flex gives priority to labels for larger slices.
  • insideWithCallout - Draw labels inside the pie, but if labels are shrunk below a legible size, Flex converts them to callouts.

Data Type

STRING

Access

Read only


Label Property (FlexButton)

Class

FlexButton class

Action

Gets the text to appear on the Button control.

If the label is wider than the Button control, the label is truncated and terminated by an ellipsis (...). The full label displays as a tooltip when the user moves the mouse over the Button control. If you have also set a tooltip by using the tooltip property, the tooltip is displayed rather than the label text.

The default value is "".

Data Type

STRING

Access

Read only


Label Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the text that displays next to the legend element.

Data Type

STRING

Access

Read only


Label Property (FlexContainer)

Class

FlexContainer class

Action

Gets the text displayed by some navigator containers to represent this Container.

For example, if this Container is a child of a TabNavigator, this string appears in the corresponding tab. If this Container is a child of an Accordion, this string appears in the corresponding header.

The default value is "".

Data Type

STRING

Access

Read only


Label Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the text that accompanies the progress bar.

You can include the following special characters in the text string:
  • %1 = current loaded bytes
  • %2 = total bytes
  • %3 = percent loaded
  • %% = "%" character

If a field is unknown, it is replaced by "??". If undefined, the label is not displayed.

Data Type

STRING

Access

Read only


Label Property (SparkButtonBase)

Class

SparkButtonBase class

Action

Gets the text to appear on the ButtonBase control.

Data Type

STRING

Access

Read only


Label Property (SparkFormItem)

Class

SparkFormItem class

Action

Gets the text of the form items label.

Data Type

STRING

Access

Read only


Label Property (SparkListLabel)

Class

SparkListLabel class

Action

Gets the label of the SparkListLabel.

Data Type

STRING

Access

Read only


LabelRotation Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the label rotation.

If the labels are rendered with device fonts, the labels are always drawn horizontally. If this style is any negative value, the AxisRenderer determines an optimal angle to render the labels in the smallest area without overlapping.

Data Type

REAL

Access

Read only


Labels Property (FlexSlider)

Class

FlexSlider class

Action

Gets an array of strings used for the slider labels.

Flex positions the labels at the beginning of the track, and spaces them evenly between the beginning of the track and the end of the track.

The default value is undefined.

Data Type

LIST OF STRING

Access

Read only


LabelStyleName Property (FlexSlider)

Class

FlexSlider class

Action

Gets the name of the style to use for the slider label. The default value is undefined.

Data Type

STRING

Access

Read only


LabelWidth Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the width of the label in pixels.

If the value is NaN, the ProgressBar control sets it to the width of the control. The default value is NaN.

Data Type

REAL

Access

Read only


LastVisibleRow Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (FlexChart)

Class

FlexChart class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (FlexChartSeries)

Class

FlexChartSeries class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (FlexComboBox)

Class

FlexComboBox class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (FlexContainer)

Class

FlexContainer class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (FlexListBase)

Class

FlexListBase class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (FlexMenu)

Class

FlexMenu class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the index of the last visible row.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (SparkSkinnableContainerBase)

Class

SparkSkinnableContainerBase class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LastVisibleRow Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets the index of the last visible child.

Data Type

INTEGER

Access

Read only


LegendItemClick Method (FlexChartLegend)

Class

FlexChartLegend class

Action

Dispatched when the user clicks on a LegendItem in the Legend control, which indicates that the user clicked the mouse button over a legend item.

Syntax

chartLegend.LegendItemClick(item)
Variable | Description
item | The item in the Legend on which this event was triggered. STRING.


Length Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the length of the axis, in screen coordinates.

Data Type

REAL

Access

Read only


Length Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the number of characters of text displayed in the TextArea.

Data Type

REAL

Access

Read only


LineScrollSize Property (FlexScrollBar)

Class

FlexScrollBar class

Action

Gets the amount to scroll when an arrow button is pressed, in pixels. The default value is 1.

Data Type

REAL

Access

Read only


LiveDragging Property (FlexSlider)

Class

FlexSlider class

Action

Gets whether live dragging is enabled for the slider.

If false, Flex sets the value and values properties and dispatches the change event when the user stops dragging the slider thumb. If true, Flex sets the value and values properties and dispatches the change event continuously as the user moves the thumb.

The default value is false.

Data Type

BOOLEAN

Access

Read only


LockedColumnCount Property (FlexListBase)

Class

FlexListBase class

Action

Gets the index of the first column in the control that scrolls.

Data Type

INTEGER

Access

Read only


LockedRowCount Property (FlexListBase)

Class

FlexListBase class

Action

Gets the index of the first row in the control that scrolls.

Data Type

INTEGER

Access

Read only


Loop Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets whether the media should play again after playback has completed.

Data Type

BOOLEAN

Access

Read only


LuminosityClip Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets a value whether the luminosity mask clips the masked content.

Data Type

BOOLEAN

Access

Read only


LuminosityClip Property (SparkRichText)

Class

SparkRichText class

Action

Gets whether the luminosity mask clips the masked content.

Data Type

BOOLEAN

Access

Read only


LuminosityInvert Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets a value that controls the calculation of the RGB color value of a graphic element being masked by a luminosity mask.

Data Type

BOOLEAN

Access

Read only


LuminosityInvert Property (SparkRichText)

Class

SparkRichText class

Action

Gets whether the calculation of the RGB color value of a graphic element is masked by a luminosity mask.

Data Type

BOOLEAN

Access

Read only


MarkerAspectRatio Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the aspect ratio for the marker associated with this legend item.

Some markers provided by chart series are intended for display at a particular aspect ratio. If this property is set, the legend item guarantees the aspect ratio of the marker during layout.

Data Type

REAL

Access

Read only


MarkerHeight Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the height of the legend element.

Data Type

INTEGER

Access

Read only


MarkerWidth Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the width of the legend element.

Data Type

INTEGER

Access

Read only


MaskType Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the mask type.

Data Type

STRING

Access

Read only


MaskType Property (SparkRichText)

Class

SparkRichText class

Action

Gets how the mask is applied to the component. The possible values are MaskType.CLIP, MaskType.ALPHA and MaskType.LUMINOSITY. Clip Masking When masking in clip mode, a clipping masks is reduced to 1-bit.

Data Type

STRING

Access

Read only


MaxBarWidth Property (FlexBarChart)

Class

FlexBarChart class

Action

Gets how wide to draw the bars, in pixels.

The actual bar width used is the smaller of this property and the barWidthRatio property. Clustered bars divide this space proportionally among the bars in each cluster.

Data Type

REAL

Access

Read only


MaxBarWidth Property (FlexBarSeries)

Class

FlexBarSeries class

Action

Gets the width of the bars, in pixels.

The actual bar width used is the smaller of this style and the barWidthRatio property. Clustered bars divide this space proportionally among the bars in each cluster.

Data Type

REAL

Access

Read only


MaxChars Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the maximum number of characters that users can enter in the text field.

Data Type

INTEGER

Access

Read only


MaxChars Property (SparkComboBox)

Class

SparkComboBox class

Action

Gets the maximum number of characters that the prompt area can contain, as entered by a user.

Data Type

INTEGER

Access

Read only


MaxChars Property (SparkNumericStepper)

Class

SparkNumericStepper class

Action

Gets the maximum number of characters that can be entered in the field.

Data Type

INTEGER

Access

Read only


MaxChars Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the maximum number of characters that the text field can contain, as entered by a user.

Data Type

INTEGER

Access

Read only


MaxChars Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets the maximum number of characters that the text field can contain, as entered by a user.

Data Type

INTEGER

Access

Read only


MaxColumnWidth Property (FlexCandlestickChart)

Class

FlexCandlestickChart class

Action

Gets how wide to draw the candlesticks, in pixels.

The actual column width used is the smaller of this property and the columnWidthRatio property. Multiple candlestick series divide this space proportionally.

Data Type

REAL

Access

Read only


MaxColumnWidth Property (FlexColumnChart)

Class

FlexColumnChart class

Action

Gets how wide to draw the columns, in pixels.

The actual column width used is the smaller of this property and the columnWidthRatio property. Clustered columns divide this space proportionally among the columns in each cluster.

Data Type

REAL

Access

Read only


MaxColumnWidth Property (FlexColumnSeries)

Class

FlexColumnSeries class

Action

Gets the width of the columns, in pixels.

The actual column width used is the smaller of this style and the columnWidthRatio property. Clustered columns divide this space proportionally among the columns in each cluster.

Data Type

REAL

Access

Read only


MaxColumnWidth Property (FlexHLOCChart)

Class

FlexHLOCChart class

Action

Gets how wide to draw the HLOC lines, in pixels.

The actual width used is the smaller of this property and the columnWidthRatio property. Multiple HLOC series divide this space proportionally.

Data Type

REAL

Access

Read only


MaxColumnWidth Property (FlexHLOCSeriesBase)

Class

FlexHLOCSeriesBase class

Action

Gets the width of the elements, in pixels.

The actual element width used is the smaller of this style and the columnWidthRatio property. You typically do not set this value directly; it is assigned by the enclosing chart.

Data Type

REAL

Access

Read only


MaxDisplayedLines Property (SparkTextBase)

Class

SparkTextBase class

Action

Gets an integer which determines whether, and where, the text gets truncated.

Data Type

INTEGER

Access

Read only


MaxHeight Property (FlexWindow)

Class

FlexWindow class

Action

Gets the maximum recommended height of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MaxHeight Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets the maximum recommended height of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MaxHeight Property (SparkWindow)

Class

SparkWindow class

Action

Gets the maximum recommended height of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MaxHeight Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets the maximum recommended height of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


Maximizable Property (FlexWindow)

Class

FlexWindow class

Action

Gets a value whether the window can be maximized.

Data Type

BOOLEAN

Access

Read only


Maximizable Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets a value whether the window can be maximized.

Data Type

BOOLEAN

Access

Read only


Maximizable Property (SparkWindow)

Class

SparkWindow class

Action

Gets a value whether the window can be maximized.

Data Type

BOOLEAN

Access

Read only


Maximizable Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets a value whether the window can be maximized.

Data Type

BOOLEAN

Access

Read only


MaximumDataTipCount Property (FlexChart)

Class

FlexChart class

Action

Gets the maximum number of datatips a chart will show.

If more datapoints are in range of the chart than allowed by this style, they will be prioritized by distance, with the closest showing first. The default value is NaN, which shows whatever datatips are within range.

Data Type

INTEGER

Access

Read only


Maximum Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the maximum value of the NumericStepper.

The maximum can be any number, including a fractional value. The default value is 10.

Data Type

REAL

Access

Read only


Maximum Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the largest progress value for the ProgressBar. You can only use this property in manual mode.

The default value is 0.

Data Type

REAL

Access

Read only


Maximum Property (FlexSlider)

Class

FlexSlider class

Action

Gets the maximum allowed value on the slider. The default value is 10.

Data Type

REAL

Access

Read only


Maximum Property (SparkRange)

Class

SparkRange class

Action

Gets the maximum valid value.

Data Type

REAL

Access

Read only


MaxLabelRadius Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets the maximum amount of the PieSeries's radius that can be allocated to labels.

This value is only applicable when the series is rendering callout labels.

Data Type

REAL

Access

Read only


MaxRadius Property (FlexBubbleSeries)

Class

FlexBubbleSeries class

Action

Gets the radius of the largest item renderered in this series.

When you use a BubbleSeries object in a BubbleChart, the chart automatically assigns its maxRadius style value to this property on all series in the chart. When you use BubbleSeries objects in CartesianChart controls, you manage this property manually.

Data Type

REAL

Access

Read only


MaxWidth Property (FlexWindow)

Class

FlexWindow class

Action

Gets the maximum recommended width of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MaxWidth Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets the maximum recommended width of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MaxWidth Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets the maximum recommended width of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MaxWidth Property (SparkWindow)

Class

SparkWindow class

Action

Gets the maximum recommended width of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MaxWidth Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets the maximum recommended width of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MaxYear Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the last year selectable in the control.

Data Type

INTEGER

Access

Read only


MaxYear Property (FlexDateField)

Class

FlexDateField class

Action

Gets the last year selectable in the control.

Data Type

INTEGER

Access

Read only


MediaPlayerState Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets the current state of the video.

Data Type

STRING

Access

Read only


MinColumnWidth Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the minimum width of the columns, in pixels.

Data Type

REAL

Access

Read only


MinColumnWidth Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets the minimum width of the columns, in pixels. If not NaN, the DataGrid control applies this value as the minimum width for all columns. Otherwise, individual columns can have their own minimum widths. The default value is NaN.

Data Type

REAL

Access

Read only


MinField Property (FlexAreaSeries)

Class

FlexAreaSeries class

Action

Gets the field of the dataProvider that determines the bottom boundary of the area.

If null, the area is based at the range minimum (or maximum, if the field value is negative). The default value is null.

Data Type

STRING

Access

Read only


MinField Property (FlexBarSeries)

Class

FlexBarSeries class

Action

Gets the field of the data provider that determines the bottom of each bar.

If null, the columns are based at the range minimum (or maximum, if the field value is negative). The default value is null.

Data Type

STRING

Access

Read only


MinField Property (FlexColumnSeries)

Class

FlexColumnSeries class

Action

Gets the field of the data provider that determines the y-axis location of the bottom of a column.

If null, the columns are based at the range minimum (or maximum, if the field value is negative). The default value is null.

Data Type

STRING

Access

Read only


MinHeight Property (FlexWindow)

Class

FlexWindow class

Action

Gets the minimum recommended height of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MinHeight Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets the minimum recommended height of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MinHeight Property (SparkWindow)

Class

SparkWindow class

Action

Gets the minimum recommended height of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MinHeight Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets the minimum recommended height of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


Minimizable Property (FlexWindow)

Class

FlexWindow class

Action

Gets a value whether the window can be minimized.

Data Type

BOOLEAN

Access

Read only


Minimizable Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets a value whether the window can be minimized.

Data Type

BOOLEAN

Access

Read only


Minimizable Property (SparkWindow)

Class

SparkWindow class

Action

Gets a value whether the window can be minimized.

Data Type

BOOLEAN

Access

Read only


Minimizable Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets a value whether the window can be minimized.

Data Type

BOOLEAN

Access

Read only


Minimum Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the minimum value of the NumericStepper.

The minimum can be any number, including a fractional value. The default value is 0.

Data Type

REAL

Access

Read only


Minimum Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the smallest progress value for the ProgressBar. This property is set by the developer only in manual mode.

The default value is 0.

Data Type

REAL

Access

Read only


Minimum Property (FlexSlider)

Class

FlexSlider class

Action

Gets the minimum allowed value on the slider control. The default value is 0.

Data Type

REAL

Access

Read only


Minimum Property (SparkRange)

Class

SparkRange class

Action

Gets the minimum valid value.

Data Type

REAL

Access

Read only


MinorTickLength Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the length of the minor tick marks on the axis, in pixels. The default value is 0.

Data Type

REAL

Access

Read only


MinorTickPlacement Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets a value where to draw the minor tick marks. Values include: inside, outside, cross, and none.

Data Type

STRING

Access

Read only


MinorTicks Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets an array that specifies where Flex draws the minor tick marks along the axis. Each array element contains a value between 0 and 1.

Data Type

LIST OF REAL

Access

Read only


MinWidth Property (FlexWindow)

Class

FlexWindow class

Action

Gets the minimum recommended width of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MinWidth Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets the minimum recommended width of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MinWidth Property (SparkWindow)

Class

SparkWindow class

Action

Gets the minimum recommended width of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MinWidth Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets the minimum recommended width of the component to be considered by the parent during layout.

Data Type

REAL

Access

Read only


MinYear Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the first year selectable in the control.

Data Type

INTEGER

Access

Read only


MinYear Property (FlexDateField)

Class

FlexDateField class

Action

Gets the first year selectable in the control.

Data Type

INTEGER

Access

Read only


MouseEnabled Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets whether this object receives mouse messages. The default value is true, which means that by default any InteractiveObject instance that is on the display list receives mouse events. If mouseEnabled is set to false, the instance does not receive any mouse events. Any children of this instance on the display list are not affected. To change the mouseEnabled behavior for all children of an object on the display list, use flash.display.DisplayObjectContainer.mouseChildren.

No event is dispatched by setting this property. You must use the addEventListener method to create interactive functionality.

Data Type

BOOLEAN

Access

Read only


MouseEnabledWhereTransparent Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets a value whether the entire bounds of the Group respond to mouse events such as click and roll over.

Data Type

BOOLEAN

Access

Read only


MouseScroll Method (FlexContainer)

Class

FlexContainer class

Action

Dispatched when a mouse wheel is spun over an InteractiveObject instance.

If the target is a text field, the text scrolls as the default behavior. Only available on Microsoft Windows operating systems.

Defines the value of the type property of a mouseWheel event object.

Syntax

container.MouseScroll([delta])
Variable | Description
delta | Optional.The number of lines that each notch on the mouse wheel represents. INTEGER.


MouseScroll Method (FlexScrollBase)

Class

FlexScrollBase class

Action

Dispatched when a mouse wheel is spun over an InteractiveObject instance.

If the target is a text field, the text scrolls as the default behavior. Only available on Microsoft Windows operating systems.

Defines the value of the type property of a mouseWheel event object.

Syntax

scrollBase.MouseScroll([delta])
Variable | Description
delta | Optional.The number of lines that each notch on the mouse wheel represents. INTEGER.


MouseScroll Method (SparkGroupBase)

Class

SparkGroupBase class

Action

Dispatched when the mouse is used to move the scroll bars on this container.

Syntax

groupBase.MouseScroll([delta])
Variable | Description
delta | Optional.The amount to scroll. INTEGER.


MouseScroll Method (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Dispatched when the mouse is used to move the scroll bars on this container.

Syntax

richEditableText.MouseScroll([delta])
Variable | Description
delta | Optional.The amount to scroll. INTEGER.


MouseScroll Method (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Dispatched when the mouse is used to move the scroll bars on this container.

Syntax

skinnableTextBase.MouseScroll([delta])
Variable | Description
delta | Optional.The amount to scroll. INTEGER.


MouseSensitivity Property (FlexChart)

Class

FlexChart class

Action

Gets the distance, in pixels, that Flex considers a data point to be under the mouse pointer when the pointer moves around a chart.

Flex considers any data point less than mouseSensitivity pixels away to be under the mouse pointer. This value is also used by the findDataPoints method. The default value is 5.

Data Type

INTEGER

Access

Read only


Move Method (FlexObject)

Class

FlexObject class

Action

Moves the component to a specified position within its parent. Calling this method is the same as setting the component's x and y properties.

Syntax

object.Move([x, y])
Variable | Description
x | Optional.Left position of the component within its parent. INTEGER.
y | Optional.Top position of the component within its parent. INTEGER.


Multiline Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets whether the user can enter multiline text.

Data Type

BOOLEAN

Access

Read only


MultiSelect Method (FlexListBase)

Class

FlexListBase class

Action

Defines the value of the type property of the event object for an event that is dispatched when an item is selected as part of an action that selects multiple items.

Syntax

listBase.MultiSelect(itemRenderer, [triggerEvent, keyModifier])
Variable | Description
itemRenderer | The item renderer object for the item. STRING.
triggerEvent | Optional.The event, such as a mouse or keyboard event, that triggered the action. FLEXTRIGGEREVENT.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when clicking the controls. MODIFIERKEYSTATE.


MuteChange Method (SparkMuteButton)

Class

SparkMuteButton class

Action

Toggles the muting of the control.

Syntax

muteButton.MuteChange()


MuteChange Method (SparkVolumeBar)

Class

SparkVolumeBar class

Action

Dispatched when the mute status changes as a result of user interaction.

Syntax

volumeBar.MuteChange()


Muted Property (SparkMuteButton)

Class

SparkMuteButton class

Action

Gets a value whether the control is muted.

Data Type

BOOLEAN

Access

Read only


Muted Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets whether the video is muted.

Data Type

BOOLEAN

Access

Read only


Muted Property (SparkVideoPlayer)

Class

SparkVideoPlayer class

Action

Gets a value whether the control is muted.

Data Type

BOOLEAN

Access

Read only


Muted Property (SparkVolumeBar)

Class

SparkVolumeBar class

Action

Gets a value whether the control is muted.

Data Type

BOOLEAN

Access

Read only


NameField Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets the field of the data provider that determines the name of each wedge of the PieChart control. The default value is null.

Data Type

STRING

Access

Read only


NextValue Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the value that is one step larger than the current value property and not greater than the maximum property value.

Data Type

REAL

Access

Read only


NumAutomationChildren Property (FlexObject)

Class

FlexObject class

Action

Gets the number of automation children this container has.

This sum should not include any composite children, though it does include those children not significant within the automation hierarchy.

Data Type

INTEGER

Access

Read only


NumAutomationChildren Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the number of automation children this container has.

Data Type

INTEGER

Access

Read only


NumChildren Property (FlexContainer)

Class

FlexContainer class

Action

Gets the number of child components in this container.

Data Type

INTEGER

Access

Read only


NumChildren Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the number of children of this object.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexChart)

Class

FlexChart class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexChartSeries)

Class

FlexChartSeries class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexComboBox)

Class

FlexComboBox class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexContainer)

Class

FlexContainer class

Action

Gets the total number of columns of data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexListBase)

Class

FlexListBase class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexMenu)

Class

FlexMenu class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the total number of columns.

Data Type

INTEGER

Access

Read only


NumColumns Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (SparkSkinnableContainerBase)

Class

SparkSkinnableContainerBase class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumColumns Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets the total number of columns in the data available.

Data Type

INTEGER

Access

Read only


NumElements Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the number of visual elements in this container.

Data Type

INTEGER

Access

Read only


NumElements Property (SparkSkinnableContainer)

Class

SparkSkinnableContainer class

Action

Gets the number of visual elements in this container.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexChart)

Class

FlexChart class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexChartSeries)

Class

FlexChartSeries class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexComboBox)

Class

FlexComboBox class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexContainer)

Class

FlexContainer class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexListBase)

Class

FlexListBase class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexMenu)

Class

FlexMenu class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the total number of rows.

Data Type

INTEGER

Access

Read only


NumRows Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (SparkSkinnableContainerBase)

Class

SparkSkinnableContainerBase class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


NumRows Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets the total number of rows of data available.

Data Type

INTEGER

Access

Read only


Offset Property (FlexBarSeries)

Class

FlexBarSeries class

Action

Gets the amount to offset the center of the bars from the center of the available space, relative to the category width.

The range of values is a percentage in the range -100 to 100. Set to 0 to center the bars in the space. Set to -50 to center the column at the beginning of the available space. You typically do not set this property directly.

The default value is 0.

Data Type

REAL

Access

Read only


Offset Property (FlexColumnSeries)

Class

FlexColumnSeries class

Action

Gets how far to offset the center of the columns from the center of the available space, relative to the category width.

At the value of default 0, the columns are centered on the space. Set to -50 to center the column at the beginning of the available space. You typically do not set this property directly. The ColumnChart control manages this value based on its columnWidthRatio property.

Data Type

REAL

Access

Read only


OpenDuration Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the length of an open or close transition for the navigation tree, in milliseconds. The default value is 250.

Data Type

INTEGER

Access

Read only


Open Method (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Opens or expands an AdvancedDataGrid branch.

Syntax

advancedDataGrid.Open(itemRenderer, [triggerEvent])
Variable | Description
itemRenderer | The ListItemRenderer for the item (node) that opened. STRING.
triggerEvent | Optional.If the item (node) opened in response to a user action, identifies it as a keyboard action or a mouse action. FLEXTRIGGEREVENT.


Open Method (FlexComboBase)

Class

FlexComboBase class

Action

Defines the value of the type property of the event object for a open event.

Syntax

comboBase.Open([triggerEvent])
Variable | Description
triggerEvent | Optional.A value indicating the type of input action that triggered the event. FLEXTRIGGEREVENT.


Open Method (FlexPopUpButton)

Class

FlexPopUpButton class

Action

Dispatched when the specified UIComponent opens.

The DropdownEvent.OPEN constant defines the value of the type property of the event object for a open event.

Syntax

popUpButton.Open([triggerEvent])
Variable | Description
triggerEvent | Optional.A value indicating the type of input action that triggered the event. FLEXTRIGGEREVENT.


Open Method (FlexTree)

Class

FlexTree class

Action

Opens or expands a tree branch.

Syntax

tree.Open(itemRenderer, [triggerEvent])
Variable | Description
itemRenderer | The ListItemRenderer for the item (node) that opened. STRING.
triggerEvent | Optional.If the item (node) opened in response to a user action, identifies it as a keyboard action or a mouse action. FLEXTRIGGEREVENT.


Open Method (SparkDropDownListBase)

Class

SparkDropDownListBase class

Action

Dispatched when the user clicks the drop-down button to display the drop-down list.

Syntax

dropDownListBase.Open([triggerEvent])
Variable | Description
triggerEvent | Optional.Whether the event was triggered by mouse or keyboard. FLEXTRIGGEREVENT.


Open Method (SparkVolumeBar)

Class

SparkVolumeBar class

Action

Dispatched when the user clicks the drop-down button to display the drop-down list.

Syntax

volumeBar.Open([triggerEvent])
Variable | Description
triggerEvent | Optional.Whether the event was triggered by mouse or keyboard. FLEXTRIGGEREVENT.


OuterRadius Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets the percentage of the total space available to the PieSeries to use when rendering the contents of the series.

This value is managed by the containing chart, and should not be assigned to directly. This value ranges from 0 to 1.

Data Type

REAL

Access

Read only


PaddingBottom Property (FlexAccordion)

Class

FlexAccordion class

Action

Gets the number of pixels between the container's bottom border and its content area.

The default value is -1, so the bottom border of the last header overlaps the Accordion container's bottom border.

Data Type

REAL

Access

Read only


PaddingBottom Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the number of pixels between the bottom of the row and the bottom of the renderer in the row.

Data Type

INTEGER

Access

Read only


PaddingBottom Property (FlexChart)

Class

FlexChart class

Action

Gets the number of pixels between the chart's bottom border and its content area.

Data Type

INTEGER

Access

Read only


PaddingLeft Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the number of pixels between the control's left border and the left edge of its content area. The default value is 2.

Data Type

INTEGER

Access

Read only


PaddingLeft Property (FlexChart)

Class

FlexChart class

Action

Gets the number of pixels between the control's left border and the left edge of its content area. The default value is 2.

Data Type

INTEGER

Access

Read only


PaddingLeft Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the number of pixels between the control's left border and the left edge of its content area. The default value is 2.

Data Type

INTEGER

Access

Read only


PaddingRight Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the number of pixels between the control's right border and the right edge of its content area. The default value is 0.

Data Type

INTEGER

Access

Read only


PaddingRight Property (FlexChart)

Class

FlexChart class

Action

Gets the number of pixels between the control's right border and the right edge of its content area. The default value is 0.

Data Type

INTEGER

Access

Read only


PaddingRight Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the number of pixels between the control's right border and the right edge of its content area. The default value is 0.

Data Type

INTEGER

Access

Read only


PaddingTop Property (FlexAccordion)

Class

FlexAccordion class

Action

Gets the number of pixels between the container's top border and its content area.

The default value is -1, so the top border of the first header overlaps the Accordion container's top border.

Data Type

REAL

Access

Read only


PaddingTop Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the number of pixels between the top of the row and the top of the renderer in the row.

Data Type

INTEGER

Access

Read only


PaddingTop Property (FlexChart)

Class

FlexChart class

Action

Gets the number of pixels between the chart's top border and its content area.

Data Type

INTEGER

Access

Read only


PageScrollSize Property (FlexScrollBar)

Class

FlexScrollBar class

Action

Gets the amount to move the scroll thumb when the scroll bar track is pressed, in pixels. The default value is 0.

Data Type

REAL

Access

Read only


PageSize Property (SparkScrollBar)

Class

SparkScrollBar class

Action

Gets the change in the value of the value property when you call the changeValueByPage() method.

Data Type

REAL

Access

Read only


PauseWhenHidden Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets whether the video continues to play when it is "hidden".

Data Type

BOOLEAN

Access

Read only


PercentComplete Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the percentage of process that is completed. The range is 0 to 100.

Data Type

REAL

Access

Read only


PercentHeight Property (FlexObject)

Class

FlexObject class

Action

Gets the number that specifies the height of a component as a percentage of its parent's size.

Allowed values are 0-100. The default value is NaN. Setting the height or explicitHeight properties resets this property to NaN.

This property returns a numeric value only if the property was previously set; it does not reflect the exact size of the component in percent.

This property is always set to NaN for the UITextField control.

Data Type

REAL

Access

Read only


PercentHeight Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the number that specifies the height of a component as a percentage of its parent's size. Valid values are 0 to 100.

Data Type

REAL

Access

Read only


PercentWidth Property (FlexObject)

Class

FlexObject class

Action

Gets the number that specifies the width of a component as a percentage of its parent's size. Allowed values are 0-100. The default value is NaN. Setting the width or explicitWidth properties resets this property to NaN.

This property returns a numeric value only if the property was previously set; it does not reflect the exact size of the component in percent.

This property is always set to NaN for the UITextField control.

Data Type

REAL

Access

Read only


PercentWidth Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the number that specifies the width of a component as a percentage of its parent's size. Valid values are 0 to 100.

Data Type

REAL

Access

Read only


Placement Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the side of the chart that the axisRenderer appears on.

Data Type

STRING

Access

Read only


Playing Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets a value whether the video is playing or is attempting to play.

Data Type

BOOLEAN

Access

Read only


Playing Property (SparkVideoPlayer)

Class

SparkVideoPlayer class

Action

Gets a value if the video is playing or is attempting to play.

Data Type

BOOLEAN

Access

Read only


PopUpHeightMatchesAnchorHeight Property (SparkPopUpAnchor)

Class

SparkPopUpAnchor class

Action

Gets whether the height of the popUp control is set to the value of the PopUpAnchor's height.

Data Type

BOOLEAN

Access

Read only


PopUpPosition Property (SparkPopUpAnchor)

Class

SparkPopUpAnchor class

Action

Gets the position of the popUp control when it is opened, relative to the PopUpAnchor component.

Data Type

STRING

Access

Read only


PopUpWidthMatchesAnchorWidth Property (SparkPopUpAnchor)

Class

SparkPopUpAnchor class

Action

Gets whether the width of the popUp control is set to the value of the PopUpAnchor's width.

Data Type

BOOLEAN

Access

Read only


PreliminaryHeight Property (SparkImage)

Class

SparkImage class

Action

Gets an estimate to use for height when the "measured" bounds of the image is requested by layout, but the image data has yet to complete loading.

Data Type

REAL

Access

Read only


PreliminaryWidth Property (SparkImage)

Class

SparkImage class

Action

Gets an estimate to use for width when the "measured" bounds of the image is requested by layout, but the image data has yet to complete loading.

Data Type

REAL

Access

Read only


Pressed Method (FlexDividedBox)

Class

FlexDividedBox class

Action

Dispatched when the user presses any divider in this container.

The dividerPress event is dispatched before any dividerDrag events are dispatched.

Syntax

dividedBox.Pressed(dividerIndex, delta)
Variable | Description
dividerIndex | Contains the zero-based index of the divider being dragged. The leftmost or topmost divider has a dividerIndex of 0. INTEGER.
delta | Contains the number of pixels that the divider has been dragged. Positive numbers represent a drag toward the right or bottom, negative numbers toward the left or top. REAL.


PreviousValue Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the value that is one step smaller than the current value property and not smaller than the maximum property value.

Data Type

REAL

Access

Read only


Prompt Property (SparkDropDownList)

Class

SparkDropDownList class

Action

Gets the prompt for the DropDownList control.

Data Type

STRING

Access

Read only


RadiusField Property (FlexBubbleSeries)

Class

FlexBubbleSeries class

Action

Gets the field of the data provider that determines the radius of each symbol, relative to the other data points in the chart.

Data Type

STRING

Access

Read only


Radius Property (FlexAreaSeries)

Class

FlexAreaSeries class

Action

Gets the radius, in pixels, of the chart elements for the data points.

This property only applies if you specify an itemRenderer property.

The default value is 4.

Data Type

REAL

Access

Read only


Radius Property (FlexLineSeries)

Class

FlexLineSeries class

Action

Gets the radius, in pixels, of the chart elements for the data points.

This property applies only if you specify an item renderer using the itemRenderer property.

The default value is 4.

Data Type

REAL

Access

Read only


Radius Property (FlexPlotSeries)

Class

FlexPlotSeries class

Action

Gets the radius style.

Specifies the radius, in pixels, of the chart element at each data point. By default, the PlotChart control draws a circle at each data point.

The default value is 4.

Data Type

REAL

Access

Read only


RecycleChildren Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets whether this Repeater should re-use previously created children, or create new ones.

If true, when this Repeater's dataProvider, startingIndex, or count changes, it will recycle the existing children by binding the new data into them. If more children are required, they are created and added. If fewer children are required, the extra ones are removed and garbage collected.

If false, when this Repeater's dataProvider, startingIndex, or count changes, it will remove any previous children that it created and then create and add new children from the new data items.

This property is false by default. Setting it to true can increase performance, but is not appropriate in all situations. For example, if the previously created children have state information such as text typed in by a user, then this state will not be reset when the children are recycled.

Data Type

BOOLEAN

Access

Read only


Released Method (FlexDividedBox)

Class

FlexDividedBox class

Action

Dispatched when the user releases a divider.

The dividerRelease event is dispatched after the dividerDrag events, but before the container's children are resized. The divider's x and y properties are not updated until after this event is triggered. As a result, a call to hDividerBox.getDividerAt(0).x will return the value of the original x position of the first divider. If you want the position of the divider after the move, you can access it when the DividerBox's updateComplete event has been triggered.

Syntax

dividedBox.Released(dividerIndex, delta)
Variable | Description
dividerIndex | Contains the zero-based index of the divider being dragged. The leftmost or topmost divider has a dividerIndex of 0. INTEGER.
delta | Contains the number of pixels that the divider has been dragged. Positive numbers represent a drag toward the right or bottom, negative numbers toward the left or top. REAL.


Required Property (SparkFormItem)

Class

SparkFormItem class

Action

Gets whether the form item has to have a value to submit the form.

Data Type

BOOLEAN

Access

Read only


RequireSelection Property (SparkListBase)

Class

SparkListBase class

Action

Gets a value if a data item must always be selected in the control.

Data Type

BOOLEAN

Access

Read only


ResizableColumns Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets whether the user can change the size of the columns.

If true, the user can stretch or shrink the columns of the DataGrid control by dragging the grid lines between the header cells. If false, individual columns must also have their resizable properties set to false to prevent the user from resizing a particular column. The default value is true.

Data Type

BOOLEAN

Access

Read only


ResizableColumns Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets whether the user can change the size of the columns.

If true, the user can stretch or shrink the columns of the DataGrid control by dragging the grid lines between the header cells. If false, individual columns must also have their resizable properties set to false to prevent the user from resizing a specific column.

The default value is true.

Data Type

BOOLEAN

Access

Read only


Resizable Property (FlexWindow)

Class

FlexWindow class

Action

Gets a value whether the window can be resized.

Data Type

BOOLEAN

Access

Read only


Resizable Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets a value whether the window can be resized.

Data Type

BOOLEAN

Access

Read only


Resizable Property (SparkWindow)

Class

SparkWindow class

Action

Gets a value whether the window can be resized.

Data Type

BOOLEAN

Access

Read only


Resizable Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets a value whether the window can be resized.

Data Type

BOOLEAN

Access

Read only


ResizeMode Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the ResizeMode for this container.

Data Type

STRING

Access

Read only


ResizeToContent Property (FlexDividedBox)

Class

FlexDividedBox class

Action

Gets whether the DividedBox automatically resizes to the size of its children.

If true, the DividedBox automatically resizes to the size of its children. The default value is false.

Data Type

BOOLEAN

Access

Read only


Restrict Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the set of characters that a user can or cannot enter into the text field.

Data Type

STRING

Access

Read only


Restrict Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the set of characters that a user can enter into the control.

Data Type

STRING

Access

Read only


Restrict Property (SparkComboBox)

Class

SparkComboBox class

Action

Gets the set of characters that a user can enter into the prompt area.

Data Type

STRING

Access

Read only


Restrict Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the set of characters that a user can enter into the text field.

Data Type

STRING

Access

Read only


Restrict Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets the set of characters that a user can enter into the text field.

Data Type

STRING

Access

Read only


RollOverColor Property (FlexComboBox)

Class

FlexComboBox class

Action

Gets the rollOverColor of the drop-down list.

Data Type

COLOR

Access

Read only


RollOverColor Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the color of the highlight area of the date when the user holds the mouse pointer over a date in the DateChooser control. The default value is 0xE3FFD6.

Data Type

COLOR

Access

Read only


RollOverColor Property (FlexDateField)

Class

FlexDateField class

Action

Gets the color of the highlight area of the date when the user holds the mouse pointer over a date in the DateChooser control. The default value is 0xE3FFD6.

Data Type

COLOR

Access

Read only


RollOverColor Property (FlexListBase)

Class

FlexListBase class

Action

Gets the color of the background of a renderer when the user rolls over it. The default value is 0xEEFEE6.

Data Type

COLOR

Access

Read only


RollOverColor Property (FlexMenu)

Class

FlexMenu class

Action

Gets the color of the menu item background when a user rolls the mouse over it. The default value is 0xB2E1FF.

Data Type

LIST OF COLOR

Access

Read only


RollOverColor Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the color of the menu item background when a user rolls the mouse over it.

Data Type

COLOR

Access

Read only


RowCount Property (FlexListBase)

Class

FlexListBase class

Action

Gets the number of rows to be displayed.

If the height of the component has been explicitly set, this property might not have any effect.

For a DataGrid control, the rowCount property includes the header row. So, for a DataGrid control with 3 body rows and a header row, the rowCount property is 4.

The default value is 4.

Data Type

INTEGER

Access

Read only


RowCount Property (FlexMenu)

Class

FlexMenu class

Action

Gets the number of rows to be displayed.

Data Type

INTEGER

Access

Read only


RowHeight Property (FlexListBase)

Class

FlexListBase class

Action

Gets the height of the rows in pixels.

Unless the variableRowHeight property is true, all rows are the same height. If not specified, the row height is based on the font size and other properties of the renderer.

Data Type

REAL

Access

Read only


RowHeight Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the height of the row.

Data Type

REAL

Access

Read only


ScaleGridBottom Property (SparkGroup)

Class

SparkGroup class

Action

Gets the bottom coordinate of the scale grid.

Data Type

REAL

Access

Read only


ScaleGridLeft Property (SparkGroup)

Class

SparkGroup class

Action

Gets the left coordinate of the scale grid.

Data Type

REAL

Access

Read only


ScaleGridRight Property (SparkGroup)

Class

SparkGroup class

Action

Gets the right coordinate of the scale grid.

Data Type

REAL

Access

Read only


ScaleGridTop Property (SparkGroup)

Class

SparkGroup class

Action

Gets the top coordinate of the scale grid.

Data Type

REAL

Access

Read only


ScaleMode Property (SparkImage)

Class

SparkImage class

Action

Gets whether the image is scaled when fillMode is set to BitmapFillMode.SCALE.

Data Type

STRING

Access

Read only


ScaleMode Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets the different ways of sizing the video content.

Data Type

STRING

Access

Read only


ScaleX Property (FlexObject)

Class

FlexObject class

Action

Gets the number that specifies the horizontal scaling factor.

The default value is 1.0, which means that the object is not scaled. A scaleX of 2.0 means the object has been magnified by a factor of 2, and a scaleX of 0.5 means the object has been reduced by a factor of 2.

A value of 0.0 is an invalid value. Rather than setting it to 0.0, set it to a small value, or set the visible property to false to hide the component.

The default value is 1.0.

This property can be used as the source for data binding. When this property is modified, it dispatches the scaleXChanged event.

Data Type

REAL

Access

Read only


ScaleX Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the horizontal scale (percentage) of the object as applied from the registration point. The default registration point is (0,0). 1.0 equals 100% scale.

Data Type

REAL

Access

Read only


ScaleY Property (FlexObject)

Class

FlexObject class

Action

Gets the number that specifies the vertical scaling factor.

The default value is 1.0, which means that the object is not scaled. A scaleY of 2.0 means the object has been magnified by a factor of 2, and a scaleY of 0.5 means the object has been reduced by a factor of 2.

A value of 0.0 is an invalid value. Rather than setting it to 0.0, set it to a small value, or set the visible property to false to hide the component.

The default value is 1.0.

This property can be used as the source for data binding. When this property is modified, it dispatches the scaleYChanged event.

Data Type

REAL

Access

Read only


ScaleY Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the vertical scale (percentage) of an object as applied from the registration point of the object. The default registration point is (0,0). 1.0 is 100% scale.

Data Type

REAL

Access

Read only


ScrollDate Method (FlexDateChooser)

Class

FlexDateChooser class

Action

The DateChooserEvent.SCROLL constant defines the value of the type property of the event object for a scrollevent.

Syntax

dateChooser.ScrollDate(detail)
Variable | Description
detail | The scroll direction. FLEXDATESCROLLDETAIL.


ScrollDate Method (FlexDateField)

Class

FlexDateField class

Action

The DateChooserEvent.SCROLL constant defines the value of the type property of the event object for a scrollevent.

Syntax

dateField.ScrollDate(detail)
Variable | Description
detail | The scroll direction. FLEXDATESCROLLDETAIL.


Scroll Method (FlexComboBase)

Class

FlexComboBase class

Action

Defines the value of the type property of the event object for a scroll event.

Syntax

comboBase.Scroll(position, direction, detail)
Variable | Description
position | Contains the new scroll position. INTEGER.
direction | Contains the scroll direction, either ScrollEventDirection.HORIZONTAL or ScrollEventDirection.VERTICAL. FLEXSCROLLDIRECTION.
detail | Provides the specifics of the type of scroll activity. Constants for the possible values are provided in the ScrollEventDetail class. FLEXSCROLLDETAIL.


Scroll Method (FlexContainer)

Class

FlexContainer class

Action

Dispatched when the user manually scrolls the container.

The event is dispatched when the scroll position is changed using either the mouse (e.g. clicking on the scrollbar's down button) or the keyboard (e.g., clicking on the down-arrow key). However, this event is not dispatched if the scroll position is changed programatically (e.g., setting the value of the horizontalScrollPosition property). The viewChanged event is delivered whenever the scroll position is changed, either manually or programatically.

At the time when this event is dispatched, the scrollbar has been updated to the new position, but the container's child objects have not been shifted to reflect the new scroll position.

Syntax

container.Scroll(position, direction, detail)
Variable | Description
position | Contains the new scroll position. INTEGER.
direction | Contains the scroll direction, either ScrollEventDirection.HORIZONTAL or ScrollEventDirection.VERTICAL. FLEXSCROLLDIRECTION.
detail | Provides the specifics of the type of scroll activity. Constants for the possible values are provided in the ScrollEventDetail class. FLEXSCROLLDETAIL.


Scroll Method (FlexListBase)

Class

FlexListBase class

Action

Defines the value of the type property of the event object for a scroll event.

Syntax

listBase.Scroll(position, direction, detail)
Variable | Description
position | Contains the new scroll position. INTEGER.
direction | Contains the scroll direction, either ScrollEventDirection.HORIZONTAL or ScrollEventDirection.VERTICAL. FLEXSCROLLDIRECTION.
detail | Provides the specifics of the type of scroll activity. Constants for the possible values are provided in the ScrollEventDetail class. FLEXSCROLLDETAIL.


Scroll Method (FlexScrollBar)

Class

FlexScrollBar class

Action

Dispatched when the ScrollBar control scrolls through user initiated action or programmatically.

Syntax

scrollBar.Scroll(position, direction, detail)
Variable | Description
position | Contains the new scroll position. INTEGER.
direction | Contains the scroll direction, either ScrollEventDirection.HORIZONTAL or ScrollEventDirection.VERTICAL. FLEXSCROLLDIRECTION.
detail | Provides the specifics of the type of scroll activity. Constants for the possible values are provided in the ScrollEventDetail class. FLEXSCROLLDETAIL.


Scroll Method (FlexTextArea)

Class

FlexTextArea class

Action

Defines the value of the type property of the event object for a scroll event.

Syntax

textArea.Scroll(position, direction, detail)
Variable | Description
position | Contains the new scroll position. INTEGER.
direction | Contains the scroll direction, either ScrollEventDirection.HORIZONTAL or ScrollEventDirection.VERTICAL. FLEXSCROLLDIRECTION.
detail | Provides the specifics of the type of scroll activity. Constants for the possible values are provided in the ScrollEventDetail class. FLEXSCROLLDETAIL.


Scroll Method (SparkAirHTML)

Class

SparkAirHTML class

Action

Dispatched when the scroll events occur. This event is dispatched if the scrolling is done programmatically or by the user.

Syntax

airHTML.Scroll(position, direction, detail)
Variable | Description
position | The new scroll position. INTEGER.
direction | The direction of motion: ScrollEventDirection.VERTICAL or ScrollEventDirection.HORIZONTAL. FLEXSCROLLDIRECTION.
detail | Provides the details of the scroll activity. For most scroll activities the value is one of the listed constants, such as THUMB_TRACK. If the event indicates that the scrollbar has moved up, down, left, or right, the value is the string concatenation of the amount of motion (such as "Line" or "Page") and the constant that indicates the direction, such as LEFT. FLEXSCROLLDETAIL.


Scroll Method (SparkGroupBase)

Class

SparkGroupBase class

Action

Dispatched when the container's scroll events occur. This event is dispatched if the scrolling is done programmatically or by the user.

Syntax

groupBase.Scroll(position, direction, detail)
Variable | Description
position | The new scroll position. INTEGER.
direction | The direction of motion: ScrollEventDirection.VERTICAL or ScrollEventDirection.HORIZONTAL. FLEXSCROLLDIRECTION.
detail | Provides the details of the scroll activity. For most scroll activities the value is one of the listed constants, such as THUMB_TRACK. If the event indicates that the scrollbar has moved up, down, left, or right, the value is the string concatenation of the amount of motion (such as "Line" or "Page") and the constant that indicates the direction, such as LEFT. FLEXSCROLLDETAIL.


ScrollPosition Property (FlexScrollBar)

Class

FlexScrollBar class

Action

Gets the number that represents the current scroll position.

The value is between minScrollPosition and maxScrollPosition inclusively.

The default value is 0.

Data Type

REAL

Access

Read only


ScrollToIndex Method (FlexListBase)

Class

FlexListBase class

Action

Ensures that the data provider item at the given index is visible.

If the item is visible, the verticalScrollPosition property is left unchanged even if the item is not the first visible item. If the item is not currently visible, the verticalScrollPosition property is changed to make the item the first visible item, unless there are not enough rows to do so because the verticalScrollPosition value is limited by the maxVerticalScrollPosition property.

Syntax

bResult = listBase.ScrollToIndex(index)
Variable | Description
bResult | BOOLEAN.
index | The index of the item in the data provider. INTEGER.


Selectable Property (FlexListBase)

Class

FlexListBase class

Action

Gets whether the list shows selected items as selected.

If true, the control supports selection. The Menu class, which subclasses ListBase, sets this property to false by default, because it does not show the chosen menu item as selected.

The default value is true.

Data Type

BOOLEAN

Access

Read only


Selectable Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets a flag indicating whether the content is selectable with the mouse, or with the keyboard when the control has the keyboard focus.

Data Type

BOOLEAN

Access

Read only


Selectable Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets a flag indicating whether the content is selectable with the mouse, or with the keyboard when the control has the keyboard focus.

Data Type

BOOLEAN

Access

Read only


SelectedCell Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the selected cell.

Data Type

STRING

Access

Read only


SelectedCells Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets an Array of cell locations as row and column indices.

Changing the value of the selectionMode property sets this property to null.

Data Type

STRING

Access

Read only


SelectedCells Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the selected cells.

Data Type

LIST OF STRING

Access

Read only


SelectedChartItem Property (FlexChart)

Class

FlexChart class

Action

Gets the selected ChartItem in the chart. If multiple items are selected, this property specifies the most recently selected item.

Data Type

INTEGER

Access

Read only


SelectedChartItems Property (FlexChart)

Class

FlexChart class

Action

Gets an array of all the selected ChartItem objects in the chart.

Data Type

LIST OF INTEGER

Access

Read only


SelectedChild Property (FlexAccordion)

Class

FlexAccordion class

Action

Gets a reference to the currently visible child container.

The default value is a reference to the first child. If there are no children, this property is null.

Note: You can only set this property in an ActionScript statement, not in MXML.

Data Type

STRING

Access

Read only


SelectedChild Property (FlexViewStack)

Class

FlexViewStack class

Action

Gets a reference to the currently visible child container.

The default is a reference to the first child. If there are no children, this property is null.

Data Type

STRING

Access

Read only


SelectedColor Property (FlexColorPicker)

Class

FlexColorPicker class

Action

Gets the value of the currently selected color in the SwatchPanel object.

You can set this property to a standard string color name, such as "blue". If the dataProvider contains an entry for black (0x000000), the default value is 0; otherwise, the default value is the color of the item at index 0 of the data provider.

Data Type

COLOR

Access

Read only


SelectedDate Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the date as selected in the DateChooser control.

Data Type

DATETIME

Access

Read only


SelectedDate Property (FlexDateField)

Class

FlexDateField class

Action

Gets the date as selected in the DateChooser control.

Data Type

DATETIME

Access

Read only


SelectedIndex Property (FlexAccordion)

Class

FlexAccordion class

Action

Gets the zero-based index of the currently visible child container.

Child indexes are in the range 0, 1, 2, ..., n - 1, where n is the number of children.

The default value is 0, corresponding to the first child. If there are no children, this property is -1.

Data Type

INTEGER

Access

Read only


SelectedIndex Property (FlexChartSeries)

Class

FlexChartSeries class

Action

Gets the index of the selected item in the data provider of the series.

If multiple items are selected, then this property refers to the most recently selected item.

Data Type

INTEGER

Access

Read only


SelectedIndex Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the index in the data provider of the selected item.

If there is a prompt property, the selectedIndex value can be set to -1 to show the prompt. If there is no prompt, property then selectedIndex will be set to 0 once a dataProvider is set.

If the ComboBox control is editable, the selectedIndex property is -1 if the user types any text into the text field.

Unlike many other Flex properties that are invalidating (setting them does not have an immediate effect), the selectedIndex and selectedItem properties are synchronous; setting one immediately affects the other.

The default value is -1.

Data Type

INTEGER

Access

Read only


SelectedIndex Property (FlexListBase)

Class

FlexListBase class

Action

Gets the index in the data provider of the selected item.

The default value is -1 (no selected item).

Data Type

INTEGER

Access

Read only


SelectedIndex Property (FlexMenu)

Class

FlexMenu class

Action

Gets the index in the data provider of the selected item.

Data Type

INTEGER

Access

Read only


SelectedIndex Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the index in the MenuBar control of the currently open Menu or the last opened Menu if none are currently open.

Data Type

REAL

Access

Read only


SelectedIndex Property (FlexNavigationBar)

Class

FlexNavigationBar class

Action

Gets the index of the active navigation item, where the first item is at an index of 0. The default value is -1.

Data Type

INTEGER

Access

Read only


SelectedIndex Property (FlexViewStack)

Class

FlexViewStack class

Action

Gets the zero-based index of the currently visible child container.

Child indexes are in the range 0, 1, 2, ..., n - 1, where n is the number of children. The default value is 0, corresponding to the first child. If there are no children, the value of this property is -1.

Note: When you add a new child to a ViewStack container, the selectedIndex property is automatically adjusted, if necessary, so that the selected child remains selected.

Data Type

INTEGER

Access

Read only


SelectedIndex Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the index of the selected row.

Data Type

INTEGER

Access

Read only


SelectedIndex Property (SparkListBase)

Class

SparkListBase class

Action

Gets the 0-based index of the selected item, or -1 if no item is selected.

Data Type

INTEGER

Access

Read only


SelectedIndices Property (FlexChartSeries)

Class

FlexChartSeries class

Action

Gets an array of indexes of the selected items in the data provider of the series.

Data Type

LIST OF INTEGER

Access

Read only


SelectedIndices Property (FlexListBase)

Class

FlexListBase class

Action

Gets an array of indices in the data provider of the selected items.

The items are in the reverse order that the user selected the items.

The default value is [ ].

Data Type

LIST OF INTEGER

Access

Read only


SelectedIndices Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the indices of the selected rows.

Data Type

LIST OF INTEGER

Access

Read only


SelectedIndices Property (SparkList)

Class

SparkList class

Action

Gets a list representing the indices of the currently selected item or items.

Data Type

LIST OF INTEGER

Access

Read only


SelectedItem Property (FlexChartSeries)

Class

FlexChartSeries class

Action

Gets the chart item that is selected in the series.

If multiple items are selected, then this property refers to the most recently selected item.

Data Type

INTEGER

Access

Read only


SelectedItem Property (FlexListBase)

Class

FlexListBase class

Action

Gets a reference to the selected item in the data provider.

The default value is null.

Data Type

STRING

Access

Read only


SelectedItem Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the item of the selected row.

Data Type

STRING

Access

Read only


SelectedItem Property (SparkListBase)

Class

SparkListBase class

Action

Gets the item that is currently selected.

Data Type

STRING

Access

Read only


SelectedItems Property (FlexChartSeries)

Class

FlexChartSeries class

Action

Gets an array of chart items that are selected in the series.

Data Type

LIST OF INTEGER

Access

Read only


SelectedItems Property (FlexListBase)

Class

FlexListBase class

Action

Gets an array of references to the selected items in the data provider.

The items are in the reverse order that the user selected the items.

The default value is [ ].

Data Type

LIST OF STRING

Access

Read only


SelectedItems Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the items of the selected rows.

Data Type

LIST OF STRING

Access

Read only


SelectedItems Property (SparkList)

Class

SparkList class

Action

Gets a list of Objects representing the currently selected data items.

Data Type

LIST OF STRING

Access

Read only


Selected Property (FlexButton)

Class

FlexButton class

Action

Gets whether a toggle button is toggled on (true) or off (false).

This property can be set only if the toggle property is set to true.

For a CheckBox control, indicates whether the box is displaying a check mark. For a RadioButton control, indicates whether the control is selected.

The user can change this property by clicking the control, but you can also set the property programmatically.

In previous versions, if the toggle property was set to true, changing this property also dispatched a change event. Starting in version 3.0, setting this property programmatically only dispatches a valueCommit event.

The default value is false.

Data Type

BOOLEAN

Access

Read only


Selected Property (SparkListLabel)

Class

SparkListLabel class

Action

Gets a value whether the SparkListLabel is selected.

Data Type

BOOLEAN

Access

Read only


Selected Property (SparkToggleButtonBase)

Class

SparkToggleButtonBase class

Action

Gets whether the button is in the down state, and false if it is in the up state.

Data Type

BOOLEAN

Access

Read only


SelectedRanges Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the selected date ranges.

Data Type

LIST OF STRING

Access

Read only


SelectIndex Method (FlexComboBox)

Class

FlexComboBox class

Action

Defines the value of the type property of the event object for an event that is dispatched when a single item is selected.

Syntax

comboBox.SelectIndex(itemIndex, [triggerEvent, keyModifier])
Variable | Description
itemIndex | The data provider index of the item to be selected. INTEGER.
triggerEvent | Optional.The event, such as a mouse or keyboard event, that triggered the action. FLEXTRIGGEREVENT.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


SelectIndex Method (FlexListBase)

Class

FlexListBase class

Action

Defines the value of the type property of the event object for an event that is dispatched when a single item is selected.

Syntax

listBase.SelectIndex(itemIndex, [triggerEvent, keyModifier])
Variable | Description
itemIndex | The data provider index of the item to be selected. INTEGER.
triggerEvent | Optional.The event, such as a mouse or keyboard event, that triggered the action. FLEXTRIGGEREVENT.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when clicking the index. MODIFIERKEYSTATE.


SelectIndex Method (SparkButtonBar)

Class

SparkButtonBar class

Action

Dispatched when the user clicks on an item in the list or navigates to the item using a keyboard.

Syntax

buttonBar.SelectIndex(itemIndex, [triggerEvent, keyModifier])
Variable | Description
itemIndex | The index of the item which was selected. INTEGER.
triggerEvent | Optional.Whether the event was triggered by mouse or keyboard. FLEXTRIGGEREVENT.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


SelectIndex Method (SparkList)

Class

SparkList class

Action

Dispatched when the user clicks on an item in the list or navigates to the item using a keyboard.

Syntax

list.SelectIndex(itemIndex, [triggerEvent, keyModifier])
Variable | Description
itemIndex | The index of the item which was selected. INTEGER.
triggerEvent | Optional.Whether the event was triggered by mouse or keyboard. FLEXTRIGGEREVENT.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


SelectIndex Method (SparkTabBar)

Class

SparkTabBar class

Action

Dispatched when the user clicks on an item in the list or navigates to the item using a keyboard.

Syntax

tabBar.SelectIndex(itemIndex, [triggerEvent, keyModifier])
Variable | Description
itemIndex | The index of the item which was selected. INTEGER.
triggerEvent | Optional.Whether the event was triggered by mouse or keyboard. FLEXTRIGGEREVENT.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


SelectionActivePosition Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets a character position, relative to the beginning of the text String, specifying the end of the selection that moves when the selection is extended with the arrow keys.

Data Type

INTEGER

Access

Read only


SelectionActivePosition Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets a character position, relative to the beginning of the text String, specifying the end of the selection that moves when the selection is extended with the arrow keys.

Data Type

INTEGER

Access

Read only


SelectionAnchorPosition Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets a character position, relative to the beginning of the text String, specifying the end of the selection that stays fixed when the selection is extended with the arrow keys.

Data Type

INTEGER

Access

Read only


SelectionAnchorPosition Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets a character position, relative to the beginning of the text String, specifying the end of the selection that stays fixed when the selection is extended with the arrow keys.

Data Type

INTEGER

Access

Read only


SelectionBeginIndex Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the zero-based character index value of the first character in the current selection.

Data Type

INTEGER

Access

Read only


SelectionColor Property (FlexComboBox)

Class

FlexComboBox class

Action

Gets the selectionColor of the drop-down list.

Data Type

COLOR

Access

Read only


SelectionColor Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the color of the highlight area of the currently selected date in the DateChooser control. The default value is 0xCDFFC1.

Data Type

COLOR

Access

Read only


SelectionColor Property (FlexListBase)

Class

FlexListBase class

Action

Gets the color of the background of a renderer when the user selects it. The default value is 0x7FCEFF.

Data Type

COLOR

Access

Read only


SelectionColor Property (FlexMenu)

Class

FlexMenu class

Action

Gets the color of the menu item background when a menu item is selected. The default value is 0x7FCEFF.

Data Type

LIST OF COLOR

Access

Read only


SelectionColor Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the color of the menu item background when a menu item is selected.

Data Type

COLOR

Access

Read only


SelectionDisabledColor Property (FlexListBase)

Class

FlexListBase class

Action

Gets the color of the background of a renderer when the component is disabled. The default value is 0xDDDDDD.

Data Type

COLOR

Access

Read only


SelectionEndIndex Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the zero-based index of the position after the last character in the current selection (equivalent to the one-based index of the last character).

Data Type

INTEGER

Access

Read only


SelectionHighlighting Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets a value whether the text selection is highlighted.

Data Type

STRING

Access

Read only


SelectionHighlighting Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets a value whether the text selection is highlighted.

Data Type

STRING

Access

Read only


SelectionLength Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the number of selected rows.

Data Type

INTEGER

Access

Read only


SelectionMode Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the selection mode of the control.

Possible values are: MULTIPLE_CELLS, MULTIPLE_ROWS, NONE, SINGLE_CELL, and SINGLE_ROW. Changing the value of this property sets the selectedCells property to null.

You must set the allowMultipleSelection property to true to select more than one item in the control at the same time.

Information about the selected cells is written to the selectedCells property.

The default value is SINGLE_ROW.

Data Type

STRING

Access

Read only


SelectionMode Property (FlexChart)

Class

FlexChart class

Action

Gets whether ChartItem objects can be selected.

Possible values are none, single, or multiple. Set to none to prevent chart items from being selected. Set to single to allow only one item to be selected at a time. Set to multiple to allow one or more chart items to be selected at a time. The default value is none.

Data Type

STRING

Access

Read only


SelectionMode Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets the selection mode (singlerow, multiplerows, singlecells or multiplecells).

Data Type

STRING

Access

Read only


Select Method (FlexChart)

Class

FlexChart class

Action

Defines the value of the type property of the event object for a headerRelease event, which indicates that the user pressed and released the mouse on a column header.

Syntax

chart.Select(selectionInfo)
Variable | Description
selectionInfo | Whether the event can bubble up the display list hierarchy. LIST OF STRING.


Select Method (FlexComboBox)

Class

FlexComboBox class

Action

Defines the value of the type property of the event object for an event that is dispatched when a single item is selected.

Syntax

comboBox.Select(itemRenderer, [triggerEvent, keyModifier])
Variable | Description
itemRenderer | The item renderer object for the item. STRING.
triggerEvent | Optional.The event, such as a mouse or keyboard event, that triggered the action. FLEXTRIGGEREVENT.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Select Method (FlexListBase)

Class

FlexListBase class

Action

Defines the value of the type property of the event object for an event that is dispatched when a single item is selected.

Syntax

listBase.Select(itemRenderer, [triggerEvent, keyModifier])
Variable | Description
itemRenderer | The item renderer object for the item. STRING.
triggerEvent | Optional.The event, such as a mouse or keyboard event, that triggered the action. FLEXTRIGGEREVENT.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when selecting the control. MODIFIERKEYSTATE.


Select Method (FlexMenu)

Class

FlexMenu class

Action

Dispatched when a menu item is selected.

Syntax

menu.Select(itemRenderer)
Variable | Description
itemRenderer | The ListItemRenderer of the selected menu item. STRING.


Select Method (SparkDataGrid)

Class

SparkDataGrid class

Action

Selects the specified data grid cell.

Syntax

dataGrid.Select(itemRenderer, [triggerEvent, keyModifier])
Variable | Description
itemRenderer | The itemRenderer for the item which got selected. STRING.
triggerEvent | Optional.Whether the event was triggered by mouse or keyboard.. FLEXTRIGGEREVENT.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Select Method (SparkDataGroup)

Class

SparkDataGroup class

Action

Dispatched when one or more items in the list are deselected.

Syntax

dataGroup.Select(itemRenderer, [triggerEvent, keyModifier])
Variable | Description
itemRenderer | The itemRenderer for the item which got deselected. STRING.
triggerEvent | Optional.Whether the event was triggered by mouse or keyboard. FLEXTRIGGEREVENT.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Select Method (SparkListBase)

Class

SparkListBase class

Action

Dispatched when an item in the list is selected.

Syntax

listBase.Select(itemRenderer, [triggerEvent, keyModifier])
Variable | Description
itemRenderer | The itemRenderer for the item which got selected. STRING.
triggerEvent | Optional.Whether the event was triggered by mouse or keyboard.. FLEXTRIGGEREVENT.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.

Examples

For example, you might select an item in a list box by typing:
    listBox.Select("apple")


SelectText Method (FlexComboBase)

Class

FlexComboBase class

Action

Lets you track selection within a text field.

Syntax

comboBase.SelectText(beginIndex, endIndex)
Variable | Description
beginIndex | Index at which selection starts. INTEGER.
endIndex | Index at which selection ends. INTEGER.


SelectText Method (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Lets you track selection within a text field.

Syntax

numericStepper.SelectText(beginIndex, endIndex)
Variable | Description
beginIndex | Index at which selection starts. INTEGER.
endIndex | Index at which selection ends. INTEGER.


SelectText Method (FlexTextArea)

Class

FlexTextArea class

Action

Lets you track selection within a text field.

Syntax

textArea.SelectText(beginIndex, endIndex)
Variable | Description
beginIndex | Index at which selection starts. INTEGER.
endIndex | Index at which selection ends. INTEGER.


SelectText Method (SparkComboBox)

Class

SparkComboBox class

Action

Dispatched when text is selected.

Syntax

comboBox.SelectText(beginIndex, endIndex)
Variable | Description
beginIndex | The index of the first character in the selection. INTEGER.
endIndex | The index of the last character in the selection. INTEGER.


SelectText Method (SparkNumericStepper)

Class

SparkNumericStepper class

Action

Dispatched when text is selected.

Syntax

numericStepper.SelectText(beginIndex, endIndex)
Variable | Description
beginIndex | The index of the first selected character. INTEGER.
endIndex | The index of the last selected character. INTEGER.


SelectText Method (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Dispatched when text is selected.

Syntax

richEditableText.SelectText(beginIndex, endIndex)
Variable | Description
beginIndex | The index of the first character selected. INTEGER.
endIndex | The index of the last character selected. INTEGER.


SelectText Method (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Dispatched when text is selected.

Syntax

skinnableTextBase.SelectText(beginIndex, endIndex)
Variable | Description
beginIndex | The index of the first character selected. INTEGER.
endIndex | The index of the last character selected. INTEGER.


SequenceLabel Property (SparkFormItem)

Class

SparkFormItem class

Action

Gets the number of the form item in the form.

Data Type

STRING

Access

Read only


SeriesClick Method (FlexChartSeries)

Class

FlexChartSeries class

Action

Indicates that the user clicked the mouse button over a chart item representing data in the chart.

Syntax

chartSeries.SeriesClick(hitSet)
Variable | Description
hitSet | An array of HitData structures describing the ChartItems that triggered the event. LIST OF INTEGER.


SeriesDoubleClick Method (FlexChartSeries)

Class

FlexChartSeries class

Action

Indicates that the user double-clicked the mouse button over a chart item representing data in the chart.

Syntax

chartSeries.SeriesDoubleClick(hitSet)
Variable | Description
hitSet | An array of HitData structures describing the ChartItems that triggered the event. LIST OF INTEGER.


SeriesItemRollOver Method (FlexChartSeries)

Class

FlexChartSeries class

Action

Indicates that the user rolled the mouse pointer over a chart item representing data in the chart.

Syntax

chartSeries.SeriesItemRollOver(hitSet)
Variable | Description
hitSet | An array of HitData structures describing the ChartItems that triggered the event. LIST OF INTEGER.


SetFocus Method (FlexObject)

Class

FlexObject class

Action

Sets the focus to this component. The component may in turn pass focus to a subcomponent.

Note: Only the TextInput and TextArea controls show a highlight when this method sets the focus. All controls show a highlight when the user tabs to the control.

Syntax

object.SetFocus()


SetFocus Method (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Called by the FocusManager when the component receives focus. The component may in turn set focus to an internal component.

Syntax

uIMovieClip.SetFocus()


ShowCloseButton Property (FlexTitleWindow)

Class

FlexTitleWindow class

Action

Gets whether to display a Close button in the TitleWindow container. The default value is false.\.

Data Type

BOOLEAN

Access

Read only


ShowDataTip Property (FlexSlider)

Class

FlexSlider class

Action

Gets whether the data tip shows during user interaction.

If set to true, show a data tip during user interaction containing the current value of the slider.

The default value is true.

Data Type

BOOLEAN

Access

Read only


ShowDataTips Property (FlexChart)

Class

FlexChart class

Action

Gets whether DataTip controls for the chart show.

DataTip controls are similar to tool tips, except that they display an appropriate value that represents the nearest chart data point under the mouse pointer.

Data Type

BOOLEAN

Access

Read only


ShowDataTips Property (FlexListBase)

Class

FlexListBase class

Action

Gets whether dataTips are displayed for text in the rows.

If true, dataTips are displayed. DataTips are tooltips designed to show the text that is too long for the row. If you set a dataTipFunction, dataTips are shown regardless of whether the text is too long for the row.

The default value is false.

Data Type

BOOLEAN

Access

Read only


ShowDataTips Property (SparkDataGrid)

Class

SparkDataGrid class

Action

Gets whether data tips should be shown.

Data Type

BOOLEAN

Access

Read only


ShowDataTipTargets Property (FlexChart)

Class

FlexChart class

Action

Gets whether to show targets over the datapoints when showDataTips is set to true.

Data Type

BOOLEAN

Access

Read only


ShowLabels Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets whether labels appear along the axis. The default value is true.

Data Type

BOOLEAN

Access

Read only


ShowLine Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets whether to display the axis. The default value is true.

Data Type

BOOLEAN

Access

Read only


Show Method (FlexMenu)

Class

FlexMenu class

Action

Dispatched when a menu or submenu opens.

Syntax

menu.Show(itemRenderer)
Variable | Description
itemRenderer | This property is not set for this type of event. STRING.


Show Method (FlexMenuBar)

Class

FlexMenuBar class

Action

Dispatched when a menu or submenu opens.

Syntax

menuBar.Show(itemRenderer)
Variable | Description
itemRenderer | This property is not set for this type of event. STRING.


ShowsCaret Property (SparkButtonBarButton)

Class

SparkButtonBarButton class

Action

Gets a value whether the item renderer can show itself as focused.

Data Type

BOOLEAN

Access

Read only


ShowsCaret Property (SparkListLabel)

Class

SparkListLabel class

Action

Gets a value whether the caret is shown.

Data Type

BOOLEAN

Access

Read only


ShowStatusBar Property (FlexWindow)

Class

FlexWindow class

Action

Gets a value whether the status bar is visible.

Data Type

BOOLEAN

Access

Read only


ShowStatusBar Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets a value whether the status bar is visible.

Data Type

BOOLEAN

Access

Read only


ShowStatusBar Property (SparkWindow)

Class

SparkWindow class

Action

Gets a value whether the status bar is visible.

Data Type

BOOLEAN

Access

Read only


ShowStatusBar Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets a value whether the status bar is visible.

Data Type

BOOLEAN

Access

Read only


ShowTextField Property (FlexColorPicker)

Class

FlexColorPicker class

Action

Gets whether to show the text box that displays the color label or hexadecimal color value. The default value is true.

Data Type

BOOLEAN

Access

Read only


ShowToday Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets whether today's date is highlighted in the DataChooser control.

If true, specifies that today is highlighted in the DateChooser control. The default value is true.

Data Type

BOOLEAN

Access

Read only


ShowToday Property (FlexDateField)

Class

FlexDateField class

Action

Gets the day highlighted in the DateChooser control.

If true, specifies that today is highlighted in the DateChooser control. Setting this property immediately changes the appearance of the DateChooser control. The default value is true.

Data Type

BOOLEAN

Access

Read only


Smooth Property (SparkImage)

Class

SparkImage class

Action

Gets whether to apply a smoothing algorithm to the bitmap image.

Data Type

BOOLEAN

Access

Read only


SnapInterval Property (FlexSlider)

Class

FlexSlider class

Action

Gets the increment value of the slider thumb as the user moves the thumb.

For example, if snapInterval is 2, the minimum value is 0, and the maximum value is 10, the thumb snaps to the values 0, 2, 4, 6, 8, and 10 as the user move the thumb. A value of 0, means that the slider moves continuously between the minimum and maximum values.

The default value is 0.

Data Type

REAL

Access

Read only


SnapInterval Property (SparkRange)

Class

SparkRange class

Action

Gets the snapInterval.

Data Type

REAL

Access

Read only


SortableColumns Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets whether the user can sort the data provider items by clicking on a column header cell.

If true, the user can sort the data provider items by clicking on a column header cell. The DataGridColumn.dataField property of the column or the DataGridColumn.sortCompareFunction property of the column is used as the sort field. If a column is clicked more than once the sort alternates between ascending and descending order. If true, individual columns can be made to not respond to a click on a header by setting the column's sortable property to false.

When a user releases the mouse button over a header cell, the DataGrid control dispatches a headerRelease event if both this property and the column's sortable property are true. If no handler calls the preventDefault() method on the event, the DataGrid sorts using that column's DataGridColumn.dataField or DataGridColumn.sortCompareFunction properties.

The default value is true.

Data Type

BOOLEAN

Access

Read only


SortOnXField Property (FlexColumnSeries)

Class

FlexColumnSeries class

Action

Gets whether the columns are sorted from left to right before rendering.

By default, the ColumnSeries renders columns in the order they appear in the data provider.

If you use the xField property to determine the position of each column, columns can appear in a different order on the screen. Columns can be rendered in any order. However, some custom columns might rely on the columns being rendered from left to right.

The default value is false.

Data Type

BOOLEAN

Access

Read only


SortOnXField Property (FlexLineSeries)

Class

FlexLineSeries class

Action

Gets whether the line datapoints are sorted from left to right before rendering.

By default, the LineSeries renders points from left to right. Set this property to false to render the items in the order they appear in the data provider.

The default value is true.

Data Type

BOOLEAN

Access

Read only


SourceHeight Property (SparkImage)

Class

SparkImage class

Action

Gets the unscaled height of the original image data.

Data Type

REAL

Access

Read only


Source Property (FlexLoader)

Class

FlexLoader class

Action

Gets the URL, object, class or string name of a class to load as the content.

The value of the source property represents a relative or absolute URL; a ByteArray representing a SWF, GIF, JPEG, or PNG; an object that implements IFlexDisplayObject; a class whose type implements IFlexDisplayObject; or a String that represents a class.

Data Type

STRING

Access

Read only


Source Property (FlexVideoDisplay)

Class

FlexVideoDisplay class

Action

Gets the relative path and filename of the FLV file to stream.

Data Type

STRING

Access

Read only


Source Property (SparkImage)

Class

SparkImage class

Action

Gets the content location.

Data Type

STRING

Access

Read only


SourceWidth Property (SparkImage)

Class

SparkImage class

Action

Gets the unscaled width of the original image data.

Data Type

REAL

Access

Read only


StartAngle Property (FlexPieSeries)

Class

FlexPieSeries class

Action

Gets the starting angle for the first slice of the PieChart control.

The default value is 0, which is horizontal on the right side of the PieChart control.

Data Type

REAL

Access

Read only


StartingIndex Property (FlexRepeater)

Class

FlexRepeater class

Action

Gets the index into the dataProvider at which this Repeater starts creating children.

Data Type

INTEGER

Access

Read only


StateChange Method (FlexWindow)

Class

FlexWindow class

Action

Dispatched when the displaystatus of the window is changed.

Syntax

window.StateChange(newWindowState)
Variable | Description
newWindowState | Indicates the new State. STRING.


StateChange Method (SparkWindow)

Class

SparkWindow class

Action

Dispatched when the displaystatus of the window is changed.

Syntax

window.StateChange(newWindowState)
Variable | Description
newWindowState | Indicates the new State. STRING.


Status Property (FlexPanel)

Class

FlexPanel class

Action

Gets the text in the status area of the title bar. The default value is "".

Data Type

STRING

Access

Read only


Status Property (FlexWindow)

Class

FlexWindow class

Action

Gets the string that appears in the status bar, if it is visible.

Data Type

STRING

Access

Read only


Status Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets the string that appears in the status bar, if it is visible.

Data Type

STRING

Access

Read only


Status Property (SparkWindow)

Class

SparkWindow class

Action

Gets the string that appears in the status bar, if it is visible.

Data Type

STRING

Access

Read only


Status Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets the string that appears in the status bar, if it is visible.

Data Type

STRING

Access

Read only


StepSize Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the non-zero unit of change between values.

The value property must be a multiple of this number. The default value is 1.

Data Type

REAL

Access

Read only


StepSize Property (SparkRange)

Class

SparkRange class

Action

Gets the amount that the value property changes when the changeValueByStep() method is called.

Data Type

REAL

Access

Read only


StickyHighlighting Property (SparkButtonBase)

Class

SparkButtonBase class

Action

Gets a value whether the button displays its down skin when the user presses it but changes to its over skin when the user drags the mouse off of it.

Data Type

BOOLEAN

Access

Read only


StrokeWidth Property (FlexRule)

Class

FlexRule class

Action

Gets the thickness of the rule in pixels.

Data Type

REAL

Access

Read only


SystemChrome Property (FlexWindow)

Class

FlexWindow class

Action

Gets the type of system chrome (if any) the window has.

Data Type

STRING

Access

Read only


SystemChrome Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets the type of system chrome (if any) the window has.

Data Type

STRING

Access

Read only


SystemChrome Property (SparkWindow)

Class

SparkWindow class

Action

Gets the type of system chrome (if any) the window has.

Data Type

STRING

Access

Read only


SystemChrome Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets the type of system chrome (if any) the window has.

Data Type

STRING

Access

Read only


TabChildren Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets whether the children of the display object are tab enabled. The default is true.

Data Type

BOOLEAN

Access

Read only


TabEnabled Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets whether this object is in the tab order.

If this object is in the tab order, the value is true; otherwise, the value is false. By default, the value is false, except for the following: a SimpleButton object, a TextField object with type = input, or a Sprite object or MovieClip object with buttonMode = true.

Data Type

BOOLEAN

Access

Read only


TabHeight Property (FlexTabNavigator)

Class

FlexTabNavigator class

Action

Gets the height of each tab, in pixels.

The default value is undefined. When this property is undefined, the height of each tab is determined by the font styles applied to this TabNavigator container. If you set this property, the specified value overrides this calculation.

Data Type

REAL

Access

Read only


TabIndex Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets the tab ordering of objects in a SWF file.

The tabIndex property is -1 by default, meaning no tab index is set for the object.

If any currently displayed object in the SWF file contains a tabIndex property, automatic tab ordering is disabled, and the tab ordering is calculated from the tabIndex properties of objects in the SWF file. The custom tab ordering includes only objects that have tabIndex properties.

The tabIndex property can be a non-negative integer. The objects are ordered according to their tabIndex properties, in ascending order. An object with a tabIndex value of 1 precedes an object with a tabIndex value of 2. Do not use the same tabIndex value for multiple objects.

The custom tab ordering that the tabIndex property defines is flat. This means that no attention is paid to the hierarchical relationships of objects in the SWF file. All objects in the SWF file with tabIndex properties are placed in the tab order, and the tab order is determined by the order of the tabIndex values.

Data Type

INTEGER

Access

Read only


TabWidth Property (FlexTabNavigator)

Class

FlexTabNavigator class

Action

Gets the width of each tab, in pixels.

The default value is undefined. When this property is undefined, the width of each tab is determined by the width of its label text, using the font styles applied to this TabNavigator container. If the total width of the tabs would be greater than the width of the TabNavigator container, the calculated tab width is decreased, but only to a minimum of 30 pixels. If you set this property, the specified value overrides this calculation.

The label text on a tab is truncated if it does not fit in the tab. If a tab label is truncated, a tooltip with the full label text is displayed when a user rolls the mouse over the tab.

Data Type

REAL

Access

Read only


TextAlign Property (FlexButton)

Class

FlexButton class

Action

Gets the alignment of text within a container.

Possible values are:left, right, or center.

The default value for most components is left. For the FormItem component, the default value is right. For the Button, LinkButton, and AccordionHeader components, the default value is center, and this property is only recognized when the labelPlacement property is set to left or right. If labelPlacement is set to top or bottom, the text and any icon are centered.

Data Type

STRING

Access

Read only


TextAlign Property (FlexCartesianChart)

Class

FlexCartesianChart class

Action

Gets the alignment of text within a container.

Possible values are:left, right, or center. The default value for most components is left.

For the Button, LinkButton, and AccordionHeader components, the default value is center. For these components, this property is only recognized when the labelPlacement property is set to left or right. If labelPlacement is set to top or bottom, the text and any icon are centered.

Data Type

STRING

Access

Read only


TextAlign Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the alignment of text within a container. Possible values are:left, right, or center.

Data Type

STRING

Access

Read only


TextAlign Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets whether the text is boldface.

Recognized values are normal and bold. The default value for Button controls is bold. The default value for all other controls is normal.

Data Type

STRING

Access

Read only


TextAlign Property (FlexLabel)

Class

FlexLabel class

Action

Gets the alignment of text within a container.

Possible values are:left, right, or center.

The default value for most components is left. For the FormItem component, the default value is right. For the Button, LinkButton, and AccordionHeader components, the default value is center, and this property is only recognized when the labelPlacement property is set to left or right. If labelPlacement is set to top or bottom, the text and any icon are centered.

Data Type

STRING

Access

Read only


TextAlign Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the alignment of text within a container.

Possible values are:left, right, or center.

The default value for most components is left. For the FormItem component, the default value is right. For the Button, LinkButton, and AccordionHeader components, the default value is center, and this property is only recognized when the labelPlacement property is set to left or right. If labelPlacement is set to top or bottom, the text and any icon are centered.

Data Type

STRING

Access

Read only


TextAlign Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the alignment of text within a container. Possible values are: left, right, or center.

The default value for most components is left. For the FormItem component, the default value is right. For the Button, LinkButton, and AccordionHeader components, the default value is center, and this property is only recognized when the labelPlacement property is set to left or right. If labelPlacement is set to top or bottom, the text and any icon are centered.

Data Type

STRING

Access

Read only


TextAlign Property (FlexPieChart)

Class

FlexPieChart class

Action

Gets the alignment of text within a container.

Possible values are:left, right, or center. The default value for most components is left.

For the Button, LinkButton, and AccordionHeader components, the default value is center. For these components, this property is only recognized when the labelPlacement property is set to left or right. If labelPlacement is set to top or bottom, the text and any icon are centered.

Data Type

STRING

Access

Read only


TextAlign Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the alignment of text within a container.

Possible values are:left, right, or center.

The default value for most components is left. For the FormItem component, the default value is right. For the Button, LinkButton, and AccordionHeader components, the default value is center, and this property is only recognized when the labelPlacement property is set to left or right. If labelPlacement is set to top or bottom, the text and any icon are centered.

Data Type

STRING

Access

Read only


TextDecoration Property (FlexButton)

Class

FlexButton class

Action

Gets whether the text is underlined.

Possible values are none and underline. The default value is none.

Data Type

STRING

Access

Read only


TextDecoration Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets whether the text is underlined.

Possible values are none and underline. The default value is none.

Data Type

STRING

Access

Read only


TextDecoration Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets whether the text is underlined.

Possible values are none and underline. The default value is none.

Data Type

STRING

Access

Read only


TextDecoration Property (FlexLabel)

Class

FlexLabel class

Action

Gets whether the text is underlined.

Possible values are none and underline. The default value is none.

Data Type

STRING

Access

Read only


TextDecoration Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets whether the text is underlined.

Possible values are none and underline. The default value is none.

Data Type

STRING

Access

Read only


TextDecoration Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets whether the text is underlined. Possible values are none and underline. The default value is none.

Data Type

STRING

Access

Read only


TextDecoration Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets whether the text is underlined.

Possible values are none and underline. The default value is none.

Data Type

STRING

Access

Read only


TextIndent Property (FlexButton)

Class

FlexButton class

Action

Gets the offset of the first line of text from the left side of the container, in pixels. The default value is 0.

Data Type

REAL

Access

Read only


TextIndent Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the offset of first line of text from the left side of the container, in pixels. The default value is 0.

Data Type

INTEGER

Access

Read only


TextIndent Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the offset of first line of text from the left side of the container, in pixels. The default value is 0.

Data Type

INTEGER

Access

Read only


TextIndent Property (FlexLabel)

Class

FlexLabel class

Action

Gets the offset of the first line of text from the left side of the container, in pixels. The default value is 0.

Data Type

INTEGER

Access

Read only


TextIndent Property (FlexMenuBar)

Class

FlexMenuBar class

Action

Gets the offset of the first line of text from the left side of the container, in pixels. The default value is 0.

Data Type

INTEGER

Access

Read only


TextIndent Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the offset of first line of text from the left side of the container, in pixels. The default value is 0.

Data Type

INTEGER

Access

Read only


TextIndent Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the offset of first line of text from the left side of the container, in pixels. The default value is 0.

Data Type

REAL

Access

Read only


Text Property (FlexAlert)

Class

FlexAlert class

Action

Gets the text to display in this alert dialog box. The default value is "".

Data Type

STRING

Access

Read only


Text Property (FlexComboBase)

Class

FlexComboBase class

Action

Gets the contents of the text field.

Data Type

STRING

Access

Read only


Text Property (FlexLabel)

Class

FlexLabel class

Action

Gets the plain text displayed by this control. Its appearance is determined by the CSS styles of this Label control.

Data Type

STRING

Access

Read only


Text Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets the plain text that appears in the control.

Its appearance is determined by the CSS styles of this Label control.

The default value is "".

Data Type

STRING

Access

Read only


Text Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the text String displayed by this component.

Data Type

STRING

Access

Read only


Text Property (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Gets the text String displayed by this component.

Data Type

STRING

Access

Read only


Text Property (SparkTextBase)

Class

SparkTextBase class

Action

Gets the text displayed by this text component.

Data Type

STRING

Access

Read only


TextRollOverColor Property (FlexButton)

Class

FlexButton class

Action

Gets the text color of the label as the user moves the mouse pointer over the button. The default value is 0x2B333C.

Data Type

COLOR

Access

Read only


TextRollOverColor Property (FlexListBase)

Class

FlexListBase class

Action

Gets the text color of the label as the user moves the mouse pointer over the button. The default value is 0x2B333C.

Data Type

COLOR

Access

Read only


TextRollOverColor Property (FlexMenu)

Class

FlexMenu class

Action

Gets the color of the menu item text when a user rolls the mouse over the menu item. The default value is 0x2B333C.

Data Type

LIST OF COLOR

Access

Read only


TextSelectedColor Property (FlexAccordion)

Class

FlexAccordion class

Action

Gets the color of selected text. The default value is 0x2B333C.

Data Type

COLOR

Access

Read only


TextSelectedColor Property (FlexButton)

Class

FlexButton class

Action

Gets the text color of the label as the user presses it. The default value is 0x000000.

Data Type

COLOR

Access

Read only


TextSelectedColor Property (FlexListBase)

Class

FlexListBase class

Action

Gets the color of the text of a renderer when the user selects it. The default value is 0x2B333C.

Data Type

COLOR

Access

Read only


TextSelectedColor Property (FlexMenu)

Class

FlexMenu class

Action

Gets the color of the menu item text when the menu item is selected. The default value is 0x2B333C.

Data Type

LIST OF COLOR

Access

Read only


ThemeColor Property (FlexObject)

Class

FlexObject class

Action

Gets the theme color of a component.

This property controls the appearance of highlights, appearance when a component is selected, and other similar visual cues, but it does not have any effect on the regular borders or background colors of the component. The preferred values are haloGreen, haloBlue, haloOrange, and haloSilver, although any valid color value can be used.

The default values of the rollOverColor and selectionColor styles are based on the themeColor value.

The default value is haloBlue.

Data Type

COLOR

Access

Read only


ThemeColor Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the theme color of a component.

Data Type

COLOR

Access

Read only


ThumbCount Property (FlexSlider)

Class

FlexSlider class

Action

Gets the number of thumbs allowed on the slider.

Possible values are 1 or 2. If set to 1, then the value property contains the current value of the slider. If set to 2, then the values property contains an array of values representing the value for each thumb.

The default value is 1.

Data Type

INTEGER

Access

Read only


TickColor Property (FlexSlider)

Class

FlexSlider class

Action

Gets the color of the tick marks.

Use a hex color value or the string name of a known color. The default value is 0x6F7777.

Data Type

COLOR

Access

Read only


TickLength Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets the length of the tick marks on the axis, in pixels. The default value is 3.

Data Type

REAL

Access

Read only


TickLength Property (FlexSlider)

Class

FlexSlider class

Action

Gets the length in pixels of the tick marks.

If direction is Direction.HORIZONTAL, then adjust the height of the tick marks. If direction is Direction.VERTICAL, then adjust the width. The default value is 3.

Data Type

REAL

Access

Read only


TickPlacement Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets a value where to draw the tick marks. Values include: inside, outside, cross, and none.

Data Type

STRING

Access

Read only


Ticks Property (FlexAxisRenderer)

Class

FlexAxisRenderer class

Action

Gets an array that specifies where Flex draws the tick marks along the axis. Each array element contains a value between 0 and 1.

Data Type

LIST OF REAL

Access

Read only


TickThickness Property (FlexSlider)

Class

FlexSlider class

Action

Gets the thickness in pixels of the tick marks.

If direction is horizontal, then adjust the width of the tick marks. If direction is vertical, then adjust the height. The default value is 1.

Data Type

REAL

Access

Read only


Title Property (FlexPanel)

Class

FlexPanel class

Action

Gets the title or caption displayed in the title bar. The default value is "".

Data Type

STRING

Access

Read only


Title Property (FlexWindow)

Class

FlexWindow class

Action

Gets the title that appears in the window title bar and the taskbar.

Data Type

STRING

Access

Read only


Title Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets the title that appears in the window title bar and the taskbar.

Data Type

STRING

Access

Read only


Title Property (SparkPanel)

Class

SparkPanel class

Action

Gets the title or caption displayed in the title bar.

Data Type

STRING

Access

Read only


Title Property (SparkWindow)

Class

SparkWindow class

Action

Gets the title that appears in the window title bar and the taskbar.

Data Type

STRING

Access

Read only


Title Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets the title that appears in the window title bar and the taskbar.

Data Type

STRING

Access

Read only


TodayColor Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets the color of the highlight of today's date in the DateChooser control. The default value is 0x2B333.

Data Type

COLOR

Access

Read only


TodayColor Property (FlexDateField)

Class

FlexDateField class

Action

Gets the color of the highlight of today's date in the DateChooser control. The default value is 0x2B333.

Data Type

COLOR

Access

Read only


Toggle Property (FlexButton)

Class

FlexButton class

Action

Gets whether a Button is in a toggle state or not.

If true, clicking the button toggles it between a selected and an unselected state. You can get or set this state programmatically by using the selected property. If false, the button does not stay pressed after the user releases it. In this case, its selected property is always false.

Buttons like this are used for performing actions. When toggle is set to false, selected is forced to false because only toggle buttons can be selected.

The default value is false.

Data Type

BOOLEAN

Access

Read only


ToolTip Property (FlexObject)

Class

FlexObject class

Action

Gets the text to display in the ToolTip. The default value is null.

Data Type

STRING

Access

Read only


ToolTip Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets the text to display in the ToolTip. The default value is null.

Data Type

STRING

Access

Read only


ToString Method (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Returns a string representation of the control.

Syntax

sResult = displayObject.ToString()
Variable | Description
sResult | STRING.


TotalTime Property (FlexVideoDisplay)

Class

FlexVideoDisplay class

Action

Gets the total length of the media, in seconds.

For FLV 1.0 video files, you manually set this property. For FLV 1.1 and later, the control calculates this value automatically.

Data Type

REAL

Access

Read only


TrackColors Property (FlexScrollBar)

Class

FlexScrollBar class

Action

Gets the colors of the track, as an array of two colors.

You can use the same color twice for a solid track color. The default value is [0x94999b, 0xe7e7e7].

Data Type

LIST OF COLOR

Access

Read only


TrackColors Property (FlexSlider)

Class

FlexSlider class

Action

Gets the colors of the track, as an array of two colors.

You can use the same color twice for a solid track color.

You use this property along with the fillAlphas property. Typically you set fillAlphas to [ 1.0, 1.0 ] when setting trackColors.

The default value is [ 0xE7E7E7, 0xE7E7E7 ].

Data Type

LIST OF COLOR

Access

Read only


Transparent Property (FlexWindow)

Class

FlexWindow class

Action

Gets a value whether the window is transparent.

Data Type

BOOLEAN

Access

Read only


Transparent Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets a value whether the window is transparent.

Data Type

BOOLEAN

Access

Read only


Transparent Property (SparkWindow)

Class

SparkWindow class

Action

Gets a value whether the window is transparent.

Data Type

BOOLEAN

Access

Read only


Transparent Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets a value whether the window is transparent.

Data Type

BOOLEAN

Access

Read only


TrustedSource Property (SparkImage)

Class

SparkImage class

Action

Gets a flag denoting whether the currently loaded content is considered loaded from a source whose security policy allows for cross domain image access.

Data Type

BOOLEAN

Access

Read only


Type Method (FlexAccordion)

Class

FlexAccordion class

Action

Dispatched when the user presses a key.

Mappings between keys and specific characters vary by device and operating system. This event type is generated after such a mapping occurs but before the processing of an input method editor (IME). IMEs are used to enter characters, such as Chinese ideographs, that the standard QWERTY keyboard is ill-equipped to produce.

Syntax

accordion.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when clicking the control. MODIFIERKEYSTATE.


Type Method (FlexAlert)

Class

FlexAlert class

Action

Dispatched when the user presses a key.

Syntax

alert.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Type Method (FlexButton)

Class

FlexButton class

Action

Dispatched when the user presses a key.

Mappings between keys and specific characters vary by device and operating system. This event type is generated after such a mapping occurs but before the processing of an input method editor (IME). IMEs are used to enter characters, such as Chinese ideographs, that the standard QWERTY keyboard is ill-equipped to produce.

Syntax

button.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when clicking the control. MODIFIERKEYSTATE.


Type Method (FlexComboBase)

Class

FlexComboBase class

Action

Dispatched when the user presses a key.

Syntax

comboBase.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Type Method (FlexDateChooser)

Class

FlexDateChooser class

Action

Dispatched when the user presses a key.

Syntax

dateChooser.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Type Method (FlexListBase)

Class

FlexListBase class

Action

Dispatched when the user presses a key.

Mappings between keys and specific characters vary by device and operating system. This event type is generated after such a mapping occurs but before the processing of an input method editor (IME). IMEs are used to enter characters, such as Chinese ideographs, that the standard QWERTY keyboard is ill-equipped to produce.

Syntax

listBase.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use when clicking the controls. MODIFIERKEYSTATE.


Type Method (FlexMenu)

Class

FlexMenu class

Action

Dispatched when the user presses a key.

Syntax

menu.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Type Method (FlexMenuBar)

Class

FlexMenuBar class

Action

Dispatched when the user presses a key.

Syntax

menuBar.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Type Method (FlexNavigationBar)

Class

FlexNavigationBar class

Action

Dispatched when the user presses a key.

Syntax

navigationBar.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Type Method (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Dispatched when the user presses a key.

Syntax

numericStepper.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Type Method (FlexTextArea)

Class

FlexTextArea class

Action

Dispatched when the user presses a key.

Syntax

textArea.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Type Method (FlexViewStack)

Class

FlexViewStack class

Action

Dispatched when the user presses a key.

Syntax

viewStack.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed or released. STRING.
keyModifier | Optional.The key modifiers (for example, the Ctrl key) to use. MODIFIERKEYSTATE.


Type Method (SparkApplication)

Class

SparkApplication class

Action

Dispatched when the user presses a key.

Syntax

application.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkButtonBase)

Class

SparkButtonBase class

Action

Dispatched when the user presses a key.

Syntax

buttonBase.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkDataGrid)

Class

SparkDataGrid class

Action

Dispatched when the user presses a key.

Syntax

dataGrid.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkGroupBase)

Class

SparkGroupBase class

Action

Dispatched when the user presses a key.

Syntax

groupBase.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkListBase)

Class

SparkListBase class

Action

Dispatched when the user presses a key.

Syntax

listBase.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkPanel)

Class

SparkPanel class

Action

Dispatched when the user presses a key.

Syntax

panel.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Dispatched when the user presses a key.

Syntax

richEditableText.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkSkinnableTextBase)

Class

SparkSkinnableTextBase class

Action

Dispatched when the user presses a key.

Syntax

skinnableTextBase.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkSpinner)

Class

SparkSpinner class

Action

Dispatched when the user presses a key.

Syntax

spinner.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkTextBase)

Class

SparkTextBase class

Action

Dispatched when the user presses a key.

Syntax

textBase.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Type Method (SparkTrackBase)

Class

SparkTrackBase class

Action

Dispatched when the user presses a key.

Syntax

trackBase.Type(keyCode, [keyModifier])
Variable | Description
keyCode | The key code value of the key pressed. STRING.
keyModifier | Optional.A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt. MODIFIERKEYSTATE.


Url Property (FlexApplication)

Class

FlexApplication class

Action

Gets the URL from which this Application's SWF file was loaded.

Data Type

STRING

Access

Read only


Url Property (SparkApplication)

Class

SparkApplication class

Action

Gets the URL from which this Application's SWF file was loaded.

Data Type

STRING

Access

Read only


UseHandCursor Property (FlexObject)

Class

FlexObject class

Action

Gets whether the pointing hand cursor appears when the mouse rolls over an element. The default value is true. If useHandCursor is false, the arrow pointer is used instead.

Data Type

BOOLEAN

Access

Read only


UseHandCursor Property (FlexUIMovieClip)

Class

FlexUIMovieClip class

Action

Gets whether the pointing hand (hand cursor) appears when the mouse rolls over a sprite in which the buttonMode property is set to true.

The default value is true. If useHandCursor is set to true, the pointing hand used for buttons appears when the mouse rolls over a button sprite. If useHandCursor is false, the arrow pointer is used instead.

Data Type

BOOLEAN

Access

Read only


UseRollOver Property (FlexListBase)

Class

FlexListBase class

Action

Gets whether items are highlighted as the mouse rolls over them.

If true, rows are highlighted as the mouse rolls over them. If false, rows are highlighted only when selected.

The default value is true.

Data Type

BOOLEAN

Access

Read only


UseVirtualLayout Property (SparkListBase)

Class

SparkListBase class

Action

Gets the value of the useVirtualLayout property of the layout associated with this control.

Data Type

BOOLEAN

Access

Read only


Value Property (FlexNumericStepper)

Class

FlexNumericStepper class

Action

Gets the value displayed in the text area of the NumericStepper control.

If a user enters number that is not a multiple of the stepSize property or is not in the range between the maximum and minimum properties, this property is set to the closest valid value.

The default value is 0.

Data Type

REAL

Access

Read only


Value Property (FlexProgressBar)

Class

FlexProgressBar class

Action

Gets the amount of progress that has been made between the minimum and maximum values.

Data Type

REAL

Access

Read only


Value Property (FlexSlider)

Class

FlexSlider class

Action

Gets the position of the thumb, and is a number between the minimum and maximum properties.

Use the value property when thumbCount is 1. When thumbCount is greater than 1, use the values property instead. The default value is equal to the minimum property.

Data Type

REAL

Access

Read only


Value Property (SparkRange)

Class

SparkRange class

Action

Gets the current value for this range.

Data Type

REAL

Access

Read only


Values Property (FlexSlider)

Class

FlexSlider class

Action

Gets an array of values for each thumb when thumbCount is greater than 1.

Data Type

LIST OF REAL

Access

Read only


VariableRowHeight Property (FlexListBase)

Class

FlexListBase class

Action

Gets whether the individual rows can have different height.

This property is ignored by TileList and HorizontalList. If true, individual rows can have different height values.

The default value is false.

Data Type

BOOLEAN

Access

Read only


VerticalAlign Property (FlexBox)

Class

FlexBox class

Action

Gets the vertical alignment of children in the container.

Possible values are: top, middle, and bottom. The default value is top, but some containers, such as ButtonBar, ControlBar, LinkBar, and ToggleButtonBar, have different default values.

Data Type

STRING

Access

Read only


VerticalAlign Property (FlexListBase)

Class

FlexListBase class

Action

Gets the vertical alignment of a renderer in a row.

Possible values are: top, middle, and bottom. The DataGrid positions the renderers in a row based on this style and the paddingTop and paddingBottom styles.

The default value is top.

Data Type

STRING

Access

Read only


VerticalAlign Property (SparkImage)

Class

SparkImage class

Action

Gets the vertical alignment of the content when it does not have a one-to-one aspect ratio and scaleMode is set to BitmapScaleMode.LETTERBOX.

Data Type

STRING

Access

Read only


VerticalAxisRatio Property (FlexCartesianChart)

Class

FlexCartesianChart class

Action

Gets the width limit of the vertical axis.

The limit is the width of the axis times this ratio. The default value is 0.33.

Data Type

REAL

Access

Read only


VerticalGap Property (FlexAccordion)

Class

FlexAccordion class

Action

Gets the number of pixels between children in the vertical direction.

The default value is -1, so the top and bottom borders of adjacent headers overlap.

Data Type

REAL

Access

Read only


VerticalGap Property (FlexChartLegend)

Class

FlexChartLegend class

Action

Gets the number of pixels between children in the vertical direction. The default value depends on the component class; if not overriden for the class, the default value is 6.

Data Type

INTEGER

Access

Read only


VerticalGridLineColor Property (FlexAdvancedDataGrid)

Class

FlexAdvancedDataGrid class

Action

Gets the color of the vertical grid lines. The default value is 0x666666.

Data Type

COLOR

Access

Read only


VerticalGridLineColor Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets the color of the vertical grid lines. The default value is 0x666666.

Data Type

COLOR

Access

Read only


VerticalGridLines Property (FlexDataGrid)

Class

FlexDataGrid class

Action

Gets whether to show vertical grid lines between the columns.

If true, the data grid shows vertical grid lines. If false, the data grid hides vertical grid lines. The default value is true.

Data Type

BOOLEAN

Access

Read only


VerticalScrollPosition Property (SparkGroupBase)

Class

SparkGroupBase class

Action

Gets the y coordinate of the origin of the viewport in the component's coordinate system, where the default value is (0,0) corresponding to the upper-left corner of the component.

Data Type

REAL

Access

Read only


VerticalScrollPosition Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the number of pixels by which the text is scrolled vertically.

Data Type

REAL

Access

Read only


ViewSourceURL Property (SparkApplication)

Class

SparkApplication class

Action

Gets the URL where the application's source can be viewed.

Data Type

STRING

Access

Read only


Visible Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets whether the display object is visible.

Display objects that are not visible are disabled. For example, if visible=false for an InteractiveObject instance, it cannot be clicked.

Data Type

BOOLEAN

Access

Read only


Volume Property (FlexVideoDisplay)

Class

FlexVideoDisplay class

Action

Gets the volume level, specified as an value between 0 and 1. The default value is 0.75.

Data Type

REAL

Access

Read only


Volume Property (SparkMuteButton)

Class

SparkMuteButton class

Action

Gets the volume of the control.

Data Type

REAL

Access

Read only


Volume Property (SparkVideoDisplay)

Class

SparkVideoDisplay class

Action

Gets the volume level, specified as a value between 0 and 1.

Data Type

REAL

Access

Read only


Volume Property (SparkVideoPlayer)

Class

SparkVideoPlayer class

Action

Gets the volume level, specified as a value between 0 and 1.

Data Type

REAL

Access

Read only


WidthInChars Property (SparkRichEditableText)

Class

SparkRichEditableText class

Action

Gets the default width of the control, measured in em units.

Data Type

REAL

Access

Read only


WidthInChars Property (SparkTextArea)

Class

SparkTextArea class

Action

Gets the default width of the control, measured in em units.

Data Type

REAL

Access

Read only


WidthInChars Property (SparkTextInput)

Class

SparkTextInput class

Action

Gets the default width of the control, measured in em units.

Data Type

REAL

Access

Read only


Width Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets the width of the display object, in pixels.

The width is calculated based on the bounds of the content of the display object. When you set the width property, the scaleX property is adjusted accordingly.

Data Type

REAL

Access

Read only


WindowState Property (FlexWindow)

Class

FlexWindow class

Action

Gets the state of a window. Values include: 1=minimized, 2=maximized, 3=restored.

Data Type

INTEGER

Access

Read only


WindowState Property (FlexWindowedApplication)

Class

FlexWindowedApplication class

Action

Gets the state of a window. Values include: 1=minimized, 2=maximized, 3=restored.

Data Type

INTEGER

Access

Read only


WindowState Property (SparkWindow)

Class

SparkWindow class

Action

Gets the state of a window. Values include: 1=minimized, 2=maximized, 3=restored.

Data Type

INTEGER

Access

Read only


WindowState Property (SparkWindowedApplication)

Class

SparkWindowedApplication class

Action

Gets the state of a window. Values include: 1=minimized, 2=maximized, 3=restored.

Data Type

INTEGER

Access

Read only


WordWrap Property (FlexListBase)

Class

FlexListBase class

Action

Gets whether text in the row should be word wrapped.

If true, enables word wrapping for text in the rows. Only takes effect if the variableRowHeight property is also true.

The default value is false.

Data Type

BOOLEAN

Access

Read only


WordWrap Property (FlexTextArea)

Class

FlexTextArea class

Action

Gets whether text in the row should be word wrapped.

If true, enables word wrapping for text in the rows. Only takes effect if the variableRowHeight property is also true. The default value is false.

Data Type

BOOLEAN

Access

Read only


XField Property (FlexAreaSeries)

Class

FlexAreaSeries class

Action

Gets the field of the data provider that determines the position of the data points on the horizontal axis.

If null, the data points are rendered in the order they appear in the data provider. The default value is null.

Data Type

STRING

Access

Read only


XField Property (FlexBarSeries)

Class

FlexBarSeries class

Action

Gets the field of the data provider that determines the x-axis location of the top of each bar.

If null, the BarSeries assumes that the data provider is an Array of numbers, and uses the numbers as values.

The default value is null.

Data Type

STRING

Access

Read only


XField Property (FlexBubbleSeries)

Class

FlexBubbleSeries class

Action

Gets the field of the data provider that determines the x-axis location of each data point.

If null, Flex renders the data points in the order that they appear in the data provider. The default value is null.

Data Type

STRING

Access

Read only


XField Property (FlexColumnSeries)

Class

FlexColumnSeries class

Action

Gets the field of the data provider that determines the x-axis location of the column.

If null, Flex renders the columns in the order they appear in the data provider. The default value is null.

Data Type

STRING

Access

Read only


XField Property (FlexHLOCSeriesBase)

Class

FlexHLOCSeriesBase class

Action

Gets the field of the data provider that determines the x-axis location of the element.

If null, the data points are rendered in the order they appear in the data provider. The default value is null.

Data Type

STRING

Access

Read only


XField Property (FlexLineSeries)

Class

FlexLineSeries class

Action

Gets the field of the data provider that determines the x-axis location of each data point.

If null, the data points are rendered in the order they appear in the data provider. The default value is null.

Data Type

STRING

Access

Read only


XField Property (FlexPlotSeries)

Class

FlexPlotSeries class

Action

Gets the field of the data provider that determines the x-axis location of each data point.

If null, Flex renders the data points in the order they appear in the dataProvider. The default value is null.

Data Type

STRING

Access

Read only


X Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.

If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90 degrees counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90 degrees counterclockwise. The object's coordinates refer to the registration point position.

Data Type

REAL

Access

Read only


YearNavigationEnabled Property (FlexDateChooser)

Class

FlexDateChooser class

Action

Gets whether year navigation is enabled.

When true an up and down button appear to the right of the displayed year. You can use these buttons to change the current year. These button appear to the left of the year in locales where year comes before the month in the date format.

The default value is false.

Data Type

BOOLEAN

Access

Read only


YearNavigationEnabled Property (FlexDateField)

Class

FlexDateField class

Action

Gets whether the year up and down buttons are available for navigation.

When true an up and down button appear to the right of the displayed year. You can use these buttons to change the current year. These button appear to the left of the year in locales where year comes before the month in the date format. The default value is false.

Data Type

BOOLEAN

Access

Read only


YField Property (FlexAreaSeries)

Class

FlexAreaSeries class

Action

Gets the field of the data provider that determines the position of the data point on the vertical axis.

If null, the AreaSeries assumes the dataProvider is an array of numbers, and uses the numbers as values for the data points. The default value is null.

Data Type

STRING

Access

Read only


YField Property (FlexBarSeries)

Class

FlexBarSeries class

Action

Gets the field of the data provider that determines the y-axis location of the bottom of each bar in the chart.

If null, Flex arranges the bars in the order of the data in the data provider.

The default value is null.

Data Type

STRING

Access

Read only


YField Property (FlexBubbleSeries)

Class

FlexBubbleSeries class

Action

Gets the field of the data provider that determines the y-axis location of each data point.

If null, the BubbleSeries assumes that the data provider is an Array of numbers, and uses the numbers as values for the data points. The default value is null.

Data Type

STRING

Access

Read only


YField Property (FlexColumnSeries)

Class

FlexColumnSeries class

Action

Gets the field of the data provider that determines the y-axis location of the top of a column.

If null, the ColumnSeries assumes the data provider is an Array of numbers and uses the numbers as values. The default value is null.

Data Type

STRING

Access

Read only


YField Property (FlexLineSeries)

Class

FlexLineSeries class

Action

Gets the field of the data provider that determines the y-axis location of each data point.

If null, the LineSeries assumes the data provider is an Array of numbers, and uses the numbers as values. The default value is null.

Data Type

STRING

Access

Read only


YField Property (FlexPlotSeries)

Class

FlexPlotSeries class

Action

Gets the field of the data provider that determines the y-axis location of each data point.

If null, the PlotSeries assumes the data provider is an Array of numbers, and uses the numbers as values. The default value is null.

Data Type

STRING

Access

Read only


Y Property (FlexDisplayObject)

Class

FlexDisplayObject class

Action

Gets the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.

If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90 degrees counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90 degrees counterclockwise. The object's coordinates refer to the registration point position.

Data Type

REAL

Access

Read only


ClearText Method (MobileTextField)

Class

MobileTextField class

Action

Clears all the content from the text field.

Syntax

textField.ClearText()


Click Method (MobileDevice)

Class

MobileDevice class

Action

Clicks on the device at the specified coordinates.

Syntax

device.Click([position])
Variable | Description
position | Optional.The coordinates at which to click. POINT.


Click Method (MobileObject)

Class

MobileObject class

Action

Clicks on the device at the specified coordinates.

Syntax

object.Click([position])
Variable | Description
position | Optional.The coordinates at which to click. POINT.


CloseApp Method (MobileDevice)

Class

MobileDevice class

Action

Closes the app and releases the device, to make it available to other users.

Syntax

device.CloseApp()


DeviceId Property (MobileDevice)

Class

MobileDevice class

Action

Gets the id of the device for the current connection.

Data Type

STRING

Access

Read only


DisplayHeight Property (MobileDevice)

Class

MobileDevice class

Action

Gets the height of the display in pixels.

Data Type

INTEGER

Access

Read only


DisplayOrientation Property (MobileDevice)

Class

MobileDevice class

Action

Gets the current orientation of the device.

Data Type

DISPLAYORIENTATION

Access

Read only


DisplayWidth Property (MobileDevice)

Class

MobileDevice class

Action

Gets the width of the display in pixels.

Data Type

INTEGER

Access

Read only


DoubleClick Method (MobileDevice)

Class

MobileDevice class

Action

Double-clicks on the device at the specified coordinates.

Syntax

device.DoubleClick([position])
Variable | Description
position | Optional.The coordinates at which to double-click. POINT.


DoubleClick Method (MobileObject)

Class

MobileObject class

Action

Double-clicks on the device at the specified coordinates.

Syntax

object.DoubleClick([position])
Variable | Description
position | Optional.The coordinates at which to double-click. POINT.


Drag Method (MobileDevice)

Class

MobileDevice class

Action

Performs a drag operation between the two specified points.

Syntax

device.Drag(start, end)
Variable | Description
start | The start point of the drag operation. POINT.
end | The end point of the drag operation. POINT.


Drag Method (MobileObject)

Class

MobileObject class

Action

Performs a drag operation between the two specified points.

Syntax

object.Drag(start, end)
Variable | Description
start | The start point of the drag operation. POINT.
end | The end point of the drag operation. POINT.


DragTo Method (MobileObject)

Class

MobileObject class

Action

Drags this object to the specified point relative to the mobile device.

Syntax

object.DragTo(destination)
Variable | Description
destination | The destination of the drag relative to the mobile device. POINT.


DragToObject Method (MobileObject)

Class

MobileObject class

Action

Drags this object to the specified destination object.

Syntax

object.DragToObject(destination)
Variable | Description
destination | The destination object of the drag. WINDOW.


GenerateConnectionString Method (MobileDevice)

Class

MobileDevice class

Action

Generates a connection string for this mobile device.

Syntax

sResult = device.GenerateConnectionString()
Variable | Description
sResult | STRING.


IsEmulator Property (MobileDevice)

Class

MobileDevice class

Action

Gets whether the connected device is an emulator.

Data Type

BOOLEAN

Access

Read only


IsEnabled Property (MobileObject)

Class

MobileObject class

Action

Gets whether the mobile object is enabled.

Data Type

BOOLEAN

Access

Read only


IsFocused Property (MobileObject)

Class

MobileObject class

Action

Gets whether the mobile object has focus. This property is not supported on iOS.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (MobileObject)

Class

MobileObject class

Action

Gets whether the mobile object is selected or checked.

Data Type

BOOLEAN

Access

Read only


LongClick Method (MobileDevice)

Class

MobileDevice class

Action

Long-clicks on the device at the specified coordinates.

Syntax

device.LongClick([position])
Variable | Description
position | Optional.The coordinates at which to long-click. POINT.


LongClick Method (MobileObject)

Class

MobileObject class

Action

Long-clicks on the device at the specified coordinates.

Syntax

object.LongClick([position])
Variable | Description
position | Optional.The coordinates at which to long-click. POINT.


Model Property (MobileDevice)

Class

MobileDevice class

Action

Gets the device name of the connected device.

Data Type

STRING

Access

Read only


MultiTouch Method (MobileDevice)

Class

MobileDevice class

Action

Performs a multi-touch operation with the given pointers. For every given pointer a swipe operation is executed at the same time.

Syntax

device.MultiTouch(pointers)
Variable | Description
pointers | A list of pointers where every pointer contains a list of points describing it's touch path. LIST OF LIST OF POINT.


MultiTouch Method (MobileObject)

Class

MobileObject class

Action

Performs a multi-touch operation with the given pointers. For every given pointer a swipe operation is executed at the same time.

Syntax

object.MultiTouch(pointers)
Variable | Description
pointers | A list of pointers where every pointer contains a list of points describing it's touch path. LIST OF LIST OF POINT.


OperatingSystem Property (MobileDevice)

Class

MobileDevice class

Action

Gets the operating system of the mobile device, Android or iOS.

Data Type

MOBILEOPERATINGSYSTEM

Access

Read only


OsVersion Property (MobileDevice)

Class

MobileDevice class

Action

Gets the version of the operating system of the connected device.

Data Type

STRING

Access

Read only


PinchIn Method (MobileDevice)

Class

MobileDevice class

Action

Performs a two-pointer gesture, where each pointer moves toward the other, from the edges to the center of this object. For example to zoom out on an image.

Syntax

device.PinchIn([percent])
Variable | Description
percent | Optional.percentage of the object's diagonal length for the pinch gesture. INTEGER.


PinchIn Method (MobileObject)

Class

MobileObject class

Action

Performs a two-pointer gesture, where each pointer moves toward the other, from the edges to the center of this object. For example to zoom out on an image.

Syntax

object.PinchIn([percent])
Variable | Description
percent | Optional.percentage of the object's diagonal length for the pinch gesture. INTEGER.


PinchOut Method (MobileDevice)

Class

MobileDevice class

Action

Performs a two-pointer gesture, where each pointer moves opposite across the other, from the center out towards the edges of the this object. For example to zoom in on an image.

Syntax

device.PinchOut([percent])
Variable | Description
percent | Optional.percentage of the object's diagonal length for the pinch gesture. INTEGER.


PinchOut Method (MobileObject)

Class

MobileObject class

Action

Performs a two-pointer gesture, where each pointer moves opposite across the other, from the center out towards the edges of the this object. For example to zoom in on an image.

Syntax

object.PinchOut([percent])
Variable | Description
percent | Optional.percentage of the object's diagonal length for the pinch gesture. INTEGER.


PressBack Method (MobileDevice)

Class

MobileDevice class

Action

Presses the back button. This method is not supported on iOS.

Syntax

device.PressBack()


PressDelete Method (MobileDevice)

Class

MobileDevice class

Action

Presses the delete button.

Syntax

device.PressDelete()


PressEnter Method (MobileDevice)

Class

MobileDevice class

Action

Presses the enter button.

Syntax

device.PressEnter()


PressHome Method (MobileDevice)

Class

MobileDevice class

Action

Presses the home button.

Syntax

device.PressHome()


PressKeyCode Method (MobileDevice)

Class

MobileDevice class

Action

Presses a certain Android-specific key code. This method is not supported on iOS.

For additional information about the supported Android key codes, refer to the Appium documentation.

Syntax

device.PressKeyCode(keyCode)
Variable | Description
keyCode | The desired key code to press. INTEGER.


PressRecentApps Method (MobileDevice)

Class

MobileDevice class

Action

Presses the recent apps button.

Syntax

device.PressRecentApps()


Rotate Method (MobileDevice)

Class

MobileDevice class

Action

Simulates rotating the device screen.

Syntax

device.Rotate(orientation)
Variable | Description
orientation | The desired device screen orientation. DISPLAYORIENTATION.


SetLocation Method (MobileDevice)

Class

MobileDevice class

Action

Sets the geographic location of the device, this method only works on Android devices (physical or emulated) and iOS simulators.

  • When testing a native mobile application on iOS, the SetLocation method is only supported for iOS simulators, not for physical iOS devices.
  • When testing a native mobile application on an Android version prior to Android 6.0, you have to enable Allow mock locations to use the SetLocation method. To do so, open the settings of the Android device or emulator and tap Developer Options.
  • When testing a native mobile application on Android 6.0 or later, you have to set the app to Appium Settings to use the SetLocation method. To do so, open the settings of the Android device or emulator and tap Developer Options > Select mock location app. Then choose Appium Settings. Note: The Appium Settings entry is only available if you have already executed a test with Appium on the Android device or emulator.

Syntax

device.SetLocation(latitude, longitude)
Variable | Description
latitude | Latitude of the location in degrees and minutes represented as a double value. REAL.
longitude | Longitude of the location in degrees and minutes represented as a double value. REAL.


SetText Method (MobileTextField)

Class

MobileTextField class

Action

Substitutes new text for the text in the text field.

Syntax

textField.SetText(text)
Variable | Description
text | The text to set. STRING.


Sleep Method (MobileDevice)

Class

MobileDevice class

Action

Presses the power button if the screen is on. This method is not supported on iOS.

Syntax

device.Sleep()


SwipeDown Method (MobileDevice)

Class

MobileDevice class

Action

Performs a down-swipe.

Syntax

device.SwipeDown([steps, delayBetweenSteps])
Variable | Description
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


SwipeDown Method (MobileObject)

Class

MobileObject class

Action

Performs a down-swipe.

Syntax

object.SwipeDown([steps, delayBetweenSteps])
Variable | Description
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


SwipeLeft Method (MobileDevice)

Class

MobileDevice class

Action

Performs a left-swipe.

Syntax

device.SwipeLeft([steps, delayBetweenSteps])
Variable | Description
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


SwipeLeft Method (MobileObject)

Class

MobileObject class

Action

Performs a left-swipe.

Syntax

object.SwipeLeft([steps, delayBetweenSteps])
Variable | Description
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


Swipe Method (MobileDevice)

Class

MobileDevice class

Action

Performs a swipe between the two specified points.

Syntax

device.Swipe(start, end, [steps, delayBetweenSteps])
Variable | Description
start | The start point of the swipe. POINT.
end | The end point of the swipe. POINT.
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


Swipe Method (MobileObject)

Class

MobileObject class

Action

Performs a swipe between the two specified points.

Syntax

object.Swipe(start, end, [steps, delayBetweenSteps])
Variable | Description
start | The start point of the swipe. POINT.
end | The end point of the swipe. POINT.
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


SwipeRight Method (MobileDevice)

Class

MobileDevice class

Action

Performs a right-swipe.

Syntax

device.SwipeRight([steps, delayBetweenSteps])
Variable | Description
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


SwipeRight Method (MobileObject)

Class

MobileObject class

Action

Performs a right-swipe.

Syntax

object.SwipeRight([steps, delayBetweenSteps])
Variable | Description
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


SwipeUp Method (MobileDevice)

Class

MobileDevice class

Action

Performs a up-swipe.

Syntax

device.SwipeUp([steps, delayBetweenSteps])
Variable | Description
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


SwipeUp Method (MobileObject)

Class

MobileObject class

Action

Performs a up-swipe.

Syntax

object.SwipeUp([steps, delayBetweenSteps])
Variable | Description
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


SwipeWithSegments Method (MobileDevice)

Class

MobileDevice class

Action

Performs a swipe between the specified points.

Syntax

device.SwipeWithSegments(segments, [steps, delayBetweenSteps])
Variable | Description
segments | The points between to swipe. LIST OF POINT.
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


SwipeWithSegments Method (MobileObject)

Class

MobileObject class

Action

Performs a swipe between the specified points.

Syntax

object.SwipeWithSegments(segments, [steps, delayBetweenSteps])
Variable | Description
segments | The points between to swipe. LIST OF POINT.
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the swipe operation. For iOS, a swipe operation is always performed in a single step. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


Text Property (MobileObject)

Class

MobileObject class

Action

Gets the text content of the mobile object.

Data Type

STRING

Access

Read only


TwoPointerMultiTouch Method (MobileDevice)

Class

MobileDevice class

Action

Performs a multi-touch operation with two pointers. It executes two swipe operation at the same time.

Syntax

device.TwoPointerMultiTouch(startPointer1, endPointer1, startPointer2, endPointer2, [steps, delayBetweenSteps])
Variable | Description
startPointer1 | The start point of the first pointer. POINT.
endPointer1 | The end point of the first pointer. POINT.
startPointer2 | The start point of the second pointer. POINT.
endPointer2 | The end point of the second pointer. POINT.
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the drag operation. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


TwoPointerMultiTouch Method (MobileObject)

Class

MobileObject class

Action

Performs a multi-touch operation with two pointers. It executes two swipe operation at the same time.

Syntax

object.TwoPointerMultiTouch(startPointer1, endPointer1, startPointer2, endPointer2, [steps, delayBetweenSteps])
Variable | Description
startPointer1 | The start point of the first pointer. POINT.
endPointer1 | The end point of the first pointer. POINT.
startPointer2 | The start point of the second pointer. POINT.
endPointer2 | The end point of the second pointer. POINT.
steps | Optional.the number of steps between the specified points. The default number of steps for Android is 5. Increase the number of steps to increase the duration of the drag operation. INTEGER.
delayBetweenSteps | Optional.the delay in milliseconds for each swipe step. For example, when scrolling an application with a swipe operation, how far the application scrolls depends on the swipe speed. The default value is 5 milliseconds. Increase this delay, for example to 300 milliseconds, to create more reproducible results. INTEGER.


TypeKeys Method (MobileDevice)

Class

MobileDevice class

Action

Sends a set of keystrokes to the object.

Syntax

device.TypeKeys(keys, [delay, ensureFocus])
Variable | Description
keys | The keystrokes to type. STRING.
delay | Optional.The delay between keystrokes in milliseconds. INTEGER.
ensureFocus | Optional.Determines whether it should be ensured that the mobile object actually has the focus. The focus will be set with a click in the middle of the mobile object. Defaults to true. BOOLEAN.


TypeKeys Method (MobileObject)

Class

MobileObject class

Action

Sends a set of keystrokes to the object.

Syntax

object.TypeKeys(keys, [delay, ensureFocus])
Variable | Description
keys | The keystrokes to type. STRING.
delay | Optional.The delay between keystrokes in milliseconds. INTEGER.
ensureFocus | Optional.Determines whether it should be ensured that the mobile object actually has the focus. The focus will be set with a click in the middle of the mobile object. Defaults to true. BOOLEAN.


TypePasswordKeys Method (MobileTextField)

Class

MobileTextField class

Action

Types an encrypted password into a text field.

The text field is cleared of any existing text before typing the encrypted password.

Syntax

textField.TypePasswordKeys(keys, [delay, ensureFocus])
Variable | Description
keys | The encrypted password. STRING.
delay | Optional.The delay between keystrokes in milliseconds. INTEGER.
ensureFocus | Optional.Determines whether it should be ensured that the control actually has the keyboard focus. Defaults to true. BOOLEAN.


WakeUp Method (MobileDevice)

Class

MobileDevice class

Action

Presses the power button if the screen is off. This method is not supported on iOS.

Syntax

device.WakeUp()


AutoEnter Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates true if the field is an AutoEnter field.

Data Type

BOOLEAN

Access

Read only


AutoSkip Property (RumbaField)

Class

RumbaField class

Action

Gets a value that is true if the field is an AutoSkip field.

Data Type

BOOLEAN

Access

Read only


BackgroundColor Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets the background color of the display control.

Data Type

COLOR

Access

Read only


CharacterSetId Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets a value that identifies the character set translation table used by the Display control.

Data Type

INTEGER

Access

Read only


Clear Method (RumbaScreen)

Class

RumbaScreen class

Action

Clears the screen by sending the "clear" key. Equivalent to synchSendKeys(RumbaKey.CLEAR).

Syntax

screen.Clear()


ColumnCount Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets a value that indicates the number of columns on the current screen.

Data Type

INTEGER

Access

Read only


Connect Method (RumbaScreen)

Class

RumbaScreen class

Action

Connects to the hosts in the current configuration.

Syntax

screen.Connect([screenUpdateWaitCount, timeout])
Variable | Description
screenUpdateWaitCount | Optional.The number of screen updates that need to be awaited until the first stable screen is ready for further interaction. Defaults to 1. If screenUpdateWaitCount is zero, no synchronization is done and the parameter timeout is ignored. INTEGER.
timeout | Optional.The timeout in milliseconds. Defaults to 30000ms. If timeout is exceeded, an exception is thrown. INTEGER.


CursorColumn Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets the column position of the cursor on the screen.

Data Type

INTEGER

Access

Read only


CursorLine Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets the line position of the cursor on the screen.

Data Type

INTEGER

Access

Read only


CursorPosition Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets the current cursor position on the screen. Values are starting with 1 for the first line or column.

Data Type

TEXTPOS

Access

Read only


Detectable Property (RumbaField)

Class

RumbaField class

Action

Gets a value is indicates true if the field is detectable.

Data Type

BOOLEAN

Access

Read only


Disconnect Method (RumbaScreen)

Class

RumbaScreen class

Action

Disconnects the current connection.

Syntax

screen.Disconnect()


Dup Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates true if the field is a dup field.

Data Type

BOOLEAN

Access

Read only


EndColumn Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates the ending column of the field.

Data Type

INTEGER

Access

Read only


EndLine Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates the ending line of the field.

Data Type

INTEGER

Access

Read only


EndPosition Property (RumbaField)

Class

RumbaField class

Action

Gets the 1-based end position of the field, when the screen is seen as one sequence of characters.

Data Type

INTEGER

Access

Read only


Enptui Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates true if the field is an ENPTUI field.

Data Type

BOOLEAN

Access

Read only


FieldExitRequired Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates true if the field is required before exiting the screen.

Data Type

BOOLEAN

Access

Read only


GetCharacterAttributes Method (RumbaField)

Class

RumbaField class

Action

Gets the character attributes for this field's characters.

Syntax

liCharacterAttributes = field.GetCharacterAttributes()
Variable | Description
liCharacterAttributes | LIST OF RUMBACHARACTERATTRIBUTE.


GetCharacterAttributes Method (RumbaScreen)

Class

RumbaScreen class

Action

Gets the character attributes for length-number of characters starting at the given position.

Syntax

liCharacterAttributes = screen.GetCharacterAttributes(position, length)
Variable | Description
liCharacterAttributes | LIST OF RUMBACHARACTERATTRIBUTE.
position | The position where the retrieval should start. TEXTPOS.
length | The amount of characters whose attributes should be returned. INTEGER.


GetContent Method (RumbaScreen)

Class

RumbaScreen class

Action

Retrieves a string containing the screen without line breaks starting at the specified text position.

Position values must be greater than 0 and less than the corresponding screen dimension.

Syntax

sContent = screen.GetContent(fromPosition, [length])
Variable | Description
sContent | STRING.
fromPosition | The start position on the screen, starting with 1 for the first column or line. TEXTPOS.
length | Optional.The number of characters on the screen to read. A specified length must be greater than -1. Reading stops at the end of the screen. If omitted the content to the end of the screen is returned. INTEGER.


GetLines Method (RumbaScreen)

Class

RumbaScreen class

Action

Retrieves a clipping of the screen and returns the selected lines in a list of strings.

Syntax

liLines = screen.GetLines([fromPosition, toPosition])
Variable | Description
liLines | LIST OF STRING.
fromPosition | Optional.The upper left position of the clipping on the screen, starting with 1 for the first line or column. Position values must be greater than 0 and less than the corresponding screen dimension, otherwise an Exception will be thrown. TEXTPOS.
toPosition | Optional.The lower right position of the clipping on the screen. An exception will be thrown if the relative position to $fromPosition$ is invalid. Position values must be greater than 0 and less than the corresponding screen dimension, otherwise an Exception will be thrown. TEXTPOS.


Hidden Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates if the field is hidden.

Data Type

BOOLEAN

Access

Read only


HostConnected Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets a value that indicates if the host is connected.

Data Type

BOOLEAN

Access

Read only


HostDeviceName Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets the host device name.

Data Type

STRING

Access

Read only


HostIpAddress Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets the host IP address.

Data Type

STRING

Access

Read only


Intense Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates true if the field is intense.

Data Type

BOOLEAN

Access

Read only


IsFocused Method (RumbaObject)

Class

RumbaObject class

Action

Return whether the control has focus.

Syntax

bFocused = object.IsFocused()
Variable | Description
bFocused | True if this object has the focus. BOOLEAN.


KeyboardLocked Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets a value that indicates whether keyboard input is inhibited.

Data Type

BOOLEAN

Access

Read only


Length Property (RumbaField)

Class

RumbaField class

Action

Gets the length of the field.

Data Type

INTEGER

Access

Read only


LineCount Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets a value that indicates the number of lines on the current screen.

Data Type

INTEGER

Access

Read only


ModifiedDataTag Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates true if the field has the ModifiedDataTag property set.

Data Type

BOOLEAN

Access

Read only


Protected Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates true if the field is protected (i.e. a RumbaLabel).

Data Type

BOOLEAN

Access

Read only


Reset Method (RumbaScreen)

Class

RumbaScreen class

Action

Resets the screen by sending the "reset" key. Equivalent to synchSendKeys(RumbaKey.RESET).

Syntax

screen.Reset()


ScreenId Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets the screen id.

Data Type

INTEGER

Access

Read only


ScreenSize Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets the size of the screen in text lines and columns.

Data Type

TEXTPOS

Access

Read only


SendKeys Method (RumbaObject)

Class

RumbaObject class

Action

Sends keys. Supports RDE mnemonics.

Syntax

object.SendKeys(keys)
Variable | Description
keys | The keys to send. The Rumba keyboard mnemonics can be used in this string. For additional information about the Rumba keyboard mnemonics, refer to the RDE .NET Help. STRING.

Examples

The line
rumbaScreen.SendKeys(RK_TAB)
is equivalent to
rumbaScreen.SendKeys("@T");
RumbaKey constants can be combined with regular strings:
rumbaScreen.SendKeys("someone{RK_AT}example.com");
For all available constants see the include file RumbaDataTypes.inc.


SessionName Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets the session name.

Data Type

STRING

Access

Read only


SetCursorPosition Method (RumbaScreen)

Class

RumbaScreen class

Action

Moves the cursor to the given position of the screen.

Syntax

screen.SetCursorPosition(position)
Variable | Description
position | The position where the cursor should be moved to, starting with 1 for the first line or column. TEXTPOS.


SetFocus Method (RumbaObject)

Class

RumbaObject class

Action

Gives focus to the control.

Syntax

object.SetFocus()


SetText Method (RumbaTextField)

Class

RumbaTextField class

Action

Sets the text field's text.

Syntax

textField.SetText(text)
Variable | Description
text | The text to set. STRING.


StartColumn Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates the column in which the field begins.

Data Type

INTEGER

Access

Read only


StartLine Property (RumbaField)

Class

RumbaField class

Action

Gets a value that indicates the line in which the field begins.

Data Type

INTEGER

Access

Read only


StartPosition Property (RumbaField)

Class

RumbaField class

Action

Gets the 1-based start position of the field, when the screen is seen as one sequence of characters.

Data Type

INTEGER

Access

Read only


Submit Method (RumbaScreen)

Class

RumbaScreen class

Action

Submits the entered data to the server by sending the "submit" key. Equivalent to synchSendKeys(RumbaKey.SUBMIT).

Syntax

screen.Submit()


SupportsStructuredFields Property (RumbaScreen)

Class

RumbaScreen class

Action

Gets a value that indicates if the host supports structured field decoding.

Data Type

BOOLEAN

Access

Read only


SynchSendKeys Method (RumbaObject)

Class

RumbaObject class

Action

Synchronously sends keys. Supports RDE mnemonics.

Syntax

object.SynchSendKeys(keys, [screenUpdateWaitCount, timeout])
Variable | Description
keys | The keys to send. The Rumba keyboard mnemonics can be used in this string. For additional information about the Rumba keyboard mnemonics, refer to the RDE .NET Help. STRING.
screenUpdateWaitCount | Optional.The number of screen updates that need to be awaited until the new screen is ready for further interaction. INTEGER.
timeout | Optional.The timeout in milliseconds. If set to 0, the Rumba APIs default timeout (currently 10000ms) is used. INTEGER.

Examples

The line
rumbaScreen.SynchSendKeys(RK_PF3)
is equivalent to
rumbaScreen.SynchSendKeys("@3");
RumbaKey constants can be combined with regular strings:
rumbaScreen.SynchSendKeys("someone{RK_AT}example.com{RK_ENTER}");
For all available constants see the include file RumbaDataTypes.inc.


Text Property (RumbaField)

Class

RumbaField class

Action

Gets the text content of the field. White space characters (for example space characters) before and after the text will be trimmed. To get the raw text use GetContent on RumbaScreen with the start position and length of this field.

Data Type

STRING

Access

Read only


Type Property (RumbaField)

Class

RumbaField class

Action

Gets a value that represents the input allowed for this field.

Data Type

HOSTFIELDEDITCONSTANTS

Access

Read only


WaitForHostConnected Method (RumbaScreen)

Class

RumbaScreen class

Action

Waits until the session is connected.

Syntax

screen.WaitForHostConnected([timeout])
Variable | Description
timeout | Optional.The timeout in milliseconds. Defaults to 30000ms. If timeout is exceeded, an exception is thrown. INTEGER.


WriteText Method (RumbaScreen)

Class

RumbaScreen class

Action

Writes text on the screen.

If no Position is specified the current cursor position is the place for insertion.

Syntax

screen.WriteText(text, [position])
Variable | Description
text | Text which is written to the screen. STRING.
position | Optional.The starting position of insertion, starting with 1 for the first line or column. TEXTPOS.


AccessibilityDescription Property (SapBarChart)

Class

SapBarChart class

Action

Gets the accessibility description of the shell.

Data Type

STRING

Access

Read only


AccessibilityDescription Property (SapChart)

Class

SapChart class

Action

Gets the accessibility description of the shell.

Data Type

STRING

Access

Read only


AccessibilityDescription Property (SapNetPlan)

Class

SapNetPlan class

Action

Gets the accessibility description of the shell.

Data Type

STRING

Access

Read only


AccessibilityDescription Property (SapTree)

Class

SapTree class

Action

Gets the accessibility description of the shell.

Data Type

STRING

Access

Read only


AccessibilityTextOnRequest Property (SapComponent)

Class

SapComponent class

Action

Gets an additional text for accessibility support.

Data Type

STRING

Access

Read only


AccessibilityText Property (SapComponent)

Class

SapComponent class

Action

Gets an additional text for accessibility support.

Data Type

STRING

Access

Read only


AccessibilityTooltip Property (SapComponent)

Class

SapComponent class

Action

Gets an additional tooltip text for accessibility support.

Data Type

STRING

Access

Read only


BarCount Method (SapBarChart)

Class

SapBarChart class

Action

Returns the number of bars in the given chart.

Syntax

iResult = barChart.BarCount(chartId)
Variable | Description
iResult | INTEGER.
chartId | Index of the chart. INTEGER.


ButtonbarVisible Property (SapWindow)

Class

SapWindow class

Action

Gets whether the application toolbar, the lower toolbar within SAP GUI, is visible.

Data Type

BOOLEAN

Access

Read only


ButtonCount Property (SapToolbarControl)

Class

SapToolbarControl class

Action

Gets the number of toolbar buttons including separators.

Data Type

INTEGER

Access

Read only


Changeable Property (SapComponent)

Class

SapComponent class

Action

Gets whether an object is changeable.

Data Type

BOOLEAN

Access

Read only


Changeable Property (SapToolbarControl)

Class

SapToolbarControl class

Action

Gets whether the control is changeable.

Data Type

INTEGER

Access

Read only


ChangeCheckbox Method (SapTree)

Class

SapTree class

Action

This method emulates changing a checkbox state.

Syntax

tree.ChangeCheckbox(nodeKey, itemName, check)
Variable | Description
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.
check | Whether the checkbox should be checked. BOOLEAN.


ChangeSelection Method (SapColorSelector)

Class

SapColorSelector class

Action

Selects the color at the given index position.

Syntax

colorSelector.ChangeSelection(index)
Variable | Description
index | The index of the color. INTEGER.


CharHeight Property (SapButton)

Class

SapButton class

Action

Gets the height of the element in character metric.

Data Type

INTEGER

Access

Read only


CharHeight Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets the height of the element in character metric.

Data Type

INTEGER

Access

Read only


CharHeight Property (SapComboBox)

Class

SapComboBox class

Action

Gets the height of the element in character metric.

Data Type

INTEGER

Access

Read only


CharHeight Property (SapRadioButton)

Class

SapRadioButton class

Action

Gets the height of the element in character metric.

Data Type

INTEGER

Access

Read only


CharHeight Property (SapTable)

Class

SapTable class

Action

Gets the height of the element in character metric.

Data Type

INTEGER

Access

Read only


CharLeft Property (SapButton)

Class

SapButton class

Action

Gets the left coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


CharLeft Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets the left coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


CharLeft Property (SapComboBox)

Class

SapComboBox class

Action

Gets the left coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


CharLeft Property (SapLabel)

Class

SapLabel class

Action

Gets the left coordinate of the label in character metric.

Data Type

INTEGER

Access

Read only


CharLeft Property (SapRadioButton)

Class

SapRadioButton class

Action

Gets the left coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


CharLeft Property (SapTable)

Class

SapTable class

Action

Gets the left coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


ChartCount Property (SapBarChart)

Class

SapBarChart class

Action

Gets the number of charts.

Data Type

INTEGER

Access

Read only


CharTop Property (SapButton)

Class

SapButton class

Action

Gets the top coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


CharTop Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets the top coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


CharTop Property (SapComboBox)

Class

SapComboBox class

Action

Gets the top coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


CharTop Property (SapLabel)

Class

SapLabel class

Action

Gets the top coordinate of the label in character metric.

Data Type

INTEGER

Access

Read only


CharTop Property (SapRadioButton)

Class

SapRadioButton class

Action

Gets the top coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


CharTop Property (SapTable)

Class

SapTable class

Action

Gets the top coordinate of the element in character metric.

Data Type

INTEGER

Access

Read only


CharWidth Property (SapButton)

Class

SapButton class

Action

Gets the width of the element in character metric.

Data Type

INTEGER

Access

Read only


CharWidth Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets the width of the element in character metric.

Data Type

INTEGER

Access

Read only


CharWidth Property (SapComboBox)

Class

SapComboBox class

Action

Gets the width of the element in character metric.

Data Type

INTEGER

Access

Read only


CharWidth Property (SapLabel)

Class

SapLabel class

Action

Gets the width of the element in character metric.

Data Type

INTEGER

Access

Read only


CharWidth Property (SapRadioButton)

Class

SapRadioButton class

Action

Gets the width of the element in character metric.

Data Type

INTEGER

Access

Read only


CharWidth Property (SapTable)

Class

SapTable class

Action

Gets the width of the element in character metric.

Data Type

INTEGER

Access

Read only


Checked Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets whether the checkbox is checked.

Data Type

BOOLEAN

Access

Read only


Check Method (SapCheckBox)

Class

SapCheckBox class

Action

Checks the check box.

Syntax

checkBox.Check()


ClearSelection Method (SapGridView)

Class

SapGridView class

Action

Removes all row, column and cell selections.

Syntax

gridView.ClearSelection()


ClickControlArea Method (SapPicture)

Class

SapPicture class

Action

clicks on the specified position.

Syntax

picture.ClickControlArea(x, y)
Variable | Description
x | The x-coordinate. INTEGER.
y | The y-coordinate. INTEGER.


ClickCurrentCell Method (SapGridView)

Class

SapGridView class

Action

Clicks the current cell.

Syntax

gridView.ClickCurrentCell()


Click Method (SapGridView)

Class

SapGridView class

Action

Clicks on the specified cell.

Syntax

gridView.Click(row, column)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


Click Method (SapPicture)

Class

SapPicture class

Action

clicks on a picture.

Syntax

picture.Click()


ClickPictureArea Method (SapPicture)

Class

SapPicture class

Action

clicks on the specified position in the picture area.

Syntax

picture.ClickPictureArea(x, y)
Variable | Description
x | The x-coordinate. INTEGER.
y | The y-coordinate. INTEGER.


Close Method (SapOkCodeField)

Class

SapOkCodeField class

Action

Collapses the GuiOkCodeField.

Syntax

okCodeField.Close()


CollapseNode Method (SapTree)

Class

SapTree class

Action

This function closes the node with the key nodeKey.

Syntax

tree.CollapseNode(nodeKey)
Variable | Description
nodeKey | The key of the node. STRING.


ColorIndex Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets the index of the list color of this element.

Data Type

INTEGER

Access

Read only


ColorIndex Property (SapLabel)

Class

SapLabel class

Action

Gets the color index of the label.

Data Type

INTEGER

Access

Read only


ColorIntensified Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets whether the Intensified flag is set in screen painter for this element.

Data Type

BOOLEAN

Access

Read only


ColorInverse Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets whether the inverse color style is set in screen painter for the element.

Data Type

BOOLEAN

Access

Read only


ColorInverse Property (SapLabel)

Class

SapLabel class

Action

Gets whether the inverse color style is set for the label.

Data Type

BOOLEAN

Access

Read only


ColumnCount Property (SapGridView)

Class

SapGridView class

Action

Gets the number of columns.

Data Type

INTEGER

Access

Read only


ColumnCount Property (SapTable)

Class

SapTable class

Action

Gets the number of columns in the table.

Data Type

INTEGER

Access

Read only


ColumnHeaders Property (SapTree)

Class

SapTree class

Action

Gets a collection of the titles of the columns.

Data Type

LIST OF STRING

Access

Read only


ColumnNames Property (SapTree)

Class

SapTree class

Action

Gets a collection of the column names.

Data Type

LIST OF STRING

Access

Read only


ColumnOrder Property (SapGridView)

Class

SapGridView class

Action

Gets a list of strings which contains all the column identifiers in the order in which they are displayed.

Data Type

LIST OF STRING

Access

Read only


ColumnOrder Property (SapTree)

Class

SapTree class

Action

Gets the column order.

Data Type

LIST OF STRING

Access

Read only


ColumnSelectionMode Property (SapTable)

Class

SapTable class

Action

Gets the column selection mode.

Data Type

TABLESELECTIONTYPE

Access

Read only


ColumnTitles Property (SapTree)

Class

SapTree class

Action

Gets a collection of the titles of the columns.

Data Type

LIST OF STRING

Access

Read only


ConfigureLayout Method (SapTable)

Class

SapTable class

Action

Opens the configuration layout dialog, in which the layout of the table can be changed.

Syntax

table.ConfigureLayout()


ContextMenu Method (SapCalendar)

Class

SapCalendar class

Action

Opens a context menu.

Syntax

calendar.ContextMenu(contextMenuId, contextMenuCellRow, contextMenuCellColumn, startDate, endDate)
Variable | Description
contextMenuId | Indicates the cell type of the cell in which the context menu was opened. CALENDARCELLTYPE.
contextMenuCellRow | The context menu cell row. The value is one-based. INTEGER.
contextMenuCellColumn | The context menu cell column. The value is one-based. INTEGER.
startDate | The begin date. STRING.
endDate | The end date. STRING.


ContextMenu Method (SapGridView)

Class

SapGridView class

Action

Requests the context menu.

Syntax

gridView.ContextMenu()


ContextMenu Method (SapHTMLViewer)

Class

SapHTMLViewer class

Action

Emulates the context menu request. Applies only to context menus provided by the backend.

Syntax

hTMLViewer.ContextMenu()


ContextMenu Method (SapPicture)

Class

SapPicture class

Action

The function opens a context menu on the given position. The coordinates should be given in pixels with respect to the picture control as it is displayed on the screen.

Syntax

picture.ContextMenu(x, y)
Variable | Description
x | The x-coordinate. INTEGER.
y | The y-coordinate. INTEGER.


ContextMenu Method (SapTextEdit)

Class

SapTextEdit class

Action

Requests the context menu.

Syntax

textEdit.ContextMenu()


CurrentCellColumn Property (SapGridView)

Class

SapGridView class

Action

Gets the current column.

Data Type

STRING

Access

Read only


CurrentCellMoved Method (SapGridView)

Class

SapGridView class

Action

This function notifies the server that another cell was made the current cell. The function must be called whenever the current cell changes.

Syntax

gridView.CurrentCellMoved()


CurrentCellRow Property (SapGridView)

Class

SapGridView class

Action

Gets the current row.

Data Type

INTEGER

Access

Read only


CurrentColumn Property (SapTable)

Class

SapTable class

Action

Gets the index of the current column. The value is one-based.

Data Type

INTEGER

Access

Read only


CurrentColumn Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the column index in which the caret is currently positioned. The value is one-based.

Data Type

INTEGER

Access

Read only


CurrentContextMenu Property (SapBarChart)

Class

SapBarChart class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapCalendar)

Class

SapCalendar class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapChart)

Class

SapChart class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapColorSelector)

Class

SapColorSelector class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapGridView)

Class

SapGridView class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapHTMLViewer)

Class

SapHTMLViewer class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapNetPlan)

Class

SapNetPlan class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapOfficeIntegration)

Class

SapOfficeIntegration class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapPicture)

Class

SapPicture class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapSplitterContainer)

Class

SapSplitterContainer class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapToolbarControl)

Class

SapToolbarControl class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapTree)

Class

SapTree class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentContextMenu Property (SapUserArea)

Class

SapUserArea class

Action

Gets the current context menu. This is only set when a context menu is available at the shell object.

Data Type

WINDOW

Access

Read only


CurrentLine Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the line index in which the caret is currently positioned. The value is one-based.

Data Type

INTEGER

Access

Read only


CurrentRow Property (SapTable)

Class

SapTable class

Action

Gets the index of the current row. The value is one-based.

Data Type

INTEGER

Access

Read only


Day Property (SapCalendar)

Class

SapCalendar class

Action

Gets the day of the month that is currently selected.

Data Type

INTEGER

Access

Read only


DefaultContextMenu Method (SapTree)

Class

SapTree class

Action

This method requests a context menu for the whole Tree Control.

Syntax

tree.DefaultContextMenu()


DefaultTooltip Property (SapComponent)

Class

SapComponent class

Action

Gets the tooltip text which is generated from the short text defined in the data dictionary for the given screen element type.

Data Type

STRING

Access

Read only


DeleteRows Method (SapGridView)

Class

SapGridView class

Action

Delete the given rows.

The parameter rows is a comma-separated string of indices or index ranges, for example '3,5-8,14,15'. The entries must be ordered and the ranges must not overlap.

Syntax

gridView.DeleteRows(rows)
Variable | Description
rows | The rows to delete. STRING.


DeselectAllColumns Method (SapTable)

Class

SapTable class

Action

This function can be used for table controls with a button that allows to de-select all columns in one step.

Syntax

table.DeselectAllColumns()


DeselectColumn Method (SapGridView)

Class

SapGridView class

Action

Removes the specified column from the list of selected columns.

Syntax

gridView.DeselectColumn(column)
Variable | Description
column | Column identifier. STRING.


DeselectColumn Method (SapTable)

Class

SapTable class

Action

Deselects the given column.

Syntax

table.DeselectColumn(column)
Variable | Description
column | Index of the column. The value is one-based. INTEGER.


DeselectRow Method (SapTable)

Class

SapTable class

Action

Deselects the given row.

Syntax

table.DeselectRow(row)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.


DisplayedText Property (SapLabel)

Class

SapLabel class

Action

Gets the text of the label.

Data Type

STRING

Access

Read only


DisplayedText Property (SapTextField)

Class

SapTextField class

Action

Gets the text as it is displayed on the screen, including preceding or trailing blanks.

Data Type

STRING

Access

Read only


DisplayMode Property (SapPicture)

Class

SapPicture class

Action

Gets the display mode of the picture, i.e. "Normal", "Stretch", "Fit", "NormalCenter", "FitCenter".

Data Type

STRING

Access

Read only


DocumentComplete Property (SapHTMLViewer)

Class

SapHTMLViewer class

Action

Gets whether the document is complete.

Data Type

BOOLEAN

Access

Read only


DoubleClickControlArea Method (SapPicture)

Class

SapPicture class

Action

double clicks on the specified position.

Syntax

picture.DoubleClickControlArea(x, y)
Variable | Description
x | The x-coordinate. INTEGER.
y | The y-coordinate. INTEGER.


DoubleClickCurrentCell Method (SapGridView)

Class

SapGridView class

Action

Double clicks on the current cell.

Syntax

gridView.DoubleClickCurrentCell()


DoubleClick Method (SapGridView)

Class

SapGridView class

Action

Double clicks the specified cell.

Syntax

gridView.DoubleClick(row, column)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


DoubleClick Method (SapPicture)

Class

SapPicture class

Action

double clicks on the picture.

Syntax

picture.DoubleClick()


DoubleClick Method (SapStatusbar)

Class

SapStatusbar class

Action

double-clicks the statusbar.

Syntax

statusbar.DoubleClick()


DoubleClick Method (SapTextEdit)

Class

SapTextEdit class

Action

Double clicks the text edit control.

Syntax

textEdit.DoubleClick()


DoubleClickPictureArea Method (SapPicture)

Class

SapPicture class

Action

double clicks on the specified position in the picture area.

Syntax

picture.DoubleClickPictureArea(x, y)
Variable | Description
x | The x-coordinate. INTEGER.
y | The y-coordinate. INTEGER.


DoubleSelectItem Method (SapTree)

Class

SapTree class

Action

This function emulates double clicking on a text item.

Syntax

tree.DoubleSelectItem(nodeKey, itemName)
Variable | Description
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


DoubleSelectNode Method (SapTree)

Class

SapTree class

Action

This function emulates double clicking a node.

Syntax

tree.DoubleSelectNode(nodeKey)
Variable | Description
nodeKey | The key of the node. STRING.


DragDropSupported Property (SapShell)

Class

SapShell class

Action

Gets whether the shell allows drag and drop operations.

Data Type

BOOLEAN

Access

Read only


DragDropSupported Property (SapToolbarControl)

Class

SapToolbarControl class

Action

Gets whether the shell allows drag and drop operations.

Data Type

INTEGER

Access

Read only


DuplicateRows Method (SapGridView)

Class

SapGridView class

Action

Duplicates the given range of rows.

The parameter rows is a comma-separated string of indices or index ranges, for example '3,5-8,14,15'. For any single index a copy of the row will be inserted at the given index. If a range of indexes is duplicated then all the new lines are inserted as a single block before the old lines. The entries must be ordered and the ranges must not overlap,

Syntax

gridView.DuplicateRows(rows)
Variable | Description
rows | The rows to duplicate. STRING.


EndSelection Property (SapCalendar)

Class

SapCalendar class

Action

Gets the end of the selection interval.

Data Type

STRING

Access

Read only


EnsureVisibleHorizontalItem Method (SapTree)

Class

SapTree class

Action

This function scrolls the Tree horizontally until the Item is visible.

Syntax

tree.EnsureVisibleHorizontalItem(nodeKey, itemName)
Variable | Description
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


ExpandNode Method (SapTree)

Class

SapTree class

Action

This function expands the node with the key nodeKey.

Syntax

tree.ExpandNode(nodeKey)
Variable | Description
nodeKey | The key of the node. STRING.


FindNodeKeyByPath Method (SapTree)

Class

SapTree class

Action

Return the node key for the given path (e.g. 2\1\2).

Syntax

sResult = tree.FindNodeKeyByPath(path)
Variable | Description
sResult | STRING.
path | The node path. STRING.


FirstVisibleColumn Property (SapGridView)

Class

SapGridView class

Action

Gets the first visible column of the scrollable area of the grid view, fixed columns are ignored.

Data Type

STRING

Access

Read only


FirstVisibleDate Property (SapCalendar)

Class

SapCalendar class

Action

Gets the earliest date visible in the calendar control.

Data Type

STRING

Access

Read only


FirstVisibleLine Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the first visible line which is visualized at the top border of the text edit control. The value is one-based.

Data Type

INTEGER

Access

Read only


FirstVisibleRow Property (SapGridView)

Class

SapGridView class

Action

Gets the index of the first visible row in the grid. The value is one-based.

Data Type

INTEGER

Access

Read only


Flushing Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets whether the value change causes a round trip.

Data Type

BOOLEAN

Access

Read only


Flushing Property (SapComboBox)

Class

SapComboBox class

Action

Gets whether the value change causes a round trip.

Data Type

BOOLEAN

Access

Read only


Flushing Property (SapRadioButton)

Class

SapRadioButton class

Action

Gets whether the value change causes a round trip.

Data Type

BOOLEAN

Access

Read only


FocusedButton Property (SapToolbarControl)

Class

SapToolbarControl class

Action

Gets the zero-based index of the button that currently has the focus.

Data Type

INTEGER

Access

Read only


FocusedNodeKey Property (SapTree)

Class

SapTree class

Action

Gets the key of the focused node.

Data Type

STRING

Access

Read only


FrozenColumnCount Property (SapGridView)

Class

SapGridView class

Action

Gets the number of columns that are excluded from horizontal scrolling.

Data Type

INTEGER

Access

Read only


GetAbapImage Method (SapTree)

Class

SapTree class

Action

Gets the abap image.

Syntax

sAbapImage = tree.GetAbapImage(nodeKey, itemName)
Variable | Description
sAbapImage | STRING.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetBarContent Method (SapBarChart)

Class

SapBarChart class

Action

Returns the content of the bar.

Syntax

sBarContent = barChart.GetBarContent(chartId, barId, textId)
Variable | Description
sBarContent | STRING.
chartId | Index of the chart. INTEGER.
barId | Index of the bar within the given chart. INTEGER.
textId | The text id. INTEGER.


GetButtonIcon Method (SapToolbarControl)

Class

SapToolbarControl class

Action

the name of the icon of the specified toolbar button.

Syntax

sButtonIcon = toolbarControl.GetButtonIcon(buttonPosition)
Variable | Description
sButtonIcon | STRING.
buttonPosition | The zero-based button position. INTEGER.


GetButtonType Method (SapToolbarControl)

Class

SapToolbarControl class

Action

the type of the specified toolbar button. Possible values are: "Button", "ButtonAndMenu", "Menu", "Separator", "Group", "CheckBox".

Syntax

buttonType = toolbarControl.GetButtonType(buttonPosition)
Variable | Description
buttonType | TOOLBARBUTTONTYPE.
buttonPosition | The zero-based button position. INTEGER.


GetCellAbsolute Method (SapTable)

Class

SapTable class

Action

Returns a table cell. If the row is not visible, it will be scrolled into view.

Syntax

cellAbsolute = table.GetCellAbsolute(row, column)
Variable | Description
cellAbsolute | WINDOW.
row | Index of the row. The value is one-based. INTEGER.
column | Index of the column. The value is one-based. INTEGER.


GetCellColor Method (SapGridView)

Class

SapGridView class

Action

Returns an identifier for the color of the cell.

This can be used to retrieve the color information using GetColorInfo.

Syntax

gridView.GetCellColor(row, column)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCellHeight Method (SapGridView)

Class

SapGridView class

Action

Gets the height of the cell in pixels.

Syntax

iCellHeight = gridView.GetCellHeight(row, column)
Variable | Description
iCellHeight | INTEGER.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCellIcon Method (SapGridView)

Class

SapGridView class

Action

Gets the icon string of the specified cell.

Syntax

sCellIcon = gridView.GetCellIcon(row, column)
Variable | Description
sCellIcon | STRING.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCellLeft Method (SapGridView)

Class

SapGridView class

Action

Gets the left position of the cell.

Syntax

iCellLeft = gridView.GetCellLeft(row, column)
Variable | Description
iCellLeft | INTEGER.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCellMaxLength Method (SapGridView)

Class

SapGridView class

Action

Gets the maximum length of the cell in number of bytes.

Syntax

iCellMaxLength = gridView.GetCellMaxLength(row, column)
Variable | Description
iCellMaxLength | INTEGER.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCell Method (SapTable)

Class

SapTable class

Action

Returns a visible table cell.

Syntax

cell = table.GetCell(row, column)
Variable | Description
cell | WINDOW.
row | Index of the row, starting at the first visible row. The value is one-based. INTEGER.
column | Index of the column. The value is one-based. INTEGER.


GetCellsForRow Method (SapTable)

Class

SapTable class

Action

Returns the cells for the given row.

Syntax

liCellsForRow = table.GetCellsForRow(row)
Variable | Description
liCellsForRow | LIST OF WINDOW.
row | Index of the row. The value is one-based. INTEGER.


GetCellState Method (SapGridView)

Class

SapGridView class

Action

Gets the state of the specified cell. Possible values are: Normal, Error, Warning, Info.

Syntax

cellState = gridView.GetCellState(row, column)
Variable | Description
cellState | GRIDCELLSTATE.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCellTooltip Method (SapGridView)

Class

SapGridView class

Action

Gets the tooltip of the specified cell.

Syntax

sCellTooltip = gridView.GetCellTooltip(row, column)
Variable | Description
sCellTooltip | STRING.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCellTop Method (SapGridView)

Class

SapGridView class

Action

Gets the top position of the specified cell.

Syntax

iCellTop = gridView.GetCellTop(row, column)
Variable | Description
iCellTop | INTEGER.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCellType Method (SapGridView)

Class

SapGridView class

Action

Gets the cell type of the specified cell.

Syntax

cellType = gridView.GetCellType(row, column)
Variable | Description
cellType | GRIDCELLTYPE.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCellValue Method (SapGridView)

Class

SapGridView class

Action

Gets the value of the specified cell.

Syntax

sCellValue = gridView.GetCellValue(row, column)
Variable | Description
sCellValue | STRING.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCellWidth Method (SapGridView)

Class

SapGridView class

Action

Gets the width of the specified cell.

Syntax

iCellWidth = gridView.GetCellWidth(row, column)
Variable | Description
iCellWidth | INTEGER.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


GetCheckBoxState Method (SapTree)

Class

SapTree class

Action

Retrieves the CheckBox state (true = Checked, false = Unchecked).

Syntax

bCheckBoxState = tree.GetCheckBoxState(nodeKey, itemName)
Variable | Description
bCheckBoxState | BOOLEAN.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetColorInfo Method (SapGridView)

Class

SapGridView class

Action

Returns the description for the color of the cell.

This function will only return a value when the accessibility mode of SAP GUI is enabled.

Syntax

gridView.GetColorInfo(color)
Variable | Description
color | The color to get the description for. The value is one-based. INTEGER.


GetColumnDataType Method (SapGridView)

Class

SapGridView class

Action

Gets the data type of the column.

Syntax

sColumnDataType = gridView.GetColumnDataType(column)
Variable | Description
sColumnDataType | STRING.
column | Column identifier. STRING.


GetColumnIndexFromName Method (SapTree)

Class

SapTree class

Action

Gets the column index for the given name.

Syntax

columnIndexFromName = tree.GetColumnIndexFromName(columnName)
Variable | Description
columnIndexFromName | INTEGER.
columnName | The name of the column. STRING.


GetColumnKeys Method (SapTree)

Class

SapTree class

Action

The keys of all the items in the given column.

Syntax

liColumnKeys = tree.GetColumnKeys(column)
Variable | Description
liColumnKeys | LIST OF STRING.
column | The name of the column. STRING.


GetColumnPosition Method (SapGridView)

Class

SapGridView class

Action

Gets the position of the specified column.

Syntax

iColumnPosition = gridView.GetColumnPosition(column)
Variable | Description
iColumnPosition | INTEGER.
column | Column identifier. STRING.


GetColumnSortType Method (SapGridView)

Class

SapGridView class

Action

Gets the sort type of the column. Possible values are: None, Ascending, Descending.

Syntax

columnSortType = gridView.GetColumnSortType(column)
Variable | Description
columnSortType | GRIDCOLUMNSORTTYPE.
column | Column identifier. STRING.


GetColumnTitleFromName Method (SapTree)

Class

SapTree class

Action

Gets the column title for the given name.

Syntax

sColumnTitleFromName = tree.GetColumnTitleFromName(columnName)
Variable | Description
sColumnTitleFromName | STRING.
columnName | The name of the column. STRING.


GetColumnTitle Method (SapTable)

Class

SapTable class

Action

This method returns the title of the given column.

Syntax

sColumnTitle = table.GetColumnTitle(column)
Variable | Description
sColumnTitle | STRING.
column | Index of the column. The value is one-based. INTEGER.


GetColumnTitles Method (SapGridView)

Class

SapGridView class

Action

Gets all column titles of the specified column.

Syntax

liColumnTitles = gridView.GetColumnTitles(column)
Variable | Description
liColumnTitles | LIST OF STRING.
column | Column identifier. STRING.


GetColumnTooltip Method (SapGridView)

Class

SapGridView class

Action

Gets the tool tip text of the specified column.

Syntax

sColumnTooltip = gridView.GetColumnTooltip(column)
Variable | Description
sColumnTooltip | STRING.
column | Column identifier. STRING.


GetColumnTotalType Method (SapGridView)

Class

SapGridView class

Action

Gets the total type of the column. Possible values are: None, Total, Subtotal.

Syntax

columnTotalType = gridView.GetColumnTotalType(column)
Variable | Description
columnTotalType | GRIDCOLUMNTOTALTYPE.
column | Column identifier. STRING.


GetCurrentEntryKey Method (SapComboBox)

Class

SapComboBox class

Action

the key of the current entry.

Syntax

sCurrentEntryKey = comboBox.GetCurrentEntryKey()
Variable | Description
sCurrentEntryKey | STRING.


GetCurrentEntryValue Method (SapComboBox)

Class

SapComboBox class

Action

the value of the current entry.

Syntax

sCurrentEntryValue = comboBox.GetCurrentEntryValue()
Variable | Description
sCurrentEntryValue | STRING.


GetDisplayedColumnTitle Method (SapGridView)

Class

SapGridView class

Action

Gets the currently displayed title of the specified column.

Syntax

sDisplayedColumnTitle = gridView.GetDisplayedColumnTitle(column)
Variable | Description
sDisplayedColumnTitle | STRING.
column | Column identifier. STRING.


GetEntryKeys Method (SapComboBox)

Class

SapComboBox class

Action

a list of all entry keys.

Syntax

liEntryKeys = comboBox.GetEntryKeys()
Variable | Description
liEntryKeys | LIST OF STRING.


GetEntryValues Method (SapComboBox)

Class

SapComboBox class

Action

a list of all entry values.

Syntax

liEntryValues = comboBox.GetEntryValues()
Variable | Description
liEntryValues | LIST OF STRING.


GetGridLineContent Method (SapBarChart)

Class

SapBarChart class

Action

Returns the content of the grid line.

Syntax

sGridLineContent = barChart.GetGridLineContent(chartId, gridLineId, textId)
Variable | Description
sGridLineContent | STRING.
chartId | Index of the chart. INTEGER.
gridLineId | Index of the grid line within the given chart. INTEGER.
textId | The text id. INTEGER.


GetHierarchyLevel Method (SapTree)

Class

SapTree class

Action

Gets the hierarchy level for the given key.

Syntax

iHierarchyLevel = tree.GetHierarchyLevel(nodeKey)
Variable | Description
iHierarchyLevel | INTEGER.
nodeKey | The key of the node. STRING.


GetItemHeight Method (SapTree)

Class

SapTree class

Action

Returns the current item height.

Syntax

iItemHeight = tree.GetItemHeight(nodeKey, itemName)
Variable | Description
iItemHeight | INTEGER.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetItemLeft Method (SapTree)

Class

SapTree class

Action

The left position of the component.

Syntax

iItemLeft = tree.GetItemLeft(nodeKey, itemName)
Variable | Description
iItemLeft | INTEGER.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetItemStyle Method (SapTree)

Class

SapTree class

Action

The style of the given item.

Syntax

iItemStyle = tree.GetItemStyle(nodeKey, itemName)
Variable | Description
iItemStyle | INTEGER.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetItemTextColor Method (SapTree)

Class

SapTree class

Action

Returns the item text color.

Syntax

itemTextColor = tree.GetItemTextColor(nodeKey, itemName)
Variable | Description
itemTextColor | COLOR.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetItemText Method (SapTree)

Class

SapTree class

Action

For multi column trees, this function returns the text of the item specified by the key and name parameters.

Micro Focus generally recommends using SAPTree.GetNodeText() instead of SAPTree.GetItemText(), because it is easier to use, however SAPTree.GetNodeText() does not work for every SAPTree. For an example of how to use SapTree.GetItemText() for a multi colum list tree, see http://stackoverflow.com/questions/29741718/text-in-tree-does-not-match-text-which-is-displayed.

Syntax

sItemText = tree.GetItemText(nodeKey, itemName)
Variable | Description
sItemText | STRING.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetItemTooltip Method (SapTree)

Class

SapTree class

Action

Returns the item tooltip text.

Syntax

sItemTooltip = tree.GetItemTooltip(nodeKey, itemName)
Variable | Description
sItemTooltip | STRING.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetItemTop Method (SapTree)

Class

SapTree class

Action

The top position of the component.

Syntax

iItemTop = tree.GetItemTop(nodeKey, itemName)
Variable | Description
iItemTop | INTEGER.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetItemType Method (SapTree)

Class

SapTree class

Action

Returns the type of the given node.

Syntax

itemType = tree.GetItemType(nodeKey, itemName)
Variable | Description
itemType | ITEMTYPE.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetItemWidth Method (SapTree)

Class

SapTree class

Action

Returns the current item width.

Syntax

iItemWidth = tree.GetItemWidth(nodeKey, itemName)
Variable | Description
iItemWidth | INTEGER.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


GetLineText Method (SapTextEdit)

Class

SapTextEdit class

Action

Returns the text of the specified line.

Syntax

sLineText = textEdit.GetLineText(line)
Variable | Description
sLineText | STRING.
line | Index of the line. The value is one-based. INTEGER.


GetLinkContent Method (SapNetPlan)

Class

SapNetPlan class

Action

Returns the content of the link.

Syntax

sLinkContent = netPlan.GetLinkContent(linkId, textId)
Variable | Description
sLinkContent | STRING.
linkId | Index of the link. INTEGER.
textId | The text id. INTEGER.


GetListTreeNodeItemCount Method (SapTree)

Class

SapTree class

Action

Returns the node item count.

Syntax

iListTreeNodeItemCount = tree.GetListTreeNodeItemCount(nodeKey)
Variable | Description
iListTreeNodeItemCount | INTEGER.
nodeKey | The key of the node. STRING.


GetNextNodeKey Method (SapTree)

Class

SapTree class

Action

Returns the key of the next node.

Syntax

sNextNodeKey = tree.GetNextNodeKey(nodeKey)
Variable | Description
sNextNodeKey | STRING.
nodeKey | The key of the node. STRING.


GetNodeAbapImage Method (SapTree)

Class

SapTree class

Action

Returns the abap image for the given node.

Syntax

sNodeAbapImage = tree.GetNodeAbapImage(nodeKey)
Variable | Description
sNodeAbapImage | STRING.
nodeKey | The key of the node. STRING.


GetNodeChildrenCountByPath Method (SapTree)

Class

SapTree class

Action

This function returns the number of children of the node given by the path parameter (e.g. 2\1\2).

Syntax

iNodeChildrenCountByPath = tree.GetNodeChildrenCountByPath(path)
Variable | Description
iNodeChildrenCountByPath | INTEGER.
path | The node path. STRING.


GetNodeChildrenCount Method (SapTree)

Class

SapTree class

Action

This function returns the number of children of the node given.

Syntax

iNodeChildrenCount = tree.GetNodeChildrenCount(nodeKey)
Variable | Description
iNodeChildrenCount | INTEGER.
nodeKey | The key of the node. STRING.


GetNodeContent Method (SapNetPlan)

Class

SapNetPlan class

Action

Returns the content of the node.

Syntax

sNodeContent = netPlan.GetNodeContent(nodeId, textId)
Variable | Description
sNodeContent | STRING.
nodeId | Index of the node. INTEGER.
textId | The text id. INTEGER.


GetNodeHeight Method (SapTree)

Class

SapTree class

Action

The current height of the node.

Syntax

iNodeHeight = tree.GetNodeHeight(nodeKey)
Variable | Description
iNodeHeight | INTEGER.
nodeKey | The key of the node. STRING.


GetNodeIndex Method (SapTree)

Class

SapTree class

Action

The index of the given node.

Syntax

nodeIndex = tree.GetNodeIndex(nodeKey)
Variable | Description
nodeIndex | INTEGER.
nodeKey | The key of the node. STRING.


GetNodeItemHeaders Method (SapTree)

Class

SapTree class

Action

Returns the headers for the given node.

Syntax

liNodeItemHeaders = tree.GetNodeItemHeaders(nodeKey)
Variable | Description
liNodeItemHeaders | LIST OF STRING.
nodeKey | The key of the node. STRING.


GetNodeLeft Method (SapTree)

Class

SapTree class

Action

The left position of the component.

Syntax

iNodeLeft = tree.GetNodeLeft(nodeKey)
Variable | Description
iNodeLeft | INTEGER.
nodeKey | The key of the node. STRING.


GetNodePathByKey Method (SapTree)

Class

SapTree class

Action

Given a node key, the path is retrieved (e.g. 2\1\2).

Syntax

sNodePathByKey = tree.GetNodePathByKey(nodeKey)
Variable | Description
sNodePathByKey | STRING.
nodeKey | The key of the node. STRING.


GetNodeStyle Method (SapTree)

Class

SapTree class

Action

Returns the style of the node.

Syntax

iNodeStyle = tree.GetNodeStyle(nodeKey)
Variable | Description
iNodeStyle | INTEGER.
nodeKey | The key of the node. STRING.


GetNodeTextByPath Method (SapTree)

Class

SapTree class

Action

The text of a node defined by the given path is returned.

Syntax

sNodeTextByPath = tree.GetNodeTextByPath(path)
Variable | Description
sNodeTextByPath | STRING.
path | The node path. STRING.


GetNodeTextColor Method (SapTree)

Class

SapTree class

Action

Returns the node text color.

Syntax

iNodeTextColor = tree.GetNodeTextColor(nodeKey)
Variable | Description
iNodeTextColor | INTEGER.
nodeKey | The key of the node. STRING.


GetNodeText Method (SapTree)

Class

SapTree class

Action

This function returns the text of the node specified by the given key.

Syntax

sNodeText = tree.GetNodeText(nodeKey)
Variable | Description
sNodeText | STRING.
nodeKey | The key of the node. STRING.


GetNodeTooltip Method (SapTree)

Class

SapTree class

Action

Returns the node tooltip text.

Syntax

sNodeTooltip = tree.GetNodeTooltip(nodeKey)
Variable | Description
sNodeTooltip | STRING.
nodeKey | The key of the node. STRING.


GetNodeTop Method (SapTree)

Class

SapTree class

Action

The top position of the component.

Syntax

iNodeTop = tree.GetNodeTop(nodeKey)
Variable | Description
iNodeTop | INTEGER.
nodeKey | The key of the node. STRING.


GetNodeWidth Method (SapTree)

Class

SapTree class

Action

Returns the current node width.

Syntax

iNodeWidth = tree.GetNodeWidth(nodeKey)
Variable | Description
iNodeWidth | INTEGER.
nodeKey | The key of the node. STRING.


GetParentNodeKey Method (SapTree)

Class

SapTree class

Action

Key of the parent node of the node specified by the given key.

Syntax

sParentNodeKey = tree.GetParentNodeKey(nodeKey)
Variable | Description
sParentNodeKey | STRING.
nodeKey | The key of the node. STRING.


GetPreviousNodeKey Method (SapTree)

Class

SapTree class

Action

Key of the previous node of the node specified by the given key.

Syntax

sPreviousNodeKey = tree.GetPreviousNodeKey(nodeKey)
Variable | Description
sPreviousNodeKey | STRING.
nodeKey | The key of the node. STRING.


GetRowTotalLevel Method (SapGridView)

Class

SapGridView class

Action

Gets the level of the row.

Syntax

iRowTotalLevel = gridView.GetRowTotalLevel(row)
Variable | Description
iRowTotalLevel | INTEGER.
row | Index of the row. The value is one-based. INTEGER.


GetStyleDescription Method (SapTree)

Class

SapTree class

Action

Returns the description for the given style.

Syntax

sStyleDescription = tree.GetStyleDescription(style)
Variable | Description
sStyleDescription | STRING.
style | The style. INTEGER.


GetSubNodesKeys Method (SapTree)

Class

SapTree class

Action

Collection of the keys of all subnodes of the node specified by the given key.

Syntax

liSubNodesKeys = tree.GetSubNodesKeys(nodeKey)
Variable | Description
liSubNodesKeys | LIST OF STRING.
nodeKey | The key of the node. STRING.


GetSymbolInfo Method (SapGridView)

Class

SapGridView class

Action

Returns the description for the symbol in the cell.

This function will only return a value when the accessibility mode of SAP GUI is enabled.

Syntax

gridView.GetSymbolInfo(symbol)
Variable | Description
symbol | The symbolic value of the cell. STRING.


GetToolbarButtonIcon Method (SapGridView)

Class

SapGridView class

Action

Gets the name of the icon of the specified toolbar button.

Syntax

sToolbarButtonIcon = gridView.GetToolbarButtonIcon(buttonpos)
Variable | Description
sToolbarButtonIcon | STRING.
buttonpos | The position of the toolbar button. The value is one-based. INTEGER.


GetToolbarButtonId Method (SapGridView)

Class

SapGridView class

Action

Gets the ID of the specified tool bar button.

Syntax

sToolbarButtonId = gridView.GetToolbarButtonId(buttonpos)
Variable | Description
sToolbarButtonId | STRING.
buttonpos | The position of the tool bar button. The value is one-based. INTEGER.


GetToolbarButtonText Method (SapGridView)

Class

SapGridView class

Action

Gets the text of the specified tool bar button.

Syntax

sToolbarButtonText = gridView.GetToolbarButtonText(buttonpos)
Variable | Description
sToolbarButtonText | STRING.
buttonpos | The button position of the tool bar button. The value is one-based. INTEGER.


GetToolbarButtonTooltip Method (SapGridView)

Class

SapGridView class

Action

Gets the tooltip of the specified tool bar button.

Syntax

sToolbarButtonTooltip = gridView.GetToolbarButtonTooltip(buttonpos)
Variable | Description
sToolbarButtonTooltip | STRING.
buttonpos | The index of the tool bar button. The value is one-based. INTEGER.


GetToolbarButtonType Method (SapGridView)

Class

SapGridView class

Action

Gets the type of the specified toolbar button. Possible values are: "Button", "ButtonAndMenu", "Menu", "Separator", "Group", "CheckBox".

Syntax

toolbarButtonType = gridView.GetToolbarButtonType(buttonpos)
Variable | Description
toolbarButtonType | GRIDTOOLBARBUTTONTYPE.
buttonpos | The index of the tool bar button. The value is one-based. INTEGER.


GetToolbarFocusButton Method (SapGridView)

Class

SapGridView class

Action

Gets the position of the current focused tool bar button.

Syntax

iToolbarFocusButton = gridView.GetToolbarFocusButton()
Variable | Description
iToolbarFocusButton | INTEGER.


GetVisibleCellsForColumn Method (SapTable)

Class

SapTable class

Action

Returns the visible cells for the given column.

Syntax

liVisibleCellsForColumn = table.GetVisibleCellsForColumn(column)
Variable | Description
liVisibleCellsForColumn | LIST OF WINDOW.
column | Index of the column. The value is one-based. INTEGER.


GridCount Method (SapBarChart)

Class

SapBarChart class

Action

Returns the number of grids within the chart.

Syntax

iResult = barChart.GridCount(chartId)
Variable | Description
iResult | INTEGER.
chartId | Index of the chart. INTEGER.


GuiFocus Property (SapWindow)

Class

SapWindow class

Action

Gets the element within SAP GUI that currently has the focus.

Data Type

WINDOW

Access

Read only


HasCellF4Help Method (SapGridView)

Class

SapGridView class

Action

Returns true if the specified cell has a value help assigned.

Syntax

bCellF4Help = gridView.HasCellF4Help(row, column)
Variable | Description
bCellF4Help | BOOLEAN.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


HeaderContextMenu Method (SapTree)

Class

SapTree class

Action

This method requests a context menu for a header.

Syntax

tree.HeaderContextMenu(headerName)
Variable | Description
headerName | The name of the header. STRING.


Height Property (SapComponent)

Class

SapComponent class

Action

Gets the current height of the component.

Data Type

INTEGER

Access

Read only


HierarchyHeaderWidth Property (SapTree)

Class

SapTree class

Action

Gets the width of the hierarchy header in pixels.

Data Type

INTEGER

Access

Read only


HierarchyTitle Property (SapTree)

Class

SapTree class

Action

Gets the hierarchy title.

Data Type

STRING

Access

Read only


Highlighted Property (SapLabel)

Class

SapLabel class

Action

Gets whether the label has the 'highlighted' flag assigned.

Data Type

BOOLEAN

Access

Read only


IconName Property (SapComponent)

Class

SapComponent class

Action

Gets whether the object has been assigned an icon, then this property is the name of the icon, otherwise it is an empty string.

Data Type

STRING

Access

Read only


Icon Property (SapPicture)

Class

SapPicture class

Action

Gets the SAPGUI icon code e.g. ("@01@").

Data Type

STRING

Access

Read only


InsertRows Method (SapGridView)

Class

SapGridView class

Action

Inserts a range of rows.

The parameter rows is a comma-separated string of indices or index ranges, for example '3,5-8,14,15'. For any single index, a new row will be added at the given index, moving the old row one line down. If a range of indexes is inserted then all the new lines are inserted as a single block before any of the old lines. The entries must be ordered and the ranges must not overlap.

Syntax

gridView.InsertRows(rows)
Variable | Description
rows | The rows to insert. STRING.


IsBreakpointLine Method (SapTextEdit)

Class

SapTextEdit class

Action

whether the specified line contains a breakpoint.

Syntax

bBreakpointLine = textEdit.IsBreakpointLine(line)
Variable | Description
bBreakpointLine | BOOLEAN.
line | Index of the line. The value is one-based. INTEGER.


IsButtonChecked Method (SapToolbarControl)

Class

SapToolbarControl class

Action

if the button is currently checked (pressed).

Syntax

bButtonChecked = toolbarControl.IsButtonChecked(buttonPosition)
Variable | Description
bButtonChecked | BOOLEAN.
buttonPosition | The zero-based button position. INTEGER.


IsButtonEnabled Method (SapToolbarControl)

Class

SapToolbarControl class

Action

if the button can be pressed.

Syntax

bButtonEnabled = toolbarControl.IsButtonEnabled(buttonPosition)
Variable | Description
bButtonEnabled | BOOLEAN.
buttonPosition | The zero-based button position. INTEGER.


IsCellChangeable Method (SapGridView)

Class

SapGridView class

Action

Returns true if the specified cell is changeable.

Syntax

bCellChangeable = gridView.IsCellChangeable(row, column)
Variable | Description
bCellChangeable | BOOLEAN.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


IsCellCheckBoxChecked Method (SapGridView)

Class

SapGridView class

Action

Returns true if the check box at the specified position is checked.

Syntax

bCellCheckBoxChecked = gridView.IsCellCheckBoxChecked(row, column)
Variable | Description
bCellCheckBoxChecked | BOOLEAN.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


IsCellHotspot Method (SapGridView)

Class

SapGridView class

Action

Returns true if the cell is a link.

Syntax

bCellHotspot = gridView.IsCellHotspot(row, column)
Variable | Description
bCellHotspot | BOOLEAN.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


IsCellSymbol Method (SapGridView)

Class

SapGridView class

Action

Returns true if the text in the cell is displayed in the SAP symbol font.

Syntax

bCellSymbol = gridView.IsCellSymbol(row, column)
Variable | Description
bCellSymbol | BOOLEAN.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


IsCellTotalExpander Method (SapGridView)

Class

SapGridView class

Action

Returns true if the specified cell contains a total expander button.

Syntax

bCellTotalExpander = gridView.IsCellTotalExpander(row, column)
Variable | Description
bCellTotalExpander | BOOLEAN.
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


IsColumnFiltered Method (SapGridView)

Class

SapGridView class

Action

Returns true if the specified column is filtered.

Syntax

bColumnFiltered = gridView.IsColumnFiltered(column)
Variable | Description
bColumnFiltered | BOOLEAN.
column | Column identifier. STRING.


IsColumnKey Method (SapGridView)

Class

SapGridView class

Action

Returns true if the specified column is a key column.

Syntax

bColumnKey = gridView.IsColumnKey(column)
Variable | Description
bColumnKey | BOOLEAN.
column | Column identifier. STRING.


IsColumnSelected Method (SapTable)

Class

SapTable class

Action

Returns true if the given column is selected.

Syntax

bColumnSelected = table.IsColumnSelected(column)
Variable | Description
bColumnSelected | BOOLEAN.
column | Index of the column. The value is one-based. INTEGER.


IsCommentLine Method (SapTextEdit)

Class

SapTextEdit class

Action

Returns true if the specified line is a comment line.

Syntax

bCommentLine = textEdit.IsCommentLine(line)
Variable | Description
bCommentLine | BOOLEAN.
line | Index of the line. The value is one-based. INTEGER.


IsFocused Method (SapComponent)

Class

SapComponent class

Action

Return whether the control has focus.

Syntax

bFocused = component.IsFocused()
Variable | Description
bFocused | True if this object has the focus. BOOLEAN.


IsFolderExpandable Method (SapTree)

Class

SapTree class

Action

Whether the folder is expandable.

Syntax

bFolderExpandable = tree.IsFolderExpandable(nodeKey)
Variable | Description
bFolderExpandable | BOOLEAN.
nodeKey | The key of the node. STRING.


IsFolderExpanded Method (SapTree)

Class

SapTree class

Action

Whether the folder is expanded.

Syntax

bFolderExpanded = tree.IsFolderExpanded(nodeKey)
Variable | Description
bFolderExpanded | BOOLEAN.
nodeKey | The key of the node. STRING.


IsFolder Method (SapTree)

Class

SapTree class

Action

Whether the given node is a folder.

Syntax

bFolder = tree.IsFolder(nodeKey)
Variable | Description
bFolder | BOOLEAN.
nodeKey | The key of the node. STRING.


IsHighlightedLine Method (SapTextEdit)

Class

SapTextEdit class

Action

Returns true if the specified line is highlighted.

Syntax

bHighlightedLine = textEdit.IsHighlightedLine(line)
Variable | Description
bHighlightedLine | BOOLEAN.
line | Index of the line. The value is one-based. INTEGER.


IsHighLighted Method (SapTree)

Class

SapTree class

Action

Whether the node is highlighted.

Syntax

bHighLighted = tree.IsHighLighted(nodeKey, itemName)
Variable | Description
bHighLighted | BOOLEAN.
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


IsHotspot Property (SapLabel)

Class

SapLabel class

Action

Gets whether a mouse click on the label causes a round trip.

Data Type

BOOLEAN

Access

Read only


IsLeftLabel Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets whether the component has the 'assign left' flag.

Data Type

BOOLEAN

Access

Read only


IsLeftLabel Property (SapComboBox)

Class

SapComboBox class

Action

Gets whether the component has the 'assign left' flag.

Data Type

BOOLEAN

Access

Read only


IsLeftLabel Property (SapLabel)

Class

SapLabel class

Action

Gets whether the component has the 'assign left' flag assigned.

Data Type

BOOLEAN

Access

Read only


IsLeftLabel Property (SapRadioButton)

Class

SapRadioButton class

Action

Gets whether the component has the 'assign left' flag.

Data Type

BOOLEAN

Access

Read only


IsListBoxActive Property (SapComboBox)

Class

SapComboBox class

Action

Gets whether the list box of the the combo box is currently open.

Data Type

BOOLEAN

Access

Read only


IsListElement Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets whether the element is on an ABAP list, not a screen.

Data Type

BOOLEAN

Access

Read only


IsListElement Property (SapLabel)

Class

SapLabel class

Action

Gets whether the element is on an ABAP list.

Data Type

BOOLEAN

Access

Read only


IsPassword Property (SapTextField)

Class

SapTextField class

Action

Gets whether the text field is a password text field.

Data Type

BOOLEAN

Access

Read only


IsProtectedLine Method (SapTextEdit)

Class

SapTextEdit class

Action

Returns true if the specified line is protected.

Syntax

bProtectedLine = textEdit.IsProtectedLine(line)
Variable | Description
bProtectedLine | BOOLEAN.
line | Index of the line. The value is one-based. INTEGER.


IsRightLabel Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets whether the component has the 'assign right' flag.

Data Type

BOOLEAN

Access

Read only


IsRightLabel Property (SapComboBox)

Class

SapComboBox class

Action

Gets whether the component has the 'assign right' flag.

Data Type

BOOLEAN

Access

Read only


IsRightLabel Property (SapLabel)

Class

SapLabel class

Action

Gets whether the component has the 'assign right' flag assigned.

Data Type

BOOLEAN

Access

Read only


IsRightLabel Property (SapRadioButton)

Class

SapRadioButton class

Action

Gets whether the component has the 'assign right' flag.

Data Type

BOOLEAN

Access

Read only


IsRowSelected Method (SapTable)

Class

SapTable class

Action

Returns true if the given row is selected.

Syntax

bRowSelected = table.IsRowSelected(row)
Variable | Description
bRowSelected | BOOLEAN.
row | Index of the row. The value is one-based. INTEGER.


IsSymbolFont Property (SapComboBox)

Class

SapComboBox class

Action

Gets whether the component's text is visualized in the SAP symbol font.

Data Type

BOOLEAN

Access

Read only


IsSymbolFont Property (SapComponent)

Class

SapComponent class

Action

Gets whether the component's text is visualized in the SAP symbol font.

Data Type

BOOLEAN

Access

Read only


IsSymbolFont Property (SapMenu)

Class

SapMenu class

Action

Gets whether the component's text is visualized in the SAP symbol font.

Data Type

BOOLEAN

Access

Read only


IsToolbarButtonChecked Method (SapGridView)

Class

SapGridView class

Action

Returns true if the specified tool bar button is checked.

Syntax

bToolbarButtonChecked = gridView.IsToolbarButtonChecked(buttonpos)
Variable | Description
bToolbarButtonChecked | BOOLEAN.
buttonpos | The button index in the tool bar. The value is one-based. INTEGER.


IsToolbarButtonEnabled Method (SapGridView)

Class

SapGridView class

Action

Returns true if the specified button is enabled.

Syntax

bToolbarButtonEnabled = gridView.IsToolbarButtonEnabled(buttonpos)
Variable | Description
bToolbarButtonEnabled | BOOLEAN.
buttonpos | The button index in the tool bar. The value is one-based. INTEGER.


IsTotalRowExpanded Method (SapGridView)

Class

SapGridView class

Action

whether the specified total row is expanded.

Syntax

bTotalRowExpanded = gridView.IsTotalRowExpanded(row)
Variable | Description
bTotalRowExpanded | BOOLEAN.
row | Index of the row. The value is one-based. INTEGER.


IsVkeyAllowed Method (SapWindow)

Class

SapWindow class

Action

The method returns True if the given virtual key can be executed on the current screen.

Syntax

bVkeyAllowed = window.IsVkeyAllowed(vkey)
Variable | Description
bVkeyAllowed | BOOLEAN.
vkey | The key to evaluate. VKEY.


ItemContextMenu Method (SapTree)

Class

SapTree class

Action

This method requests a context menu for an item.

Syntax

tree.ItemContextMenu(nodeKey, itemName)
Variable | Description
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


JumpBackward Method (SapWindow)

Class

SapWindow class

Action

Execute the Ctrl+Shift+Tab key on the window to jump backward one block.

Syntax

window.JumpBackward()


JumpForward Method (SapWindow)

Class

SapWindow class

Action

Execute the Ctrl+Tab key on the window to jump forward one block.

Syntax

window.JumpForward()


Key Property (SapComboBox)

Class

SapComboBox class

Action

Gets the key of the currently selected item.

Data Type

STRING

Access

Read only


LastVisibleDate Property (SapCalendar)

Class

SapCalendar class

Action

Gets the last date visible in the calendar control.

Data Type

STRING

Access

Read only


LastVisibleLine Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the last visible line which is visualized at the bottom border of the text edit control. The value is one-based.

Data Type

INTEGER

Access

Read only


Left Property (SapComponent)

Class

SapComponent class

Action

Gets the left position of the element in screen coordinates.

Data Type

INTEGER

Access

Read only


LineCount Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the number of all lines in the text edit control.

Data Type

INTEGER

Access

Read only


LinkCount Method (SapBarChart)

Class

SapBarChart class

Action

Returns the number of links within the given chart.

Syntax

iResult = barChart.LinkCount(chartId)
Variable | Description
iResult | INTEGER.
chartId | Index of the chart. INTEGER.


LinkCount Property (SapNetPlan)

Class

SapNetPlan class

Action

Gets the number of links in the net.

Data Type

INTEGER

Access

Read only


Maximum Property (SapScrollbar)

Class

SapScrollbar class

Action

Gets the maximum scrollbar value.

Data Type

INTEGER

Access

Read only


Maxlength Property (SapLabel)

Class

SapLabel class

Action

Gets the maximum text length of the label in code units.

Data Type

INTEGER

Access

Read only


MessageId Property (SapStatusbar)

Class

SapStatusbar class

Action

Gets the name of the message class used in the ABAP message call.

Data Type

STRING

Access

Read only


MessageNumber Property (SapStatusbar)

Class

SapStatusbar class

Action

Gets the message number used in the ABAP message call.

Data Type

STRING

Access

Read only


MessageType Property (SapStatusbar)

Class

SapStatusbar class

Action

Gets the type of the displayed message in the statusbar, i.e. S (Success), W (Warning), E (Error), A (Abort), I (Information).

Data Type

STATUSBARMESSAGETYPE

Access

Read only


Minimum Property (SapScrollbar)

Class

SapScrollbar class

Action

Gets the minimum scrollbar value.

Data Type

INTEGER

Access

Read only


Modified Property (SapComponent)

Class

SapComponent class

Action

Gets whether the state has been changed by the user and this change has not yet been sent to the SAP system.

Data Type

BOOLEAN

Access

Read only


ModifyCell Method (SapGridView)

Class

SapGridView class

Action

Modifies the value of the specified cell.

Syntax

gridView.ModifyCell(row, column, value)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.
value | The new value of the cell. STRING.


ModifyCheckBox Method (SapGridView)

Class

SapGridView class

Action

Modifies the value of the specified checkbox cell.

Syntax

gridView.ModifyCheckBox(row, column, selected)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.
selected | Specifies if the check box should be selected. BOOLEAN.


Month Property (SapCalendar)

Class

SapCalendar class

Action

Gets the month of the year that is currently selected.

Data Type

INTEGER

Access

Read only


MoveRows Method (SapGridView)

Class

SapGridView class

Action

Moves the rows with an index greater than or equal to fromRow up to an index less than or equal to toRow to the position of destRow.

Syntax

gridView.MoveRows(fromRow, toRow, destRow)
Variable | Description
fromRow | Index of the first row of the selection. The value is one-based. INTEGER.
toRow | Index of the last row of the selection. The value is one-based. INTEGER.
destRow | Index of the destination to which the rows should be moved. The value is one-based. INTEGER.


Name Property (SapComponent)

Class

SapComponent class

Action

Gets the name of the component.

Data Type

STRING

Access

Read only


NodeContextMenu Method (SapTree)

Class

SapTree class

Action

This method requests a context menu for a node.

Syntax

tree.NodeContextMenu(nodeKey)
Variable | Description
nodeKey | The key of the node. STRING.


NodeCount Property (SapNetPlan)

Class

SapNetPlan class

Action

Gets the number of Nodes in the net.

Data Type

INTEGER

Access

Read only


NodeKeys Property (SapTree)

Class

SapTree class

Action

Gets a collection containing either the node key of the root node, or the node keys of all nodes in the tree, depending on the application.

Data Type

LIST OF STRING

Access

Read only


Numerical Property (SapLabel)

Class

SapLabel class

Action

Gets whether the label may only contain numbers.

Data Type

BOOLEAN

Access

Read only


Opened Property (SapOkCodeField)

Class

SapOkCodeField class

Action

Gets whether the GuiOkCodeField is collapsed.

Data Type

BOOLEAN

Access

Read only


Open Method (SapOkCodeField)

Class

SapOkCodeField class

Action

Expands the GuiOkCodeField.

Syntax

okCodeField.Open()


PageSize Property (SapScrollbar)

Class

SapScrollbar class

Action

Gets the scrollbar pagesize.

Data Type

INTEGER

Access

Read only


Position Property (SapScrollbar)

Class

SapScrollbar class

Action

Gets the current scrollbar position.

Data Type

INTEGER

Access

Read only


PressButtonCurrentCell Method (SapGridView)

Class

SapGridView class

Action

Clicks a button placed in the current cell.

Syntax

gridView.PressButtonCurrentCell()


PressButton Method (SapGridView)

Class

SapGridView class

Action

Presses the button placed in the specified cell.

Syntax

gridView.PressButton(row, column)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


PressColumnHeader Method (SapGridView)

Class

SapGridView class

Action

Clicks on the header of the specified column.

Syntax

gridView.PressColumnHeader(column)
Variable | Description
column | Column identifier. STRING.


PressContextButton Method (SapToolbarControl)

Class

SapToolbarControl class

Action

Press the context button with the given id.

Syntax

toolbarControl.PressContextButton(id)
Variable | Description
id | The id of the button. STRING.


PressEnter Method (SapGridView)

Class

SapGridView class

Action

Presses the enter key.

Syntax

gridView.PressEnter()


PressF1 Method (SapGridView)

Class

SapGridView class

Action

Presses the F1 key.

Syntax

gridView.PressF1()


PressF1 Method (SapOkCodeField)

Class

SapOkCodeField class

Action

Emulate pressing the F1 key while the focus is on the GuiOkCodeField.

Syntax

okCodeField.PressF1()


PressF1 Method (SapTextEdit)

Class

SapTextEdit class

Action

Presses the F1 key.

Syntax

textEdit.PressF1()


PressF4 Method (SapGridView)

Class

SapGridView class

Action

Presses the F4 key.

Syntax

gridView.PressF4()


PressF4 Method (SapTextEdit)

Class

SapTextEdit class

Action

Presses the F4 key.

Syntax

textEdit.PressF4()


PressKey Method (SapTree)

Class

SapTree class

Action

This method emulates pressing a key.

Syntax

tree.PressKey(key)
Variable | Description
key | Possible values are: F1, F4, Delete, Insert, Enter, Cut, Copy, and Paste. STRING.


PressToolbarButton Method (SapGridView)

Class

SapGridView class

Action

Clicks the specified button in the grid view's tool bar.

Syntax

gridView.PressToolbarButton(id)
Variable | Description
id | The id of the tool bar button. STRING.


PressToolbarContextButton Method (SapGridView)

Class

SapGridView class

Action

Opens the context menu of the specified button of the grid view's tool bar.

Syntax

gridView.PressToolbarContextButton(id)
Variable | Description
id | The id of the tool bar button. STRING.


PressTotalRowCurrentCell Method (SapGridView)

Class

SapGridView class

Action

Presses the expansion button on the current cell.

Syntax

gridView.PressTotalRowCurrentCell()


PressTotalRow Method (SapGridView)

Class

SapGridView class

Action

Presses the row button of the specified total row.

Syntax

gridView.PressTotalRow(row, column)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.
column | Column identifier. STRING.


ReorderTable Method (SapTable)

Class

SapTable class

Action

This method re-orders the columns.

Syntax

table.ReorderTable(permutation)
Variable | Description
permutation | Describes a new ordering of the columns. For example "1 3 2" will move column 3 to second position. STRING.


Required Property (SapComboBox)

Class

SapComboBox class

Action

Gets whether the component is a required value for the screen.

Data Type

BOOLEAN

Access

Read only


ResizeWorkingPaneEx Method (SapWindow)

Class

SapWindow class

Action

The ResizeWorkingPaneEx function will resize the window so that the available working area has the given width and height in pixels.

Syntax

window.ResizeWorkingPaneEx(width, height, throwOnFail)
Variable | Description
width | The new width of the working pane. INTEGER.
height | The new height of the working pane. INTEGER.
throwOnFail | Whether an exception should be thrown in case of an failure. BOOLEAN.


ResizeWorkingPane Method (SapWindow)

Class

SapWindow class

Action

The ResizeWorkingPane function will resize the window so that the available working area has the given width and height in character metric.

Syntax

window.ResizeWorkingPane(width, height, throwOnFail)
Variable | Description
width | The new width of the working pane. INTEGER.
height | The new height of the working pane. INTEGER.
throwOnFail | Whether an exception should be thrown in case of an failure. BOOLEAN.


RowCount Property (SapGridView)

Class

SapGridView class

Action

Gets the number of rows.

Data Type

INTEGER

Access

Read only


RowCount Property (SapTable)

Class

SapTable class

Action

Gets the number of rows in the table including invisible rows.

Data Type

INTEGER

Access

Read only


RowSelectionMode Property (SapTable)

Class

SapTable class

Action

Gets the row selection mode.

Data Type

TABLESELECTIONTYPE

Access

Read only


RowText Property (SapCheckBox)

Class

SapCheckBox class

Action

Gets the text of the while line containing the current component.

Data Type

STRING

Access

Read only


SapEvent Method (SapHTMLViewer)

Class

SapHTMLViewer class

Action

This function submits an HTML form to the backend.

Syntax

hTMLViewer.SapEvent(frameName, postData, url)
Variable | Description
frameName | This is the name of the frame in which the HTML form that has been submitted lives. STRING.
postData | Contains the form data when a submit is made using the POST method. STRING.
url | This is the URL which is submitted to the backend. The protocol name for the URL string is "sapevent:". This is followed by the name of the event as defined in the Action Property of the HTML form which is called. STRING.


ScreenLeft Property (SapComponent)

Class

SapComponent class

Action

Gets the left position of the component in screen coordinates.

Data Type

INTEGER

Access

Read only


ScreenTop Property (SapComponent)

Class

SapComponent class

Action

Gets the top position of the component in screen coordinates.

Data Type

INTEGER

Access

Read only


ScrollTo Method (SapScrollbar)

Class

SapScrollbar class

Action

Scrolls to the given position.

Syntax

scrollbar.ScrollTo(position)
Variable | Description
position | The position. INTEGER.


SelectAllColumns Method (SapTable)

Class

SapTable class

Action

This function can be used for table controls with a button that allows to select all columns in one step.

Syntax

table.SelectAllColumns()


SelectAll Method (SapGridView)

Class

SapGridView class

Action

Selects the whole grid content (i.e. all rows and all columns).

Syntax

gridView.SelectAll()


SelectButton Method (SapToolbarControl)

Class

SapToolbarControl class

Action

emulates pressing the button with the given id.

Syntax

toolbarControl.SelectButton(id)
Variable | Description
id | The id of the button. STRING.


SelectButton Method (SapTree)

Class

SapTree class

Action

This method emulates pressing a button.

Syntax

tree.SelectButton(nodeKey, itemName)
Variable | Description
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


SelectColumn Method (SapGridView)

Class

SapGridView class

Action

Adds the specified column to the list of the selected columns.

Syntax

gridView.SelectColumn(column)
Variable | Description
column | Column identifier. STRING.


SelectColumn Method (SapTable)

Class

SapTable class

Action

Selects the given column.

Syntax

table.SelectColumn(column)
Variable | Description
column | Index of the column. The value is one-based. INTEGER.


SelectColumn Method (SapTree)

Class

SapTree class

Action

This function adds a column to the column selection. A node or item selection is removed.

Syntax

tree.SelectColumn(columnName)
Variable | Description
columnName | The name of the column. STRING.


SelectContextMenuItemByPosition Method (SapBarChart)

Class

SapBarChart class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

barChart.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapCalendar)

Class

SapCalendar class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

calendar.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapChart)

Class

SapChart class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

chart.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapColorSelector)

Class

SapColorSelector class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

colorSelector.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapGridView)

Class

SapGridView class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

gridView.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapHTMLViewer)

Class

SapHTMLViewer class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

hTMLViewer.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapNetPlan)

Class

SapNetPlan class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

netPlan.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapOfficeIntegration)

Class

SapOfficeIntegration class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

officeIntegration.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapPicture)

Class

SapPicture class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

picture.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapToolbarControl)

Class

SapToolbarControl class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

toolbarControl.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapTree)

Class

SapTree class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

tree.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByPosition Method (SapUserArea)

Class

SapUserArea class

Action

This method allows you to select a context menu item using the position of the item.

Syntax

userArea.SelectContextMenuItemByPosition(positionDescription)
Variable | Description
positionDescription | A string containing the path to the item. If the context menu item is on the top level menu, this is just the zero-base index of the item. Otherwise, the positions on the menu and respective submenus should be concatenated, separated by "|". STRING.


SelectContextMenuItemByText Method (SapBarChart)

Class

SapBarChart class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

barChart.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapCalendar)

Class

SapCalendar class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

calendar.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapChart)

Class

SapChart class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

chart.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapColorSelector)

Class

SapColorSelector class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

colorSelector.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapGridView)

Class

SapGridView class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

gridView.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapHTMLViewer)

Class

SapHTMLViewer class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

hTMLViewer.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapNetPlan)

Class

SapNetPlan class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

netPlan.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapOfficeIntegration)

Class

SapOfficeIntegration class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

officeIntegration.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapPicture)

Class

SapPicture class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

picture.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapToolbarControl)

Class

SapToolbarControl class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

toolbarControl.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapTree)

Class

SapTree class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

tree.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItemByText Method (SapUserArea)

Class

SapUserArea class

Action

Select a menu item of a context menu using the text of the item and possible higher level menus.

Syntax

userArea.SelectContextMenuItemByText(text)
Variable | Description
text | The menu item text. STRING.


SelectContextMenuItem Method (SapBarChart)

Class

SapBarChart class

Action

Select an item from the controls context menu.

Syntax

barChart.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapCalendar)

Class

SapCalendar class

Action

Select an item from the controls context menu.

Syntax

calendar.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapChart)

Class

SapChart class

Action

Select an item from the controls context menu.

Syntax

chart.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapColorSelector)

Class

SapColorSelector class

Action

Select an item from the controls context menu.

Syntax

colorSelector.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapGridView)

Class

SapGridView class

Action

Select an item from the controls context menu.

Syntax

gridView.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapHTMLViewer)

Class

SapHTMLViewer class

Action

Select an item from the controls context menu.

Syntax

hTMLViewer.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapNetPlan)

Class

SapNetPlan class

Action

Select an item from the controls context menu.

Syntax

netPlan.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapOfficeIntegration)

Class

SapOfficeIntegration class

Action

Select an item from the controls context menu.

Syntax

officeIntegration.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapPicture)

Class

SapPicture class

Action

Select an item from the controls context menu.

Syntax

picture.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapToolbarControl)

Class

SapToolbarControl class

Action

Select an item from the controls context menu.

Syntax

toolbarControl.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapTree)

Class

SapTree class

Action

Select an item from the controls context menu.

Syntax

tree.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectContextMenuItem Method (SapUserArea)

Class

SapUserArea class

Action

Select an item from the controls context menu.

Syntax

userArea.SelectContextMenuItem(functionCode)
Variable | Description
functionCode | The function code. STRING.


SelectedCells Property (SapGridView)

Class

SapGridView class

Action

Gets a list of strings that contains the selected cells, each of which has the format "<row>,<column id>".

Data Type

LIST OF STRING

Access

Read only


SelectedColumns Property (SapGridView)

Class

SapGridView class

Action

Gets a list of strings of currently selected columns.

Data Type

LIST OF STRING

Access

Read only


SelectedItemColumn Property (SapTree)

Class

SapTree class

Action

Gets the key of the currently selected item column.

Data Type

STRING

Access

Read only


SelectedItemNode Property (SapTree)

Class

SapTree class

Action

Gets the key of the currently selected item node.

Data Type

STRING

Access

Read only


SelectedNode Property (SapTree)

Class

SapTree class

Action

Gets the key of the currently selected node.

Data Type

STRING

Access

Read only


SelectedNodes Property (SapTree)

Class

SapTree class

Action

Gets a collection containing the node keys of all the selected nodes in the tree.

Data Type

LIST OF STRING

Access

Read only


Selected Property (SapRadioButton)

Class

SapRadioButton class

Action

Gets whether the radio button is selected.

Data Type

BOOLEAN

Access

Read only


SelectedRows Property (SapGridView)

Class

SapGridView class

Action

Gets a comma separated list of row index numbers or index ranges, such as "1,4,6-8".

Data Type

STRING

Access

Read only


SelectedTab Property (SapTabStrip)

Class

SapTabStrip class

Action

Gets the current selected tab.

Data Type

WINDOW

Access

Read only


SelectedText Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the currently selected text.

Data Type

STRING

Access

Read only


SelectHeader Method (SapTree)

Class

SapTree class

Action

This method emulates clicking a header.

Syntax

tree.SelectHeader(headerName)
Variable | Description
headerName | The name of the header. STRING.


SelectionChanged Method (SapGridView)

Class

SapGridView class

Action

Notifies the server that the selection has changed.

Syntax

gridView.SelectionChanged()


SelectionEndColumn Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the column index in which the selection ends. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectionEndLine Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the line index in which the selection ends. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectionIndexEnd Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the overall end index of the text selection. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectionIndexStart Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the overall start index of the text selection. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectionInterval Property (SapCalendar)

Class

SapCalendar class

Action

Gets the interval that is currently selected.

Data Type

STRING

Access

Read only


SelectionMode Property (SapGridView)

Class

SapGridView class

Action

Gets the selection mode. Possible values are: "RowsAndColumns", "ListboxSingle", ListboxMultiple", "Free".

Data Type

GRIDSELECTIONMODE

Access

Read only


SelectionMode Property (SapTree)

Class

SapTree class

Action

Gets the selection mode.

Data Type

TREESELECTIONMODE

Access

Read only


SelectionStartColumn Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the column start index of the text selection. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectionStartLine Property (SapTextEdit)

Class

SapTextEdit class

Action

Gets the line index in which the selection starts. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectItem Method (SapComboBox)

Class

SapComboBox class

Action

Selects the specified item.

Syntax

comboBox.SelectItem(item)
Variable | Description
item | The item. STRING.


SelectItem Method (SapTree)

Class

SapTree class

Action

This function emulates the selection of an item. This selection removes all other selections.

Syntax

tree.SelectItem(nodeKey, itemName)
Variable | Description
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


SelectKey Method (SapComboBox)

Class

SapComboBox class

Action

Selects the list item with the specified key.

Syntax

comboBox.SelectKey(key)
Variable | Description
key | The key. STRING.


SelectLink Method (SapTree)

Class

SapTree class

Action

This function emulates triggering a link.

Syntax

tree.SelectLink(nodeKey, itemName)
Variable | Description
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.


SelectMenuItemByText Method (SapToolbarControl)

Class

SapToolbarControl class

Action

emulates selecting the menu item by menu item text.

Syntax

toolbarControl.SelectMenuItemByText(text)
Variable | Description
text | The text of the menu item. STRING.


SelectMenuItem Method (SapToolbarControl)

Class

SapToolbarControl class

Action

emulates selecting the menu item with the given id.

Syntax

toolbarControl.SelectMenuItem(id)
Variable | Description
id | The id of the menu. STRING.


Select Method (SapButton)

Class

SapButton class

Action

This emulates manually pressing a button. Pressing a button will always cause server communication to occur, rendering all references to elements below the window level invalid.

Syntax

button.Select()


Select Method (SapMenu)

Class

SapMenu class

Action

Select the menu.

Syntax

menu.Select()


Select Method (SapRadioButton)

Class

SapRadioButton class

Action

Selects the radio button.

Syntax

radioButton.Select()


Select Method (SapTab)

Class

SapTab class

Action

Selects the tab.

Syntax

tab.Select()


SelectNode Method (SapTree)

Class

SapTree class

Action

The node with the key nodeKey is added to the Node Selection.

Syntax

tree.SelectNode(nodeKey)
Variable | Description
nodeKey | The key of the node. STRING.


SelectRow Method (SapTable)

Class

SapTable class

Action

Selects the given row.

Syntax

table.SelectRow(row)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.


SelectToolbarMenuItem Method (SapGridView)

Class

SapGridView class

Action

Selects an item from the context menu of the grid view's tool bar.

Syntax

gridView.SelectToolbarMenuItem(id)
Variable | Description
id | The id of the menu item. STRING.


SendData Method (SapBarChart)

Class

SapBarChart class

Action

Send data to the server.

Syntax

barChart.SendData(data)
Variable | Description
data | The data to be send. STRING.


SendData Method (SapNetPlan)

Class

SapNetPlan class

Action

This function emulates the output of each action triggered at the control side. The result of the action is sent to the server.

It is currently not possible to select - deselect single objects at the client-side and to replay/script these "local" actions.

Syntax

netPlan.SendData(data)
Variable | Description
data | The data to be send. STRING.


SendVKey Method (SapWindow)

Class

SapWindow class

Action

Send a virtual key to the system.

Syntax

window.SendVKey(vkey)
Variable | Description
vkey | The virtual key to send. VKEY.


SetCheckBoxState Method (SapTree)

Class

SapTree class

Action

Changes the state of the checkbox in the given node.

Syntax

tree.SetCheckBoxState(nodeKey, itemName, check)
Variable | Description
nodeKey | The key of the node. STRING.
itemName | The name of the item. STRING.
check | The new checkbox state. BOOLEAN.


SetColumnOrder Method (SapGridView)

Class

SapGridView class

Action

Sets the order of the columns.

Syntax

gridView.SetColumnOrder(columns)
Variable | Description
columns | A list of column identifiers in the desired order. LIST OF STRING.


SetColumnOrder Method (SapTree)

Class

SapTree class

Action

Sets the order of the tree's column.

Syntax

tree.SetColumnOrder(columns)
Variable | Description
columns | A list of the column titles in the desired order. Each title must not occur more than once. LIST OF STRING.


SetColumnWidth Method (SapGridView)

Class

SapGridView class

Action

Sets the width of the specified column.

Syntax

gridView.SetColumnWidth(column, width)
Variable | Description
column | Column identifier. STRING.
width | Width. INTEGER.


SetColumnWidth Method (SapTree)

Class

SapTree class

Action

This function sets the width of a column in pixels.

Syntax

tree.SetColumnWidth(columnName, width)
Variable | Description
columnName | The name of the column. STRING.
width | The new width of the column. INTEGER.


SetCurrentCellColumn Method (SapGridView)

Class

SapGridView class

Action

Specifies the column of the current cell.

Syntax

gridView.SetCurrentCellColumn(column)
Variable | Description
column | Column identifier. STRING.


SetCurrentCell Method (SapGridView)

Class

SapGridView class

Action

Sets the specified cell as the current cell.

Syntax

gridView.SetCurrentCell(row, column)
Variable | Description
row | Index of the row. INTEGER.
column | Column identifier. STRING.


SetCurrentCellRow Method (SapGridView)

Class

SapGridView class

Action

Sets the row of the current cell.

Syntax

gridView.SetCurrentCellRow(row)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.


SetFirstVisibleColumn Method (SapGridView)

Class

SapGridView class

Action

Sets the first visible column.

Syntax

gridView.SetFirstVisibleColumn(column)
Variable | Description
column | Column identifier. STRING.


SetFirstVisibleDate Method (SapCalendar)

Class

SapCalendar class

Action

Sets the earliest date visible in the calendar control.

Syntax

calendar.SetFirstVisibleDate(firstVisibleDate)
Variable | Description
firstVisibleDate | The date as string. example: "20020228". STRING.


SetFirstVisibleRow Method (SapGridView)

Class

SapGridView class

Action

Sets the first visible row.

Syntax

gridView.SetFirstVisibleRow(row)
Variable | Description
row | Index of the row. The value is one-based. INTEGER.


SetFocusDate Method (SapCalendar)

Class

SapCalendar class

Action

Sets the date to be focused.

Syntax

calendar.SetFocusDate(focusDate)
Variable | Description
focusDate | The date to be focused as string (YYYYMMDD). STRING.


SetFocus Method (SapComponent)

Class

SapComponent class

Action

Gives focus to the control.

Syntax

component.SetFocus()


SetHierarchyHeaderWidth Method (SapTree)

Class

SapTree class

Action

Sets the width of the Hierarchy Header in pixels.

Syntax

tree.SetHierarchyHeaderWidth(width)
Variable | Description
width | The new width of the header. INTEGER.


SetPasswordText Method (SapTextField)

Class

SapTextField class

Action

Sends an encrypted password to the object.

Syntax

textField.SetPasswordText(password)
Variable | Description
password | The encrypted password. STRING.


SetSelectedNode Method (SapTree)

Class

SapTree class

Action

Select the given node.

Syntax

tree.SetSelectedNode(nodeKey)
Variable | Description
nodeKey | The key of the node. STRING.


SetSelectedRows Method (SapGridView)

Class

SapGridView class

Action

Selects the specified rows.

Syntax

gridView.SetSelectedRows(rows)
Variable | Description
rows | Specifies the rows as comma separated list of row index or index ranges, e.g. "1,3,6-8". STRING.


SetSelectionIndexes Method (SapTextEdit)

Class

SapTextEdit class

Action

Selects the text within the specified range.

Syntax

textEdit.SetSelectionIndexes(start, end)
Variable | Description
start | Start index (inclusive). The value is one-based. INTEGER.
end | End index (exclusive). The value is one-based. INTEGER.


SetSelectionInterval Method (SapCalendar)

Class

SapCalendar class

Action

Selects the specified interval.

Syntax

calendar.SetSelectionInterval(interval)
Variable | Description
interval | The interval represented by two concatenated date strings (YYYYMMDD) separated by a comma. STRING.


SetText Method (SapOkCodeField)

Class

SapOkCodeField class

Action

Sets the text of the control to the specified text.

Syntax

okCodeField.SetText(text)
Variable | Description
text | New text of the text component. STRING.


SetText Method (SapTextEdit)

Class

SapTextEdit class

Action

Sets the specified text in the text edit control.

Syntax

textEdit.SetText(text)
Variable | Description
text | Text. STRING.


SetText Method (SapTextField)

Class

SapTextField class

Action

Sets the text of the control to the specified text.

Syntax

textField.SetText(text)
Variable | Description
text | New text of the text component. STRING.


SetTopNode Method (SapTree)

Class

SapTree class

Action

Sets the given key as top node.

Syntax

tree.SetTopNode(nodeKey)
Variable | Description
nodeKey | The key of the node. STRING.


ShowContextMenu Method (SapComponent)

Class

SapComponent class

Action

Shows the context menu of the control.

Syntax

component.ShowContextMenu()


StartSelection Property (SapCalendar)

Class

SapCalendar class

Action

Gets the start of the selection interval.

Data Type

STRING

Access

Read only


StatusbarVisible Property (SapWindow)

Class

SapWindow class

Action

Gets whether the statusbar is visible.

Data Type

BOOLEAN

Access

Read only


SystemFocus Property (SapWindow)

Class

SapWindow class

Action

Gets the element within SAP GUI that has the focus from the server application's perspective.

Data Type

WINDOW

Access

Read only


TabBackward Method (SapWindow)

Class

SapWindow class

Action

Execute the Shift+Tab key on the window to jump backward one element.

Syntax

window.TabBackward()


TabForward Method (SapWindow)

Class

SapWindow class

Action

Execute the Tab key on the window to jump forward one element.

Syntax

window.TabForward()


TableFieldName Property (SapTable)

Class

SapTable class

Action

Gets the table field name.

Data Type

STRING

Access

Read only


Tabs Property (SapTabStrip)

Class

SapTabStrip class

Action

Gets all tabs of the tab pane.

Data Type

LIST OF WINDOW

Access

Read only


TitlebarVisible Property (SapWindow)

Class

SapWindow class

Action

Gets whether the titlebar is visible.

Data Type

BOOLEAN

Access

Read only


Title Property (SapGridView)

Class

SapGridView class

Action

Gets the title of the grid control.

Data Type

STRING

Access

Read only


ToolbarButtonCount Property (SapGridView)

Class

SapGridView class

Action

Gets the number of tool bar buttons (separators included).

Data Type

INTEGER

Access

Read only


ToolbarVisible Property (SapWindow)

Class

SapWindow class

Action

Gets whether the toolbar is visible.

Data Type

BOOLEAN

Access

Read only


Tooltip Property (SapComponent)

Class

SapComponent class

Action

Gets the tooltip text.

Data Type

STRING

Access

Read only


TopNode Property (SapTree)

Class

SapTree class

Action

Gets the key of the top node.

Data Type

STRING

Access

Read only


Top Property (SapComponent)

Class

SapComponent class

Action

Gets the top coordinate of the element in screen coordinates.

Data Type

INTEGER

Access

Read only


TreeType Property (SapTree)

Class

SapTree class

Action

Gets the tree type. (simple tree, list tree or column tree).

Data Type

TREETYPE

Access

Read only


TriggerModified Method (SapGridView)

Class

SapGridView class

Action

Notifies the server of multiple changes in cells. Typically this method should be called after multiple calls to ModifyCell.

Syntax

gridView.TriggerModified()


Uncheck Method (SapCheckBox)

Class

SapCheckBox class

Action

Un-checks the check box.

Syntax

checkBox.Uncheck()


UnselectAll Method (SapTree)

Class

SapTree class

Action

All selections are removed.

Syntax

tree.UnselectAll()


UnselectColumn Method (SapTree)

Class

SapTree class

Action

This function removes a column from the column selection.

Syntax

tree.UnselectColumn(columnName)
Variable | Description
columnName | The name of the column. STRING.


UnselectNode Method (SapTree)

Class

SapTree class

Action

The node with the key nodeKey is removed from the Node Selection.

Syntax

tree.UnselectNode(nodeKey)
Variable | Description
nodeKey | The key of the node. STRING.


Url Property (SapPicture)

Class

SapPicture class

Action

Gets the URL of the picture.

Data Type

STRING

Access

Read only


ValueChange Method (SapChart)

Class

SapChart class

Action

Changes a value of the chart.

Syntax

chart.ValueChange(series, point, xValue, yValue, dataChange, id, zValue, changeFlag)
Variable | Description
series | Number of the data set within the row that should be changed. INTEGER.
point | Number of the data point within the row that should be changed. INTEGER.
xValue | New x value. REAL.
yValue | New y value. REAL.
dataChange | Setting this parameter to True means the value was not changed interactively within the graphic but rather by entering the new value on the DataPoint property page. BOOLEAN.
id | GFW data container id of the changed point. STRING.
zValue | New z value. REAL.
changeFlag | Notify which value was changed or if it was a time value. CHARTCHANGEFLAG.


Value Property (SapComboBox)

Class

SapComboBox class

Action

Gets the currently selected item.

Data Type

STRING

Access

Read only


VisibleRowCount Property (SapGridView)

Class

SapGridView class

Action

Gets the number of visible rows of the grid view.

Data Type

INTEGER

Access

Read only


VisibleRowCount Property (SapTable)

Class

SapTable class

Action

Gets the number of visible rows in the table.

Data Type

INTEGER

Access

Read only


Week Property (SapCalendar)

Class

SapCalendar class

Action

Gets the week of the year that is currently selected.

Data Type

INTEGER

Access

Read only


Width Property (SapComponent)

Class

SapComponent class

Action

Gets the current width of the component.

Data Type

INTEGER

Access

Read only


WindowHandle Property (SapBarChart)

Class

SapBarChart class

Action

Gets the window handle of the control that is connected to the GuiShell.

Data Type

INTEGER

Access

Read only


WindowHandle Property (SapChart)

Class

SapChart class

Action

Gets the window handle of the control that is connected to the GuiShell.

Data Type

INTEGER

Access

Read only


WindowHandle Property (SapHTMLViewer)

Class

SapHTMLViewer class

Action

Gets the window handle of the control that is connected to the GuiShell.

Data Type

INTEGER

Access

Read only


WindowHandle Property (SapNetPlan)

Class

SapNetPlan class

Action

Gets the window handle of the control that is connected to the GuiShell.

Data Type

INTEGER

Access

Read only


WindowHandle Property (SapToolbarControl)

Class

SapToolbarControl class

Action

Gets the window handle of the control that is connected to the GuiShell.

Data Type

INTEGER

Access

Read only


WindowHandle Property (SapWindow)

Class

SapWindow class

Action

Gets the window handle of the control that is connected to the GuiShell.

Data Type

INTEGER

Access

Read only


WindowState Property (SapWindow)

Class

SapWindow class

Action

Gets the state of a window. Values include: 1=minimized, 2=maximized, 3=restored.

Data Type

INTEGER

Access

Read only


WorkingPaneHeight Property (SapWindow)

Class

SapWindow class

Action

Gets the current height of the working pane.

Data Type

INTEGER

Access

Read only


WorkingPaneWidth Property (SapWindow)

Class

SapWindow class

Action

Gets the current width of the working pane.

Data Type

INTEGER

Access

Read only


Year Property (SapCalendar)

Class

SapCalendar class

Action

Gets the year that is currently selected.

Data Type

INTEGER

Access

Read only


AutomationId Property (SLBase)

Class

SLBase class

Action

Gets a string containing the UI Automation identifier (ID) for the element.

Data Type

STRING

Access

Read only


CanSelectMultiple Property (SLCalendar)

Class

SLCalendar class

Action

Gets whether multiple dates can be selected.

Data Type

BOOLEAN

Access

Read only


CanSelectMultiple Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets whether the data grid allows more than one row to be selected concurrently.

Data Type

BOOLEAN

Access

Read only


CanSelectMultiple Property (SLListBox)

Class

SLListBox class

Action

Gets whether the list box allows more than one child element to be selected concurrently.

Data Type

BOOLEAN

Access

Read only


Cells Property (SLDataGridRow)

Class

SLDataGridRow class

Action

Gets the cells of the data grid row.

Data Type

LIST OF WINDOW

Access

Read only


CellTexts Property (SLDataGridRow)

Class

SLDataGridRow class

Action

Gets the text of the cells of the data grid row.

Data Type

LIST OF STRING

Access

Read only


Check Method (SLCheckBox)

Class

SLCheckBox class

Action

Checks the check box.

Syntax

checkBox.Check()


ClassName Property (SLBase)

Class

SLBase class

Action

Gets the simple class name of the element.

Data Type

STRING

Access

Read only


Clear Method (SLPasswordBox)

Class

SLPasswordBox class

Action

Removes all text from the password field.

Syntax

passwordBox.Clear()


Clear Method (SLRichTextBox)

Class

SLRichTextBox class

Action

Removes all text from the text box.

Syntax

richTextBox.Clear()


Clear Method (SLTextBox)

Class

SLTextBox class

Action

Removes all text from the text field.

Syntax

textBox.Clear()


CloseCalendar Method (SLDatePicker)

Class

SLDatePicker class

Action

Closes the drop-down Calendar.

Syntax

datePicker.CloseCalendar()


Close Method (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Closes the drop-down list that contains the matches if it is currently open.

Syntax

autoCompleteBox.Close()


Close Method (SLComboBox)

Class

SLComboBox class

Action

Closes the combo box.

Syntax

comboBox.Close()


Close Method (SLWindow)

Class

SLWindow class

Action

Closes the window.

Syntax

window.Close()


Collapse Method (SLTreeView)

Class

SLTreeView class

Action

Collapses the specified item.

Syntax

treeView.Collapse(item)
Variable | Description
item | The item to collapse. LISTITEM.


Collapse Method (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Collapses the item.

Syntax

treeViewItem.Collapse()


ColumnCount Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets the number of columns in the data grid.

Data Type

INTEGER

Access

Read only


ColumnHeaders Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets a list containing the header item for every column.

Data Type

LIST OF WINDOW

Access

Read only


ColumnHeaderTexts Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets a list containing the text of the header item for every column.

Data Type

LIST OF STRING

Access

Read only


CurrentPage Property (SLDataPager)

Class

SLDataPager class

Action

Gets the current page.

Data Type

INTEGER

Access

Read only


DecreaseLarge Method (SLSlider)

Class

SLSlider class

Action

Decreases the value of the Slider by a large amount.

Syntax

slider.DecreaseLarge()


DecreaseSmall Method (SLSlider)

Class

SLSlider class

Action

Decreases the value of the Slider by a small amount.

Syntax

slider.DecreaseSmall()


DeselectAll Method (SLListBox)

Class

SLListBox class

Action

Deselects all list items.

Syntax

listBox.DeselectAll()


Deselect Method (SLListItem)

Class

SLListItem class

Action

Deselects the item.

Syntax

listItem.Deselect()


DisplayMode Property (SLCalendar)

Class

SLCalendar class

Action

Gets a value that indicates whether the calendar displays a month, year, or decade.

Data Type

SLCALENDARMODE

Access

Read only


ExpandAll Method (SLTreeView)

Class

SLTreeView class

Action

Expands all items in the tree.

Syntax

treeView.ExpandAll()


Expand Method (SLTreeView)

Class

SLTreeView class

Action

Expands the specified item.

Syntax

treeView.Expand(item)
Variable | Description
item | The item to expand. LISTITEM.


Expand Method (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Expands the item.

Syntax

treeViewItem.Expand()


ExpandSubTree Method (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Expands the sub tree under this tree item.

Syntax

treeViewItem.ExpandSubTree()


GetRawChildren Method (SLBase)

Class

SLBase class

Action

Gets the raw child element of this element. This method can be used to access elements that would otherwise not be recognized as children. Optionally one of the MSUIA control types can be specified to only return children of a certain type.

Syntax

liRawChildren = base.GetRawChildren([automationControlType])
Variable | Description
liRawChildren | LIST OF WINDOW.
automationControlType | Optional.optionally specifies that only children with this control type should be retrieved. STRING.

Examples

In order to get all raw children of an element:
slBase.GetRawChildren()
In order to get only children of a certain control type. For a list of control types have a look at the control types provided by the MSUIA.
slBase.GetRawChildren("Text")


HeaderItems Property (SLHeader)

Class

SLHeader class

Action

Gets a list containing the header items of this header control.

Data Type

LIST OF WINDOW

Access

Read only


HorizontallyScrollable Property (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Gets a value that indicates whether the combo box can scroll horizontally.

Data Type

BOOLEAN

Access

Read only


HorizontallyScrollable Property (SLComboBox)

Class

SLComboBox class

Action

Gets a value that indicates whether the combo box can scroll horizontally.

Data Type

BOOLEAN

Access

Read only


HorizontallyScrollable Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets a value that indicates whether the data grid can scroll horizontally.

Data Type

BOOLEAN

Access

Read only


HorizontallyScrollable Property (SLListBox)

Class

SLListBox class

Action

Gets a value that indicates whether the list box can scroll horizontally.

Data Type

BOOLEAN

Access

Read only


HorizontallyScrollable Property (SLPane)

Class

SLPane class

Action

Gets a value that indicates whether the pane can scroll horizontally.

Data Type

BOOLEAN

Access

Read only


HorizontallyScrollable Property (SLTreeView)

Class

SLTreeView class

Action

Gets a value that indicates whether the tree view can scroll horizontally.

Data Type

BOOLEAN

Access

Read only


HorizontalScrollPercent Property (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Gets the current horizontal scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


HorizontalScrollPercent Property (SLComboBox)

Class

SLComboBox class

Action

Gets the current horizontal scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


HorizontalScrollPercent Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets the current horizontal scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


HorizontalScrollPercent Property (SLListBox)

Class

SLListBox class

Action

Gets the current horizontal scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


HorizontalScrollPercent Property (SLPane)

Class

SLPane class

Action

Gets the current horizontal scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


HorizontalScrollPercent Property (SLTreeView)

Class

SLTreeView class

Action

Gets the current horizontal scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


IncreaseLarge Method (SLSlider)

Class

SLSlider class

Action

Increases the value of the Slider by a large amount.

Syntax

slider.IncreaseLarge()


IncreaseSmall Method (SLSlider)

Class

SLSlider class

Action

Increases the value of the Slider by a small amount.

Syntax

slider.IncreaseSmall()


IsCalendarOpen Property (SLDatePicker)

Class

SLDatePicker class

Action

Gets a value whether the drop-down Calendar is open.

Data Type

BOOLEAN

Access

Read only


IsEnabled Property (SLBase)

Class

SLBase class

Action

Gets a value that indicates whether the element is enabled.

Data Type

BOOLEAN

Access

Read only


IsExpanded Property (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Gets a value that indicates whether the nested items in a tree item are expanded or collapsed.

Data Type

BOOLEAN

Access

Read only


IsFocused Method (SLBase)

Class

SLBase class

Action

Return whether the control has focus.

Syntax

bFocused = base.IsFocused()
Variable | Description
bFocused | True if this object has the focus. BOOLEAN.


IsLeaf Property (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Gets a value that indicates whether the tree view item is a leaf item.

Data Type

BOOLEAN

Access

Read only


IsOpen Property (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Gets a value that indicates whether the auto complete box is open.

Data Type

BOOLEAN

Access

Read only


IsOpen Property (SLComboBox)

Class

SLComboBox class

Action

Gets a value that indicates whether the combo box is open.

Data Type

BOOLEAN

Access

Read only


IsReadOnly Property (SLPasswordBox)

Class

SLPasswordBox class

Action

Gets whether the password box is read-only.

Data Type

BOOLEAN

Access

Read only


IsReadOnly Property (SLTextBox)

Class

SLTextBox class

Action

Gets whether the text box is read-only.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (SLCalendarButton)

Class

SLCalendarButton class

Action

Gets a value that indicates whether the calendar button is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (SLCalendarDayButton)

Class

SLCalendarDayButton class

Action

Gets a value that indicates whether the calendar day button is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (SLComboBoxItem)

Class

SLComboBoxItem class

Action

Gets a value that indicates whether the combo box item is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (SLDataGridCell)

Class

SLDataGridCell class

Action

Gets a value that indicates whether the cell is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (SLDataGridRow)

Class

SLDataGridRow class

Action

Gets a value that indicates whether the row is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (SLListItem)

Class

SLListItem class

Action

Gets a value that indicates whether the list item is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (SLRadioButton)

Class

SLRadioButton class

Action

Gets a value that indicates whether the radio button is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (SLTabItem)

Class

SLTabItem class

Action

Gets a value that indicates whether the tab item is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Gets a value that indicates whether a tree item is selected.

Data Type

BOOLEAN

Access

Read only


IsSelectionRequired Property (SLCalendar)

Class

SLCalendar class

Action

Gets whether at least one date has to be selected.

Data Type

BOOLEAN

Access

Read only


Items Property (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Gets a list containing items of the current matches. If nothing was entered in the control's text box an empty list is returned.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (SLComboBox)

Class

SLComboBox class

Action

Gets a complete list of items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (SLListBox)

Class

SLListBox class

Action

Gets the list of list box items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (SLTabControl)

Class

SLTabControl class

Action

Gets a complete list of tab items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Gets a complete list of items.

Data Type

LIST OF WINDOW

Access

Read only


ItemTexts Property (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Gets a list containing the texts of the current matches. If nothing was entered in the control's text box an empty list is returned.

Data Type

LIST OF STRING

Access

Read only


ItemTexts Property (SLComboBox)

Class

SLComboBox class

Action

Gets a complete list of item texts.

Data Type

LIST OF STRING

Access

Read only

Examples

comboBox.Open()
LIST OF STRING items = comboBox.ItemTexts
comboBox.Close()


ItemTexts Property (SLListBox)

Class

SLListBox class

Action

Gets the list of all item texts.

Data Type

LIST OF STRING

Access

Read only


ItemTexts Property (SLTabControl)

Class

SLTabControl class

Action

Gets a complete list of tab item texts.

Data Type

LIST OF STRING

Access

Read only


ItemTexts Property (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Gets a complete list of item texts.

Data Type

LIST OF STRING

Access

Read only


LargeChange Property (SLSlider)

Class

SLSlider class

Action

Gets the value that is added to or subtracted from the Value property when a large change is made, such as with the PAGE DOWN key.

Data Type

REAL

Access

Read only


Maximum Property (SLHorizontalScrollBar)

Class

SLHorizontalScrollBar class

Action

Gets the maximum scroll position.

Data Type

REAL

Access

Read only


Maximum Property (SLProgressBar)

Class

SLProgressBar class

Action

Gets the maximum progress value.

Data Type

REAL

Access

Read only


Maximum Property (SLSlider)

Class

SLSlider class

Action

Gets the maximum progress value.

Data Type

REAL

Access

Read only


Maximum Property (SLVerticalScrollBar)

Class

SLVerticalScrollBar class

Action

Gets the maximum scroll position.

Data Type

REAL

Access

Read only


Minimum Property (SLHorizontalScrollBar)

Class

SLHorizontalScrollBar class

Action

Gets the minimum scroll position.

Data Type

REAL

Access

Read only


Minimum Property (SLProgressBar)

Class

SLProgressBar class

Action

Gets the minimum progress value.

Data Type

REAL

Access

Read only


Minimum Property (SLSlider)

Class

SLSlider class

Action

Gets the minimum progress value.

Data Type

REAL

Access

Read only


Minimum Property (SLVerticalScrollBar)

Class

SLVerticalScrollBar class

Action

Gets the minimum scroll position.

Data Type

REAL

Access

Read only


MoveHorizontal Method (SLGridSplitter)

Class

SLGridSplitter class

Action

Moves the splitter horizontally.

Syntax

gridSplitter.MoveHorizontal(value)
Variable | Description
value | The amount of pixel to move the splitter. REAL.


Move Method (SLWindow)

Class

SLWindow class

Action

Moves the window.

Syntax

window.Move(x, y)
Variable | Description
x | The x coordinate. REAL.
y | The y coordinate. REAL.


MoveToFirstPage Method (SLDataPager)

Class

SLDataPager class

Action

Moves the data pager to the first page.

Syntax

dataPager.MoveToFirstPage()


MoveToLastPage Method (SLDataPager)

Class

SLDataPager class

Action

Moves the data pager to the last page.

Syntax

dataPager.MoveToLastPage()


MoveToNextPage Method (SLDataPager)

Class

SLDataPager class

Action

Moves the data pager to the next page.

Syntax

dataPager.MoveToNextPage()


MoveToPage Method (SLDataPager)

Class

SLDataPager class

Action

Moves the data pager to the given page.

Syntax

dataPager.MoveToPage(page)
Variable | Description
page | The page to move the data pager to. INTEGER.


MoveToPreviousPage Method (SLDataPager)

Class

SLDataPager class

Action

Moves the data pager to the previous page.

Syntax

dataPager.MoveToPreviousPage()


MoveVertical Method (SLGridSplitter)

Class

SLGridSplitter class

Action

Moves the splitter vertically.

Syntax

gridSplitter.MoveVertical(value)
Variable | Description
value | The amount of pixel to move the splitter. REAL.


Name Property (SLBase)

Class

SLBase class

Action

Gets a string containing the UI Automation name for the element.

Data Type

STRING

Access

Read only


NumericValue Property (SLSpinner)

Class

SLSpinner class

Action

Gets the current numeric value of the spinner.

Data Type

REAL

Access

Read only


OpenCalendar Method (SLDatePicker)

Class

SLDatePicker class

Action

Opens the drop-down Calendar.

Syntax

datePicker.OpenCalendar()


Open Method (SLComboBox)

Class

SLComboBox class

Action

Opens the combo box.

Syntax

comboBox.Open()


PageCount Property (SLDataPager)

Class

SLDataPager class

Action

Gets the count of the pages.

Data Type

INTEGER

Access

Read only


RootItems Property (SLTreeView)

Class

SLTreeView class

Action

Gets a complete list of all root tree items.

Data Type

LIST OF WINDOW

Access

Read only


RootItemTexts Property (SLTreeView)

Class

SLTreeView class

Action

Gets a complete list of the texts of all root tree items.

Data Type

LIST OF STRING

Access

Read only


RowCount Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets the number of rows in the data grid.

Data Type

INTEGER

Access

Read only


RowHeader Property (SLDataGridRow)

Class

SLDataGridRow class

Action

Gets the header for this row.

Data Type

WINDOW

Access

Read only


Rows Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets a list of rows in the data grid.

If the data grid has a vertical scroll bar, rows which are not in the visible area of the data grid do not expose any information (e.g. text, caption). In order to interact with such a row or retrieve information about the row it needs to be scrolled into view first.

Data Type

LIST OF WINDOW

Access

Read only


RowTexts Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets a list of row texts in the data grid. The text for every row is returned as a string that contains the text of every cell separated with a blank character.

If the data grid has a vertical scroll bar, rows which are not in the visible area of the data grid return an empty text. In order to retrieve the text of such a row it needs to be scrolled into view first.

Data Type

LIST OF STRING

Access

Read only


ScrollHorizontal Method (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Scrolls the currently visible region of the content area, horizontally, the specified ScrollAmount.

Syntax

autoCompleteBox.ScrollHorizontal(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollHorizontal Method (SLComboBox)

Class

SLComboBox class

Action

Scrolls the currently visible region of the content area, horizontally, the specified ScrollAmount.

Syntax

comboBox.ScrollHorizontal(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollHorizontal Method (SLDataGrid)

Class

SLDataGrid class

Action

Scrolls the currently visible region of the content area, horizontally, the specified ScrollAmount.

Syntax

dataGrid.ScrollHorizontal(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollHorizontal Method (SLListBox)

Class

SLListBox class

Action

Scrolls the currently visible region of the content area, horizontally, the specified ScrollAmount.

Syntax

listBox.ScrollHorizontal(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollHorizontal Method (SLPane)

Class

SLPane class

Action

Scrolls the currently visible region of the content area, horizontally, the specified ScrollAmount.

Syntax

pane.ScrollHorizontal(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollHorizontal Method (SLTreeView)

Class

SLTreeView class

Action

Scrolls the currently visible region of the content area, horizontally, the specified ScrollAmount.

Syntax

treeView.ScrollHorizontal(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollIntoView Method (SLDataGrid)

Class

SLDataGrid class

Action

Scrolls the specified row or cell into view.

Syntax

dataGrid.ScrollIntoView(row, [column])
Variable | Description
row | The row where to scroll to. LISTITEM.
column | Optional.The column where to scroll to. LISTITEM.


ScrollIntoView Method (SLDataGridCell)

Class

SLDataGridCell class

Action

Scroll the cell into view.

Syntax

dataGridCell.ScrollIntoView()


ScrollIntoView Method (SLDataGridRow)

Class

SLDataGridRow class

Action

Scrolls the row into view.

Syntax

dataGridRow.ScrollIntoView()


ScrollIntoView Method (SLListItem)

Class

SLListItem class

Action

Scroll the list item into view.

Syntax

listItem.ScrollIntoView()


ScrollIntoView Method (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Scrolls the tree item into view.

Syntax

treeViewItem.ScrollIntoView()


Scroll Method (SLHorizontalScrollBar)

Class

SLHorizontalScrollBar class

Action

Scrolls the scroll bar by the specified amount.

Syntax

horizontalScrollBar.Scroll(scrollAmount)
Variable | Description
scrollAmount | The amount to scroll. SCROLLAMOUNT.


Scroll Method (SLVerticalScrollBar)

Class

SLVerticalScrollBar class

Action

Scrolls the scroll bar by the specified amount.

Syntax

verticalScrollBar.Scroll(scrollAmount)
Variable | Description
scrollAmount | The amount to scroll. SCROLLAMOUNT.


ScrollPosition Property (SLHorizontalScrollBar)

Class

SLHorizontalScrollBar class

Action

Gets the current scroll position.

Data Type

REAL

Access

Read only


ScrollPosition Property (SLVerticalScrollBar)

Class

SLVerticalScrollBar class

Action

Gets the current scroll position.

Data Type

REAL

Access

Read only


ScrollToMaximum Method (SLHorizontalScrollBar)

Class

SLHorizontalScrollBar class

Action

Scrolls the scroll bar to the right end.

Syntax

horizontalScrollBar.ScrollToMaximum()


ScrollToMaximum Method (SLVerticalScrollBar)

Class

SLVerticalScrollBar class

Action

Scrolls the scroll bar to the bottom.

Syntax

verticalScrollBar.ScrollToMaximum()


ScrollToMinimum Method (SLHorizontalScrollBar)

Class

SLHorizontalScrollBar class

Action

Scrolls the scroll bar to the left end.

Syntax

horizontalScrollBar.ScrollToMinimum()


ScrollToMinimum Method (SLVerticalScrollBar)

Class

SLVerticalScrollBar class

Action

Scrolls the scroll bar to the top.

Syntax

verticalScrollBar.ScrollToMinimum()


ScrollToPosition Method (SLHorizontalScrollBar)

Class

SLHorizontalScrollBar class

Action

Scrolls the scroll bar to the specific position.

Syntax

horizontalScrollBar.ScrollToPosition(position)
Variable | Description
position | The position. Must be within the minimum and the maximum position for this scroll bar. REAL.


ScrollToPosition Method (SLVerticalScrollBar)

Class

SLVerticalScrollBar class

Action

Scrolls the scroll bar to the specific position.

Syntax

verticalScrollBar.ScrollToPosition(position)
Variable | Description
position | The position. Must be within the minimum and the maximum position for this scroll bar. REAL.


ScrollVertical Method (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Scrolls the currently visible region of the content area, vertically, the specified ScrollAmount.

Syntax

autoCompleteBox.ScrollVertical(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollVertical Method (SLComboBox)

Class

SLComboBox class

Action

Scrolls the currently visible region of the content area, vertically, the specified ScrollAmount.

Syntax

comboBox.ScrollVertical(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollVertical Method (SLDataGrid)

Class

SLDataGrid class

Action

Scrolls the currently visible region of the content area, vertically, the specified ScrollAmount.

Syntax

dataGrid.ScrollVertical(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollVertical Method (SLListBox)

Class

SLListBox class

Action

Scrolls the currently visible region of the content area, vertically, the specified ScrollAmount.

Syntax

listBox.ScrollVertical(scrollAmount)
Variable | Description
scrollAmount | =The direction and distance to scroll. SCROLLAMOUNT.


ScrollVertical Method (SLPane)

Class

SLPane class

Action

Scrolls the currently visible region of the content area, vertically, the specified ScrollAmount.

Syntax

pane.ScrollVertical(scrollAmount)
Variable | Description
scrollAmount | The direction and distance to scroll. SCROLLAMOUNT.


ScrollVertical Method (SLTreeView)

Class

SLTreeView class

Action

Scrolls the currently visible region of the content area, vertically, the specified ScrollAmount.

Syntax

treeView.ScrollVertical(scrollAmount)
Variable | Description
scrollAmount | =The direction and distance to scroll. SCROLLAMOUNT.


SelectAll Method (SLListBox)

Class

SLListBox class

Action

Selects all items in the list.

Syntax

listBox.SelectAll()


SelectCell Method (SLDataGrid)

Class

SLDataGrid class

Action

Selects the specified cell.

Syntax

dataGrid.SelectCell(row, column, [modifiers])
Variable | Description
row | The row to select. LISTITEM.
column | The cell to select. LISTITEM.
modifiers | Optional.The modifier keys to press while selecting the cell. Use a modifier to select multiple cells. MODIFIERKEYSTATE.

Examples

In order to select a cell with the text "cell 1" in the third row type:
dataGrid.SelectCell(3, "cell 1")


SelectDate Method (SLCalendar)

Class

SLCalendar class

Action

Selects the given date.

Syntax

calendar.SelectDate(dateToSelect)
Variable | Description
dateToSelect | The date to select. DATETIME.


SelectDates Method (SLCalendar)

Class

SLCalendar class

Action

Selects the given dates.

This method will only work if the calendar supports the MultipleRange selection mode.

Syntax

calendar.SelectDates(dates)
Variable | Description
dates | The dates to select. LIST OF DATETIME.


SelectedCell Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets the currently selected cell or null if no cell is selected.

Data Type

WINDOW

Access

Read only


SelectedCellText Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets the text of the currently selected cell or an empty string if no cell is selected.

Data Type

STRING

Access

Read only


SelectedDate Property (SLCalendar)

Class

SLCalendar class

Action

Gets the currently selected date in the currently displayed view.

Data Type

DATETIME

Access

Read only


SelectedDate Property (SLDatePicker)

Class

SLDatePicker class

Action

Gets the selected date or null if no date is selected.

Data Type

DATETIME

Access

Read only


SelectedDates Property (SLCalendar)

Class

SLCalendar class

Action

Gets a list of selected dates in the currently displayed view.

Data Type

LIST OF DATETIME

Access

Read only


SelectedIndex Property (SLComboBox)

Class

SLComboBox class

Action

Gets the index of the selected item or negative one (-1) if the selection is empty. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectedIndex Property (SLListBox)

Class

SLListBox class

Action

Gets the index of the first item in the current selection or returns negative one (-1) if the selection is empty. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectedIndex Property (SLTabControl)

Class

SLTabControl class

Action

Gets the index of the selected item or negative one (-1) if the selection is empty. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectedIndices Property (SLListBox)

Class

SLListBox class

Action

Gets the indices of the currently selected items. An empty list is returned if no items are currently selected.

Data Type

LIST OF INTEGER

Access

Read only


SelectedItemPath Property (SLTreeView)

Class

SLTreeView class

Action

Gets the selected item path or an empty item path if nothing is selected.

Data Type

LISTITEM

Access

Read only


SelectedItem Property (SLComboBox)

Class

SLComboBox class

Action

Gets the selected item or null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItem Property (SLListBox)

Class

SLListBox class

Action

Gets the first item in the current selection or returns null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItem Property (SLTabControl)

Class

SLTabControl class

Action

Gets the selected item or null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItem Property (SLTreeView)

Class

SLTreeView class

Action

Gets the selected item or returns null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItems Property (SLListBox)

Class

SLListBox class

Action

Gets the currently selected items. An empty list is returned, if no items are currently selected.

Data Type

LIST OF WINDOW

Access

Read only


SelectedItemText Property (SLComboBox)

Class

SLComboBox class

Action

Gets the text of the selected item or an empty string if the selection is empty.

Data Type

STRING

Access

Read only


SelectedItemText Property (SLListBox)

Class

SLListBox class

Action

Gets the text of the first selected item.

Data Type

STRING

Access

Read only


SelectedItemText Property (SLTabControl)

Class

SLTabControl class

Action

Gets the text of the selected item or an empty string if the selection is empty.

Data Type

STRING

Access

Read only


SelectedItemText Property (SLTreeView)

Class

SLTreeView class

Action

Gets the text of the selected item or an empty string if the selection is empty.

Data Type

STRING

Access

Read only


SelectedItemTexts Property (SLListBox)

Class

SLListBox class

Action

Gets the texts of the currently selected items. An empty list is returned if no items are currently selected.

Data Type

LIST OF STRING

Access

Read only


SelectedRow Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets the currently selected row or null if no row is selected.

Data Type

WINDOW

Access

Read only


SelectedRows Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets a list of currently selected rows or an empty list if no row is selected.

Data Type

LIST OF WINDOW

Access

Read only


SelectedRowText Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets the text of the currently selected row or an empty string if no row is selected.

Data Type

STRING

Access

Read only


SelectedRowTexts Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets the text of the currently selected rows or an empty list if no row is selected.

Data Type

LIST OF STRING

Access

Read only


SelectedText Property (SLRichTextBox)

Class

SLRichTextBox class

Action

Gets the selected text.

if the selection contains non-text elements, e.g. an image, those elements are represented as blank character

Data Type

STRING

Access

Read only


Select Method (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Types the given text into the auto box complete box and selects a match.

If there is no match after entering the text an exception is thrown. If value of the parameter matchIndex is less than 0 or greater than the number of matches an exception is thrown as well.

Syntax

autoCompleteBox.Select(text, [matchIndex])
Variable | Description
text | The text to type into the text box. STRING.
matchIndex | Optional.The index of the match to select. The value is one-based. INTEGER.

Examples

In order to select the first match starting with the text "Apple" type:
autoCompletBox.Select("Apple")
In order to select the third match starting with the text "A" type:
autoCompletBox.Select("A", 3)


Select Method (SLButton)

Class

SLButton class

Action

Clicks the button.

Syntax

button.Select()


Select Method (SLCalendarButton)

Class

SLCalendarButton class

Action

Clicks the button.

Syntax

calendarButton.Select()


Select Method (SLCalendarDayButton)

Class

SLCalendarDayButton class

Action

Clicks the button.

Syntax

calendarDayButton.Select()


Select Method (SLComboBox)

Class

SLComboBox class

Action

Selects an item in the combo box.

Syntax

comboBox.Select(item)
Variable | Description
item | The item to select. LISTITEM.

Examples

In order to select the item with the text "item 1" from a combo box type:
comboBox.Select("item 1")
In order to select the third item from a combo box type:
comboBox.Select(3)


Select Method (SLComboBoxItem)

Class

SLComboBoxItem class

Action

Selects the combo box item.

Syntax

comboBoxItem.Select()


Select Method (SLDataGrid)

Class

SLDataGrid class

Action

Selects the specified row.

Syntax

dataGrid.Select(item, [modifiers])
Variable | Description
item | The row to select. LISTITEM.
modifiers | Optional.The modifier keys to press while selecting the row. Use a modifier to select multiple rows. MODIFIERKEYSTATE.

Examples

In order to select the row that contains two cells with the text "cell 1" and "cell 2" type:
dataGrid.Select("cell 1 cell 2")
or
dataGrid.Select("*cell 1*")
In order to select the third row from a data grid type:
dataGrid.Select(3)
In order to select multiple rows in a data grid use modifier keys (such as Ctrl or Shift). For selecting the fist and the third row in a data grid that supports multiple selections, type the following:
dataGrid.Select(1)
dataGrid.Select(3, MOD_CTRL)


Select Method (SLDataGridCell)

Class

SLDataGridCell class

Action

Selects the cell.

Syntax

dataGridCell.Select()


Select Method (SLDataGridRow)

Class

SLDataGridRow class

Action

Selects the row.

Syntax

dataGridRow.Select()


Select Method (SLHeaderItem)

Class

SLHeaderItem class

Action

Selects the header item.

Syntax

headerItem.Select()


Select Method (SLHyperlinkButton)

Class

SLHyperlinkButton class

Action

Clicks the hyperlink button.

Syntax

hyperlinkButton.Select()


Select Method (SLListBox)

Class

SLListBox class

Action

Selects the given list box item.

Syntax

listBox.Select(item, [modifiers])
Variable | Description
item | The name or index of the item to select. LISTITEM.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while selecting an item. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Examples

In order to select the item with the text "item 1" from a list box type:
listBox.Select("item 1")
In order to select the third item from a list box type:
listBox.Select(3)
In order to select multiple items a list box use modifier keys (such as Ctrl or Shift). For selecting both the items with the text "item 1" and "item 3" in a multi-select list box (that has the extended selection style), type the following:
listBox.Select("item 1")
listBox.Select("item 3", MOD_CTRL)
In a multi-select list box with the multiple selection style a user can deselect a selected item by clicking on it. The following code selects two items in such a list box and then deselects the first one.
listBox.Select("item 1")
listBox.Select("item 3")
listBox.Select("item 1") ' deselects "item 1"


Select Method (SLListItem)

Class

SLListItem class

Action

Selects the list item.

Syntax

listItem.Select()


Select Method (SLRadioButton)

Class

SLRadioButton class

Action

Deselects any selected items and then selects the current element.

Syntax

radioButton.Select()


Select Method (SLRepeatButton)

Class

SLRepeatButton class

Action

Clicks the button.

Syntax

repeatButton.Select()


Select Method (SLTabControl)

Class

SLTabControl class

Action

Selects an item in the tab control.

Syntax

tabControl.Select(item)
Variable | Description
item | The item to select. LISTITEM.


Select Method (SLTabItem)

Class

SLTabItem class

Action

Selects the tab item.

Syntax

tabItem.Select()


Select Method (SLTreeView)

Class

SLTreeView class

Action

Selects the specified item.

Syntax

treeView.Select(item)
Variable | Description
item | The item to select. LISTITEM.


Select Method (SLTreeViewItem)

Class

SLTreeViewItem class

Action

Selects the item.

Syntax

treeViewItem.Select()


SelectRange Method (SLCalendar)

Class

SLCalendar class

Action

Selects a range of dates.

Syntax

calendar.SelectRange(startDate, endDate)
Variable | Description
startDate | The start date of the selection. DATETIME.
endDate | The end date of the selection. DATETIME.


SetFocus Method (SLBase)

Class

SLBase class

Action

Gives focus to the control.

Syntax

base.SetFocus()


SetHorizontalScrollPercent Method (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Sets the horizontal scroll position as a percentage of the total content area within the combo box.

Syntax

autoCompleteBox.SetHorizontalScrollPercent(percent)
Variable | Description
percent | The percentage of the total horizontal content area. REAL.


SetHorizontalScrollPercent Method (SLComboBox)

Class

SLComboBox class

Action

Sets the horizontal scroll position as a percentage of the total content area within the combo box.

Syntax

comboBox.SetHorizontalScrollPercent(percent)
Variable | Description
percent | The percentage of the total horizontal content area. REAL.


SetHorizontalScrollPercent Method (SLDataGrid)

Class

SLDataGrid class

Action

Sets the horizontal scroll position as a percentage of the total content area within the data grid.

Syntax

dataGrid.SetHorizontalScrollPercent(percent)
Variable | Description
percent | The percentage of the total horizontal content area. REAL.


SetHorizontalScrollPercent Method (SLListBox)

Class

SLListBox class

Action

Sets the horizontal scroll position as a percentage of the total content area within the list box.

Syntax

listBox.SetHorizontalScrollPercent(percent)
Variable | Description
percent | The percentage of the total horizontal content area. REAL.


SetHorizontalScrollPercent Method (SLPane)

Class

SLPane class

Action

Sets the horizontal scroll position as a percentage of the total content area within the pane.

Syntax

pane.SetHorizontalScrollPercent(percent)
Variable | Description
percent | The percentage of the total horizontal content area. REAL.


SetHorizontalScrollPercent Method (SLTreeView)

Class

SLTreeView class

Action

Sets the horizontal scroll position as a percentage of the total content area within the tree view.

Syntax

treeView.SetHorizontalScrollPercent(percent)
Variable | Description
percent | The percentage of the total horizontal content area. REAL.


SetIndeterminate Method (SLCheckBox)

Class

SLCheckBox class

Action

Set the check box to the indeterminate state.

Syntax

checkBox.SetIndeterminate()


SetPosition Method (SLPasswordBox)

Class

SLPasswordBox class

Action

Sets the insertion point in the password field.

Syntax

passwordBox.SetPosition(position)
Variable | Description
position | The position of the caret within the password field. The value is one-based. INTEGER.


SetPosition Method (SLRichTextBox)

Class

SLRichTextBox class

Action

Sets the insertion point in the text box.

Syntax

richTextBox.SetPosition(position)
Variable | Description
position | The position of the caret within the text box. The value is one-based. INTEGER.


SetPosition Method (SLTextBox)

Class

SLTextBox class

Action

Sets the insertion point in the text field.

Syntax

textBox.SetPosition(position)
Variable | Description
position | The position of the caret within the text field. The value is one-based. INTEGER.


SetSelection Method (SLPasswordBox)

Class

SLPasswordBox class

Action

Selects a range of text in the password box.

Syntax

passwordBox.SetSelection(startPosition, length)
Variable | Description
startPosition | The start index for the selection. The value is one-based. INTEGER.
length | The number of characters to select from the start position. INTEGER.


SetSelection Method (SLRichTextBox)

Class

SLRichTextBox class

Action

Selects a range of text in the text box.

Syntax

richTextBox.SetSelection(startPosition, length)
Variable | Description
startPosition | The start index for the selection. The value is one-based. INTEGER.
length | The number of characters to select from the start position. INTEGER.


SetSelection Method (SLTextBox)

Class

SLTextBox class

Action

Selects a range of text in the text box.

Syntax

textBox.SetSelection(startPosition, length)
Variable | Description
startPosition | The start index for the selection. The value is one-based. INTEGER.
length | The number of characters to select from the start position. INTEGER.


SetText Method (SLPasswordBox)

Class

SLPasswordBox class

Action

Replaces the text in the password field with the given text.

Syntax

passwordBox.SetText(text)
Variable | Description
text | The new text. STRING.


SetText Method (SLRichTextBox)

Class

SLRichTextBox class

Action

Replaces the content in the text box with the given text.

Syntax

richTextBox.SetText(text)
Variable | Description
text | The new text. STRING.


SetText Method (SLTextBox)

Class

SLTextBox class

Action

Replaces the text in the text field with the given text.

Syntax

textBox.SetText(text)
Variable | Description
text | The new text. STRING.


SetValue Method (SLSlider)

Class

SLSlider class

Action

Sets the value of the slider.

Syntax

slider.SetValue(value)
Variable | Description
value | The new slider value. REAL.


SetValueToMaximum Method (SLSlider)

Class

SLSlider class

Action

Sets the Slider to the maximum position.

Syntax

slider.SetValueToMaximum()


SetValueToMinimum Method (SLSlider)

Class

SLSlider class

Action

Sets the Slider to the minimum position.

Syntax

slider.SetValueToMinimum()


SetVerticalScrollPercent Method (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Sets the vertical scroll position as a percentage of the total content area within the combo box.

Syntax

autoCompleteBox.SetVerticalScrollPercent(percent)
Variable | Description
percent | The percentage of the total vertical content area. REAL.


SetVerticalScrollPercent Method (SLComboBox)

Class

SLComboBox class

Action

Sets the vertical scroll position as a percentage of the total content area within the combo box.

Syntax

comboBox.SetVerticalScrollPercent(percent)
Variable | Description
percent | The percentage of the total vertical content area. REAL.


SetVerticalScrollPercent Method (SLDataGrid)

Class

SLDataGrid class

Action

Sets the vertical scroll position as a percentage of the total content area within the data grid.

Syntax

dataGrid.SetVerticalScrollPercent(percent)
Variable | Description
percent | The percentage of the total vertical content area. REAL.


SetVerticalScrollPercent Method (SLListBox)

Class

SLListBox class

Action

Sets the vertical scroll position as a percentage of the total content area within the list box.

Syntax

listBox.SetVerticalScrollPercent(percent)
Variable | Description
percent | The percentage of the total vertical content area. REAL.


SetVerticalScrollPercent Method (SLPane)

Class

SLPane class

Action

Sets the vertical scroll position as a percentage of the total content area within the pane.

Syntax

pane.SetVerticalScrollPercent(percent)
Variable | Description
percent | The percentage of the total vertical content area. REAL.


SetVerticalScrollPercent Method (SLTreeView)

Class

SLTreeView class

Action

Sets the vertical scroll position as a percentage of the total content area within the tree view.

Syntax

treeView.SetVerticalScrollPercent(percent)
Variable | Description
percent | The percentage of the total vertical content area. REAL.


SmallChange Property (SLSlider)

Class

SLSlider class

Action

Gets the value that is added to or subtracted from the Value property when a small change is made, such as with an arrow key.

Data Type

REAL

Access

Read only


SupportedDisplayModes Property (SLCalendar)

Class

SLCalendar class

Action

Gets a list of supported display modes.

Data Type

LIST OF SLCALENDARMODE

Access

Read only


SwitchToDecadeView Method (SLCalendar)

Class

SLCalendar class

Action

Switches the calendar display mode to 'decade', if supported.

Syntax

calendar.SwitchToDecadeView()


SwitchToMonthView Method (SLCalendar)

Class

SLCalendar class

Action

Switches the calendar display mode to 'month', if supported.

Syntax

calendar.SwitchToMonthView()


SwitchToYearView Method (SLCalendar)

Class

SLCalendar class

Action

Switches the calendar display mode to 'year', if supported.

Syntax

calendar.SwitchToYearView()


Text Property (SLRichTextBox)

Class

SLRichTextBox class

Action

Gets the text that is displayed in the text box.

if the text box contains non-text elements, e.g. an image, those elements are represented as blank character

Data Type

STRING

Access

Read only


Text Property (SLTextBlock)

Class

SLTextBlock class

Action

Gets the text of this text block.

Data Type

STRING

Access

Read only


Text Property (SLTextBox)

Class

SLTextBox class

Action

Gets the text that is displayed in the text box.

Data Type

STRING

Access

Read only


Toggle Method (SLCheckBox)

Class

SLCheckBox class

Action

Cycles through the toggle states of the check box in this order: On, Off and, if supported, Indeterminate.

Syntax

checkBox.Toggle()


Toggle Method (SLToggleButton)

Class

SLToggleButton class

Action

Cycles through the toggle states of the button in this order: On, Off and, if supported, Indeterminate.

Syntax

toggleButton.Toggle()


ToggleState Property (SLCheckBox)

Class

SLCheckBox class

Action

Gets the toggle state of the check box.

Data Type

TOGGLESTATE

Access

Read only


ToggleState Property (SLToggleButton)

Class

SLToggleButton class

Action

Gets the toggle state of the button.

Data Type

TOGGLESTATE

Access

Read only


Uncheck Method (SLCheckBox)

Class

SLCheckBox class

Action

Unchecks the check box.

Syntax

checkBox.Uncheck()


Value Property (SLProgressBar)

Class

SLProgressBar class

Action

Gets the current progress.

Data Type

REAL

Access

Read only


Value Property (SLSlider)

Class

SLSlider class

Action

Gets the current progress.

Data Type

REAL

Access

Read only


Value Property (SLSpinner)

Class

SLSpinner class

Action

Gets the current value of the spinner.

Data Type

STRING

Access

Read only


VerticallyScrollable Property (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Gets a value that indicates whether the combo box can scroll vertically.

Data Type

BOOLEAN

Access

Read only


VerticallyScrollable Property (SLComboBox)

Class

SLComboBox class

Action

Gets a value that indicates whether the combo box can scroll vertically.

Data Type

BOOLEAN

Access

Read only


VerticallyScrollable Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets a value that indicates whether the data grid can scroll vertically.

Data Type

BOOLEAN

Access

Read only


VerticallyScrollable Property (SLListBox)

Class

SLListBox class

Action

Gets a value that indicates whether the list box can scroll vertically.

Data Type

BOOLEAN

Access

Read only


VerticallyScrollable Property (SLPane)

Class

SLPane class

Action

Gets a value that indicates whether the pane can scroll vertically.

Data Type

BOOLEAN

Access

Read only


VerticallyScrollable Property (SLTreeView)

Class

SLTreeView class

Action

Gets a value that indicates whether the tree view can scroll vertically.

Data Type

BOOLEAN

Access

Read only


VerticalScrollPercent Property (SLAutoCompleteBox)

Class

SLAutoCompleteBox class

Action

Gets the current vertical scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


VerticalScrollPercent Property (SLComboBox)

Class

SLComboBox class

Action

Gets the current vertical scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


VerticalScrollPercent Property (SLDataGrid)

Class

SLDataGrid class

Action

Gets the current vertical scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


VerticalScrollPercent Property (SLListBox)

Class

SLListBox class

Action

Gets the current vertical scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


VerticalScrollPercent Property (SLPane)

Class

SLPane class

Action

Gets the current vertical scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


VerticalScrollPercent Property (SLTreeView)

Class

SLTreeView class

Action

Gets the current vertical scroll position or negative one (-1) if there is no valid scroll position.

Data Type

REAL

Access

Read only


VisibleItemPaths Property (SLTreeView)

Class

SLTreeView class

Action

Gets the visible items in the tree as item paths.

Data Type

LIST OF LISTITEM

Access

Read only


AccessibleName Property (AWTComponent)

Class

AWTComponent class

Action

Gets the accessible name of the component.

Data Type

STRING

Access

Read only

Examples

STRING sAccessibleName = Component.AccessibleName


AccessibleName Property (AWTMenuItem)

Class

AWTMenuItem class

Action

Gets the accessible name of the component.

Data Type

STRING

Access

Read only

Examples

STRING sAccessibleName = OpenFileMenuItem.AccessibleName


AccessibleRole Property (AWTComponent)

Class

AWTComponent class

Action

Gets the accessible role of the component.

Data Type

STRING

Access

Read only

Examples

STRING sAccessibleRole = Component.AccessibleRole


Alignment Property (AWTLabel)

Class

AWTLabel class

Action

Gets the alignment of the label.

Data Type

ALIGNMENT

Access

Read only

Examples

ALIGNMENT alignment = LabelInfo.Alignment


Alignment Property (JLabel)

Class

JLabel class

Action

Gets the alignment of the label.

Data Type

ALIGNMENT

Access

Read only

Examples

ALIGNMENT alignment = Label.Alignment


Alignment Property (JTextField)

Class

JTextField class

Action

Gets the alignment of the text field.

Data Type

ALIGNMENT

Access

Read only

Examples

ALIGNMENT alignment = TextField.Alignment


AllCellTexts Property (JTable)

Class

JTable class

Action

Gets the text values of all cells in the table. The cells are grouped in rows, where each row contains the texts of its cells.

Data Type

LIST OF LIST OF STRING

Access

Read only

Examples

LIST OF LIST OF STRING allCellTexts = Table.AllCellTexts


AllCellTexts Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the text values of all cells in the listview. The cells are grouped in rows, where each row contains the texts of its cells.

Only the values that have been visible to the user at least once are available.

Data Type

LIST OF LIST OF STRING

Access

Read only


AllCellValues Property (JTable)

Class

JTable class

Action

Gets the values of all cells in the table. The cells are grouped in rows, where each row contains the values of its cells.

Data Type

LIST OF LIST OF ANYTYPE

Access

Read only

Examples

LIST OF LIST OF ANYTYPE allCellValues = Table.AllCellValues


Background Property (AWTComponent)

Class

AWTComponent class

Action

Gets the background color of the component.

Data Type

COLOR

Access

Read only

Examples

COLOR backgroundColor = Component.Background


CancelEditing Method (JTree)

Class

JTree class

Action

Cancels the current editing session.

Syntax

tree.CancelEditing()

Examples

Tree.CancelEditing()


CaretPosition Property (AWTTextComponent)

Class

AWTTextComponent class

Action

Gets the position of the text insertion caret for the text component. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iCaretPosition = TextComponent.CaretPosition


CaretPosition Property (JTextComponent)

Class

JTextComponent class

Action

Gets the position of the text insertion caret for the text component. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iCaretPosition = TextComponent.CaretPosition


CaretPosition Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the position of the text insertion caret for the text field. The value is one-based.

Data Type

INTEGER

Access

Read only


CharacterAttributes Property (JTextPane)

Class

JTextPane class

Action

Gets the character attributes in effect at the location of the caret.

Data Type

LIST OF STRING

Access

Read only

Examples

LIST OF STRING lsCharacterAttributes = TextPane.CharacterAttributes


Checked Property (AWTCheckbox)

Class

AWTCheckbox class

Action

Gets whether the check box is checked.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bChecked = CaseSensitiveCheckBox.Checked


Checked Property (AWTCheckboxMenuItem)

Class

AWTCheckboxMenuItem class

Action

Gets whether the check box of the menu item is checked.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bMenuItemChecked = CheckMenuItem.Checked


Checked Property (AWTRadioButton)

Class

AWTRadioButton class

Action

Gets whether the radio button is checked.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bChecked = LeftAligmentRadioButton.Checked


Checked Property (JCheckBoxMenuItem)

Class

JCheckBoxMenuItem class

Action

Gets whether the check box in a menu item is checked.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bChecked = CheckBoxMenuItem.Checked


Checked Property (JRadioButtonMenuItem)

Class

JRadioButtonMenuItem class

Action

Gets whether the radio button in a menu item is checked.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bChecked = LeftAligmentMenuItem.Checked


Checked Property (OracleFormsCheckbox)

Class

OracleFormsCheckbox class

Action

Gets whether the check box is checked.

Data Type

BOOLEAN

Access

Read only


Checked Property (OracleFormsMenu)

Class

OracleFormsMenu class

Action

Gets whether the MenuItem is checked.

Data Type

BOOLEAN

Access

Read only


Checked Property (OracleFormsMenuItem)

Class

OracleFormsMenuItem class

Action

Gets whether the MenuItem is checked.

Data Type

BOOLEAN

Access

Read only


Checked Property (OracleFormsRadioButton)

Class

OracleFormsRadioButton class

Action

Gets whether the radio button is checked.

Data Type

BOOLEAN

Access

Read only


Check Method (AWTCheckbox)

Class

AWTCheckbox class

Action

Checks the check box.

Syntax

checkbox.Check()

Examples

CaseSensitiveCheckBox.Check()


Check Method (AWTCheckboxMenuItem)

Class

AWTCheckboxMenuItem class

Action

Checks the check box of the menu item.

Syntax

checkboxMenuItem.Check()

Examples

CheckMenuItem.Check()


Check Method (AWTRadioButton)

Class

AWTRadioButton class

Action

Checks the radio button.

Syntax

radioButton.Check()

Examples

LeftAligmentRadioButton.Check()


Check Method (JCheckBox)

Class

JCheckBox class

Action

Checks the check box.

Syntax

checkBox.Check()

Examples

ForwardCheckBox.Check()


Check Method (JRadioButton)

Class

JRadioButton class

Action

Checks the radio button.

Syntax

radioButton.Check()

Examples

LeftAligmentRadioButton.Check()


Check Method (OracleFormsCheckbox)

Class

OracleFormsCheckbox class

Action

Checks the check box.

Syntax

oracleFormsCheckbox.Check()


Check Method (OracleFormsMenu)

Class

OracleFormsMenu class

Action

Checks a menu item.

Syntax

oracleFormsMenu.Check(item)
Variable | Description
item | The menu item to check. Can be either a top-level menu item or a menu item that can be found in a submenu. For checking a menu item from a submenu separate the menu item names with a slash. The item can contain the wildcards '?' (matches one character) or '*' (matches 0 to many characters). LISTITEM.


Check Method (OracleFormsMenuItem)

Class

OracleFormsMenuItem class

Action

Checks a menu item.

Syntax

oracleFormsMenuItem.Check()


Check Method (OracleFormsRadioButton)

Class

OracleFormsRadioButton class

Action

Checks the radio button.

Syntax

oracleFormsRadioButton.Check()


Clear Method (AWTTextComponent)

Class

AWTTextComponent class

Action

Removes all the text from the text component.

Syntax

textComponent.Clear()

Examples

TextComponent.Clear()


Clear Method (JTextComponent)

Class

JTextComponent class

Action

Removes all the text from text component.

Syntax

textComponent.Clear()

Examples

TextComponent.Clear()


Clear Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Removes all the text from the text field.

Syntax

oracleFormsTextField.Clear()


ClearSelection Method (JTable)

Class

JTable class

Action

Deselects all selected columns and rows.

Syntax

table.ClearSelection()

Examples

Table.ClearSelection()


ClearSelection Method (JTree)

Class

JTree class

Action

Clears the selection.

Syntax

tree.ClearSelection()

Examples

Tree.ClearSelection()


ClearSelection Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Clears the selection.

Syntax

oracleFormsListView.ClearSelection()


ClickCell Method (JTable)

Class

JTable class

Action

Clicks the specified cell in the table.

Syntax

table.ClickCell(row, column, [button, position, modifiers])
Variable | Description
row | The index of the row. The value is one-based. INTEGER.
column | The name or index of the column. LISTITEM.
button | Optional.The button used for clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The clicked position within the table cell. If the position is omitted, the click is done in the center of the table cell. POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while clicking the table cell. Use a modifier to click multiple table cells. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Examples

Table.ClickCell(1, "Street", 1, {10, 10}, MOD_CTRL)
Table.ClickCell(1, "Street")
Table.ClickCell(1, 5)


ClickColumnHeader Method (JTableHeader)

Class

JTableHeader class

Action

Clicks the column header of the table.

Syntax

tableHeader.ClickColumnHeader(column, [button, position, modifiers])
Variable | Description
column | The name or index of the column. LISTITEM.
button | Optional.The button used for clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The clicked position within the column header. (default: column header center). POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while clicking the column header. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Examples

TableHeader.ClickColumnHeader("Product Name", 1, {10, 10}, MOD_CTRL)
TableHeader.ClickColumnHeader(4, 1, {10, 10}, MOD_CTRL)
TableHeader.ClickColumnHeader("Product Name")
TableHeader.ClickColumnHeader(4)


ClickItem Method (JList)

Class

JList class

Action

Clicks the specified list item.

Syntax

list.ClickItem(item, [button, position, modifiers])
Variable | Description
item | The name or index of the list item. LISTITEM.
button | Optional.The button used for clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The clicked position within the list. (default: center of the list item). POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while clicking the list item. Use a modifier to click multiple list items. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Examples

ColorsList.ClickItem("green", 1, {10, 10}, MOD_CTRL)
ColorsList.ClickItem(3, 1, {10, 10}, MOD_CTRL)
ColorsList.ClickItem("green")
ColorsList.ClickItem(1)


ClickItem Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Clicks the specified list item.

Syntax

oracleFormsListBox.ClickItem(item, [button, position, modifiers])
Variable | Description
item | The name or index of the list item. LISTITEM.
button | Optional.The button used for clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The clicked position within the list. (default: center of the list item). POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while clicking the list item. Use a modifier to click multiple list items. Default: Don't use modifier keys. MODIFIERKEYSTATE.


ClickItem Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Clicks on a tree node specified by the item path.

Syntax

oracleFormsTree.ClickItem(item, [button, position, modifiers])
Variable | Description
item | The path of the item to click on. LISTITEM.
button | Optional.The button used for clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The position to click. If the position is omitted, the click is done in the center of the tree node. POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while clicking the tree node. Default: Don't use modifier keys. MODIFIERKEYSTATE.


ClickNode Method (JTree)

Class

JTree class

Action

Clicks on a tree node specified by the item path.

Syntax

tree.ClickNode(item, [button, position, modifiers])
Variable | Description
item | The item path to click on. LISTITEM.
button | Optional.The button used for clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The position to click. If the position is omitted, the click is done in the center of the tree node. POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while clicking the tree node. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Examples

Tree.ClickNode("/level_1-1/level_2-1/level_3-4", 1, {10, 10}, MOD_CTRL)
Tree.ClickNode("/level_1-1/level_2-1/level_3-4")


CollapseAll Method (JTree)

Class

JTree class

Action

Collapses all tree nodes.

Syntax

tree.CollapseAll()

Examples

Tree.CollapseAll()


CollapseAll Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Collapses all tree nodes.

Syntax

oracleFormsTree.CollapseAll()


Collapse Method (JTree)

Class

JTree class

Action

Collapses the tree node identified by the specified item path.

Syntax

tree.Collapse(item)
Variable | Description
item | The item path. LISTITEM.

Examples

Tree.Collapse("/level_1-1/level_2-1/level_3-4")


Collapse Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Collapses the tree node identified by the specified item path.

Syntax

oracleFormsTree.Collapse(item)
Variable | Description
item | The item path. LISTITEM.


Color Property (JColorChooser)

Class

JColorChooser class

Action

Gets the current color value from the color chooser.

Data Type

COLOR

Access

Read only

Examples

COLOR colorRed = ColorChooser.Color


ColumnCount Property (JTable)

Class

JTable class

Action

Gets the number of columns in the table.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iColumnCount = Table.ColumnCount


ColumnCount Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the number of columns in the listview.

Data Type

INTEGER

Access

Read only


Columns Property (AWTTextArea)

Class

AWTTextArea class

Action

Gets the number of columns in the text area. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iColumns = ColorsTextArea.Columns


Columns Property (JTextArea)

Class

JTextArea class

Action

Gets the number of columns in the text area. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iColumns = TextArea.Columns


ContentType Property (JEditorPane)

Class

JEditorPane class

Action

Gets the type of content that this editor is currently set to deal with.

Data Type

STRING

Access

Read only

Examples

STRING sContentType = EditorPane.ContentType


Cursor Property (AWTComponent)

Class

AWTComponent class

Action

Gets the name of the cursor set in the component.

Data Type

STRING

Access

Read only

Examples

STRING sCursor = Component.Cursor


Default Property (OracleFormsButton)

Class

OracleFormsButton class

Action

Gets whether the button is the default button.

Data Type

BOOLEAN

Access

Read only


DeselectAll Method (AWTList)

Class

AWTList class

Action

Deselects all list items.

Syntax

list.DeselectAll()

Examples

ColorsList.DeselectAll()


DeselectAll Method (JList)

Class

JList class

Action

Deselects all list items.

Syntax

list.DeselectAll()

Examples

ColorsList.DeselectAll()


Deselect Method (AWTList)

Class

AWTList class

Action

Deselects the specified list item.

Syntax

list.Deselect(item)
Variable | Description
item | The name or index of the item to deselect. LISTITEM.

Examples

ColorsList.Deselect("blue")
ColorsList.Deselect(3)


Deselect Method (JList)

Class

JList class

Action

Deselects the specified list item.

Syntax

list.Deselect(item)
Variable | Description
item | The name or index of the list item. LISTITEM.

Examples

ColorsList.Deselect("red")
ColorsList.Deselect(1)


Direction Property (BasicArrowButton)

Class

BasicArrowButton class

Action

Gets the direction the arrow points to.

Data Type

DIRECTION

Access

Read only

Examples

DIRECTION direction = ArrowButton.Direction


DividerLocation Property (JSplitPane)

Class

JSplitPane class

Action

Gets the current divider location.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iDividerLocation = SplitPane.DividerLocation


DividerSize Property (JSplitPane)

Class

JSplitPane class

Action

Gets the size of the divider.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iDividerSize = SplitPane.DividerSize


DoubleClickCell Method (JTable)

Class

JTable class

Action

Double-clicks the specified cell in the table.

Syntax

table.DoubleClickCell(row, column, [button, position, modifiers])
Variable | Description
row | The index of the row. The value is one-based. INTEGER.
column | The name or index of the column. LISTITEM.
button | Optional.The button used for double-clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The double-clicked position within the table cell. If the position is omitted, the double-click is done in the center of the table cell. POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while double-clicking the table cell. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Examples

Table.DoubleClickCell(1, "Street", 1, {10, 10}, MOD_CTRL)
Table.DoubleClickCell(1, "Street")
Table.DoubleClickCell(1, 5)


DoubleClickItem Method (AWTList)

Class

AWTList class

Action

Double-clicks a list item.

Syntax

list.DoubleClickItem(item, [modifiers])
Variable | Description
item | The name or index of the item to double-click. LISTITEM.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while double-clicking an item. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Examples

ColorsList.DoubleClickItem("red", MOD_CTRL)
ColorsList.DoubleClickItem("red")
ColorsList.DoubleClickItem(1, MOD_CTRL)
ColorsList.DoubleClickItem(1)


DoubleClickItem Method (JList)

Class

JList class

Action

Double-clicks a list item.

Syntax

list.DoubleClickItem(item, [button, position, modifiers])
Variable | Description
item | The name or index of the list item. LISTITEM.
button | Optional.The button used for double-clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The double-clicked position within the list. (default: center of the list item). POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while double-clicking the list item. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Examples

ColorsList.DoubleClickItem("green", 1, {10, 10}, MOD_CTRL)
ColorsList.DoubleClickItem("green")
ColorsList.DoubleClickItem(3)


DoubleClickItem Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Double-clicks a list item.

Syntax

oracleFormsListBox.DoubleClickItem(item, [button, position, modifiers])
Variable | Description
item | The name or index of the list item. LISTITEM.
button | Optional.The button used for double-clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The double-clicked position within the list. (default: center of the list item). POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while double-clicking the list item. Default: Don't use modifier keys. MODIFIERKEYSTATE.


DoubleClickItem Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Double-clicks on a tree node specified by the item path.

Syntax

oracleFormsTree.DoubleClickItem(item, [button, position, modifiers])
Variable | Description
item | The path of the item to double-click on. LISTITEM.
button | Optional.The button used for double-clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The position to double-click. If the position is omitted, the double-click is done in the center of the tree node. POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while double-clicking the tree node. Default: Don't use modifier keys. MODIFIERKEYSTATE.


DoubleClickNode Method (JTree)

Class

JTree class

Action

Double-clicks on a tree node specified by the item path.

Syntax

tree.DoubleClickNode(item, [button, position, modifiers])
Variable | Description
item | The item path to double-click on. LISTITEM.
button | Optional.The button used for double-clicking. Valid values are: left (=1, the default value), right (=2), middle (=3). INTEGER.
position | Optional.The position to double-click. If the position is omitted, the double-click is done in the center of the tree node. POINT.
modifiers | Optional.The modifier keys (Alt, Shift and Ctrl) to press while double-clicking the tree node. Default: Don't use modifier keys. MODIFIERKEYSTATE.

Examples

Tree.DoubleClickNode("/level_1-1/level_2-1/level_3-4", 1, {10, 10}, MOD_CTRL)
Tree.DoubleClickNode("/level_1-1/level_2-1/level_3-4")


DropDownOpen Property (OracleFormsComboBox)

Class

OracleFormsComboBox class

Action

Gets whether the drop down is currently open.

Data Type

BOOLEAN

Access

Read only


DropDownOpen Property (OracleFormsPopList)

Class

OracleFormsPopList class

Action

Gets whether the drop down is currently open.

Data Type

BOOLEAN

Access

Read only


EchoChar Property (AWTTextField)

Class

AWTTextField class

Action

Gets the character that is displayed instead of the characters that are actually typed.

Data Type

STRING

Access

Read only

Examples

STRING sEchoChar = PasswordTextField.EchoChar


EchoChar Property (JPasswordField)

Class

JPasswordField class

Action

Gets the character that is displayed instead of the characters that are actually typed.

Data Type

STRING

Access

Read only

Examples

STRING sEchoChar = PasswordField.EchoChar


EchoCharSet Property (AWTTextField)

Class

AWTTextField class

Action

Gets whether EchoChar is set to a value other than 0.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bEchoCharSet = PasswordTextField.EchoCharSet


EchoCharSet Property (JPasswordField)

Class

JPasswordField class

Action

Gets whether EchoChar is set to a value other than 0.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bEchoCharSet = PasswordField.EchoCharSet


Editable Property (AWTTextComponent)

Class

AWTTextComponent class

Action

Gets whether the text of the text component can be changed by the user.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bEditable = TextComponent.Editable


Editable Property (JComboBox)

Class

JComboBox class

Action

Gets whether the combo box is editable.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bEditable = ColorsComboBox.Editable


Editable Property (JTextComponent)

Class

JTextComponent class

Action

Gets whether the text of the text component can be changed by the user.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bEditable = TextComponent.Editable


Editable Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets whether the text of the text field can be changed by the user.

Data Type

BOOLEAN

Access

Read only


EditingColumn Property (JTable)

Class

JTable class

Action

Gets the name or index of the column that contains the cell currently being edited.

Data Type

LISTITEM

Access

Read only

Examples

LISTITEM sEditingColumn = Table.EditingColumn


EditingRow Property (JTable)

Class

JTable class

Action

Gets the index of the row that contains the cell currently being edited. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iEditingRow = Table.EditingRow


Enabled Property (AWTComponent)

Class

AWTComponent class

Action

Gets whether the component is enabled.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bEnabled = Component.Enabled


Enabled Property (AWTMenuItem)

Class

AWTMenuItem class

Action

Gets whether the menu item is enabled.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bEnabled = OpenFileMenuItem.Enabled


ExpandAll Method (JTree)

Class

JTree class

Action

Expands all tree nodes.

Syntax

tree.ExpandAll()

Examples

Tree.ExpandAll()


ExpandAll Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Expands all tree nodes.

Syntax

oracleFormsTree.ExpandAll()


Expand Method (JTree)

Class

JTree class

Action

Expands the tree node identified by the specified item path.

Syntax

tree.Expand(item)
Variable | Description
item | The item path. LISTITEM.

Examples

Tree.Expand("/level_1-1/level_2-1/level_3-4")


Expand Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Expands the tree node identified by the specified item path.

Syntax

oracleFormsTree.Expand(item)
Variable | Description
item | The item path. LISTITEM.


FindCell Method (JTable)

Class

JTable class

Action

Returns the cell containing the specified text.

FindCell searches cells for text starting in the 1st row, 1st column. It searches each cell in the first row, then searches the second row, and so on, until it finds a match or it reaches the end of the table. You can use wildcards in your search text.

Syntax

liResult = table.FindCell(text)
Variable | Description
liResult | A list containing the row and column index of the cell (in this order). If the cell is not found the list is empty . LIST OF INTEGER.
text | The text in a cell in the table. STRING.

Examples

LIST OF INTEGER liFindCell = Table.FindCell("SilkTest")


FindItem Method (JList)

Class

JList class

Action

Returns the index of an item in the list.

Syntax

result = list.FindItem(itemText)
Variable | Description
result | The index of the first matching item or -1 (4Test: 0) if no item was not found. The value is one-based. INTEGER.
itemText | The item to find. STRING.

Examples

INTEGER iIndex = ColorsList.FindItem("green")


Focusable Property (AWTComponent)

Class

AWTComponent class

Action

Gets whether the component can be focused.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bFocusable = Component.Focusable


FocusedRow Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the index of the focused row, -1 (4Test: 0) is returned if no row is focused. The value is one-based.

Data Type

INTEGER

Access

Read only


Font Property (AWTComponent)

Class

AWTComponent class

Action

Gets the font of the component.

Data Type

STRING

Access

Read only

Examples

STRING sFont = Component.Font


Foreground Property (AWTComponent)

Class

AWTComponent class

Action

Gets the foreground color of the component.

Data Type

COLOR

Access

Read only

Examples

COLOR foregroundColor = Component.Foreground


FormattedText Property (JEditorPane)

Class

JEditorPane class

Action

Gets the text of the editor pane.

Data Type

STRING

Access

Read only

Examples

STRING sFormattedText = EditorPane.FormattedText


GetCellText Method (JTable)

Class

JTable class

Action

Returns the cell text.

Syntax

sCellText = table.GetCellText(row, column)
Variable | Description
sCellText | The cell text. STRING.
row | The index of the row. The value is one-based. INTEGER.
column | The name or index of the column. LISTITEM.

Examples

STRING sCellText = Table.GetCellText(1, "Product")
sCellText = Table.GetCellText(1, 3)


GetCellText Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Returns the cell text.

Only the values that have been visible to the user at least once are available.

Syntax

sCellText = oracleFormsListView.GetCellText(row, column)
Variable | Description
sCellText | STRING.
row | The index of the row. The value is one-based. INTEGER.
column | The name or index of the column. LISTITEM.


GetCellValue Method (JTable)

Class

JTable class

Action

Returns the cell value.

Use "GetCellText" to retrieve the displayed cell text.

Syntax

cellValue = table.GetCellValue(row, column)
Variable | Description
cellValue | The value object of the cell. If the type of the table cell is not recognized, the object String value is returned. If the cell is empty a null object is returned. ANYTYPE.
row | The index of the row. The value is one-based. INTEGER.
column | The name or index of the column. LISTITEM.

Examples

ANYTYPE cellValue = Table.GetCellValue(1, "SilkTest")
cellValue = Table.GetCellValue(1, 3)


GetColumnName Method (JTable)

Class

JTable class

Action

Returns the name of the column at the specified index.

Syntax

sColumnName = table.GetColumnName(column)
Variable | Description
sColumnName | The name of the column. STRING.
column | The index of the column. The value is one-based. INTEGER.

Examples

STRING sColumnName = Table.GetColumnName(5)


GetColumnName Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Returns the name of the column at the specified index.

Syntax

sColumnName = oracleFormsListView.GetColumnName(index)
Variable | Description
sColumnName | STRING.
index | The index of the column. The value is one-based. INTEGER.


GetColumnWidth Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Returns the width of the specified column.

Syntax

iColumnWidth = oracleFormsListView.GetColumnWidth(column)
Variable | Description
iColumnWidth | INTEGER.
column | The name or index of the column. LISTITEM.


GetHorizontalBar Method (AWTScrollPane)

Class

AWTScrollPane class

Action

Gets the horizontal scroll bar.

Syntax

horizontalBar = scrollPane.GetHorizontalBar()
Variable | Description
horizontalBar | The horizontal scroll bar control. WINDOW.


GetHorizontalBar Method (AWTTextArea)

Class

AWTTextArea class

Action

Gets the horizontal scroll bar.

Syntax

horizontalBar = textArea.GetHorizontalBar()
Variable | Description
horizontalBar | The horizontal scroll bar control. WINDOW.


GetHorizontalBar Method (JScrollPane)

Class

JScrollPane class

Action

Gets the horizontal scroll bar.

Syntax

horizontalBar = scrollPane.GetHorizontalBar()
Variable | Description
horizontalBar | WINDOW.


GetHorizontalScrollbar Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the horizontal scroll bar.

Syntax

horizontalScrollbar = oracleFormsListBox.GetHorizontalScrollbar()
Variable | Description
horizontalScrollbar | The horizontal scroll bar control. WINDOW.


GetHorizontalScrollbar Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the horizontal scroll bar.

Syntax

horizontalScrollbar = oracleFormsListView.GetHorizontalScrollbar()
Variable | Description
horizontalScrollbar | The horizontal scroll bar control. WINDOW.


GetHorizontalScrollbar Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the horizontal scroll bar.

Syntax

horizontalScrollbar = oracleFormsTextField.GetHorizontalScrollbar()
Variable | Description
horizontalScrollbar | The horizontal scroll bar control. WINDOW.


GetHorizontalScrollbar Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the horizontal scroll bar.

Syntax

horizontalScrollbar = oracleFormsTree.GetHorizontalScrollbar()
Variable | Description
horizontalScrollbar | The horizontal scroll bar control. WINDOW.


GetItem Method (AWTChoice)

Class

AWTChoice class

Action

Returns the item at the specified index.

Syntax

sItem = choice.GetItem(index)
Variable | Description
sItem | The name of the item. STRING.
index | The index of the item. The value is one-based. INTEGER.

Examples

STRING sItem = ColorsChoice.GetItem(1)


GetItem Method (AWTList)

Class

AWTList class

Action

Returns the list item at the specified index.

Syntax

sItem = list.GetItem(index)
Variable | Description
sItem | The name of the list item. STRING.
index | The index of the list item. The value is one-based. INTEGER.

Examples

STRING sItem = ColorsList.GetItem(1)


GetItem Method (JComboBox)

Class

JComboBox class

Action

Returns the item at the specified index.

Syntax

sItem = comboBox.GetItem(index)
Variable | Description
sItem | The name of the item. STRING.
index | The item index. The value is one-based. INTEGER.

Examples

STRING sItem = ColorsComboBox.GetItem(1)


GetItem Method (JList)

Class

JList class

Action

Returns the item at the specified index.

Syntax

sItem = list.GetItem(index)
Variable | Description
sItem | The name of the item. STRING.
index | The item index. The value is one-based. INTEGER.

Examples

STRING sItem = ColorsList.GetItem(2)


GetItemRect Method (JList)

Class

JList class

Action

Returns the size and position of the item relative to the list.

Syntax

itemRect = list.GetItemRect(item)
Variable | Description
itemRect | The rectangle returned includes the item's X and Y position relative to the list, its width, and its height. RECT.
item | The name or index of the item. LISTITEM.

Examples

RECT rect = ColorsList.GetItemRect("green")
rect = ColorsList.GetItemRect(2)


GetItemRect Method (JTree)

Class

JTree class

Action

Returns the size and position of the item relative to the tree.

Syntax

itemRect = tree.GetItemRect(item)
Variable | Description
itemRect | The rectangle returned includes the item's X and Y position relative to the tree, its width, and its height. RECT.
item | The item path. LISTITEM.

Examples

RECT rect = tree.GetItemRect("/level_1-1/level_2-1/level_3-4")


GetItemText Method (OracleFormsChoice)

Class

OracleFormsChoice class

Action

Returns the item at the specified index.

Syntax

sItemText = oracleFormsChoice.GetItemText(index)
Variable | Description
sItemText | The name of the item. STRING.
index | The index of the item. The value is one-based. INTEGER.


GetItemValue Method (JList)

Class

JList class

Action

Returns the value object of the list item.

Syntax

itemValue = list.GetItemValue(item)
Variable | Description
itemValue | The value object of the list item. ANYTYPE.
item | The name or index of the list item. LISTITEM.

Examples

ANYTPYE item = ColorsList.GetItemValue("green")
item = ColorsList.GetItemValue(2)


GetTabIndex Method (JTabbedPane)

Class

JTabbedPane class

Action

Returns the tab index.

Syntax

tabIndex = tabbedPane.GetTabIndex(title)
Variable | Description
tabIndex | The tab index. The value is one-based. INTEGER.
title | The title of the tab. STRING.

Examples

INTEGER iTabIndex = TabbedPane.GetTabIndex("Alignment")


GetTabIndex Method (OracleFormsTabBar)

Class

OracleFormsTabBar class

Action

Returns the tab index.

Syntax

tabIndex = oracleFormsTabBar.GetTabIndex(title)
Variable | Description
tabIndex | The tab index. The value is one-based. INTEGER.
title | The title of the tab. STRING.


GetTabTitle Method (JTabbedPane)

Class

JTabbedPane class

Action

Returns the tab title.

Syntax

sTabTitle = tabbedPane.GetTabTitle(index)
Variable | Description
sTabTitle | The title of the tab. STRING.
index | The index of the tab. The value is one-based. INTEGER.

Examples

STRING sTabTitle = TabbedPane.GetTabTitle(1)


GetTabTitle Method (OracleFormsTabBar)

Class

OracleFormsTabBar class

Action

Returns the tab title.

Syntax

sTabTitle = oracleFormsTabBar.GetTabTitle(index)
Variable | Description
sTabTitle | The title of the tab. STRING.
index | The index of the tab. The value is one-based. INTEGER.


GetVerticalBar Method (AWTScrollPane)

Class

AWTScrollPane class

Action

Gets the vertical scroll bar.

Syntax

verticalBar = scrollPane.GetVerticalBar()
Variable | Description
verticalBar | The vertical scroll bar control. WINDOW.


GetVerticalBar Method (AWTTextArea)

Class

AWTTextArea class

Action

Gets the vertical scroll bar.

Syntax

verticalBar = textArea.GetVerticalBar()
Variable | Description
verticalBar | The vertical scroll bar control. WINDOW.


GetVerticalBar Method (JScrollPane)

Class

JScrollPane class

Action

Gets the vertical scroll bar.

Syntax

verticalBar = scrollPane.GetVerticalBar()
Variable | Description
verticalBar | WINDOW.


GetVerticalScrollbar Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the vertical scroll bar.

Syntax

verticalScrollbar = oracleFormsListBox.GetVerticalScrollbar()
Variable | Description
verticalScrollbar | The vertical scroll bar control. WINDOW.


GetVerticalScrollbar Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the vertical scroll bar.

Syntax

verticalScrollbar = oracleFormsListView.GetVerticalScrollbar()
Variable | Description
verticalScrollbar | The vertical scroll bar control. WINDOW.


GetVerticalScrollbar Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the vertical scroll bar.

Syntax

verticalScrollbar = oracleFormsTextField.GetVerticalScrollbar()
Variable | Description
verticalScrollbar | The vertical scroll bar control. WINDOW.


GetVerticalScrollbar Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the vertical scroll bar.

Syntax

verticalScrollbar = oracleFormsTree.GetVerticalScrollbar()
Variable | Description
verticalScrollbar | The vertical scroll bar control. WINDOW.


Height Property (AWTComponent)

Class

AWTComponent class

Action

Gets the current height of the component.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iHeight = Component.Height


HorizontalScrollbarPage Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Increments the current scroll position by specified number of pages.

Syntax

oracleFormsListBox.HorizontalScrollbarPage(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.


HorizontalScrollbarPage Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Increments the current scroll position by specified number of pages.

Syntax

oracleFormsListView.HorizontalScrollbarPage(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.


HorizontalScrollbarPage Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Increments the current scroll position by specified number of pages.

Syntax

oracleFormsTextField.HorizontalScrollbarPage(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.


HorizontalScrollbarPage Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Increments the current scroll position by specified number of pages.

Syntax

oracleFormsTree.HorizontalScrollbarPage(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.


HorizontalScrollbarPageSize Property (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarPageSize Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarPageSize Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarPageSize Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarPosition Property (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarPosition Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarPosition Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarPosition Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarRange Property (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only


HorizontalScrollbarRange Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only


HorizontalScrollbarRange Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only


HorizontalScrollbarRange Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only


HorizontalScrollbarScrollToMax Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Scrolls to the maximum position of the scroller.

Syntax

oracleFormsListBox.HorizontalScrollbarScrollToMax()


HorizontalScrollbarScrollToMax Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Scrolls to the maximum position of the scroller.

Syntax

oracleFormsListView.HorizontalScrollbarScrollToMax()


HorizontalScrollbarScrollToMax Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Scrolls to the maximum position of the scroller.

Syntax

oracleFormsTextField.HorizontalScrollbarScrollToMax()


HorizontalScrollbarScrollToMax Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Scrolls to the maximum position of the scroller.

Syntax

oracleFormsTree.HorizontalScrollbarScrollToMax()


HorizontalScrollbarScrollTo Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Scrolls to the specified position.

Syntax

oracleFormsListBox.HorizontalScrollbarScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.


HorizontalScrollbarScrollTo Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Scrolls to the specified position.

Syntax

oracleFormsListView.HorizontalScrollbarScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.


HorizontalScrollbarScrollTo Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Scrolls to the specified position.

Syntax

oracleFormsTextField.HorizontalScrollbarScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.


HorizontalScrollbarScrollTo Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Scrolls to the specified position.

Syntax

oracleFormsTree.HorizontalScrollbarScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.


HorizontalScrollbarScrollToMin Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Scrolls to the minimum position of the scroller.

Syntax

oracleFormsListBox.HorizontalScrollbarScrollToMin()


HorizontalScrollbarScrollToMin Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Scrolls to the minimum position of the scroller.

Syntax

oracleFormsListView.HorizontalScrollbarScrollToMin()


HorizontalScrollbarScrollToMin Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Scrolls to the minimum position of the scroller.

Syntax

oracleFormsTextField.HorizontalScrollbarScrollToMin()


HorizontalScrollbarScrollToMin Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Scrolls to the minimum position of the scroller.

Syntax

oracleFormsTree.HorizontalScrollbarScrollToMin()


HorizontalScrollbarStep Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Increments the current scroll position by specified steps.

Syntax

oracleFormsListBox.HorizontalScrollbarStep(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.


HorizontalScrollbarStep Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Increments the current scroll position by specified steps.

Syntax

oracleFormsListView.HorizontalScrollbarStep(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.


HorizontalScrollbarStep Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Increments the current scroll position by specified steps.

Syntax

oracleFormsTextField.HorizontalScrollbarStep(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.


HorizontalScrollbarStep Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Increments the current scroll position by specified steps.

Syntax

oracleFormsTree.HorizontalScrollbarStep(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.


HorizontalScrollbarStepSize Property (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarStepSize Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarStepSize Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


HorizontalScrollbarStepSize Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


Indeterminate Property (JProgressBar)

Class

JProgressBar class

Action

Gets whether the progress bar is indeterminate.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bIndeterminate = ProgressBar.Indeterminate


Insert Method (AWTTextArea)

Class

AWTTextArea class

Action

Inserts the specified text at the specified position.

Syntax

textArea.Insert(text, pos)
Variable | Description
text | The text to insert. STRING.
pos | The position at which to insert. The value is one-based. INTEGER.

Examples

ColorsTextArea.Insert("yellow", 16)


Insert Method (JTextArea)

Class

JTextArea class

Action

Inserts the specified text at the specified position.

Syntax

textArea.Insert(text, pos)
Variable | Description
text | The text to insert. STRING.
pos | The position at which to insert text. The value is one-based. INTEGER.

Examples

TextArea.Insert("magenta", 5)


Inverted Property (JSlider)

Class

JSlider class

Action

Gets the value is true if the value-range shown for the slider is reversed.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bInverted = VerticalSlider.Inverted


IsCellEditable Method (JTable)

Class

JTable class

Action

Returns true if the specified cell is editable.

Syntax

bCellEditable = table.IsCellEditable(row, column)
Variable | Description
bCellEditable | True if the cell is editable; otherwise false. BOOLEAN.
row | The index of the row. The value is one-based. INTEGER.
column | The name or index of the column. LISTITEM.

Examples

BOOLEAN bCellEditable = Table.IsCellEditable(1, "Street")
bCellEditable = Table.IsCellEditable(1, 4)


IsCellSelected Method (JTable)

Class

JTable class

Action

Returns true if the specified cell is selected; otherwise false.

Syntax

bCellSelected = table.IsCellSelected(row, column)
Variable | Description
bCellSelected | True if the cell is selected; otherwise false. BOOLEAN.
row | The index of the row. The value is one-based. INTEGER.
column | The name or index of the column. LISTITEM.

Examples

BOOLEAN bCellSelected = Table.IsCellSelected(1, "Street")
bCellSelected = Table.IsCellSelected(1, 4)


IsChecked Method (OracleFormsMenu)

Class

OracleFormsMenu class

Action

a value that indicates whether the MenuItem is checked.

Syntax

bChecked = oracleFormsMenu.IsChecked(item)
Variable | Description
bChecked | BOOLEAN.
item | The menu item to check. Can be either a top-level menu item or a menu item that can be found in a submenu. For checking a menu item from a submenu separate the menu item names with a slash. The item can contain the wildcards '?' (matches one character) or '*' (matches 0 to many characters). LISTITEM.


IsColumnSelected Method (JTable)

Class

JTable class

Action

Returns true if the specified column is selected.

Syntax

bColumnSelected = table.IsColumnSelected(column)
Variable | Description
bColumnSelected | True if the column is selected; otherwise false. BOOLEAN.
column | The name or index of the column. LISTITEM.

Examples

BOOLEAN bColumnSelected = Table.IsColumnSelected("Product Name")
bColumnSelected = Table.IsColumnSelected(3)


IsEditable Property (JTree)

Class

JTree class

Action

Gets whether the tree is editable.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bEditable = Tree.IsEditable


IsEditing Property (JTree)

Class

JTree class

Action

Gets whether the tree is being edited.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bEditing = Tree.IsEditing


IsExpanded Method (JTree)

Class

JTree class

Action

Returns 'true' if the specified item path is expanded.

Syntax

bExpanded = tree.IsExpanded(item)
Variable | Description
bExpanded | True if the specified item path is expanded; otherwise false. BOOLEAN.
item | The item path. LISTITEM.

Examples

BOOLEAN bExpanded = Tree.IsExpanded("/level_1-1/level_2-1/level_3-4")


IsExpanded Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Returns 'true' if the specified item path is expanded.

Syntax

bExpanded = oracleFormsTree.IsExpanded(item)
Variable | Description
bExpanded | True if the specified item path is expanded; otherwise false. BOOLEAN.
item | The item path. LISTITEM.


IsFocused Method (AWTComponent)

Class

AWTComponent class

Action

Return whether the control has focus.

Syntax

bFocused = component.IsFocused()
Variable | Description
bFocused | True if this object has the focus. BOOLEAN.


IsFocused Method (AWTMenuComponent)

Class

AWTMenuComponent class

Action

Return whether the control has focus.

Syntax

bFocused = menuComponent.IsFocused()
Variable | Description
bFocused | True if this object has the focus. BOOLEAN.


IsPassword Property (AWTTextField)

Class

AWTTextField class

Action

Gets whether the text field is a password text field.

Data Type

BOOLEAN

Access

Read only


IsPassword Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets whether the text field is a password text field.

Data Type

BOOLEAN

Access

Read only


IsPathEditable Method (JTree)

Class

JTree class

Action

whether an item path is editable.

Syntax

bPathEditable = tree.IsPathEditable(item)
Variable | Description
bPathEditable | True if the specified item path is editable; otherwise false. BOOLEAN.
item | The item path. LISTITEM.

Examples

BOOLEAN bPathEditable = Tree.IsPathEditable("/level_1-1/level_2-1/level_3-4")


IsRowSelected Method (JTable)

Class

JTable class

Action

Returns true if the specified row is selected.

Syntax

bRowSelected = table.IsRowSelected(row)
Variable | Description
bRowSelected | True if the row is selected; otherwise false. BOOLEAN.
row | The index of the row. The value is one-based. INTEGER.

Examples

BOOLEAN bRowSelected = Table.IsRowSelected(1)


IsRowVisible Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Returns whether the specified row is visible.

Syntax

bRowVisible = oracleFormsListView.IsRowVisible(index)
Variable | Description
bRowVisible | BOOLEAN.
index | The index of the row. The value is one-based. INTEGER.


IsTabEnabled Method (JTabbedPane)

Class

JTabbedPane class

Action

Returns whether or not the tab is currently enabled.

Syntax

bTabEnabled = tabbedPane.IsTabEnabled(tab)
Variable | Description
bTabEnabled | True if the tab is enabled; otherwise false. BOOLEAN.
tab | The name or index of the tab. LISTITEM.

Examples

BOOLEAN bTabEnabled = TabbedPane.IsTabEnabled("Alignment")
bTabEnabled = TabbedPane.bTabEnabled(1)


IsTabEnabled Method (OracleFormsTabBar)

Class

OracleFormsTabBar class

Action

Returns whether or not the tab is currently enabled.

Syntax

bTabEnabled = oracleFormsTabBar.IsTabEnabled(tab)
Variable | Description
bTabEnabled | True if the tab is enabled; otherwise false. BOOLEAN.
tab | The name or index of the tab. LISTITEM.


IsVisible Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Returns 'true' if the specified item path is visible.

Syntax

bVisible = oracleFormsTree.IsVisible(item)
Variable | Description
bVisible | True if the specified item path is visible; otherwise false. BOOLEAN.
item | The item path. LISTITEM.


ItemCount Property (AWTChoice)

Class

AWTChoice class

Action

Gets the number of items in the combo box.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iItemCount = ColorsChoice.ItemCount


ItemCount Property (AWTList)

Class

AWTList class

Action

Gets the number of list items.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iItemCount = ColorsList.ItemCount


ItemCount Property (JComboBox)

Class

JComboBox class

Action

Gets the number of items in the list.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iItemCount = ColorsComboBox.ItemCount


ItemCount Property (JList)

Class

JList class

Action

Gets the number of list items.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iItemCount = ColorsList.ItemCount


ItemCount Property (OracleFormsChoice)

Class

OracleFormsChoice class

Action

Gets the number of items in the choice.

Data Type

INTEGER

Access

Read only


Items Property (AWTChoice)

Class

AWTChoice class

Action

Gets the list of combo box items.

Data Type

LIST OF LISTITEM

Access

Read only

Examples

LIST OF LISTITEM lsItems = ColorsChoice.Items


Items Property (AWTList)

Class

AWTList class

Action

Gets a list of items in the list.

Data Type

LIST OF LISTITEM

Access

Read only

Examples

LIST OF LISTITEM lsItems = ColorsList.Items


Items Property (JComboBox)

Class

JComboBox class

Action

Gets the list of all contained items.

Data Type

LIST OF LISTITEM

Access

Read only

Examples

LIST OF LISTITEM lsItems = ColorsComboBoxB.Items


Items Property (JList)

Class

JList class

Action

Gets the list of all contained list items.

Data Type

LIST OF LISTITEM

Access

Read only

Examples

LIST OF LISTITEM lsItems = ColorsList.Items


Items Property (OracleFormsChoice)

Class

OracleFormsChoice class

Action

Gets the list of choice items.

Data Type

LIST OF LISTITEM

Access

Read only


LogicalStyle Property (JTextPane)

Class

JTextPane class

Action

Gets the logical style assigned to the current paragraph in effect at the location of the caret.

Data Type

STRING

Access

Read only

Examples

STRING sLogicalStyle = TextPane.LogicalStyle


MaximumDividerLocation Property (JSplitPane)

Class

JSplitPane class

Action

Gets the maximum location of the divider.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iMaximumDividerLocation = SplitPane.MaximumDividerLocation


Maximum Property (JProgressBar)

Class

JProgressBar class

Action

Gets the progress bar's maximum value.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iMaximum = ProgressBar.Maximum


Maximum Property (JSlider)

Class

JSlider class

Action

Gets the maximum value supported by the slider.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iMaximum = VerticalSlider.Maximum


MinimumDividerLocation Property (JSplitPane)

Class

JSplitPane class

Action

Gets the minimum location of the divider.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iMinimumDividerLocation = SplitPane.MinimumDividerLocation


Minimum Property (JProgressBar)

Class

JProgressBar class

Action

Gets the progress bar's minimum value.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iMinimum = ProgressBar.Minimum


Minimum Property (JSlider)

Class

JSlider class

Action

Gets the minimum value supported by the slider.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iMinimum = VerticalSlider.Minimum


Modal Property (AWTDialog)

Class

AWTDialog class

Action

Gets whether the dialog is modal.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bModal = OptionsDialog.Modal


MoveColumn Method (JTable)

Class

JTable class

Action

Moves the column to the position of the target column.

Syntax

table.MoveColumn(column, targetColumn)
Variable | Description
column | The name or index of the column to move. LISTITEM.
targetColumn | The name or index of the target column. LISTITEM.

Examples

Table.MoveColumn(5, 3)


MultipleMode Property (AWTList)

Class

AWTList class

Action

Gets whether the list allows multiple selection.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bMultipleMode = ColorsList.MultipleMode


Name Property (AWTComponent)

Class

AWTComponent class

Action

Gets the name of the component.

Data Type

STRING

Access

Read only

Examples

STRING sName = Component.Name


NativeHandle Property (AWTComponent)

Class

AWTComponent class

Action

Gets the native window handle for the object.

Data Type

INTEGER

Access

Read only


Next Method (JSpinner)

Class

JSpinner class

Action

Sets the spinner to the object in the sequence that comes after the object returned by the Value property.

Syntax

spinner.Next()

Examples

MonthSpinner.Next()


Page Method (AWTScrollbar)

Class

AWTScrollbar class

Action

Increments the current scroll position by specified number of pages.

Syntax

scrollbar.Page(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.

Examples

ScrollBar.Page(1)


Page Method (JScrollBar)

Class

JScrollBar class

Action

Increments the current scroll position by specified number of pages.

Syntax

scrollBar.Page(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.

Examples

ScrollBar.Page(1)


Page Property (JEditorPane)

Class

JEditorPane class

Action

Gets the current URL being displayed.

Data Type

STRING

Access

Read only

Examples

STRING sPage = EditorPane.Page


PageSize Property (AWTScrollbar)

Class

AWTScrollbar class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iPageSize = ScrollBar.PageSize


PageSize Property (JScrollBar)

Class

JScrollBar class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iPageSize = ScrollBar.PageSize


PageSize Property (OracleFormsScrollbar)

Class

OracleFormsScrollbar class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iPageSize = ScrollBar.PageSize


ParagraphAttributes Property (JTextPane)

Class

JTextPane class

Action

Gets the attributes of the current paragraph in effect at the location of the caret.

Data Type

LIST OF STRING

Access

Read only

Examples

LIST OF STRING lsParagraphAttributes = TextPane.ParagraphAttributes


PasswordChar Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the character that is displayed instead of the characters that are actually typed, if the text field is a password text field.

Data Type

STRING

Access

Read only


Position Property (AWTScrollbar)

Class

AWTScrollbar class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iPosition = ScrollBar.Position


Position Property (AWTScrollPane)

Class

AWTScrollPane class

Action

Gets the current scroll position of the scrollable component.

Data Type

POINT

Access

Read only


Position Property (AWTTextArea)

Class

AWTTextArea class

Action

Gets the current scroll position of the scrollable component.

Data Type

POINT

Access

Read only


Position Property (JScrollBar)

Class

JScrollBar class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iPosition = ScrollBar.Position


Position Property (JScrollPane)

Class

JScrollPane class

Action

Gets the current scroll position of the scrollable component.

Data Type

POINT

Access

Read only


Position Property (JSlider)

Class

JSlider class

Action

Gets the position of the slider.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iPosition = VerticalSlider.Position


Position Property (OracleFormsScrollbar)

Class

OracleFormsScrollbar class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iPosition = ScrollBar.Position


Previous Method (JSpinner)

Class

JSpinner class

Action

Sets the spinner to the object in the sequence that comes before the object returned by the Value property.

Syntax

spinner.Previous()

Examples

MonthSpinner.Previous()


ProgressString Property (JProgressBar)

Class

JProgressBar class

Action

Gets the string representation of the current progress.

Data Type

STRING

Access

Read only

Examples

STRING sProgress = ProgressBar.ProgressString


Range Property (AWTScrollbar)

Class

AWTScrollbar class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only

Examples

INTEGER iRange = ScrollBar.Range


Range Property (JScrollBar)

Class

JScrollBar class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only

Examples

INTEGER iRange = ScrollBar.Range


Range Property (OracleFormsScrollbar)

Class

OracleFormsScrollbar class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only

Examples

INTEGER iRange = ScrollBar.Range


ReplaceRange Method (AWTTextArea)

Class

AWTTextArea class

Action

Replaces text between the specified start and end positions with the specified replacement text.

Syntax

textArea.ReplaceRange(text, start, end)
Variable | Description
text | The text to use as the replacement. STRING.
start | The start position. The value is one-based. INTEGER.
end | The end position. The value is one-based. INTEGER.

Examples

ColorsTextArea.ReplaceRange("blue", 31, 37)


ReplaceRange Method (JTextArea)

Class

JTextArea class

Action

Replaces text within the specified range with the new text specified.

Syntax

textArea.ReplaceRange(text, start, end)
Variable | Description
text | The text to use as the replacement. STRING.
start | The start position. The value is one-based. INTEGER.
end | The end position. The value is one-based. INTEGER.

Examples

TextArea.ReplaceRange("yellow", 5, 9)


Resizable Property (AWTDialog)

Class

AWTDialog class

Action

Gets whether the dialog is resizable by the user.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bResizable = OptionsDialog.Resizable


Resizable Property (AWTFrame)

Class

AWTFrame class

Action

Gets whether the frame is resizable by the user.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bResizable = FrameWindow.Resizable


ResizeColumn Method (JTable)

Class

JTable class

Action

Resizes the specified column.

Syntax

table.ResizeColumn(column, width)
Variable | Description
column | The name or index of the column to resize. LISTITEM.
width | The new width for the column. INTEGER.

Examples

Table.ResizeColumn("Street", 150)
Table.ResizeColumn(3, 150)


RowCount Property (JTable)

Class

JTable class

Action

Gets the number of rows that can be shown in the table.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iRowCount = Table.RowCount


RowCount Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the number of rows in the listview.

Data Type

INTEGER

Access

Read only


Rows Property (AWTTextArea)

Class

AWTTextArea class

Action

Gets the number of rows in the text area. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iRows = ColorsTextArea.Rows


Rows Property (JTextArea)

Class

JTextArea class

Action

Gets the number of rows in the text area. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iRows = TextArea.Rows


ScrollCellIntoView Method (JTable)

Class

JTable class

Action

Scrolls the specified cell into view.

Syntax

table.ScrollCellIntoView(row, column)
Variable | Description
row | The index of the row. The value is one-based. INTEGER.
column | The name or index of the column. LISTITEM.

Examples

Table.ScrollCellIntoView(25, "Street")
Table.ScrollCellIntoView(25, 4)


ScrollIntoView Method (AWTComponent)

Class

AWTComponent class

Action

Scrolls the component into view if it is hidden and a child of a scroll pane.

Syntax

component.ScrollIntoView()

Examples

Component.ScrollIntoView()


ScrollItemIntoView Method (JList)

Class

JList class

Action

Scrolls an item into view.

Syntax

list.ScrollItemIntoView(item)
Variable | Description
item | The name or index of the item to scroll into view. LISTITEM.

Examples

ColorsList.ScrollItemIntoView("orange")
ColorsList.ScrollItemIntoView(10)


ScrollItemIntoView Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Scrolls the given item path to a visible position.

Syntax

oracleFormsTree.ScrollItemIntoView(item)
Variable | Description
item | The item path. LISTITEM.


ScrollPathIntoView Method (JTree)

Class

JTree class

Action

Scrolls the given item path to a visible position.

Syntax

tree.ScrollPathIntoView(item)
Variable | Description
item | The item path. LISTITEM.

Examples

Tree.ScrollPathIntoView("/level_1-1/level_2-1/level_3-4")


ScrollToMax Method (OracleFormsScrollbar)

Class

OracleFormsScrollbar class

Action

Scrolls to the maximum position of the scroller.

Syntax

oracleFormsScrollbar.ScrollToMax()


ScrollTo Method (AWTScrollbar)

Class

AWTScrollbar class

Action

Scrolls to the specified position.

Syntax

scrollbar.ScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.

Examples

ScrollBar.ScrollTo(2)


ScrollTo Method (JScrollBar)

Class

JScrollBar class

Action

Scrolls to the specified position.

Syntax

scrollBar.ScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.

Examples

ScrollBar.ScrollTo(2)


ScrollTo Method (JScrollPane)

Class

JScrollPane class

Action

Scrolls to the specified position.

Syntax

scrollPane.ScrollTo(position)
Variable | Description
position | The position to scroll to. POINT.


ScrollToMin Method (OracleFormsScrollbar)

Class

OracleFormsScrollbar class

Action

Scrolls to the minimum position of the scroller.

Syntax

oracleFormsScrollbar.ScrollToMin()


ScrollToRow Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Scrolls to the specified row.

Syntax

oracleFormsListView.ScrollToRow(index)
Variable | Description
index | The row to scroll to. The value is one-based. INTEGER.


SelectAll Method (AWTList)

Class

AWTList class

Action

Selects all items in the list.

Syntax

list.SelectAll()

Examples

ColorsList.SelectAll()


SelectAll Method (AWTTextComponent)

Class

AWTTextComponent class

Action

Selects all the text in the text component.

Syntax

textComponent.SelectAll()

Examples

TextComponent.SelectAll()


SelectAll Method (JList)

Class

JList class

Action

Selects all list elements.

Syntax

list.SelectAll()

Examples

ColorsList.SelectAll()


SelectAll Method (JTable)

Class

JTable class

Action

Selects all rows, columns, and cells in the table.

Syntax

table.SelectAll()

Examples

Table.SelectAll()


SelectAll Method (JTextComponent)

Class

JTextComponent class

Action

Selects all the content in the text component.

Syntax

textComponent.SelectAll()

Examples

TextComponent.SelectAll()


SelectAll Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Selects all the text in the text field.

Syntax

oracleFormsTextField.SelectAll()


SelectColumn Method (JTable)

Class

JTable class

Action

Selects the specified column.

Syntax

table.SelectColumn(column, [clearSelection])
Variable | Description
column | The name or index of the column to select. LISTITEM.
clearSelection | Optional.Whether to clear the previous selection. The default is true. BOOLEAN.

Examples

Table.SelectColumn("Street", FALSE)
Table.SelectColumn(5, FALSE)


SelectedColumn Property (JTable)

Class

JTable class

Action

Gets the index or name of the selected column. -1 (4Test: 0) is returned if no column is selected.

If multiple column selection is allowed, returns the index or name of the first selected column.

Data Type

LISTITEM

Access

Read only

Examples

LISTITEM sSelectedColumn = Table.SelectedColumn


SelectedColumns Property (JTable)

Class

JTable class

Action

Gets the list of indices of all selected columns.

Data Type

LIST OF LISTITEM

Access

Read only

Examples

LIST OF LISTITEM lsSelectedColumns = Table.SelectedColumns


SelectedIndex Property (AWTChoice)

Class

AWTChoice class

Action

Gets the index of the selected item. -1 (4Test: 0) is returned, if no item is currently selected. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectedIndex = ColorsChoice.SelectedIndex


SelectedIndex Property (AWTList)

Class

AWTList class

Action

Gets the index of the currently selected item. -1 (4Test: 0) is returned, if no item is currently selected. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectedIndex = ColorsList.SelectedIndex


SelectedIndex Property (JComboBox)

Class

JComboBox class

Action

Gets the index of the currently selected item. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectedIndex = ColorsComboBox.SelectedIndex


SelectedIndex Property (JList)

Class

JList class

Action

Gets the index of the selected list item. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectedIndex = ColorsList.SelectedIndex


SelectedIndex Property (OracleFormsChoice)

Class

OracleFormsChoice class

Action

Gets the index of the selected item. -1 (4Test: 0) is returned, if no item is currently selected. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectedIndices Property (AWTList)

Class

AWTList class

Action

Gets the indices of the currently selected items. An empty list is returned, if no items are currently selected.

Data Type

LIST OF INTEGER

Access

Read only

Examples

LIST OF INTEGER liSelectedIndices = ColorsList.SelectedIndices


SelectedIndices Property (JList)

Class

JList class

Action

Gets the list of indices of the selected list items.

Data Type

LIST OF INTEGER

Access

Read only

Examples

LIST OF INTEGER liSelectedIndices = ColorsList.SelectedIndices)


SelectedItemPath Property (JTree)

Class

JTree class

Action

Gets the selected item path.

Data Type

LISTITEM

Access

Read only

Examples

LISTITEM sSelectedItemPath = Tree.SelectedItemPath


SelectedItemPath Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the list of selected item path.

Data Type

LISTITEM

Access

Read only


SelectedItemPaths Property (JTree)

Class

JTree class

Action

Gets the list of selected item paths.

Data Type

LIST OF LISTITEM

Access

Read only

Examples

LIST OF LISTITEM lsSelectedItemPaths = Tree.SelectedItemPaths


SelectedItem Property (AWTChoice)

Class

AWTChoice class

Action

Gets the selected item. NULL is returned, if no item is currently selected.

Data Type

LISTITEM

Access

Read only

Examples

LISTITEM sSelectedItem = ColorsChoice.SelectedItem


SelectedItem Property (AWTList)

Class

AWTList class

Action

Gets the currently selected list item. NULL is returned, if no item is currently selected.

Data Type

LISTITEM

Access

Read only

Examples

LISTITEM sSelectedItem = ColorsList.SelectedItem


SelectedItem Property (JComboBox)

Class

JComboBox class

Action

Gets the current selected item.

Data Type

LISTITEM

Access

Read only

Examples

LISTITEM sSelectedItem = ColorsComboBox.SelectedItem


SelectedItem Property (JList)

Class

JList class

Action

Gets the name or index of the selected list item.

Data Type

LISTITEM

Access

Read only

Examples

LISTITEM lsSelectedItem = ColorsList.SelectedItem


SelectedItem Property (OracleFormsChoice)

Class

OracleFormsChoice class

Action

Gets the selected item.

Data Type

LISTITEM

Access

Read only


SelectedItems Property (AWTList)

Class

AWTList class

Action

Gets the currently selected list items. An empty list is returned, if no items are currently selected.

Data Type

LIST OF LISTITEM

Access

Read only

Examples

LIST OF LISTITEM lsSelectedItems = ColorsList.SelectedItems


SelectedItems Property (JList)

Class

JList class

Action

Gets the list of names or indices of the selected list items.

Data Type

LIST OF LISTITEM

Access

Read only

Examples

LIST OF LISTITEM lsSelectedItems = ColorsList.SelectedItems


SelectedItemText Property (JTree)

Class

JTree class

Action

Gets the selected item text.

Data Type

STRING

Access

Read only

Examples

STRING sSelectedItemText = Tree.SelectedItemText


SelectedItemText Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the selected item text.

Data Type

STRING

Access

Read only


Selected Property (JToggleButton)

Class

JToggleButton class

Action

Gets whether the toggle button is selected.

Data Type

BOOLEAN

Access

Read only

Examples

BOOLEAN bSelected = ToggleButton.Selected


SelectedRow Property (JTable)

Class

JTable class

Action

Gets the index of the selected row, -1 (4Test: 0) is returned if no row is selected. The value is one-based.

If multiple row selection is allowed, returns the index of the first selected row.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectedReow = Table.SelectedRow


SelectedRow Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the index of the selected row, -1 (4Test: 0) is returned if no row is selected. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectedRows Property (JTable)

Class

JTable class

Action

Gets the list of indices of all selected rows.

Data Type

LIST OF INTEGER

Access

Read only

Examples

LIST OF INTEGER liSelectedRows = Table.SelectedRows


SelectedTabIndex Property (JTabbedPane)

Class

JTabbedPane class

Action

Gets the index of the currently selected tab or -1 (4Test: 0) if no tab is selected. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectedTab Property (JTabbedPane)

Class

JTabbedPane class

Action

Gets the currently selected tab.

Data Type

LISTITEM

Access

Read only

Examples

STRING sSelectedTab = TabbedPane.SelectedTab("Alignment")
sSelectedTab = TabbedPane.SelectedTab(1)


SelectedTab Property (OracleFormsTabBar)

Class

OracleFormsTabBar class

Action

Gets the currently selected tab.

Data Type

LISTITEM

Access

Read only


SelectedText Property (AWTTextComponent)

Class

AWTTextComponent class

Action

Gets the current selected text.

Data Type

STRING

Access

Read only

Examples

STRING sSelectedText = TextComponent.SelectedText


SelectedText Property (JTextComponent)

Class

JTextComponent class

Action

Gets the current selected text.

Data Type

STRING

Access

Read only

Examples

STRING sSelectedText = TextComponent.SelectedText


SelectedText Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the current selected text.

Data Type

STRING

Access

Read only


SelectionCount Property (JTree)

Class

JTree class

Action

Gets the number of tree nodes selected.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectionCount = Tree.SelectionCount


SelectionEnd Property (AWTTextComponent)

Class

AWTTextComponent class

Action

Gets the end position of the selected text. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectionEnd = TextComponent.SelectionEnd


SelectionEnd Property (JTextComponent)

Class

JTextComponent class

Action

Gets the end position of the selection. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectionEnd = TextComponent.SelectionEnd


SelectionEnd Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the end position of the selected text. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectionStart Property (AWTTextComponent)

Class

AWTTextComponent class

Action

Gets the start position of the selected text. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectionStart = TextComponent.SelectionStart


SelectionStart Property (JTextComponent)

Class

JTextComponent class

Action

Gets the start position of the selection. The value is one-based.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iSelectionStart = TextComponent.SelectionStart


SelectionStart Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the start position of the selected text. The value is one-based.

Data Type

INTEGER

Access

Read only


Select Method (AbstractButton)

Class

AbstractButton class

Action

Selects the button.

Syntax

abstractButton.Select()


Select Method (AWTButton)

Class

AWTButton class

Action

Selects the button.

Syntax

button.Select()

Examples

OKButton.Select()


Select Method (AWTChoice)

Class

AWTChoice class

Action

Selects the specified item in the combo box.

Syntax

choice.Select(item)
Variable | Description
item | The name or index of the item to select. LISTITEM.

Examples

ColorsChoice.Select("yellow")
ColorsChoice.Select(1)


Select Method (AWTList)

Class

AWTList class

Action

Selects the specified item.

Syntax

list.Select(item)
Variable | Description
item | The name or index of the item to select. LISTITEM.

Examples

ColorsList.Select("red")
ColorsList.Select(1)


Select Method (AWTMenuItem)

Class

AWTMenuItem class

Action

Selects the menu item.

Syntax

menuItem.Select()

Examples

OpenFileMenuItem.Select()


Select Method (JComboBox)

Class

JComboBox class

Action

Selects the specified item.

Syntax

comboBox.Select(item)
Variable | Description
item | The name or index of the item to select. LISTITEM.

Examples

ColorsComboBox.Select("red")
ColorsComboBox.Select(1)


Select Method (JList)

Class

JList class

Action

Selects a list item.

Syntax

list.Select(item)
Variable | Description
item | The name or index of the list item. LISTITEM.

Examples

ColorsList.Select("orange")
ColorsList.Select(10)


Select Method (JMenuItem)

Class

JMenuItem class

Action

Selects the specified menu item.

Syntax

menuItem.Select()


Select Method (JTabbedPane)

Class

JTabbedPane class

Action

Selects the specified tab.

Syntax

tabbedPane.Select(tab)
Variable | Description
tab | The name or index of the tab to select. LISTITEM.

Examples

TabbedPane.Select("Alignment")
TabbedPane.Select(1)


Select Method (JTree)

Class

JTree class

Action

Selects a tree node identified by the specified item path.

Syntax

tree.Select(item)
Variable | Description
item | The item path. LISTITEM.

Examples

Tree.Select("/level_1-1/level_2-1/level_3-4")


Select Method (OracleFormsButton)

Class

OracleFormsButton class

Action

Selects the button.

Syntax

oracleFormsButton.Select()


Select Method (OracleFormsChoice)

Class

OracleFormsChoice class

Action

Selects the specified item in the choice.

Syntax

oracleFormsChoice.Select(item)
Variable | Description
item | The name or index of the item to select. LISTITEM.


Select Method (OracleFormsMenu)

Class

OracleFormsMenu class

Action

Selects a menu item.

Syntax

oracleFormsMenu.Select(item)
Variable | Description
item | The menu item to select. Can be either a top-level menu item or a menu item that can be found in a submenu. For selecting a menu item from a submenu separate the menu item names with a slash. The item can contain the wildcards '?' (matches one character) or '*' (matches 0 to many characters). LISTITEM.


Select Method (OracleFormsMenuItem)

Class

OracleFormsMenuItem class

Action

Selects a menu item.

Syntax

oracleFormsMenuItem.Select()


Select Method (OracleFormsTabBar)

Class

OracleFormsTabBar class

Action

Selects the specified tab.

Syntax

oracleFormsTabBar.Select(tab)
Variable | Description
tab | The name or index of the tab to select. LISTITEM.


Select Method (OracleFormsTabBarItem)

Class

OracleFormsTabBarItem class

Action

Selects the tab.

Syntax

oracleFormsTabBarItem.Select()


Select Method (OracleFormsToolBarItem)

Class

OracleFormsToolBarItem class

Action

Selects the element.

Syntax

oracleFormsToolBarItem.Select()


Select Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Selects a tree node identified by the specified item path.

Syntax

oracleFormsTree.Select(item)
Variable | Description
item | The item path. LISTITEM.


SelectRange Method (AWTList)

Class

AWTList class

Action

Selects all items within the specified range.

Syntax

list.SelectRange(fromElement, toElement)
Variable | Description
fromElement | The first element to select. LISTITEM.
toElement | The last element to select. LISTITEM.

Examples

ColorsList.SelectRange(3, 5)


SelectRange Method (JList)

Class

JList class

Action

Selects a specified range of list elements.

Syntax

list.SelectRange(fromElement, toElement)
Variable | Description
fromElement | The name or index of the start element. LISTITEM.
toElement | The name or index of the end element. LISTITEM.

Examples

ColorsList.SelectRange("red", "green")
ColorsList.SelectRange(1, 2)


SelectRow Method (JTable)

Class

JTable class

Action

Selects the specified row.

Syntax

table.SelectRow(row, [clearSelection])
Variable | Description
row | The row to select. The value is one-based. INTEGER.
clearSelection | Optional.Whether to clear the previous selection. The default is true. BOOLEAN.

Examples

Table.SelectRow(1, FALSE)


SelectRow Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Selects the specified row.

Syntax

oracleFormsListView.SelectRow(index)
Variable | Description
index | The row to select. The value is one-based. INTEGER.


SetCaretPosition Method (AWTTextComponent)

Class

AWTTextComponent class

Action

Sets the position of the text insertion caret for this text component.

Syntax

textComponent.SetCaretPosition(index)
Variable | Description
index | New position of the text insertion caret. The value is one-based. INTEGER.

Examples

TextComponent.SetCaretPosition(7)


SetCaretPosition Method (JTextComponent)

Class

JTextComponent class

Action

Sets the position of the text insertion caret for this text component.

Syntax

textComponent.SetCaretPosition(index)
Variable | Description
index | The position of the text caret. The value is one-based. INTEGER.

Examples

TextComponent.SetCaretPosition(15)


SetCaretPosition Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Sets the position of the text insertion caret for this text field.

Syntax

oracleFormsTextField.SetCaretPosition(index)
Variable | Description
index | New position of the text insertion caret. The value is one-based. INTEGER.


SetCellValue Method (JTable)

Class

JTable class

Action

Sets the specified value for the specified cell in the table.

Syntax

table.SetCellValue(row, column, value)
Variable | Description
row | The index of the row. The value is one-based. INTEGER.
column | The name or index of the column. LISTITEM.
value | The cell value object. ANYTYPE.

Examples

Table.SetCellValue(1, "Product Name", "SilkTest")
Table.SetCellValue(1, 4, "SilkTest")


SetColor Method (JColorChooser)

Class

JColorChooser class

Action

Sets the current color of the color chooser to the specified color.

Syntax

colorChooser.SetColor(color)
Variable | Description
color | The color to set. COLOR.

Examples

COLOR colorRed = {255, 0, 0}
ColorChooser.SetColor(colorRed)


SetColumnWidth Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Sets the width of the specified column.

Syntax

oracleFormsListView.SetColumnWidth(column, width)
Variable | Description
column | The name or index of the column to resize. LISTITEM.
width | The new width for the column. INTEGER.


SetFocus Method (AWTComponent)

Class

AWTComponent class

Action

Gives focus to the control.

Syntax

component.SetFocus()


SetFocus Method (AWTMenuComponent)

Class

AWTMenuComponent class

Action

Gives focus to the control.

Syntax

menuComponent.SetFocus()


SetPosition Method (JSlider)

Class

JSlider class

Action

Sets the current position of the slider.

Syntax

slider.SetPosition(position)
Variable | Description
position | The current value of the slider position. INTEGER.

Examples

VerticalSlider.SetPosition(10)


SetPosition Method (JSplitPane)

Class

JSplitPane class

Action

Sets the position of the divider.

Syntax

splitPane.SetPosition(position)
Variable | Description
position | The new position of the divider. INTEGER.

Examples

SplitPane.SetPosition(100)


SetSelectionRange Method (AWTTextComponent)

Class

AWTTextComponent class

Action

Selects the text within the specified range.

Syntax

textComponent.SetSelectionRange(selectionStart, selectionEnd)
Variable | Description
selectionStart | The start position of the selection. The value is one-based. INTEGER.
selectionEnd | The end position of the selection. The value is one-based. INTEGER.

Examples

TextComponent.SetSelectionRange(11, 15)


SetSelectionRange Method (JTextComponent)

Class

JTextComponent class

Action

Selects the text within the specified range.

Syntax

textComponent.SetSelectionRange(selectionStart, selectionEnd)
Variable | Description
selectionStart | The start index of the selection. The value is one-based. INTEGER.
selectionEnd | The end index of the selection. The value is one-based. INTEGER.

Examples

TextComponent.SetSelectionRange(8, 13)


SetSelectionRange Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Selects the text within the specified range.

Syntax

oracleFormsTextField.SetSelectionRange(selectionStart, selectionEnd)
Variable | Description
selectionStart | The start position of the selection. The value is one-based. INTEGER.
selectionEnd | The end position of the selection. The value is one-based. INTEGER.


SetText Method (AWTTextComponent)

Class

AWTTextComponent class

Action

Sets the text of the text component to the specified text.

Syntax

textComponent.SetText(text)
Variable | Description
text | New text of the text component. STRING.

Examples

TextComponent.SetText("SilkTest")


SetText Method (JTextComponent)

Class

JTextComponent class

Action

Sets the text content to the specified text.

Syntax

textComponent.SetText(text)
Variable | Description
text | The new text content. STRING.

Examples

TextComponent.SetText("blue")


SetText Method (OracleFormsComboBox)

Class

OracleFormsComboBox class

Action

Sets the text of the combo box to the specified text.

Syntax

oracleFormsComboBox.SetText(text)
Variable | Description
text | New text of the combo box. STRING.


SetText Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Sets the text of the text field to the specified text.

Syntax

oracleFormsTextField.SetText(text)
Variable | Description
text | New text of the text field. STRING.


SplashScreenRunning Property (OracleFormsApplication)

Class

OracleFormsApplication class

Action

Gets whether the application currently displays a splash screen.

Data Type

BOOLEAN

Access

Read only


StartEditing Method (JTree)

Class

JTree class

Action

Starts editing at given item path or current selection.

Syntax

tree.StartEditing([item])
Variable | Description
item | Optional.The item path. LISTITEM.

Examples

Tree.StartEditing("/level_1-1/level_2-1/level_3-4")


Step Method (AWTScrollbar)

Class

AWTScrollbar class

Action

Increments the current scroll position by specified steps.

Syntax

scrollbar.Step(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.

Examples

ScrollBar.Step(1)


Step Method (JScrollBar)

Class

JScrollBar class

Action

Increments the current scroll position by specified steps.

Syntax

scrollBar.Step(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.

Examples

ScrollBar.Step(1)


StepSize Property (AWTScrollbar)

Class

AWTScrollbar class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iStepSize = ScrollBar.StepSize


StepSize Property (JScrollBar)

Class

JScrollBar class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iStepSize = ScrollBar.StepSize


StepSize Property (OracleFormsScrollbar)

Class

OracleFormsScrollbar class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iStepSize = ScrollBar.StepSize


StopEditing Method (JTree)

Class

JTree class

Action

Stops the current editing session.

Syntax

tree.StopEditing()

Examples

Tree.StopEditing()


TabCount Property (JTabbedPane)

Class

JTabbedPane class

Action

Gets the number of tabs.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iTabCount = TabbedPane.TabCount


TabCount Property (OracleFormsTabBar)

Class

OracleFormsTabBar class

Action

Gets the number of tabs.

Data Type

INTEGER

Access

Read only


TabRunCount Property (JTabbedPane)

Class

JTabbedPane class

Action

Gets the number of tab runs currently used to display the tabs.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iTabRunCount = TabbedPane.TabRunCount


Text Property (AWTTextComponent)

Class

AWTTextComponent class

Action

Gets the text of the text area.

Data Type

STRING

Access

Read only

Examples

STRING sText = TextComponent.Text


Text Property (JLabel)

Class

JLabel class

Action

Gets the text of the label.

Data Type

STRING

Access

Read only

Examples

STRING sText = Label.Text


Text Property (JTextComponent)

Class

JTextComponent class

Action

Gets the text of the text component.

Data Type

STRING

Access

Read only

Examples

STRING sText = TextComponent.Text


Text Property (OracleFormsComboBox)

Class

OracleFormsComboBox class

Action

Gets the text of the combo box.

Data Type

STRING

Access

Read only


Text Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the text of the text area.

Data Type

STRING

Access

Read only


Title Property (AWTDialog)

Class

AWTDialog class

Action

Gets the title of the dialog.

Data Type

STRING

Access

Read only

Examples

STRING sTitle = OptionsDialog.Title


Title Property (AWTFrame)

Class

AWTFrame class

Action

Gets the title of the frame.

Data Type

STRING

Access

Read only

Examples

STRING sTitle = FrameWindow.Title


Toggle Method (AWTCheckbox)

Class

AWTCheckbox class

Action

Toggles the check box state.

Syntax

checkbox.Toggle()

Examples

CaseSensitiveCheckBox.Toggle()


Toggle Method (AWTCheckboxMenuItem)

Class

AWTCheckboxMenuItem class

Action

Toggles the check box state of the menu item.

Syntax

checkboxMenuItem.Toggle()

Examples

CheckMenuItem.Toggle()


Toggle Method (JToggleButton)

Class

JToggleButton class

Action

Toggles the button.

Syntax

toggleButton.Toggle()

Examples

ToggleButton.Toggle()


ToolTipText Property (JComponent)

Class

JComponent class

Action

Gets the tool tip text of a Swing component.

Data Type

STRING

Access

Read only

Examples

STRING sToolTipText = Component.ToolTipText


Uncheck Method (AWTCheckbox)

Class

AWTCheckbox class

Action

Unchecks the check box.

Syntax

checkbox.Uncheck()

Examples

CaseSensitiveCheckBox.Uncheck()


Uncheck Method (AWTCheckboxMenuItem)

Class

AWTCheckboxMenuItem class

Action

Unchecks the check box of the menu item.

Syntax

checkboxMenuItem.Uncheck()

Examples

CheckMenuItem.Uncheck()


Uncheck Method (JCheckBox)

Class

JCheckBox class

Action

Unchecks the check box.

Syntax

checkBox.Uncheck()

Examples

ForwardCheckBox.Uncheck()


Uncheck Method (OracleFormsCheckbox)

Class

OracleFormsCheckbox class

Action

Unchecks the check box.

Syntax

oracleFormsCheckbox.Uncheck()


Uncheck Method (OracleFormsMenu)

Class

OracleFormsMenu class

Action

Unchecks a menu item.

Syntax

oracleFormsMenu.Uncheck(item)
Variable | Description
item | The menu item to uncheck. Can be either a top-level menu item or a menu item that can be found in a submenu. For unchecking a menu item from a submenu separate the menu item names with a slash. The item can contain the wildcards '?' (matches one character) or '*' (matches 0 to many characters). LISTITEM.


Uncheck Method (OracleFormsMenuItem)

Class

OracleFormsMenuItem class

Action

Unchecks a menu item.

Syntax

oracleFormsMenuItem.Uncheck()


Value Property (JProgressBar)

Class

JProgressBar class

Action

Gets the progress bar's current value.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iValue = ProgressBar.Value


Value Property (JSpinner)

Class

JSpinner class

Action

Gets the spinner value object string representation.

To get the displayed value you may have to get the value of the underlying object (textfield).

Data Type

STRING

Access

Read only

Examples

STRING sValue = MonthSpinner.Value


VerticalScrollbarPage Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Increments the current scroll position by specified number of pages.

Syntax

oracleFormsListBox.VerticalScrollbarPage(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.


VerticalScrollbarPage Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Increments the current scroll position by specified number of pages.

Syntax

oracleFormsListView.VerticalScrollbarPage(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.


VerticalScrollbarPage Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Increments the current scroll position by specified number of pages.

Syntax

oracleFormsTextField.VerticalScrollbarPage(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.


VerticalScrollbarPage Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Increments the current scroll position by specified number of pages.

Syntax

oracleFormsTree.VerticalScrollbarPage(pageCount)
Variable | Description
pageCount | The number of pages to increment. INTEGER.


VerticalScrollbarPageSize Property (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarPageSize Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarPageSize Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarPageSize Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the block increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarPosition Property (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarPosition Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarPosition Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarPosition Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the current position of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarRange Property (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only


VerticalScrollbarRange Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only


VerticalScrollbarRange Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only


VerticalScrollbarRange Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the range value of the scroll bar.

Data Type

SBRANGE

Access

Read only


VerticalScrollbarScrollToMax Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Scrolls to the maximum position of the scroller.

Syntax

oracleFormsListBox.VerticalScrollbarScrollToMax()


VerticalScrollbarScrollToMax Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Scrolls to the maximum position of the scroller.

Syntax

oracleFormsListView.VerticalScrollbarScrollToMax()


VerticalScrollbarScrollToMax Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Scrolls to the maximum position of the scroller.

Syntax

oracleFormsTextField.VerticalScrollbarScrollToMax()


VerticalScrollbarScrollToMax Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Scrolls to the maximum position of the scroller.

Syntax

oracleFormsTree.VerticalScrollbarScrollToMax()


VerticalScrollbarScrollTo Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Scrolls to the specified position.

Syntax

oracleFormsListBox.VerticalScrollbarScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.


VerticalScrollbarScrollTo Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Scrolls to the specified position.

Syntax

oracleFormsListView.VerticalScrollbarScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.


VerticalScrollbarScrollTo Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Scrolls to the specified position.

Syntax

oracleFormsTextField.VerticalScrollbarScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.


VerticalScrollbarScrollTo Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Scrolls to the specified position.

Syntax

oracleFormsTree.VerticalScrollbarScrollTo(position)
Variable | Description
position | The position to scroll to. INTEGER.


VerticalScrollbarScrollToMin Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Scrolls to the minimum position of the scroller.

Syntax

oracleFormsListBox.VerticalScrollbarScrollToMin()


VerticalScrollbarScrollToMin Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Scrolls to the minimum position of the scroller.

Syntax

oracleFormsListView.VerticalScrollbarScrollToMin()


VerticalScrollbarScrollToMin Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Scrolls to the minimum position of the scroller.

Syntax

oracleFormsTextField.VerticalScrollbarScrollToMin()


VerticalScrollbarScrollToMin Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Scrolls to the minimum position of the scroller.

Syntax

oracleFormsTree.VerticalScrollbarScrollToMin()


VerticalScrollbarStep Method (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Increments the current scroll position by specified steps.

Syntax

oracleFormsListBox.VerticalScrollbarStep(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.


VerticalScrollbarStep Method (OracleFormsListView)

Class

OracleFormsListView class

Action

Increments the current scroll position by specified steps.

Syntax

oracleFormsListView.VerticalScrollbarStep(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.


VerticalScrollbarStep Method (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Increments the current scroll position by specified steps.

Syntax

oracleFormsTextField.VerticalScrollbarStep(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.


VerticalScrollbarStep Method (OracleFormsTree)

Class

OracleFormsTree class

Action

Increments the current scroll position by specified steps.

Syntax

oracleFormsTree.VerticalScrollbarStep(stepCount)
Variable | Description
stepCount | The number of steps to increment. INTEGER.


VerticalScrollbarStepSize Property (OracleFormsListBox)

Class

OracleFormsListBox class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarStepSize Property (OracleFormsListView)

Class

OracleFormsListView class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarStepSize Property (OracleFormsTextField)

Class

OracleFormsTextField class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


VerticalScrollbarStepSize Property (OracleFormsTree)

Class

OracleFormsTree class

Action

Gets the unit increment value of the scroll bar.

Data Type

INTEGER

Access

Read only


ViewRectangle Property (JViewport)

Class

JViewport class

Action

Gets the visible part of the view, in view coordinates.

Data Type

RECT

Access

Read only

Examples

RECT rect = Viewport.ViewRectangle


VisibleItemPaths Property (JTree)

Class

JTree class

Action

Gets the visible items in the tree as item paths.

Data Type

LIST OF LISTITEM

Access

Read only


Width Property (AWTComponent)

Class

AWTComponent class

Action

Gets the current width of the component.

Data Type

INTEGER

Access

Read only

Examples

INTEGER iWidth = Component.Width


WindowState Property (AWTWindow)

Class

AWTWindow class

Action

Gets the state of a window. Values include: 1=minimized, 2=maximized, 3=restored.

Data Type

INTEGER

Access

Read only


AcceptsReturn Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets a value that indicates how the text editing control responds when the user presses the ENTER key.

Data Type

BOOLEAN

Access

Read only


AcceptsTab Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets a value that indicates how the text editing control responds when the user presses the TAB key.

Data Type

BOOLEAN

Access

Read only


Activate Method (WPFWindow)

Class

WPFWindow class

Action

Attempts to bring the window to the foreground and activates it.

Syntax

bResult = window.Activate()
Variable | Description
bResult | BOOLEAN.


ActualHeight Property (WPFFrameworkElement)

Class

WPFFrameworkElement class

Action

Gets the rendered height of this element.

Data Type

REAL

Access

Read only


ActualWidth Property (WPFFrameworkElement)

Class

WPFFrameworkElement class

Action

Gets the rendered width of this element.

Data Type

REAL

Access

Read only


AppendText Method (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Appends a string to the contents of a text control.

Syntax

textBoxBase.AppendText(textData)
Variable | Description
textData | A string that specifies the text to append to the current contents of the text control. STRING.


Author Property (WPFStickyNoteControl)

Class

WPFStickyNoteControl class

Action

Gets the name of the author who created the sticky note.

Data Type

STRING

Access

Read only


AutoWordSelection Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets a value that determines if a user selects part of a word by dragging across it with the mouse, whether the rest of the word is selected.

Data Type

BOOLEAN

Access

Read only


Balance Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets or sets a ratio of volume across speakers.

Data Type

REAL

Access

Read and write


BeginEdit Method (WPFDataGrid)

Class

WPFDataGrid class

Action

Begins to edit the specified cell.

Syntax

dataGrid.BeginEdit(row, column)
Variable | Description
row | The row to edit. LISTITEM.
column | The column to edit. LISTITEM.


BeginEdit Method (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Begins to edit the specified cell.

Syntax

toolkitDataGrid.BeginEdit(row, column)
Variable | Description
row | The row to edit. LISTITEM.
column | The column to edit. LISTITEM.


BlackoutDates Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets a list of dates that are marked as not selectable.

Data Type

LIST OF DATETIME

Access

Read only


BlackoutDates Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets a list of dates that are marked as not selectable.

Data Type

LIST OF DATETIME

Access

Read only


BringIntoView Method (WPFBase)

Class

WPFBase class

Action

Attempts to bring this element into view.

Syntax

base.BringIntoView()


CancelEdit Method (WPFDataGrid)

Class

WPFDataGrid class

Action

Cancels the edited cell.

Syntax

dataGrid.CancelEdit()


CancelEdit Method (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Cancels the edited cell.

Syntax

toolkitDataGrid.CancelEdit()


CanDecreaseZoom Property (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Gets a value that indicates whether the DocumentViewer can zoom out more.

Data Type

BOOLEAN

Access

Read only


CanDecreaseZoom Property (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Gets a value that indicates whether the Zoom level can be decreased.

Data Type

BOOLEAN

Access

Read only


CanDecreaseZoom Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets a value that indicates whether the Zoom level can be decreased.

Data Type

BOOLEAN

Access

Read only


CanDecreaseZoom Property (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Gets a value that indicates whether the Zoom level can be decreased.

Data Type

BOOLEAN

Access

Read only


CanGoBack Property (WPFFrame)

Class

WPFFrame class

Action

Gets a value that indicates whether there is at least one entry in back navigation history.

Data Type

BOOLEAN

Access

Read only


CanGoBack Property (WPFNavigationWindow)

Class

WPFNavigationWindow class

Action

Gets a value that indicates whether there is at least one entry in back navigation history.

Data Type

BOOLEAN

Access

Read only


CanGoForward Property (WPFFrame)

Class

WPFFrame class

Action

Gets a value that indicates whether there is at least one entry in forward navigation history.

Data Type

BOOLEAN

Access

Read only


CanGoForward Property (WPFNavigationWindow)

Class

WPFNavigationWindow class

Action

Gets a value that indicates whether there is at least one entry in forward navigation history.

Data Type

BOOLEAN

Access

Read only


CanGoToNextPage Property (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Gets a value that indicates whether or not the viewer can jump to the next page in the current Document.

Data Type

BOOLEAN

Access

Read only


CanGoToNextPage Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets a value that indicates whether or not the viewer can jump to the next page in the current Document.

Data Type

BOOLEAN

Access

Read only


CanGoToPage Method (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Returns a value that indicates whether or the viewer is able to jump to the specified page number.

Syntax

bResult = documentViewerBase.CanGoToPage(pageNumber)
Variable | Description
bResult | BOOLEAN.
pageNumber | The page number. INTEGER.


CanGoToPage Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Returns a value that indicates whether or the viewer is able to jump to the specified page number.

Syntax

bResult = flowDocumentReader.CanGoToPage(pageNumber)
Variable | Description
bResult | BOOLEAN.
pageNumber | The page number. INTEGER.


CanGoToPreviousPage Property (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Gets a value that indicates whether or not the viewer can jump to the previous page in the current Document.

Data Type

BOOLEAN

Access

Read only


CanGoToPreviousPage Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets a value that indicates whether or not the viewer can jump to the previous page in the current Document.

Data Type

BOOLEAN

Access

Read only


CanIncreaseZoom Property (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Gets a value that indicates whether the DocumentViewer can zoom in more.

Data Type

BOOLEAN

Access

Read only


CanIncreaseZoom Property (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Gets a value that indicates whether the Zoom level can be increased.

Data Type

BOOLEAN

Access

Read only


CanIncreaseZoom Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets a value that indicates whether the Zoom level can be increased.

Data Type

BOOLEAN

Access

Read only


CanIncreaseZoom Property (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Gets a value that indicates whether the Zoom level can be increased.

Data Type

BOOLEAN

Access

Read only


CanPause Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets a value indicating whether the media can be paused.

Data Type

BOOLEAN

Access

Read only


CanRedo Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets a value that indicates whether the most recent undo action can be redone.

Data Type

BOOLEAN

Access

Read only


CanUndo Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets a value that indicates whether the most recent action can be undone.

Data Type

BOOLEAN

Access

Read only


CaretIndex Property (WPFRichTextBox)

Class

WPFRichTextBox class

Action

Gets the insertion position index of the caret.

Data Type

INTEGER

Access

Read only


CaretIndex Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets the insertion position index of the caret.

Data Type

INTEGER

Access

Read only


Cells Property (WPFDataGridRow)

Class

WPFDataGridRow class

Action

Gets the cells of the data grid row.

Data Type

LIST OF WINDOW

Access

Read only


Cells Property (WPFToolkitDataGridRow)

Class

WPFToolkitDataGridRow class

Action

Gets the Cells of the data grid.

Data Type

LIST OF WINDOW

Access

Read only


CharacterCasing Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets a value that indicates how characters are cased when they are manually entered into the text box.

Data Type

CHARACTERCASING

Access

Read only


Check Method (WPFMenuBase)

Class

WPFMenuBase class

Action

Checks a menu item.

Syntax

menuBase.Check(item)
Variable | Description
item | The menu item to check. Can be either a top-level menu item or a menu item that can be found in a submenu. For checking a menu item from a submenu separate the menu item names with a slash. The item can contain the wildcards '?' (matches one character) or '*' (matches 0 to many characters). LISTITEM.

Examples

// Check the menu item 'Word Wrap' from the 'Format' menu
menu.Check("Format/Word Wrap")


Check Method (WPFMenuItem)

Class

WPFMenuItem class

Action

Checks the menu item.

Syntax

menuItem.Check()


Check Method (WPFToggleButton)

Class

WPFToggleButton class

Action

Checks the button.

Syntax

toggleButton.Check()


Clear Method (WPFPasswordBox)

Class

WPFPasswordBox class

Action

Clears the value of the Password property.

Syntax

passwordBox.Clear()


Clear Method (WPFRichTextBox)

Class

WPFRichTextBox class

Action

Clears all the content from the RichTextBox.

Syntax

richTextBox.Clear()


Clear Method (WPFTextBox)

Class

WPFTextBox class

Action

Clears all the content from the text box.

Syntax

textBox.Clear()


ClearSelection Method (WPFDatePicker)

Class

WPFDatePicker class

Action

Clears the selection.

Syntax

datePicker.ClearSelection()


ClearSelection Method (WPFToolkitDatePicker)

Class

WPFToolkitDatePicker class

Action

Clears the selection.

Syntax

toolkitDatePicker.ClearSelection()


ClickMode Property (WPFButtonBase)

Class

WPFButtonBase class

Action

Gets a value that specifies how the button can be clicked.

Data Type

CLICKMODE

Access

Read only


Close Method (WPFComboBox)

Class

WPFComboBox class

Action

Closes the ComboBox.

Syntax

comboBox.Close()


Close Method (WPFContextMenu)

Class

WPFContextMenu class

Action

Closes the ContextMenu.

Syntax

contextMenu.Close()


Close Method (WPFPopup)

Class

WPFPopup class

Action

Closes the pop-up window.

Syntax

popup.Close()


CloseOverflowItems Method (WPFToolBar)

Class

WPFToolBar class

Action

Closes the overflow toolbar items area.

Syntax

toolBar.CloseOverflowItems()


CloseSubmenu Method (WPFMenuItem)

Class

WPFMenuItem class

Action

Closes the submenu if available.

Syntax

menuItem.CloseSubmenu()


Collapse Method (WPFExpander)

Class

WPFExpander class

Action

Collapses the Expander control. Only the header is visible.

Syntax

expander.Collapse()


Collapse Method (WPFStickyNoteControl)

Class

WPFStickyNoteControl class

Action

Collapses the sticky note.

Syntax

stickyNoteControl.Collapse()


Collapse Method (WPFTreeView)

Class

WPFTreeView class

Action

Collapses the specified item.

Syntax

treeView.Collapse(item)
Variable | Description
item | The item to collapse. LISTITEM.


Collapse Method (WPFTreeViewItem)

Class

WPFTreeViewItem class

Action

Collapses the item.

Syntax

treeViewItem.Collapse()


ColumnHeaders Property (WPFListView)

Class

WPFListView class

Action

Gets the header columns.

Data Type

LIST OF WINDOW

Access

Read only


ColumnHeaders Property (WPFTreeView)

Class

WPFTreeView class

Action

Gets the header columns.

Data Type

LIST OF WINDOW

Access

Read only


Columns Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets a collection that contains all the columns in the data grid.

Data Type

LIST OF WINDOW

Access

Read only


Columns Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets a collection that contains all the columns in the data grid.

Data Type

LIST OF WINDOW

Access

Read only


CommitEdit Method (WPFDataGrid)

Class

WPFDataGrid class

Action

Commits the edited cell.

Syntax

dataGrid.CommitEdit()


CommitEdit Method (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Commits the edited cell.

Syntax

toolkitDataGrid.CommitEdit()


Content Property (WPFContentControl)

Class

WPFContentControl class

Action

Gets the content of the control.

Data Type

ANYTYPE

Access

Read only


Copy Method (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Copies the current selection of the text editing control to the Clipboard.

Syntax

textBoxBase.Copy()


CurrentCell Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets the cell that has focus.

Data Type

WINDOW

Access

Read only


CurrentCell Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets the cell that has focus.

Data Type

WINDOW

Access

Read only


Cut Method (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Removes the current selection from the text editing control and copies it to the Clipboard.

Syntax

textBoxBase.Cut()


DecreaseLarge Method (WPFSlider)

Class

WPFSlider class

Action

Decreases the value of the Slider by a large amount.

Syntax

slider.DecreaseLarge()


DecreaseSmall Method (WPFSlider)

Class

WPFSlider class

Action

Decreases the value of the Slider by a small amount.

Syntax

slider.DecreaseSmall()


DecreaseZoom Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Zooms out of the document content by one zoom step.

Syntax

documentViewer.DecreaseZoom()


DecreaseZoom Method (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Decreases the zoom.

Syntax

flowDocumentPageViewer.DecreaseZoom()


DecreaseZoom Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Decreases the zoom.

Syntax

flowDocumentReader.DecreaseZoom()


DecreaseZoom Method (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Decreases the zoom.

Syntax

flowDocumentScrollViewer.DecreaseZoom()


Delay Property (WPFRepeatButton)

Class

WPFRepeatButton class

Action

Gets the amount of time, in milliseconds, the RepeatButton waits while it is pressed before it starts repeating.

Data Type

INTEGER

Access

Read only


Delay Property (WPFSlider)

Class

WPFSlider class

Action

Gets the amount of time in milliseconds that a RepeatButton waits, while it is pressed, before a command to move the Thumb executes.

Data Type

INTEGER

Access

Read only


DeselectAll Method (WPFListBox)

Class

WPFListBox class

Action

Clears the selections in multi-select ListBox.

Syntax

listBox.DeselectAll()


Deselect Method (WPFDataGridCell)

Class

WPFDataGridCell class

Action

Deselects the cell.

Syntax

dataGridCell.Deselect()


Deselect Method (WPFDataGridRow)

Class

WPFDataGridRow class

Action

Deselects the row.

Syntax

dataGridRow.Deselect()


Deselect Method (WPFListBoxItem)

Class

WPFListBoxItem class

Action

Deselects the ListBoxItem.

Syntax

listBoxItem.Deselect()


Deselect Method (WPFTabItem)

Class

WPFTabItem class

Action

Deselects the item.

Syntax

tabItem.Deselect()


Deselect Method (WPFToolkitDataGridCell)

Class

WPFToolkitDataGridCell class

Action

Deselects the cell.

Syntax

toolkitDataGridCell.Deselect()


Deselect Method (WPFToolkitDataGridRow)

Class

WPFToolkitDataGridRow class

Action

Deselects the row.

Syntax

toolkitDataGridRow.Deselect()


DisplayDateEnd Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets the last date in the date range that is available in the calendar.

Data Type

DATETIME

Access

Read only


DisplayDateEnd Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets the last date in the date range that is available in the calendar.

Data Type

DATETIME

Access

Read only


DisplayDate Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets the date to display.

Data Type

DATETIME

Access

Read only


DisplayDate Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets the date to display.

Data Type

DATETIME

Access

Read only


DisplayDateStart Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets the first date that is available in the calendar.

Data Type

DATETIME

Access

Read only


DisplayDateStart Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets the first date that is available in the calendar.

Data Type

DATETIME

Access

Read only


DisplayMode Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets a value that indicates whether the calendar displays a month, year, or decade.

Data Type

CALENDARMODE

Access

Read only


DisplayMode Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets a value that indicates whether the calendar displays a month, year, or decade.

Data Type

CALENDARMODE

Access

Read only


DragCancel Method (WPFThumb)

Class

WPFThumb class

Action

Cancels the drag operation.

Syntax

thumb.DragCancel()


DragComplete Method (WPFThumb)

Class

WPFThumb class

Action

Completes the drag operation.

Syntax

thumb.DragComplete(horizontalChange, verticalChange)
Variable | Description
horizontalChange | The horizontal distance that the mouse has moved. REAL.
verticalChange | The vertical distance that the mouse has moved. REAL.


DragDelta Method (WPFThumb)

Class

WPFThumb class

Action

The delta of the current drag operation.

Syntax

thumb.DragDelta(horizontalChange, verticalChange)
Variable | Description
horizontalChange | The horizontal distance that the mouse has moved. REAL.
verticalChange | The vertical distance that the mouse has moved. REAL.


DragStart Method (WPFThumb)

Class

WPFThumb class

Action

Starts a drag operation.

Syntax

thumb.DragStart(horizontalOffset, verticalOffset)
Variable | Description
horizontalOffset | The horizontal offset of the mouse click. REAL.
verticalOffset | The vertical offset of the mouse click. REAL.


ExpandAll Method (WPFTreeView)

Class

WPFTreeView class

Action

Expands all items in the tree.

Syntax

treeView.ExpandAll()


ExpandDirection Property (WPFExpander)

Class

WPFExpander class

Action

Gets the direction in which the Expander content window opens.

Data Type

EXPANDDIRECTION

Access

Read only


Expand Method (WPFExpander)

Class

WPFExpander class

Action

Expands the Expander control.

Syntax

expander.Expand()


Expand Method (WPFStickyNoteControl)

Class

WPFStickyNoteControl class

Action

Expands the sticky note.

Syntax

stickyNoteControl.Expand()


Expand Method (WPFTreeView)

Class

WPFTreeView class

Action

Expands the specified item.

Syntax

treeView.Expand(item)
Variable | Description
item | The item to expand. LISTITEM.


Expand Method (WPFTreeViewItem)

Class

WPFTreeViewItem class

Action

Expands the item.

Syntax

treeViewItem.Expand()


ExpandSubTree Method (WPFTreeViewItem)

Class

WPFTreeViewItem class

Action

Expands the sub tree under this tree item.

Syntax

treeViewItem.ExpandSubTree()


FirstDayOfWeek Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets the day that is considered the beginning of the week.

Data Type

CALENDARDAYOFWEEK

Access

Read only


FirstDayOfWeek Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets the day that is considered the beginning of the week.

Data Type

CALENDARDAYOFWEEK

Access

Read only


FirstPage Method (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Jumps to the first page.

Syntax

documentViewerBase.FirstPage()


FirstPage Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Jumps to the first page.

Syntax

flowDocumentReader.FirstPage()


FitToHeight Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Fits a single page to the height of the current viewport.

Syntax

documentViewer.FitToHeight()


FitToWidth Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Fits a single page to the width of the current viewport.

Syntax

documentViewer.FitToWidth()


FontFamily Property (WPFControl)

Class

WPFControl class

Action

Gets the preferred top-level font family for the TextBlock.

Data Type

STRING

Access

Read only


FontFamily Property (WPFTextBlock)

Class

WPFTextBlock class

Action

Gets the preferred top-level font family for the TextBlock.

Data Type

STRING

Access

Read only


FontSize Property (WPFControl)

Class

WPFControl class

Action

Gets the top-level font size for the TextBlock.

Data Type

REAL

Access

Read only


FontSize Property (WPFTextBlock)

Class

WPFTextBlock class

Action

Gets the top-level font size for the TextBlock.

Data Type

REAL

Access

Read only


GetCharacterIndexFromLineIndex Method (WPFTextBox)

Class

WPFTextBox class

Action

Returns the zero-based character index for the first character in the specified line.

Syntax

iCharacterIndexFromLineIndex = textBox.GetCharacterIndexFromLineIndex(lineIndex)
Variable | Description
iCharacterIndexFromLineIndex | INTEGER.
lineIndex | The zero-based index of the line to retrieve the initial character index for. INTEGER.


GetFirstVisibleLineIndex Method (WPFTextBox)

Class

WPFTextBox class

Action

Returns the line index for the first line that is currently visible in the text box.

Syntax

iFirstVisibleLineIndex = textBox.GetFirstVisibleLineIndex()
Variable | Description
iFirstVisibleLineIndex | INTEGER.


GetLastVisibleLineIndex Method (WPFTextBox)

Class

WPFTextBox class

Action

Returns the line index for the last line that is currently visible in the text box.

Syntax

iLastVisibleLineIndex = textBox.GetLastVisibleLineIndex()
Variable | Description
iLastVisibleLineIndex | INTEGER.


GetLineIndexFromCharacterIndex Method (WPFTextBox)

Class

WPFTextBox class

Action

Returns the zero-based line index for the line that contains the specified character index.

Syntax

iLineIndexFromCharacterIndex = textBox.GetLineIndexFromCharacterIndex(charIndex)
Variable | Description
iLineIndexFromCharacterIndex | INTEGER.
charIndex | The zero-based character index for which to retrieve the associated line index. INTEGER.


GetLineLength Method (WPFTextBox)

Class

WPFTextBox class

Action

Returns the number of characters in the specified line.

Syntax

iLineLength = textBox.GetLineLength(lineIndex)
Variable | Description
iLineLength | INTEGER.
lineIndex | The zero-based line index for which to return a character count. INTEGER.


GetLineText Method (WPFTextBox)

Class

WPFTextBox class

Action

Returns the text that is currently displayed on the specified line.

Syntax

sLineText = textBox.GetLineText(lineIndex)
Variable | Description
sLineText | STRING.
lineIndex | The zero-based line index for which to retrieve the currently displayed text. INTEGER.


GetMaximumScrollPosition Method (WPFFrameworkElement)

Class

WPFFrameworkElement class

Action

Retrieves the maximum position of the ScrollViewer.

Syntax

maximumScrollPosition = frameworkElement.GetMaximumScrollPosition(orientation)
Variable | Description
maximumScrollPosition | REAL.
orientation | GetMaximumScrollPosition of either the horizontal or vertical scrollbar. ORIENTATION.


GetScrollPosition Method (WPFFrameworkElement)

Class

WPFFrameworkElement class

Action

Return the position of the ScrollViewer.

Syntax

scrollPosition = frameworkElement.GetScrollPosition(orientation)
Variable | Description
scrollPosition | REAL.
orientation | GetScrollPosition of either the horizontal or vertical scrollbar. ORIENTATION.


GoBack Method (WPFFrame)

Class

WPFFrame class

Action

Navigates to the most recent item in back navigation history.

Syntax

frame.GoBack()


GoBack Method (WPFNavigationWindow)

Class

WPFNavigationWindow class

Action

Navigates to the most recent item in back navigation history.

Syntax

navigationWindow.GoBack()


GoForward Method (WPFFrame)

Class

WPFFrame class

Action

Navigates to the most recent item in forward navigation history.

Syntax

frame.GoForward()


GoForward Method (WPFNavigationWindow)

Class

WPFNavigationWindow class

Action

Navigates to the most recent item in forward navigation history.

Syntax

navigationWindow.GoForward()


GoToPage Method (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Jumps to the specified page.

Syntax

documentViewerBase.GoToPage(pageNumber)
Variable | Description
pageNumber | The page number. INTEGER.


GoToPage Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Jumps to the specified page.

Syntax

flowDocumentReader.GoToPage(pageNumber)
Variable | Description
pageNumber | The page number. INTEGER.


GroupName Property (WPFRadioButton)

Class

WPFRadioButton class

Action

Gets the group name of this radio button.

Data Type

STRING

Access

Read only


HasAudio Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets a value indicating whether the media has audio.

Data Type

BOOLEAN

Access

Read only


HasContent Property (WPFContentControl)

Class

WPFContentControl class

Action

Gets a value that indicates whether the ContentControl contains content.

Data Type

BOOLEAN

Access

Read only


HasItems Property (WPFItemsControl)

Class

WPFItemsControl class

Action

Gets a value that indicates whether the ItemsControl contains items.

Data Type

BOOLEAN

Access

Read only


HasOverflowItems Property (WPFToolBar)

Class

WPFToolBar class

Action

Gets a value that indicates whether the ToolBar has items that are not visible.

Data Type

BOOLEAN

Access

Read only


HasSubmenu Property (WPFMenuItem)

Class

WPFMenuItem class

Action

Gets whether a menu item has a submenu.

Data Type

BOOLEAN

Access

Read only


HasVideo Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets a value indicating whether the media has video.

Data Type

BOOLEAN

Access

Read only


HorizontalOffset Property (WPFContextMenu)

Class

WPFContextMenu class

Action

Gets the horizontal distance between the target origin and the popup alignment point. This is a dependency property.

Data Type

REAL

Access

Read only


HorizontalOffset Property (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Gets the horizontal scroll position.

Data Type

REAL

Access

Read only


HorizontalScrollBarVisibility Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets a value that indicates whether a horizontal scroll bar is shown.

Data Type

SCROLLBARVISIBILITY

Access

Read only


IncreaseLarge Method (WPFSlider)

Class

WPFSlider class

Action

Increases the value of the Slider by a large amount.

Syntax

slider.IncreaseLarge()


IncreaseSmall Method (WPFSlider)

Class

WPFSlider class

Action

Increases the value of the Slider by a small amount.

Syntax

slider.IncreaseSmall()


IncreaseZoom Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Zooms in on the document content by one zoom step.

Syntax

documentViewer.IncreaseZoom()


IncreaseZoom Method (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Increases the zoom.

Syntax

flowDocumentPageViewer.IncreaseZoom()


IncreaseZoom Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Increases the zoom.

Syntax

flowDocumentReader.IncreaseZoom()


IncreaseZoom Method (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Increases the zoom.

Syntax

flowDocumentScrollViewer.IncreaseZoom()


Interval Property (WPFRepeatButton)

Class

WPFRepeatButton class

Action

Gets the amount of time, in milliseconds, between repeats once repeating starts.

Data Type

INTEGER

Access

Read only


IsCancel Property (WPFButton)

Class

WPFButton class

Action

Gets a value that indicates whether a Button is a Cancel button. A user can activate the Cancel button by pressing the ESC key. This is a dependency property.

Data Type

BOOLEAN

Access

Read only


IsChecked Property (WPFMenuItem)

Class

WPFMenuItem class

Action

Gets a value that indicates whether the MenuItem is checked.

Data Type

BOOLEAN

Access

Read only


IsChecked Property (WPFToggleButton)

Class

WPFToggleButton class

Action

Gets whether the button is checked.

Data Type

BOOLEAN

Access

Read only


IsDefaulted Property (WPFButton)

Class

WPFButton class

Action

Gets a value that indicates whether a Button is the button that is activated when a user presses ENTER. This is a dependency property.

Data Type

BOOLEAN

Access

Read only


IsDefault Property (WPFButton)

Class

WPFButton class

Action

Gets a value that indicates whether a Button is the default button. A user invokes the default button by pressing the ENTER key. This is a dependency property.

Data Type

BOOLEAN

Access

Read only


IsDirectionReversed Property (WPFSlider)

Class

WPFSlider class

Action

Gets the direction of increasing value.

Data Type

BOOLEAN

Access

Read only


IsDropDownOpen Property (WPFComboBox)

Class

WPFComboBox class

Action

Gets a value that indicates whether the drop-down for a combo box is currently open.

Data Type

BOOLEAN

Access

Read only


IsEditable Property (WPFComboBox)

Class

WPFComboBox class

Action

Gets a value that enables or disables editing of the text in text box of the ComboBox.

Data Type

BOOLEAN

Access

Read only


IsEditing Property (WPFDataGridCell)

Class

WPFDataGridCell class

Action

Gets a value that indicates whether the cell is in edit mode.

Data Type

BOOLEAN

Access

Read only


IsEditing Property (WPFToolkitDataGridCell)

Class

WPFToolkitDataGridCell class

Action

Gets a value that indicates whether the cell is in edit mode.

Data Type

BOOLEAN

Access

Read only


IsEnabled Property (WPFBase)

Class

WPFBase class

Action

Gets a value that indicates whether this element is enabled in the user interface (UI).

Data Type

BOOLEAN

Access

Read only


IsExpanded Property (WPFExpander)

Class

WPFExpander class

Action

Gets whether the Expander content window is visible.

Data Type

BOOLEAN

Access

Read only


IsExpanded Property (WPFStickyNoteControl)

Class

WPFStickyNoteControl class

Action

Gets a value indicating whether the StickyNoteControl is expanded.

Data Type

BOOLEAN

Access

Read only


IsExpanded Property (WPFTreeViewItem)

Class

WPFTreeViewItem class

Action

Gets a value that indicates whether the nested items in a TreeViewItem are expanded or collapsed.

Data Type

BOOLEAN

Access

Read only


IsFocused Method (WPFBase)

Class

WPFBase class

Action

Return whether the control has focus.

Syntax

bFocused = base.IsFocused()
Variable | Description
bFocused | True if this object has the focus. BOOLEAN.


IsLocked Property (WPFToolBarTray)

Class

WPFToolBarTray class

Action

Gets a value that indicates whether a ToolBar can be moved inside a ToolBarTray.

Data Type

BOOLEAN

Access

Read only


IsMainMenu Property (WPFMenu)

Class

WPFMenu class

Action

Gets a value that indicates whether this Menu receives a main menu activation notification.

Data Type

BOOLEAN

Access

Read only


IsMediaLoaded Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets a value indicating the content is loaded.

Data Type

BOOLEAN

Access

Read only


IsMoveToPointEnabled Property (WPFSlider)

Class

WPFSlider class

Action

Gets a value that indicates whether the Thumb of a Slider moves immediately to the location of the mouse click that occurs while the mouse pointer pauses on the Slider track.

Data Type

BOOLEAN

Access

Read only


IsMuted Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets or sets a value indicating whether the audio is muted.

Data Type

BOOLEAN

Access

Read and write


IsOpen Property (WPFContextMenu)

Class

WPFContextMenu class

Action

Gets a value that indicates whether the ContextMenu is open.

Data Type

BOOLEAN

Access

Read only


IsOverflowOpen Property (WPFToolBar)

Class

WPFToolBar class

Action

Gets a value that indicates whether the ToolBar overflow area is currently visible.

Data Type

BOOLEAN

Access

Read only


IsPressed Property (WPFMenuItem)

Class

WPFMenuItem class

Action

Gets a value that indicates whether a MenuItem is pressed.

Data Type

BOOLEAN

Access

Read only


IsReadOnly Property (WPFComboBox)

Class

WPFComboBox class

Action

Gets whether the combo box is in selection-only mode, in which the contents of the combo box are selectable but not editable.

Data Type

BOOLEAN

Access

Read only


IsReadOnly Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets a value that indicates whether the user can edit values in the data grid.

Data Type

BOOLEAN

Access

Read only


IsReadOnly Property (WPFDataGridCell)

Class

WPFDataGridCell class

Action

Gets a value that indicates whether the cell can be put in edit mode.

Data Type

BOOLEAN

Access

Read only


IsReadOnly Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets a value that indicates whether the text editing control is read-only to a user interacting with the control.

Data Type

BOOLEAN

Access

Read only


IsReadOnly Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets a value that indicates whether the user can edit values in the data grid.

Data Type

BOOLEAN

Access

Read only


IsReadOnly Property (WPFToolkitDataGridCell)

Class

WPFToolkitDataGridCell class

Action

Gets a value that indicates whether the cell can be put in edit mode.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (WPFDataGridCell)

Class

WPFDataGridCell class

Action

Gets a value that indicates whether the cell is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (WPFDataGridRow)

Class

WPFDataGridRow class

Action

Gets a value that indicates whether the row is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (WPFListBoxItem)

Class

WPFListBoxItem class

Action

Gets a value that indicates whether a ListBoxItem is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (WPFTabItem)

Class

WPFTabItem class

Action

Gets a value that indicates whether the TabItem is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (WPFToolkitDataGridCell)

Class

WPFToolkitDataGridCell class

Action

Gets a value that indicates whether the cell is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (WPFToolkitDataGridRow)

Class

WPFToolkitDataGridRow class

Action

Gets a value that indicates whether the row is selected.

Data Type

BOOLEAN

Access

Read only


IsSelected Property (WPFTreeViewItem)

Class

WPFTreeViewItem class

Action

Gets a value that indicates whether a TreeViewItem is selected.

Data Type

BOOLEAN

Access

Read only


IsSelectionRangeEnabled Property (WPFSlider)

Class

WPFSlider class

Action

Gets a value that indicates whether the Slider displays a selection range along the Slider.

Data Type

BOOLEAN

Access

Read only


IsSnapToTickEnabled Property (WPFSlider)

Class

WPFSlider class

Action

Gets a value that indicates whether the Slider automatically moves the Thumb to the closest tick mark.

Data Type

BOOLEAN

Access

Read only


IsSpellCheckEnabled Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets whether spell checking is enabled.

Data Type

BOOLEAN

Access

Read only


IsSubmenuOpen Property (WPFMenuItem)

Class

WPFMenuItem class

Action

Gets a value that indicates whether the submenu of the MenuItem is open.

Data Type

BOOLEAN

Access

Read only


IsTabStop Property (WPFControl)

Class

WPFControl class

Action

Gets a value that indicates whether a control is included in tab navigation.

Data Type

BOOLEAN

Access

Read only


IsTextSearchEnabled Property (WPFItemsControl)

Class

WPFItemsControl class

Action

Gets a value that indicates whether TextSearch is enabled on the ItemsControl instance.

Data Type

BOOLEAN

Access

Read only


IsThreeState Property (WPFToggleButton)

Class

WPFToggleButton class

Action

Gets whether the control supports two or three states.

Data Type

BOOLEAN

Access

Read only


IsTodayHighlighted Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets a value that indicates whether the current date is highlighted.

Data Type

BOOLEAN

Access

Read only


IsTodayHighlighted Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets a value that indicates whether the current date is highlighted.

Data Type

BOOLEAN

Access

Read only


IsUndoEnabled Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets a value that indicates whether undo support is enabled for the text-editing control.

Data Type

BOOLEAN

Access

Read only


Items Property (WPFComboBox)

Class

WPFComboBox class

Action

Gets a complete list of items.

Certain combo boxes (i.e. ones that use an items source internally) require to open the combo box first before the items can be retrieved. This is because the items are only available in the application under test if the combo box has been opened once.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets the rows in the data grid.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFItemsControl)

Class

WPFItemsControl class

Action

Gets a complete list of items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFListBox)

Class

WPFListBox class

Action

Gets a complete list of items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFListView)

Class

WPFListView class

Action

Gets a complete list of items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFMenuBase)

Class

WPFMenuBase class

Action

Gets the list of menu items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFMenuItem)

Class

WPFMenuItem class

Action

Gets the list of submenu items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFStatusBar)

Class

WPFStatusBar class

Action

Gets the items of the status bar.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFTabControl)

Class

WPFTabControl class

Action

Gets a complete list of items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets the rows in the data grid.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFTreeView)

Class

WPFTreeView class

Action

Gets a complete list of items.

Data Type

LIST OF WINDOW

Access

Read only


Items Property (WPFTreeViewItem)

Class

WPFTreeViewItem class

Action

Gets a complete list of items.

Data Type

LIST OF WINDOW

Access

Read only


ItemTexts Property (WPFItemsControl)

Class

WPFItemsControl class

Action

Gets a complete list of item texts.

Data Type

LIST OF STRING

Access

Read only


LargeChange Property (WPFRangeBase)

Class

WPFRangeBase class

Action

Gets a value to be added to or subtracted from the value of a RangeBase control.

Data Type

REAL

Access

Read only


LastPage Method (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Jumps to the last page.

Syntax

documentViewerBase.LastPage()


LastPage Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Jumps to the last page.

Syntax

flowDocumentReader.LastPage()


Length Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets the natural duration of the media in seconds.

Data Type

REAL

Access

Read only


LineCount Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets the total number of lines in the text box.

Data Type

INTEGER

Access

Read only


LoadAssembly Method (WPFWindow)

Class

WPFWindow class

Action

Loads the assembly on the specified path in the WPF application.

The main use case to load an additional assembly that contains utility methods that can be called via the "Dynamic Invoke" feature.

Syntax

window.LoadAssembly(assemblyFile)
Variable | Description
assemblyFile | The path of the assembly file to load. STRING.


MasterPageNumber Property (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Gets the page number for the current master page.

Data Type

INTEGER

Access

Read only


MaxDropDownHeight Property (WPFComboBox)

Class

WPFComboBox class

Action

Gets the maximum height for a combo box drop-down.

Data Type

REAL

Access

Read only


Maximum Property (WPFRangeBase)

Class

WPFRangeBase class

Action

Gets the highest possible value of the range element.

Data Type

REAL

Access

Read only


MaxLength Property (WPFPasswordBox)

Class

WPFPasswordBox class

Action

Gets the maximum length for passwords to be handled by this PasswordBox.

Data Type

INTEGER

Access

Read only


MaxLength Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets the maximum number of characters that can be manually entered into the text box.

Data Type

INTEGER

Access

Read only


MaxLines Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets the maximum number of visible lines.

Data Type

INTEGER

Access

Read only


MaxZoom Property (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Gets the maximum allowable Zoom level for the FlowDocumentPageViewer.

Data Type

REAL

Access

Read only


MaxZoom Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets the maximum allowable Zoom level for the FlowDocumentReader.

Data Type

REAL

Access

Read only


MaxZoom Property (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Gets the maximum allowable Zoom level for the FlowDocumentScrollViewer.

Data Type

REAL

Access

Read only


Minimum Property (WPFRangeBase)

Class

WPFRangeBase class

Action

Gets the minimum possible value of the range element.

Data Type

REAL

Access

Read only


MinLines Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets the minimum number of visible lines.

Data Type

INTEGER

Access

Read only


MinZoom Property (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Gets the minimum allowable Zoom level for the FlowDocumentPageViewer.

Data Type

REAL

Access

Read only


MinZoom Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets the minimum allowable Zoom level for the FlowDocumentReader.

Data Type

REAL

Access

Read only


MinZoom Property (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Gets the minimum allowable Zoom level for the FlowDocumentScrollViewer.

Data Type

REAL

Access

Read only


MoveDown Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Scrolls the document content down 16 device independent pixels.

Syntax

documentViewer.MoveDown()


MoveLeft Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Scrolls the document content left 16 device independent pixels.

Syntax

documentViewer.MoveLeft()


MoveRight Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Scrolls the document content right 16 device independent pixels.

Syntax

documentViewer.MoveRight()


MoveUp Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Scrolls the document content up 16 device independent pixels.

Syntax

documentViewer.MoveUp()


Name Property (WPFFrameworkElement)

Class

WPFFrameworkElement class

Action

Gets the identifying name of the element.

Data Type

STRING

Access

Read only


Navigate Method (WPFFrame)

Class

WPFFrame class

Action

Navigates asynchronously to the specified source content.

Syntax

bResult = frame.Navigate(uri)
Variable | Description
bResult | True if a navigation is not canceled; otherwise, false. BOOLEAN.
uri | The URI for the desired content. STRING.


Navigate Method (WPFHyperlink)

Class

WPFHyperlink class

Action

Performs a click on the Hyperlink.

Syntax

hyperlink.Navigate()


Navigate Method (WPFNavigationWindow)

Class

WPFNavigationWindow class

Action

Navigates asynchronously to the specified source content.

Syntax

bResult = navigationWindow.Navigate(uri)
Variable | Description
bResult | True if a navigation is not canceled; otherwise, false. BOOLEAN.
uri | The URI for the desired content. STRING.


NavigateUri Property (WPFHyperlink)

Class

WPFHyperlink class

Action

Gets a URI to navigate to when the Hyperlink is activated.

Data Type

STRING

Access

Read only


NextPage Method (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Jumps to the next page.

Syntax

documentViewerBase.NextPage()


NextPage Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Jumps to the next page.

Syntax

flowDocumentReader.NextPage()


Open Method (WPFComboBox)

Class

WPFComboBox class

Action

Opens the ComboBox.

Syntax

comboBox.Open()


OpenOverflowItems Method (WPFToolBar)

Class

WPFToolBar class

Action

Opens the overflow toolbar items area.

Syntax

toolBar.OpenOverflowItems()


OpenSubmenu Method (WPFMenuItem)

Class

WPFMenuItem class

Action

Opens the submenu if available.

Syntax

menuItem.OpenSubmenu()


Orientation Property (WPFScrollBar)

Class

WPFScrollBar class

Action

Gets whether the ScrollBar is displayed horizontally or vertically.

Data Type

ORIENTATION

Access

Read only


Orientation Property (WPFSlider)

Class

WPFSlider class

Action

Gets whether the Slider is displayed horizontally or vertically.

Data Type

ORIENTATION

Access

Read only


Orientation Property (WPFToolBar)

Class

WPFToolBar class

Action

Gets the orientation of the ToolBar.

Data Type

ORIENTATION

Access

Read only


Orientation Property (WPFToolBarTray)

Class

WPFToolBarTray class

Action

Gets the orientation of a ToolBarTray.

Data Type

ORIENTATION

Access

Read only


PageCount Property (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Gets the total number of pages in the current Document.

Data Type

INTEGER

Access

Read only


PageCount Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets the total number of pages in the current Document.

Data Type

INTEGER

Access

Read only


PageNumber Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets the page number for the current master page.

Data Type

INTEGER

Access

Read only


PasswordChar Property (WPFPasswordBox)

Class

WPFPasswordBox class

Action

Gets the masking character for the PasswordBox.

Data Type

STRING

Access

Read only


Paste Method (WPFPasswordBox)

Class

WPFPasswordBox class

Action

Pastes the contents of the clipboard over the current selection in the text editing control.

Syntax

passwordBox.Paste()


Paste Method (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Pastes the contents of the Clipboard over the current selection in the text editing control.

Syntax

textBoxBase.Paste()


Pause Method (WPFMediaElement)

Class

WPFMediaElement class

Action

Pauses media at the current position. This method has an effect only if the LoadedBehavior property is set to Manual.

Syntax

mediaElement.Pause()


Placement Property (WPFContextMenu)

Class

WPFContextMenu class

Action

Gets the Placement property of a ContextMenu. This is a dependency property.

Data Type

PLACEMENTMODE

Access

Read only


PlacementRectangle Property (WPFContextMenu)

Class

WPFContextMenu class

Action

Gets the area relative to which the context menu is positioned when it opens. This is a dependency property.

Data Type

RECT

Access

Read only


Play Method (WPFMediaElement)

Class

WPFMediaElement class

Action

Plays media from the current position. This method has an effect only if the LoadedBehavior property is set to Manual.

Syntax

mediaElement.Play()


PointFromScreen Method (WPFFrameworkElement)

Class

WPFFrameworkElement class

Action

Converts a Point in screen coordinates into a Point that represents the current coordinate system of the Visual.

Syntax

result = frameworkElement.PointFromScreen(point)
Variable | Description
result | The converted Point. POINT.
point | The Point value in screen coordinates. POINT.


PointToScreen Method (WPFFrameworkElement)

Class

WPFFrameworkElement class

Action

Converts a Point that represents the current coordinate system of the Visual into a Point in screen coordinates.

Syntax

result = frameworkElement.PointToScreen(point)
Variable | Description
result | The converted Point. POINT.
point | The Point value that represents the current coordinate system of the Visual. POINT.


Position Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets or sets the current position of progress through the media's playback time in seconds.

Data Type

REAL

Access

Read and write


PreviousPage Method (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Jumps to the previous page.

Syntax

documentViewerBase.PreviousPage()


PreviousPage Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Jumps to the previous page.

Syntax

flowDocumentReader.PreviousPage()


Redo Method (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Undoes the most recent undo command. In other words, redoes the most recent undo unit on the undo stack.

Syntax

bResult = textBoxBase.Redo()
Variable | Description
bResult | BOOLEAN.


Refresh Method (WPFFrame)

Class

WPFFrame class

Action

Reloads the current content.

Syntax

frame.Refresh()


Refresh Method (WPFNavigationWindow)

Class

WPFNavigationWindow class

Action

Reloads the current content.

Syntax

navigationWindow.Refresh()


Resize Method (WPFColumnHeader)

Class

WPFColumnHeader class

Action

Resizes the column header.

Syntax

columnHeader.Resize(value)
Variable | Description
value | The new width. REAL.


Role Property (WPFMenuItem)

Class

WPFMenuItem class

Action

Gets a value that indicates the role of a MenuItem.

Data Type

MENUITEMROLE

Access

Read only


ScrollIntoView Method (WPFDataGrid)

Class

WPFDataGrid class

Action

Scrolls the specified cell into view.

Syntax

dataGrid.ScrollIntoView(row, [column])
Variable | Description
row | The row where to scroll to. LISTITEM.
column | Optional.The column where to scroll to. LISTITEM.


ScrollIntoView Method (WPFDataGridCell)

Class

WPFDataGridCell class

Action

Scrolls the cell into view.

Syntax

dataGridCell.ScrollIntoView()


ScrollIntoView Method (WPFDataGridRow)

Class

WPFDataGridRow class

Action

Scrolls the row into view.

Syntax

dataGridRow.ScrollIntoView()


ScrollIntoView Method (WPFListBox)

Class

WPFListBox class

Action

Scrolls an item into view.

Syntax

listBox.ScrollIntoView(item)
Variable | Description
item | The item to scroll into view. LISTITEM.


ScrollIntoView Method (WPFListBoxItem)

Class

WPFListBoxItem class

Action

Scrolls the item into the view.

Syntax

listBoxItem.ScrollIntoView()


ScrollIntoView Method (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Scrolls the specified cell into view.

Syntax

toolkitDataGrid.ScrollIntoView(row, [column])
Variable | Description
row | The row where to scroll to. LISTITEM.
column | Optional.The column where to scroll to. LISTITEM.


ScrollIntoView Method (WPFToolkitDataGridCell)

Class

WPFToolkitDataGridCell class

Action

Scrolls the cell into view.

Syntax

toolkitDataGridCell.ScrollIntoView()


ScrollIntoView Method (WPFToolkitDataGridRow)

Class

WPFToolkitDataGridRow class

Action

Scrolls the row into view.

Syntax

toolkitDataGridRow.ScrollIntoView()


Scroll Method (WPFFrameworkElement)

Class

WPFFrameworkElement class

Action

Sets the value of the ScrollViewer to a specific scrolldestination.

Syntax

frameworkElement.Scroll(scrolldestination)
Variable | Description
scrolldestination | The value to set the ScrollViewer. SCROLLDESTINATION.


ScrollPageDown Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Scrolls down one viewport.

Syntax

documentViewer.ScrollPageDown()


ScrollPageLeft Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Scrolls left one viewport.

Syntax

documentViewer.ScrollPageLeft()


ScrollPageRight Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Scrolls right one viewport.

Syntax

documentViewer.ScrollPageRight()


ScrollPageUp Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Scrolls up one viewport.

Syntax

documentViewer.ScrollPageUp()


ScrollToLine Method (WPFTextBox)

Class

WPFTextBox class

Action

Scrolls the line at the specified line index into view.

Syntax

textBox.ScrollToLine(lineIndex)
Variable | Description
lineIndex | The zero-based line index of the line to scroll into view. INTEGER.


ScrollToPosition Method (WPFFrameworkElement)

Class

WPFFrameworkElement class

Action

Sets the position of the ScrollViewer.

Syntax

frameworkElement.ScrollToPosition(offset, orientation)
Variable | Description
offset | The value of the ScrollViewer. REAL.
orientation | ScrollToPosition of either the horizontal or vertical scrollbar. ORIENTATION.


SelectAll Method (WPFListBox)

Class

WPFListBox class

Action

Selects all the items in the ListBox.

Syntax

listBox.SelectAll()


SelectAll Method (WPFPasswordBox)

Class

WPFPasswordBox class

Action

Selects the entire contents of the PasswordBox.

Syntax

passwordBox.SelectAll()


SelectAll Method (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Selects the entire contents of the text editing control.

Syntax

textBoxBase.SelectAll()


SelectCell Method (WPFDataGrid)

Class

WPFDataGrid class

Action

Selects the specified cell.

Syntax

dataGrid.SelectCell(row, column, [modifiers])
Variable | Description
row | The row to select. LISTITEM.
column | The cell to select. LISTITEM.
modifiers | Optional.The modifier keys to press while selecting the cell. Use a modifier to select multiple items. MODIFIERKEYSTATE.


SelectCell Method (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Selects the specified cell.

Syntax

toolkitDataGrid.SelectCell(row, column, [modifiers])
Variable | Description
row | The row to select. LISTITEM.
column | The cell to select. LISTITEM.
modifiers | Optional.The modifier keys to press while selecting the cell. Use a modifier to select multiple items. MODIFIERKEYSTATE.


SelectDate Method (WPFCalendar)

Class

WPFCalendar class

Action

Selects the given date and clears the current selection.

Syntax

calendar.SelectDate(dateToSelect)
Variable | Description
dateToSelect | The date to select. DATETIME.


SelectDate Method (WPFDatePicker)

Class

WPFDatePicker class

Action

Selects the given date.

Syntax

datePicker.SelectDate(dateToSelect)
Variable | Description
dateToSelect | The date to select. DATETIME.


SelectDate Method (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Selects the given date and clears the current selection.

Syntax

toolkitCalendar.SelectDate(dateToSelect)
Variable | Description
dateToSelect | The date to select. DATETIME.


SelectDate Method (WPFToolkitDatePicker)

Class

WPFToolkitDatePicker class

Action

Selects the given date.

Syntax

toolkitDatePicker.SelectDate(dateToSelect)
Variable | Description
dateToSelect | The date to select. DATETIME.


SelectDates Method (WPFCalendar)

Class

WPFCalendar class

Action

Selects the given dates and clears the current selection.

Syntax

calendar.SelectDates(dates)
Variable | Description
dates | The dates to select. LIST OF DATETIME.


SelectDates Method (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Selects the given dates and clears the current selection.

Syntax

toolkitCalendar.SelectDates(dates)
Variable | Description
dates | The dates to select. LIST OF DATETIME.


SelectedCell Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets the selected cells in the data grid.

Data Type

WINDOW

Access

Read only


SelectedCell Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets the selected cells in the data grid.

Data Type

WINDOW

Access

Read only


SelectedCells Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets the list of cells that are currently selected.

Data Type

LIST OF WINDOW

Access

Read only


SelectedCells Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets the list of cells that are currently selected.

Data Type

LIST OF WINDOW

Access

Read only


SelectedCellText Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets the text of the selected cells in the data grid or an empty string if no cell is selected.

Data Type

STRING

Access

Read only


SelectedCellText Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets the text of the selected cells in the data grid or an empty string if no cell is selected.

Data Type

STRING

Access

Read only


SelectedCellTexts Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets the texts of the selected cells in the data grid or an empty list if no cells are selected.

Data Type

LIST OF STRING

Access

Read only


SelectedCellTexts Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets the texts of the selected cells in the data grid or an empty list if no cells are selected.

Data Type

LIST OF STRING

Access

Read only


SelectedDate Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets the currently selected date.

Data Type

DATETIME

Access

Read only


SelectedDate Property (WPFDatePicker)

Class

WPFDatePicker class

Action

Gets the currently selected date.

Data Type

DATETIME

Access

Read only


SelectedDate Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets the currently selected date.

Data Type

DATETIME

Access

Read only


SelectedDate Property (WPFToolkitDatePicker)

Class

WPFToolkitDatePicker class

Action

Gets the currently selected date.

Data Type

DATETIME

Access

Read only


SelectedDates Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets a list of selected dates.

Data Type

LIST OF DATETIME

Access

Read only


SelectedDates Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets a list of selected dates.

Data Type

LIST OF DATETIME

Access

Read only


SelectedIndex Property (WPFSelector)

Class

WPFSelector class

Action

Gets the index of the first item in the current selection or returns negative one (-1) if the selection is empty. The value is one-based.

Data Type

INTEGER

Access

Read only


SelectedItemPath Property (WPFTreeView)

Class

WPFTreeView class

Action

Gets the selected item path or an empty item path if nothing is selected.

Data Type

LISTITEM

Access

Read only


SelectedItem Property (WPFComboBox)

Class

WPFComboBox class

Action

Gets the first item in the current selection or returns null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItem Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets the selected row in the data grid.

Data Type

WINDOW

Access

Read only


SelectedItem Property (WPFListBox)

Class

WPFListBox class

Action

Gets the first item in the current selection or returns null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItem Property (WPFListView)

Class

WPFListView class

Action

Gets the first item in the current selection or returns null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItem Property (WPFSelector)

Class

WPFSelector class

Action

Gets the first item in the current selection or returns null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItem Property (WPFTabControl)

Class

WPFTabControl class

Action

Gets the first item in the current selection or returns null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItem Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets the selected row in the data grid.

Data Type

WINDOW

Access

Read only


SelectedItem Property (WPFTreeView)

Class

WPFTreeView class

Action

Gets the selected item or returns null if the selection is empty.

Data Type

WINDOW

Access

Read only


SelectedItems Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets the selected rows in the data grid.

Data Type

LIST OF WINDOW

Access

Read only


SelectedItems Property (WPFListBox)

Class

WPFListBox class

Action

Gets the currently selected items. A complete list of items can be retrieved with the "Items" property.

Data Type

LIST OF WINDOW

Access

Read only


SelectedItems Property (WPFListView)

Class

WPFListView class

Action

Gets the currently selected items. A complete list of items can be retrieved with the "Items" property.

Data Type

LIST OF WINDOW

Access

Read only


SelectedItems Property (WPFMultiSelector)

Class

WPFMultiSelector class

Action

Gets the items in the MultiSelector that are selected.

Data Type

LIST OF WINDOW

Access

Read only


SelectedItems Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets the selected rows in the data grid.

Data Type

LIST OF WINDOW

Access

Read only


SelectedItemText Property (WPFSelector)

Class

WPFSelector class

Action

Gets the text of the first item in the current selection or returns an empty string if the selection is empty.

Data Type

STRING

Access

Read only


SelectedItemText Property (WPFTreeView)

Class

WPFTreeView class

Action

Gets the text of the selected item or an empty string if the selection is empty.

Data Type

STRING

Access

Read only


SelectedItemTexts Property (WPFListBox)

Class

WPFListBox class

Action

Gets a list of string containing the text of every currently selected item.

Data Type

LIST OF STRING

Access

Read only


SelectedItemTexts Property (WPFMultiSelector)

Class

WPFMultiSelector class

Action

Gets the text of the items in the MultiSelector that are selected.

Data Type

LIST OF STRING

Access

Read only


SelectedText Property (WPFRichTextBox)

Class

WPFRichTextBox class

Action

Gets the content of the current selection in the text box. Getting this property returns a string copy of the current. Setting this property replaces the current selection with the specified string.

Data Type

STRING

Access

Read only


SelectedText Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets the content of the current selection in the text box. Getting this property returns a string copy of the current text. Setting this property replaces the current selection with the specified string.

Data Type

STRING

Access

Read only


SelectionEnd Property (WPFSlider)

Class

WPFSlider class

Action

Gets the largest value of a specified selection for a Slider.

Data Type

REAL

Access

Read only


SelectionLength Property (WPFRichTextBox)

Class

WPFRichTextBox class

Action

Gets a value indicating the number of characters in the current selection in the text box.

Data Type

INTEGER

Access

Read only


SelectionLength Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets a value that indicates the number of characters in the current selection in the text box.

Data Type

INTEGER

Access

Read only


SelectionMode Property (WPFCalendar)

Class

WPFCalendar class

Action

Gets a value that indicates what kind of selections are allowed.

Data Type

CALENDARSELECTIONMODE

Access

Read only


SelectionMode Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets a value that indicates how rows and cells are selected in the data grid.

Data Type

DATAGRIDSELECTIONMODE

Access

Read only


SelectionMode Property (WPFListBox)

Class

WPFListBox class

Action

Gets the selection behavior for a ListBox.

Data Type

SELECTIONMODE

Access

Read only


SelectionMode Property (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Gets a value that indicates what kind of selections are allowed.

Data Type

CALENDARSELECTIONMODE

Access

Read only


SelectionMode Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets a value that indicates how rows and cells are selected in the data grid.

Data Type

DATAGRIDSELECTIONMODE

Access

Read only


Selection Property (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Gets the selected content of the DocumentViewer.

Data Type

STRING

Access

Read only


Selection Property (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Gets the selected content of the FlowDocumentPageViewer.

Data Type

STRING

Access

Read only


Selection Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets the selected content of the FlowDocumentReader.

Data Type

STRING

Access

Read only


Selection Property (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Gets the selected content of the FlowDocumentScrollViewer.

Data Type

STRING

Access

Read only


SelectionStart Property (WPFRichTextBox)

Class

WPFRichTextBox class

Action

Gets a character index for the beginning of the current selection.

Data Type

INTEGER

Access

Read only


SelectionStart Property (WPFSlider)

Class

WPFSlider class

Action

Gets the smallest value of a specified selection for a Slider.

Data Type

REAL

Access

Read only


SelectionStart Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets a character index for the beginning of the current selection.

Data Type

INTEGER

Access

Read only


SelectionUnit Property (WPFDataGrid)

Class

WPFDataGrid class

Action

Gets a value that indicates whether rows, cells, or both can be selected in the data grid.

Data Type

DATAGRIDSELECTIONUNIT

Access

Read only


SelectionUnit Property (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Gets a value that indicates whether rows, cells, or both can be selected in the data grid.

Data Type

DATAGRIDSELECTIONUNIT

Access

Read only


Select Method (WPFButtonBase)

Class

WPFButtonBase class

Action

Selects the Button.

Syntax

buttonBase.Select()


Select Method (WPFDataGrid)

Class

WPFDataGrid class

Action

Selects the specified row.

Syntax

dataGrid.Select(item, [modifiers])
Variable | Description
item | The row to select. LISTITEM.
modifiers | Optional.The modifier keys to press while selecting the row. Use a modifier to select multiple rows. MODIFIERKEYSTATE.


Select Method (WPFDataGridCell)

Class

WPFDataGridCell class

Action

Selects the cell.

Syntax

dataGridCell.Select()


Select Method (WPFDataGridRow)

Class

WPFDataGridRow class

Action

Selects the row.

Syntax

dataGridRow.Select()


Select Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Selects a range of text.

Syntax

documentViewer.Select(text, [occurrence])
Variable | Description
text | The text to be selected. STRING.
occurrence | Optional.The zero based occurrence of the specified text to be selected. The value is one-based. INTEGER.


Select Method (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Selects a range of text.

Syntax

flowDocumentPageViewer.Select(text, [occurrence])
Variable | Description
text | The text to be selected. STRING.
occurrence | Optional.The zero based occurrence of the specified text to be selected. The value is one-based. INTEGER.


Select Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Selects a range of text.

Syntax

flowDocumentReader.Select(text, [occurrence])
Variable | Description
text | The text to be selected. STRING.
occurrence | Optional.The zero based occurrence of the specified text to be selected. The value is one-based. INTEGER.


Select Method (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Selects a range of text.

Syntax

flowDocumentScrollViewer.Select(text, [occurrence])
Variable | Description
text | The text to be selected. STRING.
occurrence | Optional.The zero based occurrence of the specified text to be selected. The value is one-based. INTEGER.


Select Method (WPFListBoxItem)

Class

WPFListBoxItem class

Action

Selects the ListBoxItem.

Syntax

listBoxItem.Select()


Select Method (WPFMenuBase)

Class

WPFMenuBase class

Action

Selects a menu item.

Syntax

menuBase.Select(item)
Variable | Description
item | The menu item to select. Can be either a top-level menu item or a menu item that can be found in a submenu. For selecting a menu item from a submenu separate the menu item names with a slash. The item can contain the wildcards '?' (matches one character) or '*' (matches 0 to many characters). LISTITEM.

Examples

// Select the 'Open' menu item from the 'File' menu
menu.Select("File/Open")


Select Method (WPFMenuItem)

Class

WPFMenuItem class

Action

Selects the menu item.

Syntax

menuItem.Select()


Select Method (WPFRichTextBox)

Class

WPFRichTextBox class

Action

Selects a range of text in the text box.

Syntax

richTextBox.Select(start, length)
Variable | Description
start | The start position for the selection. INTEGER.
length | The number of characters to select from the start position. INTEGER.


Select Method (WPFSelector)

Class

WPFSelector class

Action

Selects an item in the ListBox. If the item is not visible, it is scrolled into view.

Syntax

selector.Select(item, [modifiers])
Variable | Description
item | The item to select. LISTITEM.
modifiers | Optional.The modifier keys to press while selecting the item. Use a modifier to select multiple items in a multi-select ListBox. MODIFIERKEYSTATE.


Select Method (WPFTabItem)

Class

WPFTabItem class

Action

Selects the item.

Syntax

tabItem.Select()


Select Method (WPFTextBox)

Class

WPFTextBox class

Action

Selects a range of text in the text box.

Syntax

textBox.Select(start, length)
Variable | Description
start | The zero-based character index of the first character in the selection. INTEGER.
length | The length of the selection, in characters. INTEGER.


Select Method (WPFToolkitDataGrid)

Class

WPFToolkitDataGrid class

Action

Selects the specified row.

Syntax

toolkitDataGrid.Select(item, [modifiers])
Variable | Description
item | The row to select. LISTITEM.
modifiers | Optional.The modifier keys to press while selecting the cell. Use a modifier to select multiple items. MODIFIERKEYSTATE.


Select Method (WPFToolkitDataGridCell)

Class

WPFToolkitDataGridCell class

Action

Selects the cell.

Syntax

toolkitDataGridCell.Select()


Select Method (WPFToolkitDataGridRow)

Class

WPFToolkitDataGridRow class

Action

Selects the row.

Syntax

toolkitDataGridRow.Select()


Select Method (WPFTreeView)

Class

WPFTreeView class

Action

Selects the specified item.

Syntax

treeView.Select(item)
Variable | Description
item | The item to select. LISTITEM.


Select Method (WPFTreeViewItem)

Class

WPFTreeViewItem class

Action

Selects the item.

Syntax

treeViewItem.Select()


SelectRange Method (WPFCalendar)

Class

WPFCalendar class

Action

Selects a range of dates.

Syntax

calendar.SelectRange(startDate, endDate, [extend])
Variable | Description
startDate | The start date of the selection. DATETIME.
endDate | The end date of the selection. DATETIME.
extend | Optional.Whether to extend the currently present selection. BOOLEAN.


SelectRange Method (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Selects a range of dates.

Syntax

toolkitCalendar.SelectRange(startDate, endDate, [extend])
Variable | Description
startDate | The start date of the selection. DATETIME.
endDate | The end date of the selection. DATETIME.
extend | Optional.Whether to extend the currently present selection. BOOLEAN.


SetDisplayDate Method (WPFCalendar)

Class

WPFCalendar class

Action

Sets the date to display.

Syntax

calendar.SetDisplayDate(dateToDisplay)
Variable | Description
dateToDisplay | The date to set. DATETIME.


SetDisplayDate Method (WPFToolkitCalendar)

Class

WPFToolkitCalendar class

Action

Sets the date to display.

Syntax

toolkitCalendar.SetDisplayDate(dateToDisplay)
Variable | Description
dateToDisplay | The date to set. DATETIME.


SetFocus Method (WPFBase)

Class

WPFBase class

Action

Gives focus to the control.

Syntax

base.SetFocus()


SetIndeterminate Method (WPFToggleButton)

Class

WPFToggleButton class

Action

Set the button to the indeterminate state.

Syntax

toggleButton.SetIndeterminate()


SetText Method (WPFPasswordBox)

Class

WPFPasswordBox class

Action

Sets the text.

Syntax

passwordBox.SetText(text)
Variable | Description
text | The text to set. STRING.


SetText Method (WPFRichTextBox)

Class

WPFRichTextBox class

Action

Sets the text.

Syntax

richTextBox.SetText(text)
Variable | Description
text | The text to set. STRING.


SetText Method (WPFTextBox)

Class

WPFTextBox class

Action

Sets the text.

Syntax

textBox.SetText(text)
Variable | Description
text | The text to set. STRING.


SetValue Method (WPFScrollBar)

Class

WPFScrollBar class

Action

Sets the value of the ScrollBar.

Syntax

scrollBar.SetValue(value)
Variable | Description
value | The value the ScrollBar is set to. REAL.


SetValue Method (WPFSlider)

Class

WPFSlider class

Action

Sets the value of the Slider.

Syntax

slider.SetValue(value)
Variable | Description
value | The value the Slider is set to. REAL.


SetValueToMaximum Method (WPFScrollBar)

Class

WPFScrollBar class

Action

Sets the ScrollBar to maximum.

Syntax

scrollBar.SetValueToMaximum()


SetValueToMaximum Method (WPFSlider)

Class

WPFSlider class

Action

Sets the Slider to the maximum position.

Syntax

slider.SetValueToMaximum()


SetValueToMinimum Method (WPFScrollBar)

Class

WPFScrollBar class

Action

Sets the ScrollBar to minimum.

Syntax

scrollBar.SetValueToMinimum()


SetValueToMinimum Method (WPFSlider)

Class

WPFSlider class

Action

Sets the Slider to the minimum position.

Syntax

slider.SetValueToMinimum()


SmallChange Property (WPFRangeBase)

Class

WPFRangeBase class

Action

Gets a value to be added to or subtracted from the value of a RangeBase control.

Data Type

REAL

Access

Read only


Source Property (WPFFrame)

Class

WPFFrame class

Action

Gets the uniform resource identifier (URI) of the current content.

Data Type

STRING

Access

Read only


Source Property (WPFNavigationWindow)

Class

WPFNavigationWindow class

Action

Gets the uniform resource identifier (URI) of the current content.

Data Type

STRING

Access

Read only


SpeedRatio Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets or sets the speed ratio of the media.

Data Type

REAL

Access

Read and write


State Property (WPFToggleButton)

Class

WPFToggleButton class

Action

Gets the state of the button.

Data Type

BUTTONSTATE

Access

Read only


StaysOpenOnClick Property (WPFMenuItem)

Class

WPFMenuItem class

Action

Gets a value that indicates that the submenu in which this MenuItem is located should not close when this item is clicked.

Data Type

BOOLEAN

Access

Read only


StaysOpenOnEdit Property (WPFComboBox)

Class

WPFComboBox class

Action

Gets whether a ComboBox that is open and displays a drop-down control will remain open when a user clicks the TextBox.

Data Type

BOOLEAN

Access

Read only


StaysOpen Property (WPFContextMenu)

Class

WPFContextMenu class

Action

Gets a value that indicates whether the ContextMenu should close automatically. This is a dependency property.

Data Type

BOOLEAN

Access

Read only


StaysOpen Property (WPFPopup)

Class

WPFPopup class

Action

Gets a value that indicates whether the Popup control closes when the control is no longer in focus.

Data Type

BOOLEAN

Access

Read only


StopLoading Method (WPFFrame)

Class

WPFFrame class

Action

Stops further downloading of content for the current navigation request.

Syntax

frame.StopLoading()


StopLoading Method (WPFNavigationWindow)

Class

WPFNavigationWindow class

Action

Stops further downloading of content for the current navigation request.

Syntax

navigationWindow.StopLoading()


Stop Method (WPFMediaElement)

Class

WPFMediaElement class

Action

Stops and resets media to be played from the beginning. This method has an effect only if the LoadedBehavior property is set to Manual.

Syntax

mediaElement.Stop()


SwitchViewingMode Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Switches the viewing mode.

Syntax

flowDocumentReader.SwitchViewingMode(viewingMode)
Variable | Description
viewingMode | The viewing mode to switch to. VIEWINGMODE.


TabIndex Property (WPFControl)

Class

WPFControl class

Action

Gets a value that determines the order in which elements receive focus when the user navigates through controls by using the TAB key.

Data Type

INTEGER

Access

Read only


TargetName Property (WPFHyperlink)

Class

WPFHyperlink class

Action

Gets the name of a target window or frame for the Hyperlink.

Data Type

STRING

Access

Read only


TextAlignment Property (WPFTextBlock)

Class

WPFTextBlock class

Action

Gets a value that indicates the horizontal alignment of text content.

Data Type

TEXTALIGNMENT

Access

Read only


TextAlignment Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets the horizontal alignment of the contents of the text box.

Data Type

TEXTALIGNMENT

Access

Read only


Text Property (WPFComboBox)

Class

WPFComboBox class

Action

Gets the text of the ComboBox.

Data Type

STRING

Access

Read only


Text Property (WPFDocumentViewerBase)

Class

WPFDocumentViewerBase class

Action

Gets the text of the whole Document.

Data Type

STRING

Access

Read only


Text Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets the text of the whole Document.

Data Type

STRING

Access

Read only


Text Property (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Gets the text of the whole Document.

Data Type

STRING

Access

Read only


Text Property (WPFTextBlock)

Class

WPFTextBlock class

Action

Gets the text of this text block.

Data Type

STRING

Access

Read only


Text Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets the text that is displayed in the text control.

Data Type

STRING

Access

Read only


TextTrimming Property (WPFTextBlock)

Class

WPFTextBlock class

Action

Gets the text trimming behavior to employ when content overflows the content area.

Data Type

TEXTTRIMMING

Access

Read only


TextWrapping Property (WPFTextBlock)

Class

WPFTextBlock class

Action

Gets a value that indicates how the TextBlock wraps text.

Data Type

TEXTWRAPPING

Access

Read only


TextWrapping Property (WPFTextBox)

Class

WPFTextBox class

Action

Gets a value indicating how the text box should wrap text.

Data Type

TEXTWRAPPING

Access

Read only


TickFrequency Property (WPFSlider)

Class

WPFSlider class

Action

Gets the interval between tick marks.

Data Type

REAL

Access

Read only


TickPlacement Property (WPFSlider)

Class

WPFSlider class

Action

Gets the position of tick marks with respect to the Track of the Slider.

Data Type

TICKPLACEMENT

Access

Read only


Title Property (WPFPage)

Class

WPFPage class

Action

Gets the title of the Page.

Data Type

STRING

Access

Read only


Title Property (WPFWindow)

Class

WPFWindow class

Action

Gets a window's title.

Data Type

STRING

Access

Read only


ToggleFindDialog Method (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Toggles the Find dialog.

Syntax

flowDocumentPageViewer.ToggleFindDialog()


ToggleFindDialog Method (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Toggles the Find dialog.

Syntax

flowDocumentReader.ToggleFindDialog()


ToggleFindDialog Method (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Toggles the Find dialog.

Syntax

flowDocumentScrollViewer.ToggleFindDialog()


ToolBars Property (WPFToolBarTray)

Class

WPFToolBarTray class

Action

Gets the collection of ToolBar elements in the ToolBarTray.

Data Type

LIST OF WINDOW

Access

Read only


ToolTip Property (WPFBase)

Class

WPFBase class

Action

Gets the tool tip that is displayed for this element in the user interface (UI).

Data Type

STRING

Access

Read only


Uncheck Method (WPFMenuBase)

Class

WPFMenuBase class

Action

Unchecks a menu item.

Syntax

menuBase.Uncheck(item)
Variable | Description
item | The menu item to uncheck. Can be either a top-level menu item or a menu item that can be found in a submenu. For unchecking a menu item from a submenu separate the menu item names with a slash. The item can contain the wildcards '?' (matches one character) or '*' (matches 0 to many characters). LISTITEM.

Examples

// Uncheck the menu item 'Word Wrap' from the 'Format' menu
menu.Uncheck("Format/Word Wrap")


Uncheck Method (WPFMenuItem)

Class

WPFMenuItem class

Action

Unchecks the menu item.

Syntax

menuItem.Uncheck()


Uncheck Method (WPFToggleButton)

Class

WPFToggleButton class

Action

Unchecks the button.

Syntax

toggleButton.Uncheck()


Undo Method (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Undoes the most recent undo command. In other words, undoes the most recent undo unit on the undo stack.

Syntax

bResult = textBoxBase.Undo()
Variable | Description
bResult | BOOLEAN.


Value Property (WPFRangeBase)

Class

WPFRangeBase class

Action

Gets the current setting of the range control.

Data Type

REAL

Access

Read only


VerticalOffset Property (WPFContextMenu)

Class

WPFContextMenu class

Action

Gets the vertical distance between the target origin and the popup alignment point. This is a dependency property.

Data Type

REAL

Access

Read only


VerticalOffset Property (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Gets the vertical scroll position.

Data Type

REAL

Access

Read only


VerticalScrollBarVisibility Property (WPFTextBoxBase)

Class

WPFTextBoxBase class

Action

Gets a value that indicates whether a vertical scroll bar is shown.

Data Type

SCROLLBARVISIBILITY

Access

Read only


ViewingMode Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets the viewing mode for the FlowDocumentReader.

Data Type

VIEWINGMODE

Access

Read only


ViewportSize Property (WPFScrollBar)

Class

WPFScrollBar class

Action

Gets the amount of the scrollable content that is currently visible. This is a dependency property.

Data Type

REAL

Access

Read only


VisibleItemPaths Property (WPFTreeView)

Class

WPFTreeView class

Action

Gets the visible items in the tree as item paths.

Data Type

LIST OF LISTITEM

Access

Read only


Volume Property (WPFMediaElement)

Class

WPFMediaElement class

Action

Gets or sets the media's volume.

Data Type

REAL

Access

Read and write


WindowState Property (WPFWindow)

Class

WPFWindow class

Action

Gets the state of a window. Values include: 1=minimized, 2=maximized, 3=restored.

Data Type

INTEGER

Access

Read only


ZoomIncrement Property (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Gets the zoom increment.

Data Type

REAL

Access

Read only


ZoomIncrement Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets the zoom increment.

Data Type

REAL

Access

Read only


ZoomIncrement Property (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Gets the zoom increment.

Data Type

REAL

Access

Read only


Zoom Property (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Gets the document zoom percentage.

Data Type

REAL

Access

Read only


Zoom Property (WPFFlowDocumentPageViewer)

Class

WPFFlowDocumentPageViewer class

Action

Gets the current zoom level for the FlowDocumentPageViewer.

Data Type

REAL

Access

Read only


Zoom Property (WPFFlowDocumentReader)

Class

WPFFlowDocumentReader class

Action

Gets the current zoom level for the FlowDocumentReader.

Data Type

REAL

Access

Read only


Zoom Property (WPFFlowDocumentScrollViewer)

Class

WPFFlowDocumentScrollViewer class

Action

Gets the current zoom level for the FlowDocumentScrollViewer.

Data Type

REAL

Access

Read only


ZoomToActualSize Method (WPFDocumentViewer)

Class

WPFDocumentViewer class

Action

Zooms to 100%.

Syntax

documentViewer.ZoomToActualSize()