Interview Questions on Descriptive programming


Interview Questions on Descriptive programming

1) What is Descriptive programming or Programmatic Descriptions?

Enter or Provide Objects Information (Properties and values) directly into
Statements.

2) What is the Test Execution Process in case of Descriptive Programming?

During execution QTP reads statements one by one from Test Pane, Objects Information
also available in statements, based on that info performs operations
directly on AUT.

3) What is the Syntax for writing Test Object Statements in Descriptive Programming?

a) Syntax for Single Test Object Statement

TestObject("propertyname:=value").Method or Operation

    Or

TestObject("property1name:=value","property2name:=value" ).Method or Operation

Ex:

Dialog("text:=Login", "width:=320").Activate

Browser("title:=Google").Close
---------------------
b) Syntax for two Test Object Statement

TestObject("propertyname:=value").ChildTestObject("propertyname:=value")Method or Operation


Ex:

Dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set "abcd"

Browser("title:=Google").Page("name:=Google")Close
--------------------------

4) What are the Types of Descriptive Programming?

Descriptive Programming can be written in two ways:
1. Static (by provide the set of properties and values directly).
2. Dynamic (by creating description object).

5) What is Static method in descriptive programming?

In Static method of descriptive programming, we provide the set of properties and values directly in a single line, in form of the string arguments.
Here is the format/syntax of DP:

object's Class Name("property name:=property value").Method

6) What is dynamic descriptive programming?

The second way to write descriptive programming is by using the Description object.
This way is also known as Programmatic Description. Description Object also do the same thing as static way do but there are some differences.
• Description Object stores the properties and values of a particular object in an instance of that object. So it become easy to use it in the statement.
• Description Object are used with ChildObjects (very useful method) of QTP.
• It's more useful if you are using multiple properties to identify object. As you will use only instance name in your statement, your code looks more organized.
• It's very handy if you are using index property for object identification.

0 comments:

Post a Comment