This site requires JavaScript to be enabled
IE BUMPER

Logo

Dear Tricentis qTest users,

If you would like to submit a Tricentis qTest ticket,

please use this support request form.

Tosca Version
IncidentLookup using list
Language
How can we help?

Solution Suggestions

Please enter your question to get suggestions.
  Help
IE BUMPER
Categories
Boolean Operators
OR or vertical bar symbol (|)
Finds a match if either the terms exist in a document (a union using sets).
AND
Finds a match if both terms exist in a document (an intersection of sets).
NOT, minus (-), or exclamation point (!)
Excludes documents that contain the term after NOT (a difference of sets).
Wildcards
Asterisk (*)
The asterisk symbol performs a multi character wildcard search.
Percent sign (%)
The percent sign performs a single character wildcard search.
Phrases
Quotation marks (")
Use quotation marks to search for an exact phrase with multiple terms.
For examples and more information look at our Knowledge Base: Advanced Search On The Support Portal

Query an Excel File with Database Engine

This article explains how to connect to an Excel file using the Database Engine to perform SQL queries using the standard modules.


Situation

If you need to generate a baseline file, filter tables based on conditions, or generally run SQL queries against an Excel file. This will also show how to connect without needing to establish an ODBC connection for each Excel file you want to read, as the information will be set with your connection string.

Requirements

This solution requires the use of Excel ODBC Driver 32-Bit, which should be installed with all Windows Office solutions. It can be downloaded as a part of the Microsoft Access Database Engined 2010 Redistributable located here.

This solution requires the Tosca Aidpack, which can be downloaded from our Downloads section here.

Solution

Create a new Test Case, and add the DB Expert Module Classic as a test step. Using the DB Expert Module Classic, you can connect to an Excel File by setting the connection string value to the following:

Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};Dbq=C:\Temp\Excel1.xlsx;

Where you set the value of Dbq to be the full file path of the Excel file.

To return the values of the entire TestSheet you use the following SQL Statement:

Select * from [TestSheet$]

TestSheet must be replaced with the name of the Testsheet you are trying to query.

The column names are determined by the first row of the Excel Spreadsheet.

Once set up, the TestStep to verify a value should look like this:

Queries against Excel files must be written in Microsoft SQL Format, and can be limited by using WHERE clauses.

The Range of an excel Testsheet can be set following the $:

 

 

IE BUMPER

Tosca is the perfect solution

Optimize - Manage - Automate

Download Trial