Object 如何在UFT中使用SendKeys右键单击对象?

Object 如何在UFT中使用SendKeys右键单击对象?,object,testing,automation,qtp,sendkeys,Object,Testing,Automation,Qtp,Sendkeys,我想在测试应用程序中的对象上执行右键单击,但我无法执行此操作。在Web中,如果右键单击操作没有达到预期的结果,这可能是因为UFT没有触发浏览器预期的事件序列,那么是否可以使用发送键来执行此操作?。您可以告诉UFT使用设备重播运行Web测试,在这种情况下,它会将鼠标光标移动到正确的位置,并模拟实际的鼠标单击(包括右键单击) 请参阅,或者只执行以下操作: Setting.WebPackage("ReplayType") = 2 ' change to device replay mode ' Per

我想在测试应用程序中的对象上执行右键单击,但我无法执行此操作。在Web中,如果
右键单击
操作没有达到预期的结果,这可能是因为UFT没有触发浏览器预期的事件序列,那么是否可以使用发送键来执行此操作?

。您可以告诉UFT使用设备重播运行Web测试,在这种情况下,它会将鼠标光标移动到正确的位置,并模拟实际的鼠标单击(包括右键单击)

请参阅,或者只执行以下操作:

Setting.WebPackage("ReplayType") = 2 ' change to device replay mode
' Perform your right-click here
Setting.WebPackage("ReplayType") = 1 ' back to normal

你可以用两种方法来做

1) 通过对象。单击

类似于ObjSomeObject。单击1,1,右键按钮

2) 通过Mercury设备回放

为此,获取高度、宽度属性。计算它们并导出intDerivedxLocation和intDerivedxLocation。然后执行以下操作

intabsX=objApp.getroperty(“abs_x”)

intabsY=objApp.getroperty(“abs_y”)

intHeight=objApp.getroperty(“高度”)

intWidth=objApp.getroperty(“宽度”)

intDerivedxLocation=Cint(intabsX)+Cint(intWidth/2)

intDerivedxLocation=Cint(intabsY)+Cint(intights/2)

昏暗的objMercuryDeviceReplay

设置objMercuryDeviceReplay=CreateObject(“Mercury.DeviceReplay”)


objMercuryDeviceReplay.mouse单击intDerivedxLocation,intDerivedxLocation,2

键盘右键单击Shift+F10有一个快捷键。 如果我们通过发送键传递,那么我们就可以这样做。在执行此操作之前,我们必须将鼠标移到该对象上,或者通过单击该对象使其处于活动状态

比如说

Browser().page().webelement().click;
Browser().page().webelement().sendkeys "+F10";

您的AUT是什么技术?我正在测试的应用程序在Web上