Quick Test Professional Training Part 1

Slides:



Advertisements
Similar presentations
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Advertisements

AE6382 VBA - Excel l VBA is Visual Basic for Applications l The goal is to demonstrate how VBA can be used to leverage the power of Excel u VBA syntax.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Data Types and Operations Programming Fundamentals (Writing Code)Programming Fundamentals (Writing Code)
JavaScript, Third Edition
VB .NET Programming Fundamentals
Programming Concepts MIT - AITI. Variables l A variable is a name associated with a piece of data l Variables allow you to store and manipulate data in.
1 Chapter Two Using Data. 2 Objectives Learn about variable types and how to declare variables Learn how to display variable values Learn about the integral.
CIS Computer Programming Logic
Mr C Johnston ICT Teacher BTEC IT Unit 06 - Lesson 05 Learning To Program.
Java Primitives The Smallest Building Blocks of the Language (corresponds with Chapter 2)
1 VBA – podstawowe reguły języka Opracowanie Janusz Górczyński wg Microsoft Help.
2440: 211 Interactive Web Programming Expressions & Operators.
Dani Vainstein1 VBScript Session 1. Dani Vainstein2 Subjets for Session 1 Vbscript fundamentals. Variant subtypes. Variables. Option Explicit statement.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
VBScript Language. What is VBScript Based on the Visual Basic family of languages Supports object oriented features Interpreted Loosely Typed Implicitly.
EIW - ASP Introduction1 Active Server Pages VBScript.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Saeed Ghanbartehrani Summer 2015 Lecture Notes #5: Programming Structures IE 212: Computational Methods for Industrial Engineering.
Items in Visual Basic programs
VARIABLES, CONSTANTS, OPERATORS ANS EXPRESSION
Variables & Function Calls. Overview u Variables  Programmer Defined & Intrinsic  Data Types  Calculation issues u Using Functions  The val() function.
CNS 1120 Exam 1 Review. Programming Language Elements Syntax = the rules to follow Syntax = the rules to follow Semantics = the meaning of symbols Semantics.
INT213-Week-2 Working with Variables. What is variable
1 Scripting Languages VBScript - Recognized mainly by Internet Explorer only - Netscape does have a plug-in JavaScript - Recognized by Internet Explorer.
Dani Vainstein1 VBScript Session 3. Dani Vainstein2 What We learn Last seasson? How to declare arrays. Working with one dimensional a multi- dimensional.
Introduction to Programming Lecture Note - 2 Visual Basic Programming Fundamentals.
Visual Basic Programming I 56:150 Information System Design.
CIVIL AND GEOMATIC ENGINEERING FT Okyere. CIV 257- COMPUTER PROGRAMMING Lecture 3.
Variables Hold information that may be manipulated, used to manipulate other information or remembered for later use A storage location in memory (RAM)
CECS 5020 Computers in Education Visual Basic Variables and Constants.
CN2180 Chapter 4 Kemtis Kunanuraksapong MSIS with Distinction, A+ MCTS, MCDST, MCP Kemtis Kunanuraksapong MSIS with Distinction, A+ MCTS, MCDST, MCP.
Creation of Variables with Numeric, alphanumeric, date, picture, memo data types Constant - A quantity that does not change during the execution of a program.
Inside Class Methods Chapter 4. 4 What are variables? Variables store values within methods and may change value as the method processes data.
Dani Vainstein1 VBScript Session 5. Dani Vainstein2 What we learn last session? Branching Branching using If … Then … Else statement. Branching using.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are used in programs so that values can be represented with.
By “FlyingBono” 2009_02By FlyingBono.  ASP code is embedded in HTML using tags.  A ASP scripting block always starts with.  Server scripts are executed.
7 - Programming 7J, K, L, M, N, O – Handling Data.
VISUAL BASIC 6.0 Designed by Mrinal Kanti Nath.
A variable is a name for a value stored in memory.
VBScript Session 1 Dani Vainstein.
VB Script V B S.
VBScript Session 3.
VBA - Excel VBA is Visual Basic for Applications
VBA - Excel VBA is Visual Basic for Applications
VBScript Session 1 IT Professional Academy.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
An Application Uses Variables to Hold Information So It May Be Manipulated, Used to Manipulate Other Information, or Remembered for Later Use.
Visual Basic Variables
Visual Basic 6 (VB6) Data Types, And Operators
The Selection Structure
Variables, Expressions, and IO
Development of Internet Application 1501CT - Sara Almudauh
2. Understanding VB Variables
Java Programming: From Problem Analysis to Program Design, 4e
Chapter 6 Variables What is VBScript?
Data Types, Identifiers, and Expressions
VBScript Session 6 Dani Vainstein.
PHP.
Coding Concepts (Basics)
Fundamentals of visual basic
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
VBScript Session 1.
PHP an introduction.
Visual Basic Numbers Chapter 3.3 Prepared By: Deborah 7/9/2019.
Web Programming and Design
Introduction to Computer Programming IT-104
COMPUTING.
Presentation transcript:

Quick Test Professional Training Part 1 Neha Thakur Dec 02, 2010

Agenda Test Automation What & Why? QTP: An overview Intro to VBScript Language Data Types Algorithm Variables/Constants Operators Arrays Conditional Statements Loop Structures Best Scripting Practices

