Serial number function name function Function
1 qtp_small () to minimize qtp Runtime
2 qtp_big () 'restore the qtp window
3 "qtp_writefile (pathway, words)" 'Write File function (append) file path write content
4 "function qtp_writefile_change (pathway, words)" 'Write File function (rewrite) file path write content
5 "qtp_read_excel (pathway, sheetname, x, y)" 'read the value of the row value column of the worksheet name in the file path of the Excel file Element
6 "qtp_write_excel (pathway, sheetname, X, Y, content)" 'write the Excel file element and save the exit file path
Worksheet name, row value, column value, write content
7 "qtp_msgbox (value, waittime, title)" timed stay pop-up box function pop-up value pop-up box stay time pop-up box title
8 "qtp_change_color (pathway, sheetname, X, Y, color)" 'change the Excel cell color file path worksheet name
Color of the row value column value (only red and green are accepted)
9 qtp_capture (pathway) 'capture current screen () Save image path
1 function createexcel (): generate an Excel object and a new default worksheet Excel Object
2 sub closeexcel (excelapp) Close specified Excel objects
3 "Function SaveWorkbook (ExcelApp, workbookIdentifier, path)" Save the worksheet Excel Object worksheet name
Excel File Path 1 succeeded, 0 failed
4 "Sub SetCellValue (excelSheet, row, column, value)" assigns a worksheet name, row, and column value to an Excel element.
5 "Function GetCellValue (excelSheet, row, column)" get the value of the specified element. The value of the row column in the worksheet name is 0. No element is found.
6 "Function GetSheet (ExcelApp, sheetIdentifier) returns the worksheet
7 "Function InsertNewWorksheet (ExcelApp, workbookIdentifier, sheetName)" Insert a new worksheet Excel Object
Worksheet name new worksheet object
8 Function CreateNewWorkbook (ExcelApp) creates a new table Excel Object
9 "Function OpenWorkbook (ExcelApp, path)" open a previously saved worksheet Excel Object path
10 "Sub ActivateWorkbook (ExcelApp, workbookIdentifier)" activates the worksheet Excel Object worksheet name
11 "Sub CloseWorkbook (ExcelApp, workbookIdentifier)" Close worksheet Excel Object worksheet name
12 "Function CompareSheets (sheet1, sheet2, startColumn, numberOfColumns, startRow, numberOfRows, trimed)" compare worksheets
1 Worksheet 1 2 worksheet 2 3 Start column 4 columns 5 start Row 6 rows default parameter true consistent false inconsistent
QTP and Robot common functions:
Serial number function name function Function
1 Get_Data () Get the current date
2 Get_Time () Get the current time
3 "Get_RandNum (fromNum, toNum)" random function generation start generation value end generation value Random Number
4 "Swap (byref a, byref B)" value exchange function exchange parameter 1 exchange parameter 2 (Reference call)
5. If IsPrimeNumber (num) is a prime number function, true is returned. Otherwise, false is returned.
6 "ReadLine (pathway, rowcount )"
"The specified row content is returned." text out of bounds "", "" file does not exist """
7 Function MakeString (inputlength): randomly generated string String Length: random string
8 Sub ZYGLQ () Start Resource Manager
9 Sub Run () start running
10 "SendMail (SendTo, Subject, Body, Attachment)" calls outlook to send email recipient Subject email content Attachment
11 "Function NoRepeat (indium, Sp)" removes repeated items in the string. The input string is a string separator without repeated strings.
12 Function GetLen (Str) Evaluate the string length (Chinese character counts as 2 Spanish characters) input string
13 Sub RunApp (command) run the specified program running program name
14 Function Nextday (ByVal inputday) calculates the date of the day after the original date of the Function whose next day is the number
15 Function ISLeapYear (ByVal inYear) determines whether a leap year is true: a leap year, false: A non-leap year
16 "Function Days (SourceData, DesData)" calculates the number of Days between two dates.
17 Function Identification (Text1) check whether the ID card number is correct: true error: false
18 "Access_GetCount (DBlocation, TableName, Value )"
Number of times the returned value of the query appears
19 Function checkString (myString) check whether there is a number input string true: there is a number false: There is no number
20 "Function BubbleSort (VString, Spl, Func)" sort by ASCII code value bubble sort the string separator to be sorted:
1 descending, 2 ascending