Solved

Clicking a wpflist item

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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