zoukankan      html  css  js  c++  java
  • QTP如何启动应用程序(转)

    QTP提供了很多自动启动应用程序的办法,方法如下:
            1)SystemUtil.Run 允许启动新的进程
            格式:SystemUtil.Run file, [params], [dir], [op], [mode]
            下面代码利用SystemUtil对象如何启动进程。

            '启动IE

              SystemUtil.Run "iexplore.exe"
             SystemUtil.Run "iexplore.exe", "http://www.51testing.com/?72" '打开pcl blog
             SystemUtil.Run "iexplore.exe", "http://www.knowledgeinbox.com", , , 3
     


    打开其他软件:

    SystemUtil.Run "E:\software\xshell30.exe"   


            2)InvokeApplication 启动应用程序
            格式:InvokeApplication(Command [,StartIn])

            例子:
            '启动ie
               InvokeApplication "IEXPLORE.EXE"
            '启动计算器
               InvokeApplication "calc.exe"

            3) COM - Wsh
               利用Wsh对象进行启动
            例子:

                Dim oShell
               set ōShell= CreateObject ("Wscrīpt.shell")
               oShell.Run "IEXPLORE.EXE"
               Set ōShell = Nothing
     


    oShell.Run "E:\software\xshell30.exe"

            4)Qtp自动启动应用程序
              Qtp打开 Automation-〉Record and Run Settings 下进行设置

            5)录制启动过程

    也可以手动将Dialog:运行的所有对象添加到对象库中,并首先启动dialog:运行

              Dialog("运行").WinEdit("打开(O):").Set "calc"
             Dialog("运行").WinButton("确定").Click
     
  • 相关阅读:
    开启CTF大门
    关于windows下scapy出现log_runtime问题
    Python关于Threading暂停恢复解决办法
    angr入门之CLE
    Linux信号量
    IDApython 命令
    Array 数组对象
    随机数 random()
    四舍五入round()
    向下取整floor()
  • 原文地址:https://www.cnblogs.com/Hacker/p/1754343.html
Copyright © 2011-2022 走看看