Kao

Click on specific part of multipart control.

4 posts in this topic

I am trying to build a platform for performing tests on our winforms application  and I'm trying to find a way to reliably click on the correct item in a treeview (a ComponentOne treeview to be specific).  Ideally I would like to be able to perform the click based on the text but a second best solution would be to to coordinates relative to the active window; the latter is not ideal as it the items aren't guaranteed to always be in the same location but with some extra work I should be able to correct position for 9 out of 10 scenarios.

I'm also open to other suggestions if anyone else has found an alternative method for achieving this.

Share this post


Link to post
Share on other sites



So 5 more minutes after posting this (having done an hour or so of research prior) I stumbled across the ability to specify coordinates to the ControlClick method that are relative to the control.

As per my first post this isn't ideal, but it will definitely be a step in the right direction.

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Welcome to AutoIt and the forum!
Even "old-timers" on this forum learn something new every day ;)

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Don't use controlclick...that will be as unreliable as a mouseclick in this situation.

Use the __GUICtrlTreeView_* functions.


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now