请教如何在多个测试脚本中调用同一个function啊?
我想在多个测试脚本中调用同一个文件中的函数,该怎么做啊 打开->运行其它文件中就可以调用了. compiled modules.
Function Viewer
Enables you to load and unload compiled modules, to copy, paste, and execute the functions of loaded compiled modules and tests, and to open compiled modules and tests containing loaded functions.
You can see all loaded compiled modules and tests containing loaded functions in the Function Viewer.
If you expand a compiled module or test, you can see the functions it contains.
If you expand a function, you can see the arguments, if any, that the function uses.
Function Viewer Options
Load: Opens the Load Functions dialog box. Enables you to load a compiled module. When a compiled module is loaded, your tests can call its functions.
Unload: Unloads the selected compiled module and all its functions. This works only for a compiled module that was loaded either using the Load button or using the load
function from another test. A compiled module that was loaded by running it in WinRunner can be unloaded only by clicking the Stop button.
Unload All Modules: Unloads all compiled modules and their functions. This works only for a compiled module that was loaded either using the Load button or using the
load function from another test. A compiled module that was loaded by running it in WinRunner can be unloaded only by clicking the Stop button.
Copy: Copies the prototype of the selected function to the clipboard. You can then paste it to another application.
Paste: Copies and pastes the prototype of the selected function to the current cursor position in the test window. You can also use drag-and-drop to paste the prototype of a function to the test window.
Execute: Runs the selected function. If the function requires you to enter arguments, the Function Arguments dialog box is displayed.
Go to: Opens the selected compiled module, test, or function in the test window. If you open a function, the entire test in which that function is defined is opened, and the function’s first line is marked by the execution marker. File-Test Properties- Test Type--Compiled Modules.
http://bbs.51testing.com/viewthread.php?tid=5374&extra=page%3D1 1.将这些函数定义成public function
2.在要调用的文件中call 包含这些public function的文件
页:
[1]