How does TSI functions work with a database? WinRunner

Several TSL functions facilitate your work with a TestDirector project by returning the values of fields in a TestDirector project. In addition, working with TestDirector facilitates working with many TSL functions: when WinRunner is connected to TestDirector, you can specify a path in a TestDirector project in a TSL statement instead of using the full file system path.

TestDirector Project Functions

Several TSL functions enable you to retrieve information from a TestDirector project.

tddb_add_defect Adds a new defect to the TestDirector defect database for the project to which WinRunner is connected.

tddb_get_step_value Returns the value of a field in the "dessteps" table in a TestDirector project.

tddb_get_test_value Returns the value of a field in the "test" table in a TestDirector project.

tddb_get_testset_value Returns the value of a field in the "testcycl" table in a TestDirector project.

tddb_load_attachment Downloads a file attachment of a test to the local cache and returns its location.

You can use the Function Generator to insert these functions into your test scripts, or you can manually program statements that use them.

Call Statements and Compiled Module Functions

When WinRunner is connected to TestDirector, you can specify the paths of tests and compiled module functions saved in a TestDirector project when you use the call, call_close, load, reload, and unload functions.

For example, if you have a test with the following path in your TestDirector project, SubjectSub1My_test, you can call it from your test script with the statement:

call "[TD]SubjectSub1My_test"();

Alternatively, if you specify the “[TD]SubjectSub1” search path in the Folders category of the General Options dialog box or by using a setvar statement in your test script, you can call the test from your test script with the following statement:

call "My_test"();

Note that the [TD] prefix is optional when specifying a test or a compiled module in a TestDirector project.

Note:When you run a WinRunner test from a TestDirector project, you can specify its parameters from within TestDirector, instead of using call statements to pass parameters from a test to a called test. For information about specifying parameters for WinRunner tests from TestDirector, refer to the TestDirector User’s Guide.

GUI Map Editor Functions

When WinRunner is connected to TestDirector, you can specify the names of GUI map files saved in a TestDirector project when you use GUI Map Editor functions in a test script.

When WinRunner is connected to a TestDirector project, WinRunner stores GUI map files in the GUI repository in the database. Note that the [TD] prefix is optional when specifying a GUI map file in a TestDirector project.

For example, if the My_gui.gui GUI map file is stored in a TestDirector project, in My_project_databaseGUI, you can load it with the statement:

GUI_load ("My_gui.gui");

Specifying Search Paths for Tests Called from TestDirector

You can configure WinRunner to use search paths based on the path in a TestDirector project.

In the following example, a setvar statement specifies a search path in a TestDirector project:

setvar ("searchpath", "[TD]My_project_databaseSubjectSub1" );

For information on how to specify the search path using the General Options dialog box, see “Setting Global Testing Options.” For information on how to specify the search path by using a setvar statement, see “Setting Testing Options from a Test Script.”


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WinRunner Topics