?
Solved

Clicking a wpflist item

Posted on 2013-05-20
1
Medium Priority
?
858 Views
Last Modified: 2014-04-08
Hi Guys,

I'm currently trying to create some automated tests using QTP and the application has an object which is being recognised as a wpflist object. The code below will select an item in the list however I'm trying to simulate a right click mouse action on an item which will bring up another menu or even a left mouse click so I can position the mouse on the correct item. The automation tool QTP uses VBScript as its language however I can create an instance of a .Net object using the DotNetFactory object and access its methods and properties. Any ideas?

FindActiveEvent "E13051010008"

Function FindActiveEvent(eventNo)
 
   Set wActiveEvents = WpfWindow("Active Events").WpfList("eventList")

   For i = 0 to wActiveEvents.Object.Items.Count - 1

            lineEventNo = wActiveEvents.Object.Items.Item(i).AgencyEventId
            If strComp(trim(lineEventNo),trim(eventNo)) = 0 Then
                   wActiveEvents.Object.Items.Item(i).Selected = True
                  Exit Function
            End If      

      Next

   
End Function
0
Comment
Question by:victoriaharry
1 Comment
 
LVL 11

Accepted Solution

by:
Mihai Stancescu earned 2000 total points
ID: 39185544
Hi,


If you are using wpf then I'm afraid it's not going to work so easy because the vbscript uses COM Handles to access the COM controls or .Net winforms controls. But the WPF controls do not derive from standard windows COM controls, they are rendered through directx engine and thus they have no handle pointer only the window class has and can be accessed through WindowInteropHelper.

Apparently QTP version 11 supports WPF, more info here.

Regards,
Mishu
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question