对UFT中SwfTable列标题的右键单击操作

问题描述 投票:1回答:1

我正在通过UFT自动化应用程序,在此过程中,我需要从SwfTable中的记录列表中搜索特定的文本。

此表具有列标题,在列标题上单击鼠标右键将使我输入过滤器文本。

我的桌子看起来像这样

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9QY09VZi5wbmcifQ==” alt =“表格截图”>

右键单击列标题将允许我输入过滤器文本

“过滤器截图”

为表捕获的代码段为

SwfWindow("XXX").SwfWindow("Dashboard").SwfTable("completedGrid").

我在很多论坛中都进行了搜索,但没有找到解决方案,有人可以在这里帮助我。

vbscript hp-uft uft14
1个回答
0
投票

我在自动化Web应用程序时遇到了类似的问题。这就是我所做的:

Set menu=Browser("").Page("").WebElement("")
idx=2
'This var. points the which option to select in the right click menu. This var. is 
'always the option+1 value. Ex. If u want to select the second option then the var. 
'should have the value 3
Set obj = CreateObject("Mercury.DeviceReplay")
Set WshShell = CreateObject("WScript.Shell")
'Get the absolute coordinates of the ibject
absx = menu.QueryValue("abs_x")
absy = menu.QueryValue("abs_y")

obj.MouseClick absx, absy, 2
'Optional wait statement
wait 1

For i = 1 To idx-1
   WshShell.sendkeys "{DOWN}"
Next
WshShell.sendkeys "{ENTER}"
Set WshSEll = nothing
Set obj = nothing

如果您的AUT是桌面应用程序,只需将菜单更改为要右键单击的元素。希望对您有所帮助!

© www.soinside.com 2019 - 2024. All rights reserved.