51Testing软件测试论坛

标题: SilkTest概念性问题求助 [打印本页]

作者: tianzw    时间: 2006-1-9 17:12
标题: SilkTest概念性问题求助
刚用SilkTest,有很多问题不明白。
1。SilkTest里面,TestCase和Script是个怎样的关系?
2。在QTP里面,我可以手工在脚本源代码里面修改脚本,只要我知道VBScript语法就行。在SilkTest里面是遵循的什么语法,而且我要手工在脚本源代码里面修改脚本,应该改以什么后缀名结尾的文件?(例如,我在QTP里面用wait,在SilkTest里面是用什么命令?)


谢谢啦!
作者: asks_zhuang    时间: 2006-1-9 18:55
1.TestCase是由script组成的,保存在.t后缀的文件中,对这个文件,经常叫做脚本文件。如
TestCase TestCase_Login
     Login_Window.Username.SetText("username")
     LogIn_Window.Passwd.SetText("password")
     LogIn_Window.SubmitButton.click()
上面的所有内容保存在test.t文件中,这个文件就是脚本文件。

2。是4test语法,其实和vb代码很类似,也有Class的概念,可以参照help文档里面的4test语法介绍

3。而且我要手工在脚本源代码里面修改脚本,应该改以什么后缀名结尾的文件?(例如,我在QTP里面用wait,在SilkTest里面是用什么命令?)
不太明白,脚本的后缀名都是.t,保存时候默认会选择的。
作者: tianzw    时间: 2006-1-10 17:36
谢谢斑竹的解答,清楚了很多。

又有一个问题了,麻烦斑竹:
在QTP里面,如果一个控件在录制的时候,QTP没有录入正确,我可以手工修改,甚至可以在Object Repository里面加一个对象。但是同样的情况,要是出现在SilkTest里面,要如何处理呢?我就是拿SilkTest录了QTP里面自带的航空订票系统很少的几个步骤,但是老是回放出错,原先录制的是点击“Insert Order”然后点击“Updata Order”,但是回放的时候总是只点击“Insert Order”,然后居然又出现了一个“Login”窗口,没有点击“Updata Order”,这种情况我录了几次都是这样,很痛苦,这是为什么啊?我怀疑是系统把按钮的对象属性认错了,但是在哪里修改对象的属性呢?
作者: asks_zhuang    时间: 2006-1-11 13:45
标题: 先看看这篇文章,帮助文件里面也有
Handling login windows in non-Web applications

Although a non-Web application抯 main window is usually displayed first, it is also common for a login or security window to be displayed before the main window.

Use the wStartup constant and the Invoke method

To handle login windows, you need to record a declaration for the login window, set the value of the wStartup constant, and write a new Invoke method for the main window that enters the appropriate information into the login window and dismisses it. This enables the DefaultBaseState routine to perform the actions necessary to get past the login window.

Note          You do not need to use this procedure for splash screens, which  disappear on their own.

To handle login windows:

1        Activate the login window and record a declaration for it selecting the Record/Declarations menu command. (See
Record menu.) Paste the resulting dialog declaration to the test frame file.

2        In your test frame file, find the stub of the declaration for the wStartup constant, located at the top of the declaration for the main window:

// First window to appear when application is invoked
// const wStartup = ?

3        Complete the declaration for the wStartup constant by:

?Removing the comment characters (the two forward slash characters) at the beginning of the declaration.

?Replacing the question mark with the identifier of the login window, as recorded in the window declaration for the login window.

4        Define an Invoke method in the main window declaration that calls the built-in Invoke method and additionally performs any actions required by the login window, such as entering a name and password.

Example

After following this procedure, your test frame might look like this:

xample
作者: hansha2010    时间: 2006-11-14 15:39
动手写脚本都是在什么情况下?




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