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


NLP- Natural language Processing basics

NLP- natural language processing
NLP is a sub field of AI that is focused on enabling computers to understand and process human language.

text processing techniques
1.basic text processing
2. advance text processing

Basic text preprocessing of text data
1. lower casing
2. punctuation removal
3. strop words removal
4. frequent words removal
5. rare words removal
6. tokenization
7. stemming
8. lemmatization

Advance text processing
1. N- grams
2. term frequency
3. inverse document frequency
4. term frequency- inverse document frequency -TF-IDF
5. bag of words
6. word embedding

NLP tools and libraries
  • spacy
  • polyglot
  • core nlp
  • rasa nlu
  • python
  • textblob
  • sckit learn
  • gensim

API Testing

API:

API stands for Application Programming Interface. API acts as an interface between two software applications and allows the two software applications to communicate with each other. API is a collection of software functions which can be executed by another software program

API Testing
API testing is a type of software testing that involves testing APIs directly and also as a part of integration testing to check whether the API meets expectations in terms of functionality, reliability, performance, and security of an application. In API Testing our main focus will be on Business logic layer of the software architecture. API testing can be performed on any software system which contains multiple APIs

common API Testing Types
  • Unit testing
  • Functional testing
  • Load testing
  • Runtime/ Error Detection
  • Security testing
  • UI testing
  • Interoperability and WS Compliance testing
  • Penetration testing
  • Fuzz testing

common protocols used in API Testing
  • HTTP
  • REST
  • SOAP
  • JMS
  • UDDI
Difference between API and Web services?
  • Web services:
1. All web services are APIs
2. All web services need to be exposed over web(HTTP)
3. A Web service uses only three styles of use: SOAP, REST and XML-RPC for communication
4. A Web service always needs a network to operate
  • APIs:
1. All APIs are not web services
2. All APIs need not be exposed over web(i.e. HTTP)
3. API uses multiple ways for communication e.g. DLL files in C/C++, Jar files/ RMI in java, Interrupts in Linux kernel API etc.
4. APIs don’t need a network for operation
Soap- SOAP stands for Simple Object Access Protocol. It is an XML based messaging protocol. It helps in exchanging information among computers
Rest API REST stands for Representational State Transfer. It is a set of functions helping developers in performing requests and receive responses. Interaction is made through HTTP Protocol in REST API.

Challenges faced in API testing
  • Selecting proper parameters and its combinations
  • Categorizing the parameters properly
  • Proper call sequencing is required as this may lead to inadequate coverage in testing
  • Verifying and validating the output
  • Due to absence of GUI it is quite difficult to provide input values

commonly used HTTP methods
GET: It enables you to retrieve data from a server
POST: It enables you to add data to an existing file or resource in a server
PUT: It lets you replace an existing file or resource in a server
DELETE: It lets you delete data from a server
PATCH: It is used to apply partial modifications to a resource
OPTIONS: It is used to describe the communication options for the target resource
HEAD: It asks for a response identical to that of a GET request, but without the response body

difference between PUT and POST methods
PUT and POST methods are sometimes confused in regards to when each should be used. Using POST request, our intent is to create a new object on the server whereas with PUT request, our intent is to replace an object by another object

Components of an HTTP request
HTTP request have five components. These are:
1.       Action showing HTTP method like GET, PUT, POST, DELETE.
2.       Uniform Resource Identifier (URI): URI is the identifier for the resource on the server.
3.       HTTP version: Indicate the HTTP version like- HTTP V1.1.
4.       Request Header: Request Header carries metadata for the HTTP request message. Metadata could be a client type, format supported by the client, format of a message body, cache setting etc.
5.       Request Body: Resource body indicates message content or resource representation.

Error codes for request
  • 200 ok
  • 201 created
  • 204 no content
  • 400 bad request
  • 403 forbidden
  • 404 not found
  • 405 method not allowed
  • 409 conflict
  • 500 internal server error

API Testing Tools
·         Postman
·         Tosca
·         SOAP UI
·         UFT
·         Selenium