Solved

Clicking a wpflist item

Posted on 2013-05-20
1
638 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 500 total points
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now