Testing Excel files

Free Trial

Testing Excel files: procedure Call in QF-Test

The procedure call creates a property variable which contains the different values of the Excel file. Hereby, the name of the property group is passed via the resultGroupName parameter. so, in the above example ${resultGroup:A1} will expand to the value located in the cell A1, ${resultGroup:A2} will expand to the value located in the cell A2 and so on.

Afterwards, it’s possible to check the different values of the excel file, for example with the help of the different procedures in the check-Package (e.g. checkValueToBeEqual). However, especially if you do have a large Excel file, creating so many procedure calls can be cumbersome. In this case it makes sense to create a reference Excel file. Then QF-Test can read both the Excel file and the reference Excel file into different property groups. The following Jython server script can then be used to compare the property groups with one another:

p1 = rc.lookup("groupName1")
p2 = rc.lookup("groupName2")
props1 = rc.getProperties(p1)
props2 = rc.getProperties(p2)

errors = []

for p in props1.keys():
    if props2.containsKey(p):
        v1 = props1.get(p)
        v2 = props2.get(p)
        if v1 != v2:
            errors.append("%s has value %s in %s but %s in %s" % (p, v1, p1, v2, p2))
    else:
        errors.append("%s in %s but not in %s" % (p, p1, p2))

for p in props2.keys():
    if not props1.containsKey(p):
        errors.append("%s in %s but not in %s" % (p, p2, p1))

if errors:
    rc.logError("\n".join(errors))

Excel files can be read into QF-Test using a simple procedure call where the procedure qfs.utils.files.readExcelFile must be called:

We use "Matomo" cookies to anonymously evaluate your visit to our website. For this we need your consent, which is valid for twelve months.

Cookie Configuration

Functional cookies

We use functional cookies to ensure the basic functionality of the website.

Performance and statistics cookies

We use Matomo for analyzing and optimizing our website. Cookies permit an anonymous collection of information that help us offering you a clear and user-friendly visit of our web pages.

Cookie details
Description Vendor Lifetime Type Purpose
_pk_id Matomo 13 Months HTTP Contains a unique, pseudonymized visitor ID internal to Matomo for recognizing returning visitors.
_pk_ref Matomo 6 Months HTTP Used to track from which website the anonymized user proceeded to our website.
_pk_ses Matomo 1 Day HTTP The Matomo session cookie is used to track the visitor's page requests during the session.
_pk_testcookie Matomo Session HTTP Used to check whether the visitor's browser supports cookies.
_pk_cvar Matomo 30 Minutes HTTP Temporarily store data about the visit.
_pk_hsr Matomo 30 Minutes HTTP Temporarily store data about the visit.