51Testing软件测试论坛

标题: 请教如何在多个测试脚本中调用同一个function啊? [打印本页]

作者: langhun    时间: 2006-6-7 17:00
标题: 请教如何在多个测试脚本中调用同一个function啊?
我想在多个测试脚本中调用同一个文件中的函数,该怎么做啊
作者: vonsy    时间: 2006-6-7 18:39
打开->运行
其它文件中就可以调用了.
作者: vonsy    时间: 2006-6-7 18:47
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.
作者: vonsy    时间: 2006-6-8 11:39
File-Test Properties- Test Type--Compiled Modules.

http://bbs.51testing.com/viewthr ... &extra=page%3D1
作者: winterson    时间: 2006-6-13 14:09
1.将这些函数定义成public function
2.在要调用的文件中call 包含这些public function的文件




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2