Micro Focus QTP (UFT) Forums
unable to click webelement by holding shift key - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: unable to click webelement by holding shift key (/Thread-unable-to-click-webelement-by-holding-shift-key)



unable to click webelement by holding shift key - tanyamrz - 09-11-2012

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



RE: unable to click webelement by holding shift key - kcn - 09-14-2012

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