Micro Focus QTP (UFT) Forums

Full Version: unable to click webelement by holding shift key
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,


In my application, I have some independent webelements( not contained under any object like weblist, webtable) stored on the page. I need to click on 1st webelement and hold down shift key and click last webelement.
when I tried below code..it is selecting whole page


Code:
browser("").Page("").WebElement("").Click '1st webelement
Set obj = CreateObject("Mercury.DeviceReplay")
obj.Keydown 42
x = browser("").Page("").WebElement("").Getroproperty("x")
y = browser("").Page(" ").WebElement("").getroproperty("y")
obj.mouseclick x,y
obj.Keyup 42
Hi ,
Try the below code and let me know if it works.


Code:
Setting.WebPackage("ReplayType") = 2
set obj= browser("").Page("").WebElement("").Click
Obj.FireEvent "onmouseover"
browser("").Page("").WebElement("").click ' click on the last webelement


Regards,
kcn