Chuckero Posted September 22, 2020 Share Posted September 22, 2020 (edited) I'm using DevExpress TcxGrid in a Delphi application and AutoIt to some test automation. At this point AutoIt can not recognize the TcxGrid objects and it can not even read the content of the cells. In my test I have to do a simple search in the TcxGrid, read the content of a cell (A1), if the content is not what I expect I go to the next one (A2) and so on until find the content. Maybe I have to scroll down the list. When I find the content I have to select that line. Simple like that. In other words, I need to read the cells content and select a specific line. The big problem is AutoIt not recognize non Windows standard objects. Any tip? Just linking the things (same question in StackOverflow) : https://stackoverflow.com/questions/63995382/read-the-content-of-a-tcxgrid-cell-from-autoit Edited September 22, 2020 by Chuckero Link to comment Share on other sites More sharing options...
zeenmakr Posted September 22, 2020 Share Posted September 22, 2020 you might want to look into 'iuiautomation ms framework' Link to comment Share on other sites More sharing options...
Chuckero Posted September 24, 2020 Author Share Posted September 24, 2020 On 9/22/2020 at 1:49 PM, zeenmakr said: you might want to look into 'iuiautomation ms framework' Thanks for the tip, but I didn't find any information that this should work with TcxGrid, also, using this tool means restart my project from scratch. Did you already used MS UI Automation? It works with TcxGrid? Link to comment Share on other sites More sharing options...
seadoggie01 Posted September 24, 2020 Share Posted September 24, 2020 Did you try using UIASpy? What results did you get? Most of us won't have access to a TcxGrid so we'll need more information to help you out. All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
zeenmakr Posted September 24, 2020 Share Posted September 24, 2020 1 hour ago, Chuckero said: using this tool means restart my project from scratch well it depends on what you mean, autoit adopted it. make sure look around for a few options on UIASpy tool there are different versions by different people and some are by non autoit developers. you might find out you would prefer one over another. if you are familiar with the traditional 'AutoIt Window Info' tool then for UIA Spy is for this take a look here Link to comment Share on other sites More sharing options...
zeenmakr Posted September 24, 2020 Share Posted September 24, 2020 oh i would recommend stick with uia spy tool developed by autoit people because it offers with the best intent in mind Link to comment Share on other sites More sharing options...
Chuckero Posted September 24, 2020 Author Share Posted September 24, 2020 I found a small demo app that uses TcxGrid and have the exact same behavior as my app, so everybody can use it to test (QuantumGrid.exe) : https://www.alphaskins.com/randtip.php?num=32 Using the AutoIt Window Info I got this (no relevant info): Using UIASpy I got this: I tried to understand the info provided by UIASpy but I still stuck. It looks like the TcxGrid is totally closed and have no interface to any test automation. Link to comment Share on other sites More sharing options...
LarsJ Posted September 24, 2020 Share Posted September 24, 2020 I've been looking at the TcxGrid control in QuantumGrid.exe. It only supports MSAA (MS Active Accessibility) automation. But it's apparently not possible to get an overview of the entire Grid control. Only a single cell at a time if you click it. With AutoIt Window Info tool you can also get info about a single cell if you click it. By far the easiest way of automation for your purpose is to use an OCR program eg. Tesseract which is already available in AutoIt. Ie. take one or more screenshots of the Grid control (it can be fully automated) and extract the text in the images with Tesseract. Then you have all the Grid text in a file. Then it's easy to solve the task described in first post. Earthshine 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Chuckero Posted September 25, 2020 Author Share Posted September 25, 2020 On 9/24/2020 at 5:12 PM, LarsJ said: I've been looking at the TcxGrid control in QuantumGrid.exe. It only supports MSAA (MS Active Accessibility) automation. But it's apparently not possible to get an overview of the entire Grid control. Only a single cell at a time if you click it. With AutoIt Window Info tool you can also get info about a single cell if you click it. By far the easiest way of automation for your purpose is to use an OCR program eg. Tesseract which is already available in AutoIt. Ie. take one or more screenshots of the Grid control (it can be fully automated) and extract the text in the images with Tesseract. Then you have all the Grid text in a file. Then it's easy to solve the task described in first post. I just test this as you mentioned, in the QuantumGrid.exe is possible to click on the cells and edit the content, but just because the edition is enabled. In my app the edition is not enabled, so, is not possible to click on the cells... Also I tried Cheat Engine to check the memory, in the QuantumGrid.exe the memory looks very regular and easy to read and identify the fields, but in my application, I don't know why, there is no logic, the order of the field is different and there is no regular distance between the fields. About OCR, I already thought about it but I'm trying to avoid using third party software. I think this going to be the solution. I never used MSAA (MS Active Accessibility), I'll gonna check it. Link to comment Share on other sites More sharing options...
LarsJ Posted September 25, 2020 Share Posted September 25, 2020 Inspect.exe in the Microsoft SDK supports MSAA automation. Switch to MSAA mode with the button in upper left corner. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Chuckero Posted September 28, 2020 Author Share Posted September 28, 2020 On 9/25/2020 at 6:12 PM, LarsJ said: Inspect.exe in the Microsoft SDK supports MSAA automation. Switch to MSAA mode with the button in upper left corner. I tried inspect.exe and also its successor "Accessibility Insights for Windows", but no lucky. Now I'm pretty convinced the only way to manipulate the TcxGrid is using some kind of OCR... Link to comment Share on other sites More sharing options...
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