Пример #1
0
  public void setCell(int rowIndex, String colName, Location input) {

    checkRowArgument(rowIndex);
    int colIndex = getColumnIndexByName(colName);
    Cell cell = new Cell(new Row(new Index(rowIndex)), new Column(new Index(colIndex)));
    _Table.click(new List(cell, input));
  }
Пример #2
0
 /**
  * @param guiObj, TestObject may be JMenuBar or JPopupMenu
  * @param path, String is the full path of some MenuItem on which a click action will take place
  */
 protected void selectMenuItemWithoutVerification(GuiSubitemTestObject guiObj, String path) {
   com.rational.test.ft.script.List list = Script.localAtPath(path);
   // guiObj.setState(Action.select(), list); // RobotJ doesn't like this...
   try {
     guiObj.click(list);
     // set status to ok
     testRecordData.setStatusCode(StatusCodes.OK);
     String altText =
         "MenuItem \"" + path + "\" clicked, " + windowName + ":" + compName + " " + action;
     log.logMessage(
         testRecordData.getFac(),
         passedText.convert(PRE_TXT_SUCCESS_4, altText, path, windowName, compName, action),
         PASSED_MESSAGE);
   } catch (TargetGoneException tge) {
     Log.info(
         "CFMenuBar IGNORING TargetGoneException probably resulting from intended window closure...");
     // set status to ok
     testRecordData.setStatusCode(StatusCodes.OK);
     String altText =
         "MenuItem \"" + path + "\" clicked, " + windowName + ":" + compName + " " + action;
     log.logMessage(
         testRecordData.getFac(),
         passedText.convert(PRE_TXT_SUCCESS_4, altText, path, windowName, compName, action),
         PASSED_MESSAGE);
   } catch (NullPointerException npe) {
     testRecordData.setStatusCode(StatusCodes.GENERAL_SCRIPT_FAILURE);
     log.logMessage(testRecordData.getFac(), "item not found: " + path, FAILED_MESSAGE);
   }
 }
Пример #3
0
  public void clickCell(String rowValue, int col) {
    int rowIndex = getRowIndexByName(rowValue, col);
    System.out.println(rowIndex);
    checkColArgument(col);
    Cell cell = new Cell(new Row(new Index(rowIndex)), new Column(new Index(col)));

    java.awt.Point p = new Point();
    p.x = 16;
    p.y = 3;
    _Table.click(cell, p);
  }
Пример #4
0
 public void setCell(int rowIndex, int colIndex, String input, boolean doubleClick) {
   if (doubleClick) {
     doubleClickCell(rowIndex, colIndex);
   } else {
     clickCell(rowIndex, colIndex);
   }
   IWindow w = RationalTestScript.getScreen().getActiveWindow();
   w.inputKeys("{ExtHome}+{ExtEnd}{ExtDelete}");
   w.inputChars(input);
   _Table.click();
 }
Пример #5
0
 /**
  * @param guiObj, TestObject may be JMenuBar or JPopupMenu
  * @param path, String is the full path of some MenuItem on which a click action will take place
  * @param fuzzy, boolean, If true, we will do a non-exact verification of existance of path
  */
 protected void selectMenuItemWithVerification(
     GuiSubitemTestObject guiObj, String path, boolean fuzzy) {
   MenuTree atree = null;
   try {
     atree = (MenuTree) extractMenuItems(guiObj, 0);
     log.logMessage(testRecordData.getFac(), "atree: " + atree, DEBUG_MESSAGE);
     // Do the work of matching..., verify the path
     // If fuzzy is true, do the partial match; otherwise do the exact match
     String match = atree.matchPath(path, fuzzy, null);
     if (match != null) {
       log.logMessage(testRecordData.getFac(), "match: " + match, DEBUG_MESSAGE);
       com.rational.test.ft.script.List slist = Script.localAtPath(match);
       try {
         guiObj.click(slist);
         // set status to ok
         testRecordData.setStatusCode(StatusCodes.OK);
         String altText =
             "MenuItem \"" + match + "\" clicked, " + windowName + ":" + compName + " " + action;
         log.logMessage(
             testRecordData.getFac(),
             passedText.convert(PRE_TXT_SUCCESS_4, altText, match, windowName, compName, action),
             PASSED_MESSAGE);
       } catch (TargetGoneException tge) {
         Log.info(
             "CFMenuBar IGNORING TargetGoneException probably resulting from intended window closure...");
         // set status to ok
         testRecordData.setStatusCode(StatusCodes.OK);
         String altText =
             "MenuItem \"" + match + "\" clicked, " + windowName + ":" + compName + " " + action;
         log.logMessage(
             testRecordData.getFac(),
             passedText.convert(PRE_TXT_SUCCESS_4, altText, match, windowName, compName, action),
             PASSED_MESSAGE);
       } catch (NullPointerException npe) {
         testRecordData.setStatusCode(StatusCodes.GENERAL_SCRIPT_FAILURE);
         log.logMessage(testRecordData.getFac(), "item not found: " + path, FAILED_MESSAGE);
       }
     } else {
       testRecordData.setStatusCode(StatusCodes.GENERAL_SCRIPT_FAILURE);
       log.logMessage(
           testRecordData.getFac(),
           getClass().getName() + ": no match on: " + path,
           FAILED_MESSAGE);
     }
   } catch (SAFSException se) {
     testRecordData.setStatusCode(StatusCodes.GENERAL_SCRIPT_FAILURE);
     log.logMessage(
         testRecordData.getFac(), getClass().getName() + ": " + se.getMessage(), FAILED_MESSAGE);
   }
 }
Пример #6
0
 /**
  * Click at the specified text
  *
  * @param text
  */
 public void click(String text) {
   _Table.click(new Text(text));
 }
Пример #7
0
 // [2007/6/15 Lucy Bi]
 // added clickColumnHeader
 public void clickColumnHeader(String HeaderName) {
   _Table.click(SubitemFactory.atHeader(SubitemFactory.atText(HeaderName)));
 }
Пример #8
0
 // [2007/6/4 Rain Chen]
 // added clickCell which execute the click cell action
 public void clickCell(int row, String colName) {
   int col = getColumnIndexByName(colName);
   Cell cell = new Cell(new Row(new Index(row)), new Column(new Index(col)));
   _Table.click(cell);
 }
Пример #9
0
 // [2007/6/4 Rain Chen]
 // added clickCell which execute the click cell action
 public void clickCell(int row, int col) {
   Cell cell = new Cell(new Row(new Index(row)), new Column(new Index(col)));
   _Table.click(cell);
 }