cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter a grid using native features of delphi

Highlighted
New Contributor

How to filter a grid using native features of delphi

In a grid of a delphi application, it is possible to make this filter in the table via script command in the test complete?

 

2020-08-13 10_29_32-Window.png

 

Investigating in the object browser of that grid, I found the command that does the filtering at that address

(...).DataController.Filter.FilterText, contained this: "(DESCRIPT LIKE 'Óleo%') AND (VALUE = 3,2248)"

 

However if I change the data in the DESCRIPT or VALUE field and execute it it seems that it has no effect.

 

In several doubts I solved consulting the topics of the documentation(https://support.smartbear.com/testcomplete/docs/app-objects/specific-tasks/grids/devexpress-quantum/...), but in this specific case I couldn't find anything that would help me

4 REPLIES 4
Highlighted
Community Manager

Thank you for posting your question @joaobc !

Let's ask the Community for help. 

 

@BenoitB @AlexKaras @cunderw , also, I'm pretty sure @tristaanogre has helped with some Delphi-related things before!

Any suggestions?🙂

 


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Community Hero

Hi,

 

I am not sure where and how you have tried to change filter data, but it is my understanding that .FilterText property is just a textual representation of the applied filter.

Highlight the required grid object in your tested application using Object Spy and check the Methods pane in the Object Browser / Object Spy. This pane will list all methods that are accessible from test script code.

Talk to your developers and ask them how they are setting filter in code. Check if the same method is accessible to you in TestComplete. Depending on the implementation of the grid, you might be needing debug version of it (along with debug information) to be used in the tested application in order to access required method.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Community Manager

Thank you for reply Alex!

 

@joaobc Does this help? Please share your progress with the Community regarding this issue🙂


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
New Contributor

Really .FilterText property is just a textual representation of the applied filter, but it was my attempt. I do not master the Delphi language, my scripts in Test Complete I develop in javascript.

 

I am using it in active debug mode. The developer compiled following the example of the test complete documentation.


Yesterday I talked to a colleague at work who had the source code, we found that the grid filter uses an object with class TVsClientDataSet. Even the IndexFieldNames property has the name of the columns.

 

I ended up solving the window I sent in the print, checking the column with the value (3,2248 and 2,66). And I continued my script development

 

As soon as I encounter similar problems I will investigate in the class (TVsClientDataSet) and post here if I discover something

 

There is a way to search the object browser for words? For example, I've been trying to use the Find() and FindChild() methods, but in the Property parameter (PropNames) I can't use regular expressions, only in PropValues. The idea is to search for the words that were in the grid columns.

 

Regards,

João

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors