Sunday, June 14, 2020

Test complete useful content

  • Programming language supported by test complete
    1. Jscript, vbscript, c#, c++,delphi,python
  • Recording mode in Test complete
    1. Simple recording – shift+F1
    2. Low level recording – shift +F4
    3. Stop recording – shift+F11
  • Capture object in test complete
    1. Object spy
    2. Recording
    3. Find method-
      • Find
      • Findchild
      • FindAllchildren
      • Findall
  • Checkpoints in Test complete
    1. File
    2. Web service
    3. Database table
    4. Property
    5. Object

  • Run, pause and stop the test run
    • Run – F5
    • Pause – Shift+F10
    • Resume – shift +F3
    • Stop – shift +F2 (in scripts - using the Runner.Stop or Runner.Halt method)
  • Debugging in Test complete
    • Using debugging we can evaluate variable values, define debug points and go through steps
    • Running test through debugging- we can run to the cursor, stepping through test and set next execution step too
    • Breakpoints- using breakpoint we can create and modify the properties of variables
    • Debug panel- call stack panel, local panel and watch list panel
  • Export Test result format for testcomplete (Log.SaveResultsAs is use to store the result from script and Use the /exportLog command-line argument:)
    • Junit report
    • Mht
    • Html
    • Pdf
    • Xml
    • tclogx

Environment variables
If you have a system variable and a user variable with the same name:
·         To get the user variable, use aqEnvironment.GetEnvironmentVariable.
·         To get the system variable, use WMI.GetEnvironmentVariable.

Regular Expression
  1. Native Regular expression (built into scripting language)
    1. Example in vbscript
Dim re, matches, match

  
Set re = New RegExp
  re.Pattern = "gr[ae]y"
  re.IgnoreCase = 
True
  re.Global = 
True ' Find all occurrences of the pattern

  
Set matches = re.Execute("Do you spell it gray or grey?")
  
For Each match In Matches
    Log.Message(match.Value)
  
Next
  1. Non native regular expression (own regular expressions) syntax: obj.Find("WndCaption", "regexp:pattern"); example: notepad.Find("WndCaption", "regexp:.* Notepad", 5);


NameMappingNameMapping is one of the important features of TestComplete through which we could provide a Custom Name for any selected object. The unique name is created by using some special values

If your computer resolution will be change, your same script will be run or it will get fail
There are two possibilities -Yes! Our script gets fail in case if we implement Record and Playback methodology. Yes! Our Script will be run successfully If we Implement Name mapping or Descriptive programming methodology

If any unexpected windows pop up during your script in TestComplete, how can you handle that- Use OnUnexpectedWindow Event to handle unexpected windows

distributed testing and how it can be achieved using TestComplete Distributed testing means that a test consists of several parts and each of them is performed on a separate computer. TestComplete uses Network suite plugin to achieve distributed testing.

Launch desktop application- dbgservice plugin should install
  1. Using dbgservice.launchapplication(pathof application)
  2. Using dbservice.launchtestedapplication(pathof application)
  3. Using Testedapplication.launch=true, testedapplication.run()

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

String functions

  • aqString.Compare(String1String2CaseSensitive) – compare two string casesensitive(true,false) and return 0 if match else 1 or -1.
  • aqString.Concat(String1String2) – concate two string
  • aqString.Find(InputStringSubStringStartPositionCaseSensitive)- to find the first occurrence of a substring in the input string
  • aqString.GetChar(InputStringPosition) to get the character located at the specified position within a string (ex. Aqstring.getchar(“abc”,2) return b)
  • aqString.SubString(InputStringStartPositionLength) to obtain a text fragment starting from the specified position and having the specified length. Ex. aqString.SubString(“123456789”, 3, 5) returns 45678
  • aqString.Replace(InputStringStringToReplaceSubStringCaseSensitive)
  • aqString.ToLower(InputString)
  • aqString.ToUpper(InputString)
  • aqString.Trim(InputStringSpace)
  • aqString.GetLength(InputString) -returns the total number of characters in the input string


No comments:

Post a Comment