ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Running and Closing Applications Programmatically

Running and Closing Applications Programmatically

原创 Linux操作系统 作者:ipqiaojj 时间:2009-03-14 10:28:04 0 删除 编辑

Running and Closing Applications Programmatically

You can run any application from a specified location using a SystemUtil.Run statement in a function library. This is especially useful if you want to provide an operation (function) that opens an application from within a component. 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.

You can close most applications using the Close method. You can also use SystemUtil statements to close applications. For more information, see the HP QuickTest Professional Object Model Reference.

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:

SystemUtil.Run "C:\type.txt", "","",""

Window("Text:=type.txt - Notepad").Type "happy days"

Window("Text:=type.txt - Notepad").Type micAltDwn & "F" & micAltUp

Window("Text:=type.txt - Notepad").Type micLShiftDwn & "S" & micLShiftUp

Window("Text:=type.txt - Notepad").Close 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16792402/viewspace-567246/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-02-22

  • 博文量
    140
  • 访问量
    73848