Test Automation Test Automation is the use of software to control the following: Test Creation Setting up Test preconditions Test Execution Comparison of actual v/s expected results Test Reporting functions In short, test automation is to automate the existing manual testing process as effectively and efficiently as possible

Test Automation Benefits

Test Automation Challenges Maintainability: Automated test requires maintenance Skill-set: Creation of automation test suite requires skill sets such as knowledge programming language, testing tool etc Cost Benefits: The cost of automating the tests are sometimes more than manual Look & Feel verification: Difficult

QTP Overview Functional Testing Tool An HP Product (Initially by Mercury Interactive) Support wide ranges of environment: Web, VB, JAVA, Oracle, SAP, ActiveX and many more Provide Expert and Keyword views Default Scripting language: VBScript

VBScript Option Explicit Algorithm A pseudo code to solve a problem, which contains Initial Point Logic Steps (Instructions) End Point Problem: Add 2 numbers

VBScript Algorithm: AddNumbers Step#1: Input first number Step#2: Input second number Step#3: Add two numbers Step#4: Output the sum

VBScript Data Types VBScript supports only one data type called ‘Variant’. The variant data type is a special kind of data type that can contain different kinds of information . It is the default data type returned by all functions in VBScript. What are the values of c & d below?

VBScript Variables A variable is a placeholder that refers to a memory location that stores program information that may change at run time. A variable is referred to by its name for accessing the value stored or to modify its value. Public Statement Private Statement Dim Statement Note:  Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure.  Public statement variables are available to all procedures in all scripts.  Private statement variables are available only to the script in which they are declared. 

Working with constants A constant is a variable within a program that never changes in value. Users can create their own constants by initializing variables accordingly and then not changing their value. VBScript defines the special True and False constants, as well.

Working with constants Here are the various categories of constants provided in VBScript and a brief description of each: Color Constants - Defines eight basic colors that can be used in scripting. Date and Time Constants - Defines date and time constants used by various date and time functions. Date Format Constants - Defines constants used to format dates and times. Miscellaneous Constants - Defines constants that don't conveniently fit into any other category. MsgBox Constants - Defines constants used in the MsgBox function to describe button visibility, labeling, behavior, and return values. String Constants - Defines a variety of non-printable characters used in string manipulation. Tristate Constants - Defines constants used with functions that format numbers. VarType Constants - Defines the various Variant subtypes.

VBScript Constants A constant is a meaningful name that takes the place of a number or a string, and never changes. VBScript in itself has a number of defined intrinsic constants like vbOK, vbCancel, vbTrue, vbFalse and so on. Example: Const MY_STRING = "This is my string."Const MY_AGE = 49 Note: Standards can be defined to declare constants using only uppercase letters whereas all other variable are declared using first letter as smaller case.

VBScript Naming Convention There are standard rules for naming variables in VBScript. A variable name: Must begin with an alphabetic character. Cannot contain an embedded period. Must not exceed 255 characters. Must be unique in the scope in which it is declared.

VBScript Operators Arithmetic Operators Comparison Operators Description Symbol Addition + Subtraction - Multiplication * Division / Integer Division \ Exponentiation ^ Modulus arithmetic Mod Unary negation String concatenation & Description Symbol Equality = Inequality <> Less than < Greater than > Less than or equal to <= Greater than or equal to >= Object equivalence Is Logical Operators Description Symbol Logical negation Not Logical conjunction And Logical disjunction Or Logical exclusion Xor Logical equivalence Eqv Logical implication Imp

VBScript Conditional Constructs Conditional Constructs execute statements or repeat certain set of statements based on conditions.  The following conditional constructs are available in VBScript : If – Then –Else Select Case 

Using Control Structures to Make Code Repeat Looping allows you to run a group of statements repeatedly. Some loops repeat statements until a condition is False; others repeat statements until a condition is True. The following looping statements are available in VBScript: Do...Loop: Loops while or until a condition is True. While...Wend: Loops while a condition is True. For...Next: Uses a counter to run statements a specified number of times. For Each...Next: Repeats a group of statements for each item in a collection or each element of an array.

Using Control Structures to Make Code Repeat Do code to execute Loop Until condition Loop While condition Do Until condition code to execute Loop Do While condition While condition [statements] Wend

Variable Naming Conventions Subtype Prefix Example Boolean b bExist DateTime d dNow String s sName Object o oFile Integer, Byte, Long n (numeric) nCounter Single, Double f fPrice Error err errResponse Array arr arrLabels Currency c cDollar

Overriding Standard Variable Naming Conventions You can override standard variable naming conventions by placing your variable name in brackets. This allows you to use reserved words or illegal characters in variable names. In a common usage, is not recommended to use this syntax. However, is possible.

Working with Arrays Array variables and scalar variables are declared in the same way, except that the declaration of an array variable uses parentheses ( ) following the variable name. Arrays are useful when you're storing sets of similar data because they often make it easier to manipulate the data together. Fixed Length Arrays Dynamic Arrays The benefit of a dynamic array is that if you don't know how large the array will be when you write the code, you can create code that sets or changes the size while the VBScript code is running. A dynamic array is created in the same way as a fixed array, but you don't put any bounds in the declaration. Eventually, you need to tell VBScript how many elements the array will contain. You can do this with the ReDim function. ReDim tells VBScript to "re-dimension“ the array to however many elements you specify. ReDim takes dimensions the same way Dim can.