Opening and closing applications

Relevant for: GUI actions and function libraries

In addition to using the Record and Run Settings Dialog Box (for tests) to instruct UFT to open a new application when a run session begins, or manually opening the application you want to test, you can insert statements into your test or component that open and close the applications you want to test.

You can run any application from a specified location using a SystemUtil.Run statement. You can specify an application and pass any supported parameters, or you can specify a file name and the associated application starts with the specified file open.

This is especially useful in the following situations:

If your test includes more than one application, and you selected the Record and run test on any application check box in the Record and Run Settings Dialog Box.

If you want to provide an operation (function) that opens an application from within a component.

You can close most applications using the Close method. You can also use SystemUtil statements to close applications.

For example, you could use the following statements to open a file named type.txt in the default text application (Notepad), type happy days, save the file using shortcut keys, and then close the application:

Tips to improve your search results...TOCUnified Functional Testing Help CenterUFT14.50-14.51AllView Local Help CenterView Online Help CenterbackGo back in browser historyforwardGo forward in browser historyRemove search highlightsnext topicGo to next topicprevious topicGo to previous topicPrint the current topicVersion(Undefined variable: _rscC_Basic_Variables.FloatingTocShow)