Hi
I am evaluating Macro Scheduler V12 for testing an application developed in Delphi. My application has a TDBrid with lot of data.
Question: Is there any way to extract data from TDBGrid and save it in a variable?
Thanks
How to extract data from TDBGrid?
Moderators: Dorian (MJT support), JRL
Use the Tools -> "View System Windows" to see if you can "see" any of the data this way. If yes, there is a chance to get at the data directly. If not, then you will have to use other GUI means to get at the data.
The technique I have used is to position the cursor in the grid and using a combination of clicks, and/or using the space key get the data to highlight. Then send the keystrokes of ctrl-c to copy the text to the clipboard. Proceed in a loop, using tab keystrokes to go from column to column until you have copied the entire row. And then usually in a grid of this type a Tab keystroke entered from the last cell repositions to the first cell of the next row. So in this fashion you can grab as much data as you like, not fast, but it works, I have done it.
Another technique would be to try image recognition to "read" the data.
Yet another technique I have used, (but this one requires a great deal of knowledge about how the system under test operates) is, if the grid displays data from a database, then program Macro Scheduler to connect directly to the database and perform a SQL query to get this information directly. Using VBScript or the new DBConnect functionality, this is quite easy.
The technique I have used is to position the cursor in the grid and using a combination of clicks, and/or using the space key get the data to highlight. Then send the keystrokes of ctrl-c to copy the text to the clipboard. Proceed in a loop, using tab keystrokes to go from column to column until you have copied the entire row. And then usually in a grid of this type a Tab keystroke entered from the last cell repositions to the first cell of the next row. So in this fashion you can grab as much data as you like, not fast, but it works, I have done it.
Another technique would be to try image recognition to "read" the data.
Yet another technique I have used, (but this one requires a great deal of knowledge about how the system under test operates) is, if the grid displays data from a database, then program Macro Scheduler to connect directly to the database and perform a SQL query to get this information directly. Using VBScript or the new DBConnect functionality, this is quite easy.
Did you have any luck?
Just wondering if you had any luck getting line items from a delphi grid.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
The text capture functions can extract text from a TDBGrid.
Also if the grid is not read only you can use the clipboard. Double click in a cell (or tab to it and hit f2) and you can then select all and copy the cell contents to the clipboard.
Also if the grid is not read only you can use the clipboard. Double click in a cell (or tab to it and hit f2) and you can then select all and copy the cell contents to the clipboard.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?