Wednesday, April 15, 2020

Integration of testcomplete with Jenkin

Integrating Test complete with jenkin can be in following way

•By using the TestComplete support plugin. – most convenient way
•By using the special SessionCreator command-line utility that is shipped along with TestComplete.
•By running TestComplete from the command line.

Pre requisite
Test complete must be available on jenkin node
Test complete license should be accessible from jenkin node

Run TestComplete tests in Jenkins
  1. Install the TestComplete support plugin. In jenkin- manage jenkin>manage plugin>switch available tab>testcompletesupport plug in and install without restart
  2. Prepare jenkin node
    1. Enable remote desktop connection, configure group policies, and do a few more preparatory actions
    2. Configure slave computers as Jenkins nodes and launch the slave agent. For complete information
  3. Add your TestComplete tests to Jenkins builds -You can add your TestCompletetests in Jenkins by using Freestyle Jobs or Pipelines

Test results
After the build is finished, you can view the results of your TestComplete tests in Jenkins on the build page. To do this open the build page in your browser and click TestComplete Test Results in the menu on the left

Export results
With TestComplete, you can export test results in various formats: tcLogX or .mht and JUnit report

Reference by support of smart bear and credit goes to them.

Dictionary Object in UFT or Testcomplete

A Dictionary object contains a set of key-item pairs
The dictionary object has the following benefits when compared with arrays:
·         The size of the Dictionary object can be set dynamically.
·         Dictionaries surpass arrays in locating items by their content.
·         Dictionaries work better than arrays when accessing random elements frequently.
·         The Dictionary object has built-in methods and properties that allow users to manage the dictionary’s contents and keys.
·         When deleting an item from a Dictionary, the remaining items are automatically shifted up.
The only disadvantage of dictionaries when compared to arrays, is that they cannot be multidimensional.
Methods:
  1. Add
  2. Exists
  3. Items
  4. Keys
  5. Remove
  6. Removeall

Properties
  1. Count
  2. Item
  3. Key
  4. Comparemode

Scrum Overview

Scrum framework
Roles
  1. Product owner
  2. Scrum master
  3. Scrum development team

Sprint planning
Work to be performed in the sprint
Created through collaborated teamwork of scrum team
Answer the questions- what can be delivered and how can be delivered

Backlog refinement
Product owner and team review items in backlog to ensure
  1. Backlog contains appropriate items
  2. The items are prioritized
  3. Items at top of the backlog are ready for delivery

Scrum Artifacts
Product backlog
  1. Ordered list of everything that might be needed in the project
  2. Single source of requirements for any changes that need to made to the product
  3. At any point, the total work remaning to reach the goal can be summed in the product backlog
Sprint Backlog
  1. A set of product backlog selected for that sprint
  2. Contains a plan for delivering the product increment and realizing the sprint goal
  3. Makes all the work the team sees as necessary to meet the sprint goal visible
Increment
  1. The sum of all the backlogs that have been completed in the sprint
  2. The values of all previous sprints

Limitation of scrums
  1. No detailed estimated of time and cost
  2. Uncertainty over cost and completion date of final product
  3. Meetings can consume resources

Scrum values
  1. Commitment
  2. Focus
  3. Openness
  4. Respect 
  5. Courage

Scrumban
  1. Combines scrum and Kanban
  2. Generally used in maintenance projects
  3. Uses the prescriptive nature of scrum
  4. Uses the process improvement of Kanban

Scrum workflow steps
  1. Product backlog
  2. Sprint planning
  3. Sprint backlog
  4. Daily scrum
  5. Sprint review

Error Handling in Test complete

Error Handling in Test complete
  • Errors can be occurs due to script code or application under the test, which needs to handle.
  • Testcomplete doesn’t provide any specific methods at own, but support statements supported by the scripting language.
  • Jscript, javascript,c++, C# - try catch and finally block
  • VB Script- Err object and On Err statement
    • Err.ClearErr.NumberErr.Description
    • On Error Resume next – if error occurs, test complete continue running the script rather than stop it
    • On error go to 0 – to cancel the effect of on error go to next use this
    • On error go to linenum
  • Record-time and design-time actions can notify a user about errors using the aqDlg.ShowError or aqDlg.MessageDlg methods
  • Use the Log.Error or Log.Warning method to post an error or warning message to the test log

Possible error like object not found, name mapping found or something like that.
The object didn’t exist at the time TestComplete tried to obtain it.
The object’s identification properties changed.
Click Accept Intelligent Fix to update recognition attributes
Click Intelligent Fix to view and update recognition attributes
Click View and change to view recognition attributes
The object’s position in the object tree was changed.
One of the parent objects causes the ambiguous recognition problem.
The tested process was not found.
The alias refers to a mapped object that is not in the NameMapping project item.
The tested application stopped responding.
The object tree model differs from the model that was used to create the test.
Below are typical causes of the problem and typical ways to eliminate them.
Cross-platform web tests: There is no object that matches the specified search expression
Handling the 'Unable to Find the Object' error in TestComplete: Name of the object over which the operation simulates user actions
Handling the 'Unable to Find the Object' error in TestComplete: Selecting available locators on a keyword test
Handling the 'Unable to Find the Object' error in TestComplete: Viewing the object name in the Object Spy
Handling the 'Unable to Find the Object' error in TestComplete: Viewing available locators in the Object Spy
Handling the 'Unable to Find the Object' error in TestComplete: Viewing the object name in the Object Browser
Handling the 'Unable to Find the Object' error in TestComplete: Viewing available locators in the Object Browser
The object name is misprinted.
The object name has changed.
The object’s position in the object tree was changed.
The object has not been created by the time TestComplete tries to obtain it.
The tested application stopped responding.
The object tree model differs from the model that was used to create the test.
Below are typical causes of the problem and typical ways to eliminate them.
The window class name, caption or index is misprinted.
The window caption (text), class name or index has changed.
The object’s position in the object tree was changed.
The object has not been created by the time TestComplete tries to obtain it.
The tested application stopped responding.
The object tree model differs from the model that was used to create the test.


Log operations
Log.messageLog.Message(MessageTextAdditionalInformationPriorityAttrPictureFolderID)
Log.error(Log.Error(MessageTextAdditionalInformationPriorityAttrPictureFolderID)
Log.picture
Log.EventLog.Event(MessageTextAdditionalInformationPriorityAttrPictureFolderID)
Log.warning(Log.Warning(MessageTextAdditionalInformationPriorityAttrPictureFolderID)