发布新日志

  • QTP使用技巧之二:使用相对路径

    2008-08-02 17:03:25

    在QTP的使用当中,很多情况下需要引用其它的一些东西,如关联公用的存取对象库,调用其它的test的Action,或者,调用某一个vbs文件,这时需要QTP能够识别的路径,你可以使用绝对路径,但是使用绝对路径在移值的时候就会出现很多问题了,这里就应该考虑用相对路径了,QTP本身提供了这样的机制。
    首先,你在tools-options当中(可能不同版本之间有区别),看到设置Folder的TAB页,在里面,设置你相对路径的前面部分,如,一般你会把一个项目自动化的所有的东西都放在同一个目录下(c:\auto\test),这时,你就可以把c:\auto\test加进来,如:你现在有一个文件,它的绝对路径为“c:\auto\test\11.vbs”,你想要在程序当中引用它,你就可以这样写“..\test\11.vbs”,QTP会自动的去你设置的Folder下面去搜索这一个文件了。
  • QTP访问外部数据之三:execl文件

    2008-07-30 21:50:50

    QTP访问外部数据,可以通过把数据存放一个Excel文件当中,然后在脚本当中来访问,当然你也可以通过把Excel文件导入到DataTable当中来,这样使用起来更方便。下面为一些在脚本直接对Excel文件操作的Function Library,可以在QTP安装目录\CodeSamplesPlus下有一个UsingExcel.vbs文件,里面详细的列表出如何对Excel文件进行操作。
    ' ****************************************** Function Library ***********************************************************

    Dim ExcelApp 'As Excel.Application
    Dim excelSheet 'As Excel.worksheet
    Dim excelBook 'As Excel.workbook
    Dim fso 'As scrīpting.FileSystemObject
     
    ' This function will return a new Excel Object with a default new Workbook
    Function CreateExcel() 'As Excel.Application
        Dim excelSheet 'As Excel.worksheet
        Set ExcelApp = CreateObject("Excel.Application") 'Create a new excel Object
        ExcelApp.Workbooks.Add
        ExcelApp.Visible = True
        Set CreateExcel = ExcelApp
    End Function
     
    'This function will close the given Excel Object
    'excelApp - an Excel application object to be closed
    Sub CloseExcel(ExcelApp)
        Set excelSheet = ExcelApp.ActiveSheet
        Set excelBook = ExcelApp.ActiveWorkbook
        Set fso = CreateObject("scrīpting.FileSystemObject")
        On Error Resume Next
        fso.CreateFolder "C:\Temp"
        fso.DeleteFile "C:\Temp\ExcelExamples.xls"
        excelBook.SaveAs "C:\Temp\ExcelExamples.xls"
        ExcelApp.Quit
        Set ExcelApp = Nothing
        Set fso = Nothing
        Err = 0
        On Error GoTo 0
    End Sub
     
    'The SaveWorkbook method will save a workbook according to the workbookIdentifier
    'The method will overwrite the previously saved file under the given path
    'excelApp - a reference to the Excel Application
    'workbookIdentifier - The name or number of the requested workbook
    'path - the location to which the workbook should be saved
    'Return "OK" on success and "Bad Workbook Identifier" on failure
    Function SaveWorkbook(ExcelApp, workbookIdentifier, path) 'As String
        Dim workbook 'As Excel.workbook
        On Error Resume Next
        Set workbook = ExcelApp.Workbooks(workbookIdentifier)
        On Error GoTo 0
        If Not workbook Is Nothing Then
            If path = "" Or path = workbook.FullName Or path = workbook.Name Then
                workbook.Save
            Else
                Set fso = CreateObject("scrīpting.FileSystemObject")
     
                'if the path has no file extension then add the 'xls' extension
                If InStr(path, ".") = 0 Then
                    path = path & ".xls"
                End If
     
                On Error Resume Next
                fso.DeleteFile path
                Set fso = Nothing
                Err = 0
                On Error GoTo 0
                workbook.SaveAs path
            End If
            SaveWorkbook = "OK"
        Else
            SaveWorkbook = "Bad Workbook Identifier"
        End If
    End Function
     
    'The SetCellValue method sets the given 'value' in the cell which is identified by
    'its row column and parent Excel sheet
    'excelSheet - the excel sheet that is the parent of the requested cell
    'row - the cell's row in the excelSheet
    'column - the cell's column in the excelSheet
    'value - the value to be set in the cell
    Sub SetCellValue(excelSheet, row, column, value)
        On Error Resume Next
        excelSheet.Cells(row, column) = value
        On Error GoTo 0
    End Sub
     
    'The GetCellValue returns the cell's value according to its row column and sheet
    'excelSheet - the Excel Sheet in which the cell exists
    'row - the cell's row
    'column - the cell's column
    'return 0 if the cell could not be found
    Function GetCellValue(excelSheet, row, column)
        value = 0
        Err = 0
        On Error Resume Next
        tempValue = excelSheet.Cells(row, column)
        If Err = 0 Then
            value = tempValue
            Err = 0
        End If
        On Error GoTo 0
        GetCellValue = value
    End Function
     
    'The GetSheet method returns an Excel Sheet according to the sheetIdentifier
    'ExcelApp - the Excel application which is the parent of the requested sheet
    'sheetIdentifier - the name or the number of the requested Excel sheet
    'return Nothing on failure
    Function GetSheet(ExcelApp, sheetIdentifier) 'As Excel.worksheet
        On Error Resume Next
        Set GetSheet = ExcelApp.Worksheets.Item(sheetIdentifier)
        On Error GoTo 0
    End Function
     
    'The InsertNewWorksheet method inserts an new worksheet into the active workbook or
    'the workbook identified by the workbookIdentifier, the new worksheet will get a default
    'name if the sheetName parameter is empty, otherwise the sheet will have the sheetName
    'as a name.
    'Return - the new sheet as an Object
    'ExcelApp - the excel application object into which the new worksheet should be added
    'workbookIdentifier - an optional identifier of the worksheet into which the new worksheet should be added
    'sheetName - the optional name of the new worksheet.
    Function InsertNewWorksheet(ExcelApp, workbookIdentifier, sheetName) 'As Excel.worksheet
        Dim workbook 'As Excel.workbook
        Dim worksheet 'As Excel.worksheet
     
        'In case that the workbookIdentifier is empty we will work on the active workbook
        If workbookIdentifier = "" Then
            Set workbook = ExcelApp.ActiveWorkbook
        Else
            On Error Resume Next
            Err = 0
            Set workbook = ExcelApp.Workbooks(workbookIdentifier)
            If Err <> 0 Then
                Set InsertNewWorksheet = Nothing
                Err = 0
                Exit Function
            End If
            On Error GoTo 0
        End If
     
        sheetCount = workbook.Sheets.Count
        workbook.Sheets.Add , sheetCount
        Set worksheet = workbook.Sheets(sheetCount + 1)
     
        'In case that the sheetName is not empty set the new sheet's name to sheetName
        If sheetName <> "" Then
            worksheet.Name = sheetName
        End If
     
        Set InsertNewWorksheet = worksheet
    End Function
     
    'The RenameWorksheet method renames a worksheet's name
    'ExcelApp - the excel application which is the worksheet's parent
    'workbookIdentifier - the worksheet's parent workbook identifier
    'worksheetIdentifier - the worksheet's identifier
    'sheetName - the new name for the worksheet
    Function RenameWorksheet(ExcelApp, workbookIdentifier, worksheetIdentifier, sheetName) 'As String
        Dim workbook 'As Excel.workbook
        Dim worksheet 'As Excel.worksheet
        On Error Resume Next
        Err = 0
        Set workbook = ExcelApp.Workbooks(workbookIdentifier)
        If Err <> 0 Then
            RenameWorksheet = "Bad Workbook Identifier"
            Err = 0
            Exit Function
        End If
        Set worksheet = workbook.Sheets(worksheetIdentifier)
        If Err <> 0 Then
            RenameWorksheet = "Bad Worksheet Identifier"
            Err = 0
            Exit Function
        End If
        worksheet.Name = sheetName
        RenameWorksheet = "OK"
    End Function
     
    'The RemoveWorksheet method removes a worksheet from a workbook
    'ExcelApp - the excel application which is the worksheet's parent
    'workbookIdentifier - the worksheet's parent workbook identifier
    'worksheetIdentifier - the worksheet's identifier
    Function RemoveWorksheet(ExcelApp, workbookIdentifier, worksheetIdentifier) 'As String
        Dim workbook 'As Excel.workbook
        Dim worksheet 'As Excel.worksheet
        On Error Resume Next
        Err = 0
        Set workbook = ExcelApp.Workbooks(workbookIdentifier)
        If Err <> 0 Then
            RemoveWorksheet = "Bad Workbook Identifier"
            Exit Function
        End If
        Set worksheet = workbook.Sheets(worksheetIdentifier)
        If Err <> 0 Then
            RemoveWorksheet = "Bad Worksheet Identifier"
            Exit Function
        End If
        worksheet.Delete
        RemoveWorksheet = "OK"
    End Function
     
    'The CreateNewWorkbook method creates a new workbook in the excel application
    'ExcelApp - the Excel application to which an new Excel workbook will be added
    Function CreateNewWorkbook(ExcelApp)
        Set NewWorkbook = ExcelApp.Workbooks.Add()
        Set CreateNewWorkbook = NewWorkbook
    End Function
     
    'The OpenWorkbook method opens a previously saved Excel workbook and adds it to the Application
    'excelApp - the Excel Application the workbook will be added to
    'path - the path of the workbook that will be opened
    'return Nothing on failure
    Function OpenWorkbook(ExcelApp, path)
        On Error Resume Next
        Set NewWorkbook = ExcelApp.Workbooks.Open(path)
        Set ōpenWorkbook = NewWorkbook
        On Error GoTo 0
    End Function
     
    'The ActivateWorkbook method sets one of the workbooks in the application as Active workbook
    'ExcelApp - the workbook's parent excel Application
    'workbookIdentifier - the name or the number of the workbook
    Sub ActivateWorkbook(ExcelApp, workbookIdentifier)
        On Error Resume Next
        ExcelApp.Workbooks(workbookIdentifier).Activate
        On Error GoTo 0
    End Sub
     
    'The CloseWorkbook method closes an open workbook
    'ExcelApp - the parent Excel application of the workbook
    'workbookIdentifier - the name or the number of the workbook
    Sub CloseWorkbook(ExcelApp, workbookIdentifier)
        On Error Resume Next
        ExcelApp.Workbooks(workbookIdentifier).Close
        On Error GoTo 0
    End Sub
     
    'The CompareSheets method compares between two sheets.
    'if there is a difference between the two sheets then the value in the second sheet
    'will be changed to red and contain the string:
    '"Compare conflict - Value was 'Value2', Expected value is 'value2'"
    'sheet1, sheet2 - the excel sheets to be compared
    'startColumn - the column to start comparing in the two sheets
    'numberOfColumns - the number of columns to be compared
    'startRow - the row to start comparing in the two sheets
    'numberOfRows - the number of rows to be compared
    Function CompareSheets(sheet1, sheet2, startColumn, numberOfColumns, startRow, numberOfRows, trimed) 'As Boolean
        Dim returnVal 'As Boolean
        returnVal = True
     
        'In case that one of the sheets doesn't exists, don't continue the process
        If sheet1 Is Nothing Or sheet2 Is Nothing Then
            CompareSheets = False
            Exit Function
        End If
     
        'loop through the table and fill values into the two worksheets
        For r = startRow to (startRow + (numberOfRows - 1))
            For c = startColumn to (startColumn + (numberOfColumns - 1))
                Value1 = sheet1.Cells(r, c)
                Value2 = sheet2.Cells(r, c)
     
                'if 'trimed' equels True then used would like to ignore blank spaces
                If trimed Then
                    Value1 = Trim(Value1)
                    Value2 = Trim(Value2)
                End If
     
                'in case that the values of a cell are not equel in the two worksheets
                'create an indicator that the values are not equel and set return value
                'to False
                If Value1 <> Value2 Then
                    Dim cell 'As Excel.Range
                    sheet2.Cells(r, c) = "Compare conflict - Value was '" & Value2 & "', Expected value is '" & Value1 & "'."
                    Set cell = sheet2.Cells(r, c)
                    cell.Font.Color = vbRed
                    returnVal = False
                End If
            Next
        Next
        CompareSheets = returnVal
    End Function
  • QTP访问外部数据之二:环境变量

    2008-07-30 21:37:58

    QTP的环境变量之中有系统变量和用户自定义变量,环境变量的设置和查看可以可以通过打开(File-settings)Test Settings,在Environment Tab页。系统的环境变量不能增加,修改和删除,用户自定义的,可以增加、修改和删除,同时QTP还提供了,从一个xml文件把符合一定格式的数据导入到QTP的自定义变量当中,所以,在我们需要访问外部数据的时候,也可以通过把数据放到一个xml文件当中,把它作为自定义环境变量,这样,无论在脚本的某一个地方,都可以引用它(环境变量是全局),同时我们也可以修改自定义的环境变量,这样,我们也可以通过用户自定义的环境变量来在脚本当中传递、引用。


    到底如何把一个xml文件引用关联到QTP当中来呢?第一可以通过手工在Test Settings的Environment Tab页来设置,还可以在脚本当中,利用Environment的LoadFromFile方法来实现,如下面, Environment.LoadFromFile("C:\QuickTest\Files\MyVariables.xml")
    这样就可以把MyVariables.xml文件当中的数据作为用户自定义环境变量来使用了。Environment还有两个属性:一个是Value,一个是ExternalFileName。ExternalFileName表示环境变量引用的外部文件的名称,如何没有引用外部的文件,那么Environment.ExternalFileName的值为一个空的字符串。
  • qtp使用技巧之一

    2008-07-30 21:10:01

    1、创建Action 模板
    有时候,我们想在每一次新建一个Action的时候,在Action的最前面,标明Action的一些相关的信息,如Action 创建日期,作者等等,这个时候,可以创建一个Action的模板,这样只要根据模板,把一些信息填进去就可以了,不需要全部的手工的输入,而且在多人开发当中,可以保证格式某种程度的一致性。
    下面说一下,如何创建Action的模板:
    创建一个txt文件,在里面中输入一些你想在Action的最前面的语句,当然,语句必须符合QTP的要求,然后把名称改为ActionTemplate.mst,保存到QTP安装目录\dat下面,这样,每一次创建一个新的Action,就会自动在你在ActionTemplate.mst中输入的内容。

  • QTP访问外部数据之一:数据库

    2008-07-10 20:52:49

       QTP有时候需要访问数据库,以下整理了一些访问数据库常用的FUNCTION

    '================================================
    '说明:连接数据库
    '参数:curSession,数据库连接的指针,用于后面具体访问的操作
    'connection_string,连接字符串,如 
    'connection_string="Provider=MSDAORA.1;Password=password;User ID=user;Data Source=orcl;Persist Security Info=True"
    '返回值:0表示连接数据库成功,其它的为出错信息。
    '================================================
    Function db_connect( byRef curSession ,connection_string)
        dim connection
        on error Resume next
        ' 打开连接
        set connection = CreateObject("ADODB.Connection")
        If Err.Number <> 0 then
            db_connect= "Error # " & CStr(Err.Number) & " " & Err.Descrīption
            err.clear
            Exit Function
        End If
     
        connection.Open connection_string
        If Err.Number <> 0 then
            db_connect= "Error # " & CStr(Err.Number) & " " & Err.Descrīption
            err.clear
            Exit Function
        End If
        set curSession=connection
        db_connect=0
    End Function

    '==============================================
    '说明:断开数据库连接
    '参数:curSession,数据库连接的指针
    '返回值:无
    '==============================================
    Function db_disconnect( byRef curSession )
        curSession.close
        set curSession = Nothing
    End Function


    '===============================================
    '说明:通过查询语句,得到一个记录集
    '参数:curSession,数据库连接的指针,SQL,相关SQL语句
    '返回值:函数返回一个记录集'
    '==============================================
    Function db_execute_query ( byRef curSession , SQL)
         set rs = curSession.Execute( SQL )
        set db_execute_query = rs
    End Function
    '=============================================
    '说明:获取记录集的行数
    '参数:curRS,记录集的指针
    '返回值:返回行数
    '===============================================
    Function db_get_rows_count( byRef curRS )
        On error resume next
        dim rows
        rows = 0
        curRS.MoveFirst
        Do Until curRS.EOF
            rows = rows+1
            curRS.MoveNext
        Loop
        db_get_rows_count = rows
    End Function

    '=============================================
    '说明:得到记录集当中某一行某一列的值
    '参数:curRecordSet,记录集的指针,rowIndex,行的标识,从0开始,
    'colIndex,列的标识,从0开始,可以是列名
    '============================================
    Function db_get_field_value( curRecordSet , rowIndex , colIndex )
        dim curRow
     
        curRecordSet.MoveFirst
        count_fields = curRecordSet.fields.count-1
        If ( TypeName(colIndex)<> "String" ) and ( count_fields < colIndex ) then
            db_get_field_value = -1 'requested field index more than exists in recordset
        Else
            curRecordSet.Move rowIndex
            db_get_field_value = curRecordSet.fields(colIndex).Value
        End If
    End Function

    补充说明:数据库连接字符串(连接数据库的时候用到的),可以通过新建一个后缀名为udl的文件,通过该文件完成数据库的连接之后,用文本的方式打开该文件,就可以得到数据库连接的字符串了。


  • QTP设置可选步骤

    2007-03-24 15:24:56

    当运行测试或组件时,如果在打开对话框时某一步骤没有成功,QTP不必中止运行会话.它可以跳过任何被指定为可选的步骤,继续运行.默认情况下,QTP会自动标记打开哪些对话框的可选步骤。可以手动将其他步骤指定为可选。

    设置可选步骤

    当录制测试或组件时,正在测试的应用程序可能提示您在登录窗口中输入用户名和密码。但是,当运行测试或组件时,应用程序不会提示您输入用户名和密码,因为它保留了以前输入的信息。在这种情况下,不需要为输入登录信息而录制步骤,因此这些步骤应该标记为可选。

        当运行测试或组件时,如果可选对话框中的步骤未打开, QuickTest 将跳过该步骤,继续运行测试。当运行会话结束时,将对无法打开对话框的步骤显示一条消息,但是该步骤不会导致测试或组件失败。

        要在关键字视图中设置可选步骤,请右键单击某步骤,然后选择“可选步骤”。

  • QTP数据表的使用

    2007-03-24 15:21:11

    使用全局表和操作表
    1如果希望将数据用于测试中的所有操作,并且希望数据可以控制测试循环的次数,则应当将数据存储在“全局”选项卡中。
    2如果只希望将数据表参数中的数据用于某项操作,并且希望数据可以控制操作循环的次数,则应当将数据存储在该项操作的选项卡中。
  • QTP虚拟对象的使用

    2007-03-24 15:18:13

    1:QuickTest 不支持用于模拟或低级录制的虚拟对象
    2:录制和运行测试或组件时,网页或应用程序窗口的大小和位置必须和定义虚拟对象时的大小和位置相同。
    3:仅当录制和运行测试或组件时,才能使用虚拟对象。您不能在虚拟对象上插入任何类型的检查点,也不能使用“对象探测器”来查看其属性
    4:虚拟对象管理器中显示的虚拟对象集合存储在您的计算机中,而不是随包含虚拟对象步骤的测试或组件存储。这意味着如果您在测试或组件步骤中使用虚拟对象,则仅当在包含正确的虚拟对象定义的计算机中运行时,该对象在运行会话过程中才能被识别。要将您的虚拟对象集合定义复制到另一个计算机,请将您的 <QTP安装文件夹>\dat\VoTemplate 文件夹的内容(或该文件夹中的单个 .vot 集合文件)复制到目标计算机上的相同文件夹中。
    5:您只能为可以在其上单击或双击并录制 Click 或 DblClick 步骤的对象定义虚拟对象。否则,将忽略虚拟对象。例如,如果您在 WinList 对象上定义一个虚拟对象,录制 Select 操作,则虚拟对象被忽略。
    6:不要使您的应用程序或网页中的虚拟对象相互重叠。如果虚拟对象与另一个虚拟对象重叠, QuickTest 可能无法正确地在虚拟对象上录制或运行测试或组件。
    7:在“标识对象使用”框中,选择您希望 QuickTest 标识和映射虚拟对象的方式。
    7.1 如果您想要 QuickTest 标识所有出现的虚拟对象,请选择“仅父类”。QuickTest 仅通过其直接父类标识虚拟对象,而不考虑整个父层次。 例如,如果虚拟对象是使用 Browser("A").Page("B").Image("C") 定义的,则即使层次更改为 Browser("X").Page("Y").Image("C"), QuickTest 仍将识别该虚拟对象。
    7.2 如果想要 QuickTest 仅标识一次出现的虚拟对象,请选择“整个父层次”。QuickTest 将仅标识具有准确的父层次的虚拟对象。 例如,如果虚拟对象是使用 Browser("A").Page("B").Image("C") 定义的,则如果层次更改为Browser("X").Page("B").Image("C"), QuickTest 将无法识别该虚拟对象。

     

     

  • QTP使用操作的规则

    2007-03-24 15:16:52

    使用操作时请考虑下列规则:
    1.如果操作运行多次循环,该操作必须“在运行后进行清理”。换句话说,操作的结束与开始必须位于应用程序中的同一点,以便可以不间断地运行另一次循环。例如,假设您正在测试一个示例航班预定网站。如果操作以空白航班预定表单开始,则它应该以空白航班预定表单结束。
    2.单个测试可能同时包含全局数据表参数和操作(本地)数据表参数。例如,可以创建一个测试,在该测试中,旅行代理登录航班预定系统,预定三个航班,然后注销;下一个旅行代理登录航班预定系统,预定三个航班,注销,等等。要参数化“预定航班”操作,可以在参数化对话框中选择“当前操作表(本地)”,然后在数据表中的相关“操作”选项卡中输入三个航班。要参数化整个测试,可以在参数化对话框中选择“全局”,然后在数据表中的“全局”选项卡中,输入不同代理的登录名和密码。整个测试将对全局数据表中的每一行运行一次。在每个测试中,每个参数化的操作将根据其数据表中的行数以及根据在“操作属性”对话框的“运行”选项卡中选定的运行设置重复执行。
    3.您可能希望使用描述性名称重命名测试中的操作,以便识别这些操作。添加详细的操作描述也是一种很好的想法。这有利于将一个测试中的操作插入到另一个测试中。可以通过选择“编辑” > “重命名操作”对操作进行重命名。
    4.如果计划在多个测试中使用相同的或实质上相同的过程,应该考虑插入一个对其他测试中的操作的调用。
    5.0.如果仅希望对一个测试中的操作进行细微的修改,则应该使用“插入对操作副本的调用”选项来创建该操作的副本。
    5.1.如果希望修改影响到所有包含该操作的测试,则应该使用“插入对现有操作的调用”选项来插入一个对原始测试中该操作的链接。
    5.2.如果希望对该操作的修改影响到所有包含该操作的测试,但又希望在特定测试的数据表中编辑数据,请使用“插入对现有操作的调用”选项,同时,在“操作属性”对话框的“外部”选项卡中,选择“使用本地可编辑的副本
    6.当插入对外部操作的调用时,该操作将以只读格式插入,因此“录制”按钮被禁用。如果要继续录制,首先需要在测试中插入一个对本地操作的调用,或者从测试中已存在的本地操作中选择一个步骤。
    7.可重用操作有助于维护测试,但将操作变为可重用时请务必考虑其影响。将操作变为可重用后,请确保要考虑到对该操作所做的更改可能对调用该操作的其他测试产生怎样的影响
    8.如果希望其他用户可以打开您的测试,并且测试中的所有操作均存储在同一驱动器中,则应该对可重用操作使用相对路径,以便即使其他用户已各自映射了不同的网络驱动器,他们也能打开您的测试
    9.如果希望应用程序的某些元素定期更改,则最好将与可更改元素相关的这些步骤划分为单独的操作,以便在修改应用程序后,可以在必要时轻松地重新录制所需的步骤。
    使用操作参数的规则
    1.只能在调用操作的步骤内使用输入操作参数值。
    2.只能在调用操作的步骤内并且只有在操作被调用后,才能使用输出操作参数。
    3.要在另一个操作的步骤内使用某个操作中(或测试中)的操作参数值,必须将该值通过测试层次结构按操作依次向下传递到要使用该参数值的操作中(测试 ->操作 A -> 操作 B -> 操作 C -> 步骤 1)。
    4.要在另一个操作的步骤内使用某个操作中的操作输出值,必须将该值通过测试层次结构按操作依次向上传递到要使用该值的操作中(步骤 1 -> 操作 C -> 操作 B ->操作 A -> 测试 1)。
    5.如果两个值类型相同,则只能使用一个操作参数来参数化值
    6.可以将从被调用操作中检索的任一类型的操作输出参数值,在调用操作的后续步骤中用作一个变量。例如,如果 ActionA 调用 ActionB 并指定 MyBVar 作为变量来存储 ActionB 的输出参数,则 ActionA 中的步骤在调用 ActionB 之后可以将 MyBVar 作为一个值使用(如同使用任何其他变量一样)。

    来自QTP帮助文档

Open Toolbar