The Test Scripting Language - Testing Tools

When you are recording the application, the test script is automatically generatecThe test script used in SilkTest is called 4Test.

There are basically four classes to which these methods belong

  1. AgentClass
  2. AynWin
  3. ClipboardClass
  4. CursorClass

Few important methods that you will come across in test scripts are listed belov

  1. Accept (): closes the dialog box and accepts the values specified there.
    Syntax: dialogbox.AcceptQ
  2. ClearText (): removes all text from the text field.
    Syntax: textfield.ClearText()
  3. Click (): Clicks a mouse button on the push button.
    Syntax: pushbutton.Click ([iButton, iXpos, iYpos, bRawEvent])
    iButton: The number of the button to click. (Optional)
    iXpos: The horizontal coordinate to click. (Optional)
    iYpos: The vertical coordinate to click. (Optional)
    bRawEvent: Specifies playback mechanism. (Optional)
  4. Close (): Closes the window.
    Syntax: window.Close ([bCloseConfirm, bSetActive])
    bCloseConfirm: TRUE to close confirmation boxes (Optional)
    bSetActive:  TRUE to set window active before closing.(Optional)
  5. Close Windows (): closes all windows of the application except the main window.
    Syntax: mainwindow. CloseWindows ([bTrace])
    bTrace: TRUE to log of all windows closed. (Optional)
  6. Exit (): terminates the application.
    Syntax: mainwin.Exit ()
  7. GetActive (): returns the active window in the application.
  8. Syntax: wActive = mainwin.GetActive ()wActive:The active window.
  9. GetCloseWindows (): returns the windows that must close to return the application to base state.
    Syntax: IwWindow = mainwin.GetCloseWindows ()
    IwWindows:  The list of windows to close.
  10. GetFocus(): returns the control with the input focus
    Syntax: wFocus = GetFocus ()
    wFocus: The returned control
  11. Invoke (): invokes the application.
    Syntax: mainwin. Invoke ()
  12. SetActive(): makes the windows active.
    Syntax: window.setActive ()
  13. Wait (): waits for the specified cursor and returns the value of elapsed time.
  14. Syntax: nSeconds = Cursor. Wait (Cursor, n Timeout [, nNoChange])
    nSeconds         The seconds waited for the cursor.
    Cursor              The type of cursor to wait for. CURSOR
    nTimeout         The time to wait for cursor to change
    nNoChange      How long the cursor must remain (Optional)
  15. VerifyActive (): verifies that the window is active.
    Syntax: window. VerifyActive ()
  16. Start (): invokes the application and waits for the main window to appear.
    Syntax: mainwin.Start (sCmdLine)
  17. SCmdLine :The command for running the application
  18. Size (): resizes the window.
    Syntax: window. Size (iWidth, iHeight)
    iWidth: The new width of the window
    iHeight : The new height of the window

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Testing Tools Topics