Windows Operations allows you to perform special tasks in the Tosca. It contains the following modues.
TBox Take Screenshot
TBox Clipboard
TBox Dialog
TBox Send Keys
TBox Window Operation
TBox Save as
TBox Take Screenshot
The Module TBox Take Screenshot has the following ModuleAttributes:
Environment -- Select from the drop-down menu whether you want to take a screenshot of your desktop or mobile device . If you leave the value empty, Tricentis Tosca takes a screenshot of the desktop.
Directory -- Path to the screenshot. If you don't specify a path, Tricentis Tosca uses the storage path defined in the setting Screenshot directory.
Filename -- Name of the screenshot.This name doesn't include the file extension. You can define the file format in the setting Screenshot image format.
Example ::
Take a screenshot of your desktop, Save it to the directory D:\Screenshots and Give this screenshot the name as Screen1.
Note - Module name is TBox Take Screenshot
TBox Clipboard
TBox Clipboard allows you to copy a text to the Microsoft Windows clipboard. You can also use it to verify text that's in your clipboard or to save that text to a buffer.
It has the following ModuleAttribute:
Value -- Value that you want to copy to the clipboard, verify, or buffer. Depending on the desired action, use ActionMode Input, Verify, or Buffer, respectively.
Example -
The first TestStep copies the value Sample text to the clipboard.
The second TestStep verifies whether the value in your clipboard is Sample text.
TBox Send Keys
The TBox Send Keys module sends the keyboard commands to any opened window or screen or web page.
The TBox Send Keys has the following ModuleAttributes:
Caption -- This is optional attribute, The captin of the window or page or screen to be steered is entered here.
You can add either a leading or trailing wildcard, i.e. a wildcard at the start or at the end of a string.
Key - This module attribute specifies the value to be used for steering.
NOTE -- Always put keyboard commands in curly brackets between inverted commas.
Below are the command codes corresponding to the keys shown in the below table.
Key | Code |
---|---|
BACKSPACE | {BACKSPACE}, {BS}, or {BKSP} |
BREAK | {BREAK} |
CAPS LOCK | {CAPSLOCK} |
DEL or DELETE | {DELETE} or {DEL} |
DOWN ARROW | {DOWN} |
END | {END} |
ENTER | {ENTER} or ~ |
ESC | {ESC} |
HELP | {HELP} |
HOME | {HOME} |
INS or INSERT | {INSERT} or {INS} |
LEFT ARROW | {LEFT} |
NUM LOCK | {NUMLOCK} |
PAGE DOWN | {PGDN} |
PAGE UP | {PGUP} |
PRINT SCREEN | {PRTSC} (reserved for future use) |
RIGHT ARROW | {RIGHT} |
SCROLL LOCK | {SCROLLLOCK} |
TAB | {TAB} |
UP ARROW | {UP} |
F1 | {F1} |
F2 | {F2} |
F3 | {F3} |
F4 | {F4} |
F5 | {F5} |
F6 | {F6} |
F7 | {F7} |
F8 | {F8} |
F9 | {F9} |
F10 | {F10} |
F11 | {F11} |
F12 | {F12} |
F13 | {F13} |
F14 | {F14} |
F15 | {F15} |
F16 | {F16} |
Keypad add | {ADD} |
Keypad subtract | {SUBTRACT} |
Keypad multiply | {MULTIPLY} |
Keypad divide | {DIVIDE} |
Example -
Send a value and several keyboard commands to the file Example_Send_Key.txt.
The double quotation marks that enclose specific commands escape the special characters within the command.
^(a) - Sends the command Select all to the window.
"{DEL}" - Sends the command Delete to the window.
^(s) - Sends the command Save to the window.
%"{F4}" - Sends the command Close window to the window.
TBox Window Operation
The TBox Window Operation Module can be used to send specific commands to a window relating to intended operation.
The TBox Window Operatin has the following ModuleAttributes:
Caption - The captin of the window or page or screen to be steered is entered here.
Operation - Specify the command to be used for steering the control.
Operation->Height - This is mandatory if you have selected the operation Resize. (Required height of the window in pixel).
Operation->Width - This is mandatory if you have selected the operation Resize (Required width of the window in pixel.).
Window Index - This is optional, but useful if the Caption that you have specified applies to more than one window. For instance if you use a wildcard. (Specify the window that Tricentis Tosca should apply the specified Operation to.)
Tricentis Tosca supports the following operations:
Bring To Front - Brings the window to the front.
Close - This option closes the selected window.
Maximize - This option maximizes the selected window.
Minimize - This option minimizes the selected window.
Move to Center - Moves the window to the center of the screen.
Normal - Restores the window to its original size.
Resize - Re-sizes the window to the height and width that you have specified in the ModuleAttributes Height and Width, respectively.
Verify Window Exists - This option invokes the system to verify if a specific window is open.
Wait On Close - This option makes the system wait for a specific period until a window is closed.
Wait On Open - This option makes the system wait for a specific period until a window is Opened.
Example : More than one window open. The caption of all open windows starts with Test file. You want to close the second window.
TBox Save As
The Module TBox Save As steers the dialog window Save As. To steer it, the Save As dialog has to be open.
It has the following ModuleAttributes:
Caption - This is mandatory. Caption of the Save As dialog that you want to steer. Tosca identifies the dialog from the caption in the upper section of the screen (WindowText). You can enter any string.
FileNameLabel - Label of the input field where you enter the path in the Save As dialog. You only need to specify the label if the input field is NOT File name. If the label is File name, Tosca Commander steers it automatically.You can enter any string.
FilePath - This is mandatory. Path where Tosca Commander saves the file.
Button - This is optional. Specify which button Tosca Commander should click. Tosca Commander steers Save or Cancel automatically. You only need to specify the button if the button is NOT Save or Cancel.
ConfirmationPopupCaption - This is optional.Caption of the modal dialog window. This allows you to steer modal dialog windows, for instance a confirmation dialog or an overwrite dialog if the file already exists. You can only confirm the modal dialog. Enter any string to specify the caption of the modal dialog.
ConfirmationPopupButton - Specifies the confirmation button in the dialog specified in the Attribute ConfirmationPopup. You can enter any string.Tosca Commander steers Ja, Yes, or OK automatically. You only need to specify the button if the button is NOT Ja, Yes, or OK.
Example : -
Identifies the Save as dialog
Saves the file test.txt to the path C:\Temp
If the file already exists, Tosca Commander confirms the overwrite in the Confirm Save As dialog.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.