51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 3706|回复: 2
打印 上一主题 下一主题

为什么总是显示没有定义方法startApp???

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-2-17 16:36:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
import resources.Script3Helper;

import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.object.interfaces.SAP.*;
import com.rational.test.ft.object.interfaces.siebel.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;


/**
* Description   : Functional Test Script
* @author David
*/
public class Script3 extends Script3Helper
{
        /**
         * Script Name   : <b>Script3</b>
         * Generated     : <b>2008-2-17 下午03:52:00</b>
         * Description   : Functional Test Script
         * Original Host : WinNT Version 5.1  Build 2600 (S)
         *
         * @since  2008/02/17
         * @author David
         */
        public void testMain(Object[] args)
        {
                // TODO 在此插入代码
               
                TestObject[] foundTOs ;
                RootTestObject root = RootTestObject.getRootTestObject() ;
//                 Find all toplevel windows in the Windows domain with caption "My
//                 Document"
                CaptionText caption = new CaptionText("My Document") ;
                foundTOs = root.find(atChild(".domain", "Win", ".caption",
                     caption)) ;

//                 Find any dialogs, then return their children
//                 "OK" buttons.
                RegularExpression dialogRE = new
                     RegularExpression("*dialog", false) ;
                RegularExpression buttonRE = new
                     RegularExpression("*button", false) ;
                foundTOs = root.find(atList(atDescendant(".class",
                                     dialogRE),
                                     atChild(".class", buttonRE,".value",
                                     "OK"))) ;

//                 Start Notepad, dynamically enable that process,
//                 find its top-level window that matches the process id
//                 and get its descendant text window.
                        ProcessTestObject p1 = StartApp("Notepad") ;
                        Integer pid = new Integer((int)p1.getProcessId()) ;
                        foundTOs = root.find(atList(atProperty(".processId",
                     pid), atDescendant(".class", ".text"))) ;
                 
//                 This enables a Windows app with the provided window handle and returns a
//                 TestObject representing the window.
                Long hWnd = getAppsHwnd();
                foundTOs = root.find(atChild(".hwnd", hWnd, ".domain", "Win"));

//                 This enables a .NET app with the provided window handle and returns a
//                 TestObject representing the window.
                Long handle = getAppsHwnd();
                foundTOs = root.find(atChild("Handle", handle, ".domain", "Net"));
               
               
               
               

               

        }
}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2008-2-19 11:58:39 | 只看该作者
这段代码里有好几处错误,肯定运行不通过
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2008-2-19 21:04:15 | 只看该作者
莫非是大小写问题?

另外似乎代码并没有太多问题。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-5 19:02 , Processed in 0.072911 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表