?
Solved

Clicking a wpflist item

Posted on 2013-05-20
1
Medium Priority
?
800 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 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