发布新日志

  • 遍历jScrollPane中的JLabel对象

    2008-11-12 17:40:06

       TestObject[] foundTOs ;    
          foundTOs = jScrollPane2().find(atChild(".class", "javax.swing.JLabel","accessibleContext.accessibleName", "Tellabs 1090"));
             
       for (int i = 0; i<foundTOs.length; i++){
        GuiTestObject guiLabel = new GuiTestObject(foundTOs[i]);           
        guiLabel.click();
        sleep(1);           
       } 
       save2().click();

  • 控制data pool中的游标

    2008-11-12 17:37:02

    IDatapool dp = (IDatapool) this.getDatapool();
      IDatapoolIterator dpIter = this.dpFactory().open(dp, null);
      dpIter.dpInitialize(dp);
      String str = new String("");
      
      for(int i=0;i<=149;i++)//while ( !dpIter.dpDone() )
      { 
       dpIter.dpCurrent();
       if(i>=140)
       {
        str = dpIter.dpString(0); 
        System.out.println(str);        
       }
       dpIter.dpNext();   
      }  
  • Data pool

    2008-11-12 17:35:55

    import resources.scrīpt1Helper;

    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.scrīpt.*;
    import com.rational.test.ft.value.*;
    import com.rational.test.ft.vp.*;
    import org.eclipse.hyades.edit.datapool.*;
    import org.eclipse.hyades.edit.datapool.IDatapool;
    import org.eclipse.hyades.execution.runtime.datapool.*;
    /**
     * Descrīption   : Functional Test scrīpt
     * @author xjiang
     */
    public class scrīpt1 extends scrīpt1Helper
    {
     /**
      * scrīpt Name   : <b>scrīpt1</b>
      * Generated     : <b>Sep 26, 2008 10:54:02 AM</b>
      * Descrīption   : Functional Test scrīpt
      * Original Host : WinNT Version 5.1  Build 2600 (S)
      *
      * @since  2008/09/26
      * @author xjiang
      */
     public void testMain(Object[] args)
     {
      IDatapool dp = (IDatapool) this.getDatapool();
      IDatapoolIterator dpIter = this.dpFactory().open(dp, null);
      dpIter.dpInitialize(dp);  
      while ( !dpIter.dpDone() )
      {  
       dpIter.dpCurrent();
       String strTC = dpIter.dpString("TestcaseTitle");
       System.out.println(strTC);
       dpIter.dpNext();
      }
     } 
    }

  • Syntax error on tokens, delete these tokens

    2008-11-12 17:30:48

    假如运行脚本时出现下面的异常,依次检查脚本文件/右侧的Test Objects中是否有中文字符。

    scrīpt Playback Failure: Construct scrīpt class failed [scrīpt1] [java.lang.Error: Unresolved compilation problems:
     Syntax error on tokens, delete these tokens
     Return type for the method is missing
     Syntax error on tokens, delete these tokens
     Return type for the method is missing
     Syntax error on tokens, delete these tokens
     Return type for the method is missing
     Syntax error on tokens, delete these tokens
     Return type for the method is missing
     Syntax error on tokens, delete these tokens
     Return type for the method is missing
     Syntax error on tokens, delete these tokens
     Return type for the method is missing
     Syntax error on tokens, delete these tokens
     Return type for the method is missing
     Syntax error on tokens, delete these tokens
     Return type for the method is missing
    ]

Open Toolbar