在运行时在 QTP 中高亮字段时截取快照或屏幕截图

Take snapshot or screenshot while highligting the field in QTP during runtime

我正在尝试在 QTP 运行 时间内突出显示该字段的同时截取该字段的屏幕截图。

systemUtil.Run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "--ignore-certificate-errors -incognito " & "www.google.com"

Browser("Google").Page("Google").WebEdit("Search").highlight

While Browser("Google").Page("Google").WebEdit("Search").highlight = True
Browser("Google").Page("Google").WebEdit("Search").CaptureBitmap("C:\Google.bmp")
Wend

谢谢,任何线索都会对我有所帮助。

HighlightCaptureBitmap 方法都是同步的,这意味着到函数 returns 时,高亮 operation/bitmap 捕获已经完成。为了捕获高光的闪烁,您需要创建自己的函数,在它完成 运行ning 后捕获屏幕一段时间,这可能需要多线程,这不是一个好方法适合 VBScript。

您可以做的另一件事是告诉 UFT 捕获测试的影片 运行,这将包括突出显示的对象(然后您必须手动找到剪辑中的位置并捕获它) .

请参阅工具 -> 选项 -> GUI 测试 -> 屏幕捕获 -> 保存影片以获取结果