Posts

Showing posts with the label TestComplete tool

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 18 - Creating Snapshots in Object Browser

Image
 TestComplete allows you to store snapshots of your tested application. A snapshot contains complete information about properties, fields and/or methods of an object that you selected and, optionally, of all of its child objects. Creating Snapshots To create a snapshot from the Object Browser - Select the desired object in the object hierarchy displayed in the  Object Browser . Click the    Save Object Snapshot  button on the  Save/Load Snapshots  toolbar. If the toolbar is hidden, right-click somewhere within the TestComplete toolbar or menu area and select  Save/Load Snapshots  from the pop-up list. This will open the Save Object Snapshot dialog. In the dialog specify the snapshot file name and object information the snapshot will contain. Click  OK . To create a snapshot from tests -  Use the  aqObject.SaveObjectSnapshotToFile  method that saves the object snapshot to the specified file. The method takes param...

TestComplete Tutorial 17 - Object Browser

Image
 Object Browser shows - Running applications The hierarchy of objects in applications Object properties and methods To open the Object Browser, click its tab or select View > Object Browser from the main menu - If needed, you can move the Object Browser to another place within the TestComplete window, or make it a separate window using docking options. Clicking on any running application from Objects panel, we can see the corresponding properties and methods used for application. Selecting each property will give the Description in the bottom Description panel. Also name mapping will also show for selected process in the top 'Selected Object' panel. Exploring Object Hierarchy The Object Browser panel lets you explore the hierarchical structure of processes running in your system. Here is a general view of the hierarchy displayed in the Object Browser: The hierarchical structure represents a tree with the Sys and Mobile objects as the top-level nodes. Each main branch ...

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...

TestComplete Tutorial 7 - TestComplete Projects and Project Items

Image
 TestComplete operates with test projects and project suites . Project   A  project is a starting point for creating tests. Project contains your tests, baseline data for checkpoints, information about tested applications, and other items needed to perform testing.  The project also defines the execution sequence of tests. Project suites You can group related projects into a project suite.  TestComplete automatically generates a project suite when you create a new project.  You can also create an empty project suite and add projects to it. Project items Project items are project elements that perform or assist in performing various testing operations. Besides project items, your projects can also include helper files like Excel or .csv files with test data. 

TestComplete Tutorial 6 - Object Identification in TestComplete

Image
   Different ways to identify objects in TestComplete -  A.  By Search Criteria  -  1. Name Mapping:  With name mapping, TestComplete stores all the objects with which your tests interact in the Name Mapping repository.  T hese mappings are stored as object where we can specify search criteria like properties provided by TestComplete or xpath expressions or CSS selectors and TestComplete finds these objects in the application. User friendly name(Alias) can be given to address the objects from tests.          Examples:                                        Aliases.browser.page2.btnSave                               Aliases.Windows.navigationbar.btnSearch 2. Object Browser: TestComplete have the Object Browser pa...

TestComplete Tutorial 5 - Testing Approaches in TestComplete

  Unit Testing :   When we have to test only a particular part of the application, we will create the unit test. We can invoke implicit methods of the applications. White-Box Testing :  We will use this when we have to test the application as per the access. This testing has been carried out with the access not higher than the user Functional Testing :  When we have to test the form from the customer's point-of-view, like checking What the way does for every user action. Parallel Testing :  It is used for testing the multiple subcomponents of the applications in parallel. It reduces the testing time. Load Testing :  It is utilized to put the predetermined load on the application and check the response. Regression Testing :  It is utilized for reusing the test on the project when modifications are made to the code. We can compare the latest results with the old results.

TestComplete Tutorial 4 - Creating your first project in TestComplete

Image
   Launch the application and you will see the start page. Follow these steps to create a new project. 1.  Go to the File menu. 2.  Click on the New option from the menu. 3.  Click on the New Project option. 4.   Alternately, you can use the shortcut key (shift + ctrl + N) to create a new project. 5.  A window will appear, give a name to the project. 6.  Click on Finish. 7.  Thus, we have created our first project in TestComplete.

TestComplete Tutorial 3 - Download and Install TestComplete

Image
  Download   TestComplete  -    TestComplete can be downloaded from the official SmartBear web site from  here . Install   TestComplete  -   1. Double-click on the downloaded TestComplete setup exe. It will show you the Installation Wizard. 2. Click on Next. It will start Installation. 3. Once Installation is Done, it will give the License dialog for activation. 4. Based on the users choice, they can select the option.