com.rational.test.ft.script

Class SubitemFactory

  • Direct Known Subclasses:
    RationalTestScript


    public class SubitemFactory
    extends DatapoolScriptSupport
    A collection of static methods that create subitems. These methods are part of every script and are separated out for ease of documentation.
    Since:
    RFT1.0
    • Constructor Detail

      • SubitemFactory

        public SubitemFactory()
    • Method Detail

      • atPoint

        public static java.awt.Point atPoint(int x,
                                             int y)
        Returns a Point subitem.
        Since:
        RFT1.0
      • atDPoint

        public static DPoint atDPoint(double x,
                                      double y)
        Returns a DPoint value.
        Since:
        RFT1.0
      • atIndex

        public static Index atIndex(int index)
        Returns an Index subitem.
        Since:
        RFT1.0
      • atRecognitionIndex

        public static RecognitionIndex atRecognitionIndex(int index)
        Returns an RecognitionIndex subitem.
        Since:
        RFT2.0
      • atText

        public static Text atText(java.lang.String text)
        Returns a Text subitem.
        Since:
        RFT1.0
      • atText

        public static Text atText(java.lang.String text,
                                  int index)
        Returns an indexed Text subitem.
        Since:
        RFT1.0
      • atDate

        public static Date atDate(int mm,
                                  int dd,
                                  int yyyy)
        Returns a Date subitem.
        Since:
        RFT1.0
      • atDate

        public static Date atDate(int mm,
                                  int yyyy)
        Returns a Date subitem.
        Since:
        RFT2.0
      • atWeekDay

        public static WeekDay atWeekDay(int mm,
                                        int dayofweek,
                                        int yyyy)
        Returns a Date subitem.
        Since:
        RFT2.0
      • atWeek

        public static Week atWeek(int week,
                                  int mm,
                                  int yyyy)
        Returns a Date subitem.
        Since:
        RFT2.0
      • atToolTipText

        public static ToolTipText atToolTipText(java.lang.String text)
        Returns a ToolTipText subitem.
        Since:
        RFT1.0
      • atToolTipText

        public static ToolTipText atToolTipText(java.lang.String text,
                                                int index)
        Returns an indexed ToolTipText subitem.
        Since:
        RFT1.0
      • atName

        public static Name atName(java.lang.String name)
        Returns a Name subitem.
        Since:
        RFT1.0
      • atName

        public static Name atName(java.lang.String name,
                                  int index)
        Returns an indexed Name subitem.
        Since:
        RFT1.0
      • atId

        public static Id atId(long id)
        Returns an Id subitem.
        Since:
        RFT1.0
      • atHref

        public static Href atHref(java.lang.String url)
        Returns an Href subitem.
        Since:
        RFT1.0
      • atArea

        public static Area atArea(Subitem area)
        Returns an Area subitem.
        Since:
        RFT1.0
      • atHeader

        public static Header atHeader(Subitem header)
        Returns an Header subitem.
        Since:
        RFT1.0
      • atColumnHeader

        public static ColumnHeader atColumnHeader(Subitem header)
        Returns an ColumnHeader subitem.
        Since:
        RFT1.1
      • atTopLeftHeader

        public static TopLeftHeader atTopLeftHeader(Subitem header)
        Returns an ColumnHeader subitem.
        Since:
        RFT1.1
      • atRowHeader

        public static RowHeader atRowHeader(Subitem header)
        Returns an Header subitem.
        Since:
        RFT1.1
      • atTextPosition

        public static TextPosition atTextPosition(int textPosition)
        Returns a TextPosition subitem.
        Since:
        RFT1.0
      • atValue

        public static Value atValue(java.lang.Object value)
        Returns a Value subitem.
        Since:
        RFT1.0
      • atLocation

        public static Location atLocation(java.lang.String location)
        Returns a Location subitem.
        Since:
        RFT1.0
      • atDPosition

        public static DPosition atDPosition(double position)
        Returns a Position subitem.
        Since:
        RFT1.0
      • atPosition

        public static Position atPosition(int position)
        Returns a Position subitem.
        Since:
        RFT1.0
      • atList

        public static List atList(Subitem s1)
        Returns a List of one subitem.
        Since:
        RFT1.0
      • atList

        public static List atList(Subitem s1,
                                  Subitem s2)
        Returns a List of two subitems.
        Since:
        RFT1.0
      • atList

        public static List atList(Subitem[] subitems)
        Returns a List consisting of an array of subitems.
        Since:
        RFT1.0
      • atPath

        public static List atPath(java.lang.String path)
        Returns a List that is a pathname.
        Since:
        RFT1.0
      • atSeparator

        public static Separator atSeparator(int separator)
        Returns a Separator subitem.
        Since:
        RFT1.0
      • atCell

        public static Cell atCell(Column c,
                                  Row r)
        Returns a Cell subitem.
        Since:
        RFT1.0
      • atCell

        public static Cell atCell(Row r,
                                  Column c)
        Returns a Cell subitem.
        Since:
        RFT1.0
      • atColumn

        public static Column atColumn(java.lang.String headerName)
        Returns a Column subitem.
        Since:
        RFT1.0
      • atColumn

        public static Column atColumn(Index i)
        Returns a Column subitem.
        Since:
        RFT1.0
      • atColumn

        public static Column atColumn(int i)
        Returns a Column subitem.
        Since:
        RFT1.0
      • atColumn

        public static Column atColumn(java.lang.String key,
                                      java.lang.Object val)
        Returns a Column subitem.
        Since:
        RFT1.0
      • atColumn

        public static Column atColumn(java.lang.String key1,
                                      java.lang.Object val1,
                                      java.lang.String key2,
                                      java.lang.Object val2)
        Returns a Column subitem.
        Since:
        RFT1.0
      • atColumn

        public static Column atColumn(java.lang.String key1,
                                      java.lang.Object val1,
                                      java.lang.String key2,
                                      java.lang.Object val2,
                                      java.lang.String key3,
                                      java.lang.Object val3)
        Returns a Column subitem.
        Since:
        RFT1.0
      • atColumn

        public static Column atColumn(Subitem specifier)
        Returns a Column subitem.
        Since:
        RFT1.0
      • atRow

        public static Row atRow(java.lang.String headerName)
        Returns a Row subitem.
        Since:
        RFT1.0
      • atRow

        public static Row atRow(Index i)
        Returns a Row subitem.
        Since:
        RFT1.0
      • atRow

        public static Row atRow(int i)
        Returns a Row subitem.
        Since:
        RFT1.0
      • atRow

        public static Row atRow(java.lang.String key,
                                java.lang.Object val)
        Returns a Row subitem.
        Since:
        RFT1.0
      • atRow

        public static Row atRow(java.lang.String key1,
                                java.lang.Object val1,
                                java.lang.String key2,
                                java.lang.Object val2)
        Returns a Row subitem.
        Since:
        RFT1.0
      • atRow

        public static Row atRow(java.lang.String key1,
                                java.lang.Object val1,
                                java.lang.String key2,
                                java.lang.Object val2,
                                java.lang.String key3,
                                java.lang.Object val3)
        Returns a Row subitem.
        Since:
        RFT1.0
      • atRow

        public static Row atRow(Subitem specifier)
        Returns a Row subitem.
        Since:
        RFT1.0
      • atRowColumnIndex

        public static RowColumnIndex atRowColumnIndex(int rowIndex,
                                                      int colIndex)
      • atFile

        public static java.lang.String atFile(java.lang.String directory,
                                              java.lang.String file)
        Combines a directory path and file path into a file name.
        Since:
        RFT1.0
      • atFile

        public static java.lang.String atFile(java.lang.String directory)
        Returns a file path into a file name.
        Since:
        RFT1.0
      • atModifiers

        public static MouseModifiers atModifiers(int modifiers)
        Returns a MouseModifiers subitem.
        Since:
        RFT1.0
      • toScreenPoint

        public static java.awt.Point toScreenPoint(int x,
                                                   int y)
        Returns a Point. It is used to specify the target of a dragToScreenPoint operation.
        Since:
        RFT1.1
      • atProperty

        public static Property atProperty(java.lang.String propertyName,
                                          java.lang.Object propertyValue)
        Returns a Property subitem.
        Parameters:
        propertyName - the canonical property name
        propertyValue - the property value
        Since:
        RFT2.0
      • atChild

        public static Anchor atChild(java.lang.String propName,
                                     java.lang.Object propValue)
        Returns an Anchor subitem.
        Parameters:
        propName - the property name
        propValue - the property value
        Since:
        RFT2.0
      • atDescendant

        public static Anchor atDescendant(java.lang.String propName,
                                          java.lang.Object propValue)
        Returns an Anchor subitem.
        Parameters:
        propName - the property name
        propValue - the property value
        Since:
        RFT2.0
      • atChild

        public static Anchor atChild(java.lang.String propName1,
                                     java.lang.Object propValue1,
                                     java.lang.String propName2,
                                     java.lang.Object propValue2)
        Returns an Anchor subitem.
        Parameters:
        propName1 - the property name
        propValue1 - the property value
        propName2 - the property name
        propValue2 - the property value
        Since:
        RFT2.0
      • atDescendant

        public static Anchor atDescendant(java.lang.String propName1,
                                          java.lang.Object propValue1,
                                          java.lang.String propName2,
                                          java.lang.Object propValue2)
        Returns an Anchor subitem.
        Parameters:
        propName1 - the property name
        propValue1 - the property value
        propName2 - the property name
        propValue2 - the property value
        Since:
        RFT2.0
      • atChild

        public static Anchor atChild(Property[] properties)
        Returns an Anchor subitem.
        Parameters:
        properties - the array of properties
        Since:
        RFT2.0
      • atDescendant

        public static Anchor atDescendant(Property[] properties)
        Returns an Anchor subitem.
        Parameters:
        properties - the array of properties
        Since:
        RFT2.0
      • atButton

        public static Button atButton(java.lang.String name)
        Returns an Button subitem.
        Parameters:
        name - the name of the button
        Since:
        RFT2.1
      • atButton

        public static Button atButton(Subitem item)
        Returns an Button subitem.
        Parameters:
        item - the subitem for the button
        Since:
        RFT2.1
      • atImage

        public static Image atImage(java.lang.String tag)
        Returns a Image subitem.
        Since:
        RFT8.0
      • atImage

        public static Image atImage(java.lang.String tag,
                                    int index)
        Returns a Image subitem.
        Since:
        RFT1.0
      • atLink

        public static Link atLink(java.lang.String text)
        Returns a Link subitem.
        Since:
        RFT8.0
      • atLink

        public static Link atLink(java.lang.String text,
                                  int index)
        Returns a Link subitem.
        Since:
        RFT1.0
      • mouseWheel

        public static LowLevelEvent mouseWheel(int numClicks)
        Returns a LowLevelEvent representing a mouse wheel movement.
        Parameters:
        numClicks - the number of mouse wheel clicks to move. A postive value indicates the wheel was moved forward (up) and a negative value indicates the wheel was moved backward (down).
        Since:
        RFT2.0
      • mouseMove

        public static LowLevelEvent mouseMove(java.awt.Point pt)
        Returns a LowLevelEvent representing a mouse movement.
        Parameters:
        pt - the point to move the mouse cursor to.
        Since:
        RFT2.0
      • leftMouseButtonDown

        public static LowLevelEvent leftMouseButtonDown()
        Returns a LowLevelEvent representing a mouse left button down event at the current cursor position.
        Since:
        RFT2.0
      • leftMouseButtonUp

        public static LowLevelEvent leftMouseButtonUp()
        Returns a LowLevelEvent representing a mouse left button up event at the current cursor position.
        Since:
        RFT2.0
      • middleMouseButtonDown

        public static LowLevelEvent middleMouseButtonDown()
        Returns a LowLevelEvent representing a mouse middle button down event at the current cursor position.
        Since:
        RFT2.0
      • middleMouseButtonUp

        public static LowLevelEvent middleMouseButtonUp()
        Returns a LowLevelEvent representing a mouse middle button up event at the current cursor position.
        Since:
        RFT2.0
      • rightMouseButtonDown

        public static LowLevelEvent rightMouseButtonDown()
        Returns a LowLevelEvent representing a mouse right button down event at the current cursor position.
        Since:
        RFT2.0
      • rightMouseButtonUp

        public static LowLevelEvent rightMouseButtonUp()
        Returns a LowLevelEvent representing a mouse right button up event at the current cursor position.
        Since:
        RFT2.0
      • delay

        public static LowLevelEvent delay(int millis)
        Returns a LowLevelEvent representing a low level delay event. During playback of low level events this inserts a delay at least millis long since the previous event was queued up. If the time for the prior event to be consumed is longer than millis no additional delay will be taken.
        Parameters:
        millis - the minimum delay in milliseconds to wait
        Since:
        RFT2.0
      • keyDown

        public static LowLevelKeyEvent keyDown(java.lang.String key)
        Returns a LowLevelEvent representing a low level key down event.
        Parameters:
        key - this can either be a literal character to playback (i.e. "a") or a tool given name representing non-printable characters. The list follows: {CAPSLOCK} {NUMLOCK} {SCROLLLOCK} {ESCAPE} {ESC} {ENTER} {HELP} {PRTSC} {TAB} {BREAK} {CLEAR} {BACKSPACE} {BS} {BKSP} {DELETE} {DEL} {INSERT} {LEFT} {RIGHT} {UP} {DOWN} {PGUP} {PGDN} {HOME} {END} {F1} {F2} {F3} {F4} {F5} {F6} {F7} {F8} {F9} {F10} {F11} {F12} {F13} {F14} {F15} {F16} {APPS} {Win} {LEFTWIN} {RIGHTWIN} {CTRL} {SHIFT} {ALT} {LEFTCTRL} {LEFTSHIFT} {LEFTALT} {RIGHTCTRL} {RIGHTSHIFT} {RIGHTALT} {ExtDelete} {ExtInsert} {ExtLeft} {ExtRight} {ExtUp} {ExtDown} {ExtPgUp} {ExtPgDn} {ExtHome} {ExtEnd} {NumDelete} {NumInsert} {NumLeft} {NumRight} {NumUp} {NumDown} {NumPgUp} {NumPgDn} {NumHome} {NumEnd} {Num} {Num-} {Num/} {Num+} {Num~} {NumEnter} {Num0} {Num1} {Num2} {Num3} {Num4} {Num5} {Num6} {Num7} {Num8} {Num9} {Num.}
        Since:
        RFT2.0
      • keyUp

        public static LowLevelKeyEvent keyUp(java.lang.String key)
        Returns a LowLevelEvent representing a low level key up event.
        Parameters:
        key - this can either be a literal character to playback (i.e. "a") or a tool given name representing non-printable characters.
        Since:
        RFT2.0
        See Also:
        keyDown(String)
      • _S

        public static java.lang.String _S(java.lang.String key)
        Look up a localized string table entry based on the provided key
        Parameters:
        key: - the key into the string table
        Returns:
        the string in the string table or key if it could not be found.
        See Also:
        StringTableService
      • atColor

        public static java.awt.Color atColor(int red,
                                             int blue,
                                             int green)
        Returns a java.awt.Color subitem for the given color.
        Parameters:
        red - int The green color
        blue - int The blue color
        green - int The green color
        Returns:
        java.awt.Color The color for the given color
        Since:
        RFT8.0.1
      • atXpath

        public static Xpath atXpath(java.lang.String propValue)
        Returns an Xpath subitem.
        Parameters:
        propValue - is the xpath expression string
        Since:
        RFT 8.3.0.2