Kao Posted December 11, 2015 Posted December 11, 2015 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.
Kao Posted December 11, 2015 Author Posted December 11, 2015 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.
water Posted December 11, 2015 Posted December 11, 2015 (edited) Welcome to AutoIt and the forum!Even "old-timers" on this forum learn something new every day Edited December 11, 2015 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
jdelaney Posted December 12, 2015 Posted December 12, 2015 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now