Lieutenant
Lieutenant
239 views

WpfTable - Double click or right click on specific row

Jump to solution

Hi,

I need to double click or right click on specific row in wpftable.

UFT version 14.53. Add ins used : .net,WPF, web


I have tried below solutions and didn't work.

1. "WpfWindow("myApplication").WpfTable("myGrid").ActivateCell 0,0"

2. For my application instead of double clicking I can right click on the row and select the required option.
 code i am using:
"WpfWindow("myApplication").WpfTable("myGrid").SelctRow 0
"WpfWindow("myApplication").WpfTable("myGrid").Click ,,1 '(perform right click)
Set objWshShell = WScript.CreateObject("WScript.Shell")

objWshShell.SendKeys "{DOWN}" '(selecting specific option from context menu)
objWshShell.SendKeys "{ENTER}"

The problem with this code is, since I can not get the x,y axis of the specific cell, the right click happens to only on the row in the middle. No matter which row I select. I tried to use send key Shift+F10 instead of ""WpfWindow("myApplication").WpfTable("myGrid").Click ,,1". But couldn't figure it out.


Do we need to install any hot fixes or any third party tools to get more control on wpftable rows. Please help.

Tags (3)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Try

WpfWindow("myApplication").WpfTable("myGrid").Type micLShiftDwn

WpfWindow("myApplication").WpfTable("myGrid").Type micF10

WpfWindow("myApplication").WpfTable("myGrid").Type micLShiftUp

We can also try device replay:

Set dr = CreateObject("mercury.devicereplay")
dr.KeyDown 42
dr.KeyDown 68
dr.KeyUp 42
dr.KeyUp 68
Set dr = nothing

This code just sends key strokes so you have to make sure the AUT is in focus when it is executed.

View solution in original post

2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Try

WpfWindow("myApplication").WpfTable("myGrid").Type micLShiftDwn

WpfWindow("myApplication").WpfTable("myGrid").Type micF10

WpfWindow("myApplication").WpfTable("myGrid").Type micLShiftUp

We can also try device replay:

Set dr = CreateObject("mercury.devicereplay")
dr.KeyDown 42
dr.KeyDown 68
dr.KeyUp 42
dr.KeyUp 68
Set dr = nothing

This code just sends key strokes so you have to make sure the AUT is in focus when it is executed.

View solution in original post

Highlighted
Lieutenant
Lieutenant
Hi

Thank you for the quick reply. It worked like a charm. I was able to use both set of codes . However, do let me know if you have some ideas on performing a double click on the wpftable row.

Thank You
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.