Posts

Showing posts with the label TestComplete

TestComplete Tutorial 19 - Adding Objects to the Name Mapping Repository

Image
You can add objects to the Name Mapping repository in several ways: Automatically  when recording and editing tests. Manually  from the screen or from the Object Browser. From scripts . Mapping Objects Automatically By default, TestComplete adds objects to the  Name Mapping  repository  automatically  when you – Record tests, Create  checkpoints , Add or edit keyword test operations. This behavior is controlled by the  Engines > Name Mapping > Map object names automatically   option of TestComplete: If you do not use the Name Mapping repository in your project, you can disable this option to prevent TestComplete from mapping objects. To enable or disable automatic name mapping Select  Tools > Options  from the TestComplete main menu. This will open the  Options  dialog. Select the  Engines > Name Mapping  category. Select or clear the  Map object names automatically  check box. Click  O...

TestComplete Tutorial 16 - How TestComplete searches for mapped objects

Image
 When a test tries to get an object by its alias, TestComplete does the following: In the Mapped Objects tree, it finds an item that corresponds to the alias. Searches for the corresponding object in your system, starting from the top-level item in the Mapped Objects tree and moving down the hierarchy to the target item.It searches for each item on the appropriate level of the application hierarchy. If Extended Find is enabled, it will also search for the item on the following hierarchy levels as well. To find each item, it uses its specified identification criteria. Notes - The object hierarchy in the Aliases tree and in the Mapped Objects tree must not contradict the parent-child relationships of the corresponding objects in the application. Unlike aliases, mapped objects cannot be moved to the topmost hierarchy level. The topmost mapped objects can be Sys or Mobile. You can refer to objects in tests by their names both in the Aliases tree and in the Mapped Object tree. In the la...

TestComplete Tutorial 15 - Aliases and mapped objects

Image
 The Name Mapping repository includes two trees: Mapped Objects (hidden by default) - Shows all the objects (windows, dialogs, pages, and controls) found in your tested application. Typically, the Mapped Object tree matches the application’s object hierarchy. However, for web and mobile applications, it can omit some intermediate levels. The mapped name shows the object position in the Mapped Objects tree: You can use the mapped name to address objects from tests. However, it is more convenient to use aliases for this purpose. Aliases - Objects in the Name Mapping repository can have an alias – a user-friendly name, for example, ButtonOK or linkProducts. Aliases are used to refer to objects in tests. In script tests, you use full aliases, that is, the full hierarchy path of the object in the Aliases tree.  In keyword tests, you do not actually see the full hierarchy path, because TestComplete shows a short notation for easy viewing.  

TestComplete Tutorial 14 - Object identification criteria in Name Mapping

  The object identification criteria that the repository stores and that TestComplete uses to search for objects in the applications can be: Property-value pairs -  For example: ObjectType = Page, URL=http://example.com Conditional expressions -  For example: WndCaption = Open OR Select File Selectors  -  (for web and mobile applications) For web applications, it can be XPath expressions and CSS selectors, for example,  //input[@id='instasearch']  or  #instasearch . For mobile applications, it can be the object class name, accessibility identifier, or an XPath expression, for example,  XCUIElementTypeStatusBar  or  //*[@name="Orders"] . Extended search -  Search for an object on all the levels down the object hierarchy rather than just on the current level. Required child objects -  Search for an object that has specific child objects.

TestComplete Tutorial 12 - Constant and simulated Keys

Image
   

TestComplete Tutorial 11 - Different Ways to click on Button in Windows Desktop Applications

 There are several ways to click a button in an application:     1.  Click( ) or ClickButton( ) -                These methods are used for single click on button.             Examples -                                       myButton.Click();                                     myButton.ClickButton();         2. Keystrokes - You can click a button by simulating keystrokes that represent an access key.  An access key is an underlined symbol within the button caption.  It permits a click of a button by pressing the ALT key in combination with the assigned access key.              Example -...

TestComplete Tutorial 10 - Keystrokes

 Using different keystroke methods, you can simulate keyboard input in your tests. Different Methods are   -  SetText( )  - sets text in an edit control. Desktop.KeyDown( ) -  Simulate pressing the specified key by its virtual code.  This method is applied for Desktop objects. Desktop.KeyUp( ) -  Simulate releasing the specified key by its virtual code.  This method is applied for Desktop objects. OnscreenObject.Keys -  Send key presses to the desired object.  OnscreenObject Keys types in the specified onscreen object. Sys.Keys and Desktop.Keys  -  Send key presses to the desired object.  Desktop.Keys and Sys.Keys type in the currently focused object. Examples -  setText -                              var userName = "name mapping for  userName  button";           ...

TestComplete Tutorial 9 - Mouse Actions and Mouse Wheel Events

 TestComplete provides mouse actions and mouse wheel events . Mouse Actions To simulate clicks, double-clicks, dragging and hovering (hot-tracking) operations, each onscreen object provides the following methods: Click( ) -  Simulates a single click performed with the left mouse button. ClickR( ) -  Simulates a single click performed with the right mouse button. ClickM( ) -  Simulates a single click performed with the middle mouse button. DblClick( ) -  Simulates a double click performed with the middle mouse button. DblClickR( ) -  Simulates a double click performed with the middle mouse button. DblClickM( ) -  Simulates a double click performed with the middle mouse button. Drag( ) -  Simulates a dragging operation performed with the left mouse button. DragR( ) -  Simulates a dragging operation performed with the right mouse button. DragM( ) -  Simulates a dragging operation performed with the middle mouse button. HoverMouse( ) - ...

TestComplete Tutorial 8 - Recording Script with TestComplete

Image
 TestComplete gives options for recording the Script and running the recorded script. To start the recording in TestComplete do any of the following: If Project is already open -  Click    Record Keyword Test   or     Record Script   on the   Test Engine   toolbar. Select  Test > Record > Record Keyword Test   or   Test > Record > Record Script   from the TestComplete main menu. Click    Record   on the toolbar of the   Keyword Test editor . Click    Record Test   on the   Start Page. Press  SHIFT+F1 . If no project is open -  TestComplete will show the Record Test wizard that will guide you through creating and configuring a project for your test. Then TestComplete will start recording. TestComplete will show the Recording toolbar where you control the recording process. To pause recording, click    Pause  on the Recording toolbar or pr...