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
Solved

Clicking a wpflist item

Posted on 2013-05-20
1
714 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
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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 …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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