Micro Focus QTP (UFT) Forums
How to perform keyboard and click actions - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to perform keyboard and click actions (/Thread-How-to-perform-keyboard-and-click-actions)



How to perform keyboard and click actions - Ravi_Chandra - 05-18-2011

Hi,

Can anyone resolve below query:

Scenario - Select two web tables from the application

1. Select first web table
2. Press Ctrl button from keyboard
3. Select second web table

Bwlos is the code i tried:

Code:
Set ODesc=Description.Create()
        ODesc("html tag").Value="TABLE"
        ODesc("text").Value="ABC"
        Browser("S2 Product Control").Page("P&L View").WebTable(ODesc).Click

        Set WshShell = CreateObject("WScript.Shell")
        WshShell.SendKeys("^")

        Set ODesc1=Description.Create()
        ODesc1("html tag").Value="TABLE"
        ODesc1("text").Value= "XYZ"
        Browser("S2 Product Control").Page("P&L View").WebTable(ODesc1).Click

Thanks,
Ravi


RE: How to perform keyboard and click actions - Jay - 05-18-2011

you code should work only you need to make sure that first webtable should be activate


RE: How to perform keyboard and click actions - Ravi_Chandra - 05-23-2011

Hi,

For the above code, two rows are not selected. Only one row is clicked.
Tried with below code as well, but did not work...

can anyone help me on this??

Code:
Set ODesc=Description.Create()
ODesc("html tag").Value="TABLE"
ODesc("text").Value="ABC"
Browser("XXX").Page("YYY").WebTable(ODesc).Click

Set DeviceReplay = CreateObject("Mercury.DeviceReplay")
DeviceReplay.KeyDown 29 ‘ 29 is for control

Set ODesc1=Description.Create()
ODesc1("html tag").Value="TABLE"
ODesc1("text").Value= "XYZ"
Browser("XXX").Page("YYY").WebTable(ODesc1).Click
DeviceReplay.KeyUp 29 ‘ 29 is for control



RE: How to perform keyboard and click actions - sundari.msls - 05-24-2011

Correction:
Code:
Set ODesc1=Description.Create()
ODesc1("micclass").Value="[b]Webtable[/b]"
ODesc1("text").Value= "XYZ"
set objects=Browser("S2 Product Control").Page("P&L View").[b]ChildObjects(ODesc1)[/b]
[b]objects(0).click[/b]