google搜索 51Testing站内搜索                    软件测试门户 | 软件测试培 训 | 文章资料精选 | 软件测试论坛 | 软件测试博客 | 测试招聘求职 
打印

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

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


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"));
               
               
               
               

               

        }
}

TOP

你是指运行时报的"没有定义方法startApp"这个错吗?

你粘贴的脚本是你要运行的脚本吗?

TOP

这段代码里有好几处错误,肯定运行不通过

TOP

莫非是大小写问题?

另外似乎代码并没有太多问题。

TOP

 
当前时区 GMT+8, 现在时间是 2008-10-7 23:24Copyright(C)上海博为峰软件技术有限公司 2001-2007 电话:021-64471599-8017
当您在访问网站、论坛及博客过程中遇到问题时可发送email:webmaster@51testing.com或发送论坛短信至管理员风在吹