cancel
Showing results for 
Search instead for 
Did you mean: 

Re: How to fetch the data from a Grid/dataset/table?

Highlighted
Contributor

Re: How to fetch the data from a Grid/dataset/table?

Please help me how to fetch the data from the column name from excel.


@baxatob wrote:

1. Please go carefully through this topic: https://support.smartbear.com/testcomplete/docs/app-objects/specific-tasks/grids/index.html 

 

2. You can create a DBTable variable from your excel file. Then you can use it something like this:

 

def get_value(column_name):

    source = Project.Variables.your_dbtable_variable
    source.Reset()
    while not source.IsEOF():
        Log.Message(source.Value[column_name])
        source.Next()

The code above will save all values under the column_name into the Log.

 

3. Enable Post image on error option in your Project -> Properties -> Playback -> Log

 

4. You can't do it out-of-the-box, however you can create your own script or extension for this purpose.


 

1 REPLY 1
Highlighted
Community Hero

Re: How to fetch the data from a Grid/dataset/table?

I've moved this discussion to a new topic as it is not related to the original problem of reading data from a grid or table.

 

So, based upon your other reply, you are looking to read data from an excel spreadsheet, not as part of a data driven test, but to be able to retrieve data from a specific row and a specific column, is that correct?

If so, start with this topic:

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou...

 

There is Python sample code there that you should be able to use as a starting point for building your functionality.  Give this a try and, if you have questions, feel free to ask.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
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

Compare images using the Region Checkpoint

See replies!

Converting UTC TimeDate in an Excel file

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