QTP

QTP自动化测试-调用函数

你离开我真会死。 提交于 2019-12-26 20:58:51
在QTP里调用函数 不使用小括号如: MoreQueryValueForSupplier xg,yg,rowno '============================================= '名称:MoreQueryValueForSupplier '作用:更多查询-添加查询条件-往来信息 '参数:rowno 当前运行的行数,xg 点击X轴位置,yg 点击的y轴位置 '函数调用实例:MoreQueryValueForSupplier(x,y,2) '============================================= Function MoreQueryValueForSupplier(xg,yg,rowno) Window("查询").WinObject("TRzStringGrid").VScroll micLineNext, 1 Window("查询").WinObject("TRzStringGrid").Click xg,yg'1往来编码 Window("查询").WinObject("TRzStringGrid").Type "0" Window("查询").WinObject("TRzStringGrid").VScroll micLineNext, 1 Window("查询").WinObject("TRzStringGrid

功能自动化测试之QTP录制脚本(一)

故事扮演 提交于 2019-12-25 18:44:31
说明:该篇博客是博主一字一码编写的,实属不易,请尊重原创,谢谢大家! 接着上一篇博客继续往下写 : https://blog.csdn.net/qq_41782425/article/details/103668789 文章目录 一、安装 QTP 1.安装 QTP 脚本调试器 2.安装 QTP 3.汉化 4.破解 二、QTP 的工作原理 1.录制脚本 2.运行脚本 3.增强脚本 4.支持的脚本语言 三、QTP 的测试过程 1.QTP 的测试流程 2.案例 2.1 录制脚本 2.2 运行脚本 2.3 解决执行(回放)脚本的一系列问题 2.4 增强脚本(设置检查点,检查计算器结果是否正确) 2.5 增强脚本(参数化,使用不同的用例测试计算器) 2.6 QTP导入Excel表用例 2.7 执行计算器用例并添加实际结果 2.8 分析计算器的测试结果 一、安装 QTP 说明:博主在windows server 2008中进行演示 1.安装 QTP 脚本调试器 首先恢复纯净版快照,然后挂载QTP iso安装文件 点击退出安装页面,右击光盘驱动器打开,进入脚本调试器目录 安装脚本调试器 2.安装 QTP 点击光盘驱动器,进入QTP安装页面,点击安装程序 安装必要程序 安装.net FrameWork,点击同意安装即可 安装完成,点击退出即可 紧接着会自动弹出C++ 2005的安装,点击yes即可

Running QTP Scripts on a Remote Machine (Windows 7)

混江龙づ霸主 提交于 2019-12-25 06:47:27
问题 I want to run the QTP script that resides in my machine from another Machine in the LAN. Tried doing the following: DCOM Configuration is done (on the machine where the script has to be run) Script resides in the Script Initiator machine: dim qapp set qapp = createobject("QuickTest.Application","<IP Address") qapp.launch qapp.visible = true Please Help.. 回答1: 1) I would first ensure that below script works fine in the machine (without IP address. Just directly try to run this in the remote

Excel VB to QTP 11 script convertion issue

醉酒当歌 提交于 2019-12-25 04:03:09
问题 I have written script in Excel VBA and it is working fine, now I am trying to covert the same to QTP 11.0 - however facing some issue. Updated Question based on suggestion by Xiaofu - What is the VBA - shell function equivalent in QTP 11? And below is QTP 11 Script : Extern.Declare micHwnd, "OpenProcess", "kernel32", "OpenProcess", micLong, micLong, micLong Extern.Declare micHwnd, "WaitForSingleObject", "kernel32", "WaitForSingleObject", micLong, micLong Extern.Declare micHwnd, "CloseHandle",

QTP:强化脚本之参数化

安稳与你 提交于 2019-12-24 23:06:05
一,DataTable-最常用 按照Global表或者Sheet表中是数据一行一行执行,数据需要提前人工设置。 SystemUtil.Run "C:\HP\QTP\samples\flight\app\flight4a.exe" Dialog("Login").WinEdit("Agent Name:").Set DataTable("p_Text", dtGlobalSheet) Dialog("Login").WinEdit("Agent Name:").Type micTab Dialog("Login").WinEdit("Password:").SetSecure DataTable("p_Text1", dtGlobalSheet) Dialog("Login").WinEdit("Password:").Type micReturn Window("Flight Reservation").Close 二,随机数 按照随机数,随机出一个区间中的一个数,然后填入指定位置,适合于下列框等。 SystemUtil.Run "C:\HP\QTP\samples\flight\app\flight4a.exe" Dialog("Login").WinEdit("Agent Name:").Set RandomNumber(1000, 2000) Dialog("Login")

UFT not identifying a window in some playback

一个人想着一个人 提交于 2019-12-24 17:23:15
问题 I am using descriptive programming in UFT. During playback, I want to check if the Windows print dialog does appear. Then I want to click the Cancel button in that dialog. My problem: Sporadically QTP fails to identify the printing dialog, so clicking on the cancel button fails. How can this possibly sometimes fail, sometimes succeed? My code syntax given below: Set Window_EnterMeter = browser_servicemanager.Window("regexpwndtitle:=Enter Meters.*") Set dialog_Print = Window_EnterMeter.Dialog(

QTP: How do I match (or parametrize) line breaks in multiline edit controls?

烂漫一生 提交于 2019-12-24 10:37:35
问题 Consider this script: SystemUtil.Run "notepad.exe" With Window("Notepad") .WinEditor("Edit").Type "A" .WinEditor("Edit").Type micReturn .WinEditor("Edit").Type "B" .WinEditor("Edit").Check CheckPoint("Edit") End With The "Edit" checkpoint simply checks if the "Edit" WinEdit contains "A", CR, LF, "B". (This is exactly what the editor contains, you can verify by looking at GetROProperty ("Text") , it returns a string of length 4 with ASCII 65, 13, 10, 66, which is exactly what I'd expect.) I

Open QTP (UFT) Using Java Script using Chrome

久未见 提交于 2019-12-24 10:28:51
问题 The following is the code I used to launch qtp, It is working well with IE but not in chrome. What are the changes I shd Make to open through Chrome var qtApp = new ActiveXObject("QuickTest.Application"); qtApp.Launch(); // Start QuickTest qtApp.Visible = true; 回答1: Microsoft's VBScript is integrated with COM and UFT also exposes a COM interface, this is why you were able to launch UFT from HTML using VBScript. However VBScript is not supported by Chrome and JavaScript is not integrated with

QTP: How do I get the “complex value” edit control in the checkpoint property edit dialog?

余生颓废 提交于 2019-12-24 10:04:34
问题 Consider this script: SystemUtil.Run "notepad.exe" With Window("Notepad") .WinEditor("Edit").Type "A" .WinEditor("Edit").Type micReturn .WinEditor("Edit").Type "B" .WinEditor("Edit").Check CheckPoint("Edit") End With The edit checkpoint simply checks if the Text property of the WinEditor is equal to what we entered: "A", carriage return, line feed, "B". (This is exactly what the editor contains, you can verify by looking at GetROProperty ("Text") , it returns a string of length 4 with ASCII

How to select specific element in Powerbuilder window using HP UFT

╄→尐↘猪︶ㄣ 提交于 2019-12-24 09:10:12
问题 I am trying to record/automate an application developed in Sybase' Powerbuilder. I am currently using HP UFT v12.54. Using the default recording process, the object spy is only seeing the area on my PB Window, not the specific field/dropdown. In short, I am unable to select a specific object in the window. Please see the following image: I am trying to select the Authorized Signatory field, but instead, UFT does not see the specific element, but the field area Customer Data instead. UFT just