Friday, February 25, 2011

How to find current time, Hour, Minute, second in QTP

H=Hour(now)
msgbox H

H=Hour(Time)
msgbox H

M=Minute(now)
msgbox M

S=Second(now)
msgbox S

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to find current time in QTP

systime= Time
msgbox systime

How to find current time and date in QTP

mynow=now
msgbox mynow

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to convert date formate in QTP

Mydate=date
msgbox "Current Formate"&Mydate

myday =day(date)
'msgbox myday

mymonth = month(date)
'msgbox mymonth

myyear = Year(Date)
'msgbox myyear

msgbox "New Formate "&myday&"/"&mymonth&"/"&myyear

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to print a table in QTP

Set obj=createobject("Scripting.filesystemobject")
Set of=obj.createtextfile("c:\Shahadat.txt")
For i=1 to 10
x=2*i
of.writeline"2 * "&i&" = "&x
Next

How to Reverse String in QTP

'Plese reverse the string.....Shahadat Khan

str="Shahadat Khan"
Dim l
l=Len(str)
For i=l to 1 step -1
strresult=mid (str,i,1) 'Returns a specified number of characters from a string.Ex.
'Dim MyVar
'MyVar = Mid("VB Script is fun!", 4, 6) ' MyVar contains "Script".
finalresult=finalresult&strresult

Next

msgbox finalresult

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Tuesday, February 22, 2011

Immediate requiremen​t for QA Engineer proffs

Dear,

Greetings from Adecco.....

We have a opening with our prestigious client in Hyderabad for QA Engineer Proffs :::

Client : PORTWARE

Location : Hyderabad

Required Skills ::

- Minimum 3 - 5 years working in QA .
- - Writing Java Programs to simplify testing would be an added advantage.

If you are interested for Hyderabad Location and who can join within 30 - 45 Days, Please revert back with your updated profile at hepzybha.g@adecco.co.in

with These details:

Total Exp (Yrs) :
Exp in Testing Enterprise Systems (Yrs) :
Exp in Manual Testing (Yrs) :
Exp in Manual and Automated test Development (Y/N) :
Exp in writing Java Programs (Yrs) :
Current Employer :
Highest Qualification :
Current CTC :
Expected CTC :
Notice Period :
Current Location :
Willing to Relocate to Hyderabad (Y/) :
Reason looking out for job change :

How to do Batch run in qtp?

Click on TOOL->Options->Run, select Other HP Product to run
Tests and components

after that click on Start menu->Quick Test Professional-
>Tool->Test Batch Runner; Test batch runner will be open,
click Batch on menu bar and select the Tests which you want
to run in couples.
Please let me know if any question/suggestion
Thanks,
Shahadat Khan

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Urgent opening with NIIT TECHNOLOGIES

There is an urgent and hot opening with NIIT TECHNOLOGIES (www.niit-tech.com).
Below are the details :-
Experience: 3.5 to 6 yrs
Position based at Noida / Gurgaon.
Interview Location – Noida. (Thursday 17 December)
Required Skills:

QTP 9.2 experience is a must, VB Script, Framework
Good Knowledge of STLC
Good understanding of Test Methodologies
Working Knowledge of QTP frameworks and scripting experience is a must.
Candidate must have good understanding of QA processes
Should have worked in the test architecture design

So if are interested, please send your updated CV at sanjay@brainsoftconsultants.com with the following information:

Current CTC
Expected CTC
Notice period

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Sapient hiring Automation Test Professionals

Sapient is looking for Senior Associate QA test professionals with rich experience in Quick Test Professional (QTP). Experience in Automation Framework Designing, Test Estimation, Test Strategy formation, Test Reporting.
Candidates should have a between 4 to 6 years of experience in testing IT applications.
Desirable: Exposure to at least one automation project in the last one year.
Job Location: Gurgaon
If you are interested, please send your updated CV at mdhar3@sapient.com with the following information
Current CTC:
Expected CTC:
Notice Period:
Reason for change:
Other required skills are

Testing Strategy & Management Test Strategy
Define test strategies for low to medium …

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

TCS is looking for QTP professionals

TCS is looking for QTP professionals.
Below are the details:
Skill: QTP Testing
Experience: 4 to 6 Yrs
Joining Location: Bangalore
Mode: Contract to Hire
If you are interested, please send your updated CV at jayadevi.hr@gmail.com with the following information:
CURRENT CTC:
EXPECTED CTC:
NOTICE PERIOD:
TECHNICAL REFERENCES:

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

QTP tester

Need QTP tester CMML5 Co.In Mumbai,
Experience required 3-5 Years.

Please call Ulka

ulka@harjaicomputers.com

QTP Interview Questions and Answers

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/
33. Checking Bitmaps:
A.) You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. QuickTest captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk space.

When you run the test or component, QuickTest compares the object or selected area of the object currently displayed on the Web page or application with the bitmap stored when the test or component was recorded. If there are differences, QuickTest captures a bitmap of the actual object and displays it with the expected bitmap in the details portion of the Test Results window. By comparing the two bitmaps (expected and actual), you can identify the nature of the discrepancy.

For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.

You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins is loaded).

Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.

34. Text/Text Area Checkpoint: In the Text/Text Area Checkpoint Properties dialog box, you can specify the text to be checked as well as which text is displayed before and after the checked text. These configuration options are particularly helpful when the text string you want to check appears several times or when it could change in a predictable way during run sessions.

Note: In Windows-based environments, if there is more than one line of text selected, the Checkpoint Summary pane displays [complex value] instead of the selected text string. You can then click Configure to view and manipulate the actual selected text for the checkpoint.

QTP automatically displays the Checked Text in red and the text before and after the Checked Text in blue. For text area checkpoints, only the text string captured from the defined area is displayed (Text Before and Text After are not displayed).

To designate parts of the captured string as Checked Text and other parts as Text Before and Text After, click the Configure button. The Configure Text Selection dialog box opens.

35. Checking XML: XML (Extensible Markup Language) is a meta-markup language for text documents that is endorsed as a standard by the W3C. XML makes the complex data structures portable between different computer environments/operating systems and programming languages, facilitating the sharing of data.

XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading Style Sheets (CSS) or XSL Formatting Objects (XSL-FO) to present the data.

You can verify the data content of XML files by inserting XML checkpoints. A few common uses of XML checkpoints are described below:

- An XML file can be a static data file that is accessed in order to retrieve commonly used data for which a quick response time is needed—for example, country names, zip codes, or area codes. Although this data can change over time, it is normally quite static. You can use an XML file checkpoint to validate that the data has not changed from one application release to another.

- An XML file can consist of elements with attributes and values (character data). There is a parent and child relationship between the elements, and elements can have attributes associated with them. If any part of this structure (including data) changes, your application's ability to process the XML file may be affected. Using an XML checkpoint, you can check the content of an element to make sure that its tags, attributes, and values have not changed.

- XML files are often an intermediary that retrieves dynamically changing data from one system. The data is then accessed by another system using Document Type Definitions (DTD), enabling the accessing system to read and display the information in the file. You can use an XML checkpoint and parameterize the captured data values in order to check an XML document or file whose data changes in a predictable way.

- XML documents and files often need a well-defined structure in order to be portable across platforms and development systems. One way to accomplish this is by developing an XML schema, which describes the structure of the XML elements and data types. You can use schema validation to check that each item of content in an XML file adheres to the schema description of the element in which the content is to be placed.

36. Object Repositories types, which & when to use?
A.) To choose the default object repository mode and the appropriate object repository mode for each test, you need to understand the differences between the two modes. In general, the object repository per-action mode is easiest to use when you are creating simple record and run tests, especially under the following conditions:

- You have only one, or very few, tests that correspond to a given application, interface, or set of objects.

- You do not expect to frequently modify test object properties.

- You generally create single-action tests.

Conversely, the shared object repository mode is generally the preferred mode when:

- You have several tests that test elements of the same application, interface, or set of objects.

- You expect the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties.

- You often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options.

37. Can we Script any test case with out having Object repository? or Using Object Repository is a must?
Ans: No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available.

38. How to execute a WinRunner Script in QTP?
Ans :

(a) TSLTest.RunTest TestPath, TestSet [, Parameters ] --> Used in QTP 6.0 used for backward compatibility

Parameters: The test set within Quality Center , in which test runs are stored. Note that this argument is relevant only when working with a test in a Quality Center project. When the test is not saved in Quality Center , this parameter is ignored.
e.g : TSLTest.RunTest "D:\test1", ""

(b) TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ]
TSLTest.RunTestEx "C:\WinRunner\Tests\basic_flight", TRUE, FALSE, "MyValue"
CloseApp : Indicates whether to close the WinRunner application when the WinRunner test run ends.
Parameters : Up to 15 WinRunner function argument

39. How to handle Run-time errors?
Ans: On Error Resume Next : causes execution to continue with the statement immediately following the statement that caused the run-time error, or with the statement immediately following the most recent call out of the procedure containing the On Error Resume Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure. Using "Err" object msgbox "Error no: " & " " & Err.Number & " " & Err.description & " " & Err.Source & Err.HelpContext

40. How to change the run-time value of a property for an object?
Ans : SetTOProperty changes the property values used to identify an object during the test run. Only properties that are included in the test object description can be set.

41. How to retrieve the property of an object?
Ans : using "GetRoProperty".

42. How to open any application during Scripting?
Ans : SystemUtil, object used to open and close applications and processes during a run session. A SystemUtil.Run statement is automatically added to your test when you run an application from the Start menu or the Run dialog box while recording a test
E.g : SystemUtil.Run "Notepad.exe"
SystemUtil.CloseDescendentProcesses (Closes all the processes opened by QTP)

43. Types of properties that Quick Test learns while recording?

Ans : (a) Mandatory (b) Assistive .

In addition to recording the mandatory and assistive properties specified in the Object Identification dialog box, QuickTest can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so.

44. What is the extension of script and object repository files?
Ans : Object Repository : .tsr , Script : .mts, Excel : Default.xls

45. How to supress warnings from the "Test results page"?
Ans : From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".

46. When we try to use test run option "Run from Step", the browser is not launching automatically why?

Ans : This is default behaviour.

47. How to "Turn Off" QTP results after running a Script?
Ans : Goto "Tools > Options > Run Tab" and Deselect "View results when run session ends". But this supresses only the result window, but a og will be created and can viewed manulaly which cannot be restricted from getting created.

48. How to verify the Cursor focus of a certain field?
Ans : Use "focus" property of "GetRoProperty" method"

49. How to make arguments optional in a function?
Ans : this is not possible as default VBS doesn't support this. Instead you can pass a blank scring and have a default value if arguments r not required.

50. How to covert a String to an integer?
Ans : CInt()---> a conversion function available.

51. Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?
Ans : Inserting a call to action will only Import the columns of the Action called

QTP Interview Questions and Answers

22. How does u create new test sets in TD?

Ans :

- Login to TD.
- Click on "Test Lab" tab.
- Select the Desired folder under which we need to Create the Test Set. (Test Sets can be grouped as per module.)
- Click on "New Test Set or Ctrl+N" Icon to create a Test Set.

23. How do u do batch testing in WR & is it possible to do in QTP, if so explain?
Ans : You can use Test Batch Runner to run several tests in succession. The results for each test are stored in their default location.

Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file, so that you can easily run the same batch of tests again, at another time. You can also choose to include or exclude a test in your batch list from running during a batch run.

24. How to Import data from a ".xls" file to Data table during Runtime.

Ans :

- Datatable.Import "...XLS file name..."
- DataTable.ImportSheet(FileName, SheetSource, SheetDest)
- DataTable.ImportSheet "C:\name.xls" ,1 ,"name"

25. How to export data present in Datatable to an ".xls" file?
Ans : DataTable.Export "....xls file name..."

26. Syntax for how to call one script from another and Syntax to call one "Action" in another?
Ans: RunAction ActionName, [IterationMode , IterationRange , Parameters]

Here the actions become reusable on making this call to any Action.
IterationRange String Not always required. Indicates the rows for which action iterations will be performed. Valid only when the IterationMode is rngIterations. Enter the row range (i.e. "1-7"), or enter rngAll to run iterations on all rows.
If the action called by the RunAction statement includes an ExitAction statement, the RunAction statement can return the value of the ExitAction's RetVal argument.

27. How to export QTP results to an ".xls" file?
Ans : By default it creates an "XML" file and displays the results.

28. Differences between QTP & Winrunner?
Ans :

- QTP is object bases Scripting ( VBS) where Winrunner is TSL (C based) Scripting.
- QTP supports ".NET" application Automation not available in Winrunner.
- QTP has "Active Screen" support which captures the application, not available in WR.
- QTP has "Data Table" to store script values , variables which WR does not have.
Using a "point and click" capability you can easily interface with objects, their definitions and create checkpoints after having recorded a script without having to navigate back to that location in your application like you have to with WinRunner. This greatly speeds up script development.

29. How to add a runtime parameter to a datasheet?
Ans: By using LocalSheet property. The following example uses the LocalSheet property to return the local sheet of the run-time Data Table in order to add a parameter (column) to it:

MyParam=DataTable.LocalSheet.AddParameter("Time", "5:45")

30. What scripting language is QTP of?
Ans : VB Script.

31. Analyzing the Checkpoint results
Standard Checkpoint: By adding standard checkpoints to your tests or components, you can compare the expected values of object properties to the object's current values during a run session. If the results do not match, the checkpoint fails.

32. Table and DB Checkpoints: By adding table checkpoints to your tests or components, you can check that a specified value is displayed in a cell in a table on your application. By adding database checkpoints to your tests or components, you can check the contents of databases accessed by your application.

The results displayed for table and database checkpoints are similar. When you run your test or component, QuickTest compares the expected results of the checkpoint to the actual results of the run session. If the results do not match, the checkpoint fails.

You can check that a specified value is displayed in a cell in a table by adding a table checkpoint to your test or component. For ActiveX tables, you can also check the properties of the table object. To add a table checkpoint, you use the Checkpoint Properties dialog box.

Table checkpoints are supported for Web and ActiveX applications, as well as for a variety of external add-in environments.

You can use database checkpoints in your test or component to check databases accessed by your Web site or application and to detect defects. You define a query on your database, and then you create a database checkpoint that checks the results of the query.

Database checkpoints are supported for all environments supported by QuickTest, by default, as well as for a variety of external add-in environments.

There are two ways to define a database query:

- Use Microsoft Query. You can install Microsoft Query from the custom installation of Microsoft Office.
- Manually define an SQL statement.

The Checkpoint timeout option is available only when creating a table checkpoint. It is not available when creating a database checkpoint.

QTP Interview Questions and Answers

11) In how many ways we can add check points to an application using QTP. A) We can add checkpoints while recording the application or we can add after recording is completed using Active screen

(Note : To perform the second one The Active screen must be enabled while recording).

12) How does QTP identifies the object in the application?
A) QTP identifies the object in the application by Logical Name and Class.

13) If an application name is changes frequently i.e while recording it has name "Window1" and then while running its "Windows2" in this case how does QTP handles?

A) QTP handles those situations using "Regular Expressions".

14) What is Parameterizing Tests?
A) When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data.

15) What is test object model in QTP?
A) The test object model is a large set of object types or classes that QuickTest uses to represent the objects in your application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that QuickTest can record for it.

A test object is an object that QuickTest creates in the test or component to represent the actual object in your application. QuickTest stores information about the object that will help it identify and check the object during the run session.
A run-time object is the actual object in your Web site or application on which methods are performed during the run session.

When you perform an operation on your application while recording, QuickTest identifies the test object class that represents the object on which you performed the operation and creates the appropriate test object reads the current value of the object's properties in your application and stores the list of properties and values with the test object chooses a unique name for the object, generally using the value of one of its prominent properties records the operation that you performed on the object using the appropriate QuickTest test object method. For example, suppose you click on a Find button with the following HTML source code:



QuickTest identifies the object that you clicked as a WebButton test object. It creates a WebButton object with the name Find, and records the properties and values for the Find WebButton. It also records that you performed a Click method on the WebButton. QuickTest displays your step like this:

Browser("Mercury Interactive").Page("Mercury Interactive").
WebButton("Find").Click

16) What is Object Spy in QTP?
A) Using the Object Spy, you can view the properties of any object in an open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected object's hierarchy tree and its properties and values in the Properties tab of the Object Spy dialog box.

17) What is the Diff between Image check-point and Bit map Check point?
A) Image checkpoints enable you to check the properties of a Web image. You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. QuickTest captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk Space. For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map.

Using the bitmap checkpoint, you can check that the map zooms in correctly. You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins is loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.

18) How many ways we can parameterize data in QTP?

A) There are four types of parameters:

- Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test.

- Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, QuickTest uses a different value from the Data Table.

- Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that QuickTest generates for you based on conditions and options you choose.

- Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have QuickTest generate a random number and insert it in a number of tickets edit field.

19. How do u do batch testing in WR & is it possible to do in QTP, if so explain?
Ans: Batch Testing in WR is nothing but running the whole test set by selecting "Run Testset" from the "Execution Grid". The same is possible with QTP also. If our test cases are automated then by selecting "Run Testset" all the test scripts can be executed. In this process the Scripts get executed one by one by keeping all the remaining scripts in "Waiting" mode.

20. What does it mean when a check point is in red color? what do u do?
Ans : A red color indicates failure. Here we analyze the cause for failure whether it is a Script Issue or Environment Issue or a Application issue.

21. What do you call the window test director - testlab?
Ans : "Execution Grid". It is place from where we Run all Manual / Automated Scripts.

QTP Interview Questions and Answers

1. How Does Run time data (Parameterization) is handled in QTP?
A). You can then enter test data into the Data Table, an integrated Spreadsheet with the full functionality of Excel, to manipulate data Sets and create multiple test iterations, without programming, to Expand test case coverage. Data can be typed in or imported from Databases, spreadsheets, or text files.

2) What is keyword view and Expert view in QTP?
A) Quick Test’s Keyword Driven approach, test automation experts Have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View.
Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that Quick Test Professional automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.

3) Explain about the Test Fusion Report of QTP?
A) Once a tester has run a test, a TestFusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining TestFusion reports with QuickTest Professional, you can share reports across an entire QA and development team.

4) To which environments does a QTP support?
A) QuickTest Professional supports functional testing of all enterprise environments, including Windows, Web, NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.

5) What is QTP?
A) QuickTest is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, QuickTest Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and .NET framework applications.

6) Explain QTP testing process?
A) The QuickTest testing process consists of 6 main phases:

1. Create your test plan: Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application.

2. Recording a session on your application: As you navigate through your application, QuickTest graphically displays each step you perform in the form of a collapsible icon-based test tree . A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.

3. Enhancing your test: Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly.

NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process.

Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data. Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.

4. Debugging your test: If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.

5. Running your test on a new version of your application: You run a test to check the behavior of your application. While running, QuickTest connects to your application and performs each step in your test.

6. Analyzing the test results: You examine the test results to pinpoint defects in your application.

7. Reporting defects: As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.

7) Explain the QTP Tool interface.

A) It contains the following key elements:

- Title bar, displaying the name of the currently open test

- Menu bar, displaying menus of QuickTest commands

- File toolbar, containing buttons to assist you in managing tests

- Test toolbar, containing buttons used while creating and maintaining tests

- Debug toolbar, containing buttons used while debugging tests.

Note: The Debug toolbar is not displayed when you open QuickTest for the first time. You can display the Debug toolbar by choosing View > Toolbars > Debug.

- Action toolbar, containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow.

Note: The Action toolbar is not displayed when you open QuickTest for the first time. You can display the Action toolbar by choosing View > Toolbars > Action. If you insert a reusable or external action in a test, the Action toolbar is displayed automatically.

- Test pane, containing two tabs to view your test-the Tree View and the Expert View Test Details pane, containing the Active Screen.

- Data Table, containing two tabs, Global and Action, to assist you in parameterizing your test Debug Viewer pane, containing three tabs to assist you in debugging your test-Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened only when a test run pauses at a breakpoint.)

- Status bar, displaying the status of the test.

8) How QTP recognizes Objects in AUT?
A) QuickTest stores the definitions for application objects in a file called the Object Repository. As you record your test, QuickTest will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by QuickTest), and will contain a set of properties (type, name, etc) that uniquely identify each object.

Each line in the QuickTest script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.

9) What are the types of Object Repository’s in QTP?
A) QuickTest has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test.

The object repository per-action mode is the default setting. In this mode, QuickTest automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object's property values in one action, you may need to make the same change in every action (and any test) containing the object.

10) Explain the check points in QTP?

A). A checkpoint verifies that expected information is displayed in a Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.

- A page checkpoint checks the characteristics of a Application.
- A text checkpoint checks that a text string is displayed in the appropriate place on a Application.
- An object checkpoint (Standard) checks the values of an object on a Application.
- An image checkpoint checks the values of an image on a Application.
- A table checkpoint checks information within a table on a Application.
- An Accessibility checkpoint checks the web page for Section 508 compliance.
- An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application.
- Adatabase checkpoint checks the contents of databases accessed by your web site.

QTP Interview Questions and Answers for Freshers

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Full form of QTP ?

Quick Test Professional

What’s the QTP ?

QTP is HP Functional Testing Tool.

Which scripting language used by QTP ?

QTP uses VB scripting.

What’s the basic concept of QTP ?

QTP is based on two concept-
* Recording
* Playback

How many types of recording facility are available in QTP ?

QTP provides three types of recording methods-
* Context Recording (Normal)
* Analog Recording
* Low Level Recording

How many types of Parameters are available in QTP ?

QTP provides three types of Parameter-
* Method Argument
* Data Driven
* Dynamic

What’s the QTP testing process ?

QTP testing process consist of seven steps-
* Preparing to recoding
* Recording
* Enhancing your script
* Debugging
* Run
* Analyze
* Report Defects

What’s the Active Screen ?

It provides the snapshots of your application as it appeared when you performed a certain steps during recording session.

What’s the Test Pane ?

Test Pane contains Tree View and Expert View tabs.

What’s Data Table ?

It assists to you about parameterizing the test.

What’s the Test Tree ?

It provides graphical representation of your operations which you have performed with your application.

Which all environment QTP supports ?

ERP/ CRM
Java/ J2EE
VB, .NET
Multimedia, XML
Web Objects, ActiveX controls
SAP, Oracle, Siebel, PeopleSoft
Web Services, Terminal Emulator
IE, NN, AOL

How can you view the Test Tree ?

The Test Tree is displayed through Tree View tab.

What’s the Expert View ?

Expert View display the Test Script.

Which keyword used for Nornam Recording ?

F3

Which keyword used for run the test script ?

F5

Which keyword used for stop the recording ?

F4

Which keyword used for Analog Recording ?

Ctrl+Shift+F4

Which keyword used for Low Level Recording ?

Ctrl+Shift+F3

Which keyword used for switch between Tree View and Expert View ?

Ctrl+Tab

What’s the Transaction ?

You can measure how long it takes to run a section of your test by defining transactions.

Where you can view the results of the checkpoint ?

You can view the results of the checkpoints in the Test Result Window.

What’s the Standard Checkpoint ?

Standard Checkpoints checks the property value of an object in your application or web page.

Which environment are supported by Standard Checkpoint ?

Standard Checkpoint are supported for all add-in environments.

What’s the Image Checkpoint ?

Image Checkpoint check the value of an image in your application or web page.

Which environments are supported by Image Checkpoint ?

Image Checkpoint are supported only Web environment.

What’s the Bitmap Checkpoint ?

Bitmap Checkpoint checks the bitmap images in your web page or application.

Which environment are supported by Bitmap Checkpoints ?

Bitmap checkpoints are supported all add-in environment.

What’s the Table Checkpoints ?

Table Checkpoint checks the information with in a table.

Which environments are supported by Table Checkpoint ?

Table Checkpoints are supported only ActiveX environment.

What’s the Text Checkpoint ?

Text Checkpoint checks that a test string is displayed in the appropriate place in your application or on web page.

Which environment are supported by Test Checkpoint ?

Text Checkpoint are supported all add-in environments

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Sunday, February 13, 2011

How to convert Word documents to the PDF or Excel or HTML

ConvertDOCtoHTMLPDF("C:\Test1.docx","Pdf")
ConvertDOCtoHTMLPDF("C:\Test1.docx","html")

Function ConvertDOCtoHTMLPDF(SrcFile, Format)
Dim fso, oFile, FilePath, myFile
Set fso = CreateObject( "Scripting.FileSystemObject" )
Set oFile = fso.GetFile(SrcFile)
FilePath = oFile.Path

Dim oWord
Set oWord = CreateObject( "Word.Application" )
oWord.Documents.Open FilePath
If ucase(Format) = "PDF" Then
myFile = fso.BuildPath (ofile.ParentFolder ,fso.GetBaseName(ofile) & ".pdf")
oWord.Activedocument.Saveas myfile, 17
elseIf ucase(Format) = "HTML" Then
myFile = fso.BuildPath (ofile.ParentFolder ,fso.GetBaseName(ofile) & ".html")
oWord.Activedocument.Saveas myfile, 8
End If
oWord.Quit
Set oWord = Nothing
Set fso = Nothing
Set oFile = Nothing
End Function

Saturday, February 12, 2011

How to run QTP from Command prompt?

Set qtApp= CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True

'And then call your scripts one after another
qtApp.Open "Enter Complete path for script here"
qtApp.Test.Run
'and once you are done then close the QTP with the following :

qtApp.Quit

Free QTP Certification Dumps

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

1) Identify the recording mode, by which you can record the non-standard object in
QTP
A) Standard recording
B) Analog recording
C) Low level recording
D) None

2) By default, how many no of tables would be there in a script?

a) One
b) Two
c) Three
d) Four

3) By default, how many no of actions would be there in a script?

a) One
b) Two
c) Three
d) Four

4) The file extension of Local object repository file is

a) .MTR
b) .TSR
c) .QRS
d) None

5) The file extension of Shared object repository file is

a. .MTR
b. .TSR
c. .QRS
d. None

6) When a procedure is created in the Function Library editor, what is the extension of the file?

A. .INI
B. .TXT
C. .QFL
D. .VBS

7) What are the categories in the Step Generator?

E. Object, Operation, Value
F. Library, Built-in, Local Script
G. Operation, Arguments, Return Value
H. Test Objects, Utility Objects, Functions

8) In Test Settings -> Run the Data Table iteration options are for which data sheet?

I. Local
J. Global
K. Run-time Data Table
L. Design-time Data Table

9) What can you use to handle unpredictable testing exceptions?

M. A Do Loop
N. Recovery Scenario
O. IF Then statement
P. Select Case statement

10) In which command can you associate a function library to a test?

Q. Run Options
R. Test Settings
S. View Options
T. Function Definition Generator

11) To invoke the function which does not return any value, we can use

a. call function name
b. function name
c. Both A & B
d. None

12) The result of the checkpoints can be stored in a variable

a. True
b. False


13) Parameterization generally involves

a. Data table
b. Random number
c. Environment
d. Both A & B
e. Both A, B & C

14) The file which is used for recovering from the run time errors known as

i. QRS
ii. TSR
iii. PNG
iv. DAT

15) Among the following recording modes, which method uses both the objects and
mouse coordinates

a. Normal
b. Low level
c. Analog
d. All of the above

16) Where do you set the action iterations for a specified action?

a. Action Settings
b. Action Properties
c. Action Run Properties
d. Action Call Properties

17) Where do you mark an action as reusable?
a. Action Settings
b. Action Properties
c. Action Run Properties
d. Action Call Properties

18) After running a test that contains both input and output parameters, where can the results of an output parameter be found?

a. Local Data Sheet
b. Global Data Sheet
c. Run-time Data Table
d. Design-time Data Table


19) If you have a Virtual Object Collection stored on your machine, and you don’t want to use it what you must do?

a. Disable Virtual Objects in Test Settings
b. Remove the Collection from your machine
c. Disable Virtual Objects in General Options
d. Remove the Collections from the Resources list

20) Which method for the Data Table utility object will allow you to retrieve information from the Data Table during a test run?

a. Value
b. Import
c. GetCell
d. GetValue

21) Statement to return the value from the function

i. Return (return value)
ii. Exit (Return value)
iii. Function name = Return value
iv. None

22) constant “2” with the reporter statement returns

a. Pass
b. Fail
c. Done
d. Warning

23) The standard timing delay for windows application is

i. 20 seconds
ii. 60 seconds
iii. Infinite
iv. 100 seconds

24) The standard timing delay for web based application is

i. 20 seconds
ii. 60 seconds
iii. Infinite
iv. 100 seconds

25) In VB Script functions, which one is false among the following

a. Variables must be declared before use
b. Variables may not be declared before use
c. Variables may be declared without data types
None

26) What does the source property of a database checkpoint object represent?

A. The SQL query
B. The identification number of the database
C. The number of rows returned from the query
D. The connection string used to connect to the database

27) What is created, by default, with each new action?

A. Local Data Sheet, Global Data Sheet, Folder
B. Local Object Repository, Local Data Sheet, Folder
C. Global Data Sheet, Local Object Repository, Folder
D. Local Data Sheet, Global Data Sheet, Local Object Repository

28) What are the available environment variable types?

A. Built-in
B. User-defined
C. User-function
D. Built-in, User-defined
E. Built-in, User-function

29) If the Global Data sheet contains no data and the Local Datasheet contains two rows of data, how many times will the test iterate?

A. 1
B. 2
C. 3
D. 5

30) What is the first thing that must be defined in a Recovery Scenario?

A. Trigger
B. Recovery Operation
C. Recovery Scenario Name
D. The Function used in the scenario

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

data Type validation in VB Scripts?

Dim temp
WScript.Echo (VarType (temp))
WScript.Echo (TypeName (temp))
WScript.Echo

temp = 3
WScript.Echo (VarType (temp))
WScript.Echo (TypeName (temp))
WScript.Echo

temp = 3111111
WScript.Echo (VarType (temp))
WScript.Echo (TypeName (temp))
WScript.Echo

temp = "afsda"
WScript.Echo (VarType (temp))
WScript.Echo (TypeName (temp))
WScript.Echo

ReDim temp(6)
WScript.Echo (TypeName (temp))
WScript.Echo

temp(0) = 1
temp(1) = 1
WScript.Echo (VarType (temp))

WScript.Echo (vbSunday)
WScript.Echo (TypeName (temp))

How to Debug vbscript & Jscript from Command prompt?

How to debug Windows Script Host (WSH) scripts, which can be written in any ActiveX script language (as long as the proper language engine is installed), but which, by default, are written in VBScript and JScript.
There are certain flags in the registry and, depending on the debugger used, certain required procedures to enable debugging.
To debug WSH scripts in Microsoft Visual InterDev, the Microsoft Script Debugger, or any other debugger, use the following command-line syntax to start the script:

wscript.exe //d

This code informs the user when a runtime error has occurred and gives the user a choice to debug the application. Also, the //x flag can be used, as follows, to throw an immediate exception, which starts the debugger immediately after the script starts running:
wscript.exe //d //x

After a debug condition exists, the following registry key determines which debugger will be used:

HKEY_CLASSES_ROOT\CLSID\{834128A2-51F4-11D0-8F20-00805F2CD064}\LocalServer32

The script debugger should be Msscrdbg.exe, and the Visual InterDev debugger should be Mdm.exe.

If Visual InterDev is the default debugger, make sure that just-in-time (JIT) functionality is enabled. To do this, follow these steps:
Start Visual InterDev.
On the Tools menu, click Options.
Click Debugger, and then ensure that the Just-In-Time options are selected for both the General and Script categories.
Additionally, if you are trying to debug a .wsf file, make sure that the following registry key is set to 1:

HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings\JITDebug

How to create dictionary?

Dim vKey
Dim sItem, sMsg
Dim oDict
'--- Creating a dictionary object
Set oDict = CreateObject("Scripting.Dictionary")
'--- Adding items to dictionary
oDict.Add "One", "Engine"
oDict.Add "Two", "Wheel"
oDict.Add "Three", "Tire"
oDict.Add "Four", "Spanner"
'--- Looping the Collection

For Each vKey In oDict
sItem = oDict.Item(vKey)
'sMsg = sMsg & sItem & vbCrLf
Next

'WScript.Echo (oDict.Count)
'oDict.Item("one") = "temp"
'WScript.Echo sMsg

'wscript.Echo (odict.item(one))
oDict.Key("One") = "nine"
'oDict.Item("nine") = "nine"
oDict.Add "Ten", "ten"

For Each vKey In oDict
sItem = oDict.Item(vKey)
sMsg = sMsg & sItem & " - " &vKey & vbCrLf
Next

WScript.Echo sMsg

WScript.Echo "===============Again============="

WScript.Echo (oDict.Exists ("One"))
WScript.Echo (oDict.Exists ("nine"))
WScript.Echo (oDict.Exists ("Ten"))

'WScript.Echo (odict.item(One))1
'WScript.Echo (odict.item(nine))
'WScript.Echo (odict.item(Ten))

For Each vKey In oDict
sItem = oDict.Item(vKey)
WScript.Echo (sItem & " - " & vKey)
Next
If oDict.Exists("One") Then
WScript.Echo "heello"
End If


If oDict.Exists("nine") Then
WScript.Echo "heello"
End If

Dim temp()
Dim count, counter
count = oDict.Count
WScript.Echo (count)

WScript.Echo
ReDim temp(count)
counter = 0
For Each key In oDict
temp(counter) = key
' WScript.Echo key & " - " & counter
' WScript.Echo temp(counter)
counter = counter+1

Next


'WScript.Echo ("oDict.Keys")

How to create dictionary?

Dim vKey
Dim sItem, sMsg
Dim oDict
'--- Creating a dictionary object
Set oDict = CreateObject("Scripting.Dictionary")
'--- Adding items to dictionary
oDict.Add "One", "Engine"
oDict.Add "Two", "Wheel"
oDict.Add "Three", "Tire"
oDict.Add "Four", "Spanner"
'--- Looping the Collection

For Each vKey In oDict
sItem = oDict.Item(vKey)
'sMsg = sMsg & sItem & vbCrLf
Next

'WScript.Echo (oDict.Count)
'oDict.Item("one") = "temp"
'WScript.Echo sMsg

'wscript.Echo (odict.item(one))
oDict.Key("One") = "nine"
'oDict.Item("nine") = "nine"
oDict.Add "Ten", "ten"

For Each vKey In oDict
sItem = oDict.Item(vKey)
sMsg = sMsg & sItem & " - " &vKey & vbCrLf
Next

WScript.Echo sMsg

WScript.Echo "===============Again============="

WScript.Echo (oDict.Exists ("One"))
WScript.Echo (oDict.Exists ("nine"))
WScript.Echo (oDict.Exists ("Ten"))

'WScript.Echo (odict.item(One))1
'WScript.Echo (odict.item(nine))
'WScript.Echo (odict.item(Ten))

For Each vKey In oDict
sItem = oDict.Item(vKey)
WScript.Echo (sItem & " - " & vKey)
Next
If oDict.Exists("One") Then
WScript.Echo "heello"
End If


If oDict.Exists("nine") Then
WScript.Echo "heello"
End If

Dim temp()
Dim count, counter
count = oDict.Count
WScript.Echo (count)

WScript.Echo
ReDim temp(count)
counter = 0
For Each key In oDict
temp(counter) = key
' WScript.Echo key & " - " & counter
' WScript.Echo temp(counter)
counter = counter+1

Next


'WScript.Echo ("oDict.Keys")

Sample Scripts for msgbox

Class Hello_World

Public Sub Say_Hello(Name)
MsgBox "Hello, " & Name & ", welcome to " & Garden & "."
End Sub
Public Garden
End Class

Dim MyHello_World

Set MyHello_World = New Hello_World

MyHello_World.Garden = "Fountain"
MyHello_World.Say_Hello "Sachin"
MyHello_World.Garden = "Foun"

Friday, February 11, 2011

What is Automation Object Model?


for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/
What is QuickTest Automation Object Model?
It's a way to write scripts so as to automate your QuickTest operations.


Some places where we can use AOM
This is a small list of places (but not limited to) where we can use AOM. Thumb Rule - Use it at any place where you find yourself doing repetitive tasks while using QTP.

•AOM can come handy when you have a large no of scripts to be uploaded to QC. A simple script can save you hours of manual work!
•Use AOM to initialize QTP options and settings like add-ins etc.
•You can use AOM to call QTP from other application: For ex: You can write a macro for calling QTP from excel.
Caution: AOM should be used outside of QTP and not within the script (during playback). Though there is no harm using it inside but some of the AOM statements might fail.


How to write AOM scripts?
You need to understand that the very root of QT AOM is Application Object. Every automation script begins with the creation of the QuickTest "Application" object. Creating this object does not start QuickTest. It simply provides an object from which you can access all other objects, methods and properties of the QuickTest automation object model.You can create only one instance of the Application object. You do not need to recreate the QuickTest Application object even if you start and exit QuickTest several times during your script. Once you have defined this object you can then successfully work and perform operations on other objects given in Quick Test Pro > Documentation > QuickTest Automation Reference.
For ex: Let us connect to TD QC using AOM and open a script "qtp_demo"

Dim qt_obj 'Define a Quick Test object
qt_obj = CreateObject("Quick Test.Application") ' Instantiate a QT Object. It does not start QTP.
qt_obj.launch ' Launch QT
qt_obj.visible ' Make QT visible
qt_obj.TDConnection.Connect "http://tdserver/tdbin", _ 'Referencing TDConnection Object
"TEST_DOMAIN", "TEST_Project", "Ankur", "Testing", False ' Connect to Quality Center
If qt_obj.TDConnection.IsConnected Then ' If connection is successful
qt_obj.Open "[QualityCenter] Subject\tests\qtp_demo", False ' Open the test
Else
MsgBox "Cannot connect to Quality Center" ' If connection is not successful, display an error message.
End If
To quickly generate an AOM script with the current QTP settings. Use the Properties tab of the Test Settings dialog box (File > Settings) OR the General tab of the Options dialog box (Tools > Options) OR the Object Identification dialog box (Tools > Object Identification). Each contain a "Generate Script" button. Clicking this button generates a automation script file (.vbs) containing the current settings from the corresponding dialog box.
You can run the generated script as is to open QuickTest with the exact configuration of the QuickTest application that generated the script, or you can copy and paste selected lines from the generated files into your own automation script.
for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Thursday, February 10, 2011

What is QTP Automation Object Model

Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your program

Object Repository

displays a tree of all objects in the current component or in the current action or entire test( depending on the object repository mode you selected).
we can view or modify the test object description of any test object in the repository or to add new objects to the repository.
Quicktest learns the default property values and determines in which test object class it fits. If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description. If no assistive properties are available, then it adds a special Ordianl identifier such as objects location on the page or in the source code.

What is the file extension of the code file and object repository file in QTP?

File extension of
Per test object rep: filename.mtr
Shared Object rep: filename.tsr
Code file extension id: script.mts

What is the use of Text output value in QTP?

Output values enable to view the values that the application talks during run time. When parameterized, the values change for each iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.

How to handle the exceptions using recovery scenario manager in QTP?

How To Make Career In QTP: What are the features and benefits of Quick Test Pro(QTP)?

You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps
1. Triggered Events
2. Recovery steps
3. Post Recovery Test-Run

What are the features and benefits of Quick Test Pro(QTP)?

1. Key word driven testing
2. Suitable for both client server and web based application
3. VB script as the script language
4. Better error handling mechanism
5. Excellent data driven testing features

Monday, February 7, 2011

KeyWord Driven Testing

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Keyword-driven testing is a Software testing technique that separates much of the programming work from the actual test steps so that the test steps can be developed earlier and can often be maintained with only minor updates, even when the application or testing needs change significantly.

In case of keyword driven testing, we need to do proper planning and initial huge effort. Anyway it will give benefit of easy maintenance and easily adding more test cases/scenarios.

As we see the keyword view in QTP IDE, the keyword driven testing involves specifying the test steps in below format

Object Action parameter

e.g
Browser("FireFox").Page("QualityPointHome").webEdit("username").Set "QualityPoint"

Here,

->Browser("FireFox").Page("QualityPointHome").webEdit("username") is the Object.
->"Set" is the Action.
->"QualityPoint" is the parameter.

Here we can change any of the three things to create test steps.

The Keyword Driven framework consists of the basic components given below

1. Control File
2. Test Case File
3. Startup Script
4. Driver Script
5. Utility Script

1. Control File


a) Consists details of all the Test scenarios to be automated.
b) User will be able to select a specific scenario to execute based on
turning on or off a flag in the Control File.
c) Control File is in the form of an excel worksheet and contains columns
for Scenario ID, Execute (Y/N), Object Repository Path, Test Case File
Path.

2. Test Case File
a) Contains the detailed steps to be carried out for the execution of a test
case
b) It is also in the form of an excel sheet and contains columns for
Keyword, Object Name, Parameter

3. Startup Script
a) The Startup script is utilised for the initialization and reads the control files.
b) It then calls the driver script to execute all the scenarios marked for execution in the control file.

4. Driver Script

a) It Reads the Test Case files. Checks the keywords and calls the appropriate utility script functions based on specific keyword
b) Error Handling is taken care of in the driver script.

5. Utility Scripts

a) Perform generic tasks that can be used across applications.


Advantage of keyword Driven Framework.

• The main advantage of this framework is the low cost for maintenance. If there is change to any test case then only the Test Case File needs to be updated and the Driver Script and Startup script will remain the same.
• No need to update the scripts in case of changes to the application.



The framework design will be purely based on your requirements and your way of thinking. There is no Solid rule to follow.

Personally, I would like to have my own framework (hybrid framework) designed according to my own requirements.

Anyway, the best practice is, we should create below sub folders in your root folder.

ObjectRepository-> To keep your shared object repositories.
Datatables->To keep QTP data tables and external Excel sheets.
Config-> To keep environment variable xml file
RecoveryScenario ->To keep your recovery scenario files.
Tests-> You can keep your QTP Tests here. You may include Test containing Reusable Actions here. And a Test which is getting used as driver script can also be stored here.
library->you can keep your vbs file which contains vbscript functions.
Results-> You can store Result files (Either QTP result file or customized result file) here.
Actually there won't be any solid rules/approach for creating QTP framework.
for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

Friday, February 4, 2011

How to Call SQL stored procedure in QTP?

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/
How To Make Career In QTP: How to create Array in QTP?

How to Call SQL stored procedure in QTP?


Function RunStoredProcedure(StoredProcedureName)
sDatabaseName=”ABC”
sUID=”xyz”
sPWD=”ABC_xyz” ‘ Create the database object
Set cm = CreateObject(”ADODB.Command”)
‘ Activate the connection.
cm.ActiveConnection = “DRIVER={Microsoft ODBC for Oracle}; ” &_
“SERVER=” & sDatabaseName & “;User ID=” & sUID & “;Password=” & sPWD & ” ;”
‘ Set the command type to Stored Procedures
cm.CommandType = 4
‘ Stored Procedures
cm.CommandText = StoredProcedureName
‘ Define Parameters for the stored procedure
cm.Parameters.Refresh
‘ Pass input value. Assuming Stored Procedure requires 2 parameters
cm.Parameters(0).Value = “Kuldeep”
cm.Parameters(1).Value = “Kumar”
‘ Execute the stored procedure
cm.Execute()
Set cm = Nothing
End Function

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to create Array in QTP?

The easiest way create an array is to simply declare it as followsDim strCustomers()

'Another method is to define a variable and then set it as an array afterwardsDim strStaffstrStaff = Array("Alan","Brian","Chris")


'Yet another way is to use the split command to create and populate the arrayDim strProductArraystrProductArray = "Keyboards,Laptops,Monitors"strProductArray = Split(strProductArray, ",")

' To itterate through the contents of an array you can use the For Each loopDim strItemFor Each strItem In strProductArray MsgBox strItemNext

' This will also itterate through the loopDim intCountFor intCount = LBound(strProductArray) To UBound(strProductArray) Msgbox strProductArray(intCount)Next

' This will itterate through the array backwardsFor intCount = UBound(strProductArray) To LBound(strProductArray) Step -1 Msgbox strProductArray(intCount)Next

' To add extra data to an array use Redim PreserveRedim Preserve strProductArray(3)strProductArray(3) = "Mice"' To store the contents of an array into one string, use JoinMsgbox Join(strProductArray, ",")
' To delete the contents of an array, use the Erase commandErase strProductArray

Thursday, February 3, 2011

Structure for Keyword Framework

Structure for Keyword Driven Framework:


·Test case (Excel OR XML OR ELSE)
·Driver script
·Data script ( To collect & Validate the test data & Keyword from test case excel )
·Common Functional Library (Common for all the test)
·Business function & procedure (Can be specific to test)
·Supportive library (Application Independent)
· Scripts ( Specific to test - only if required)
· Test result



Configuration files which contain following thing:


1. File 1: Contain the variable to make debug mode enable/disable.
a. Can also include flag to install\Uninstall application.
b. Point to re-configure the test environment.
c. Flag to make different level of validation\Check point before executing test.
2. File 2 : Which contain all the required path of files. (Application, result, etc)
3. File 3 : which contain global variable & QTP environment variable used as reference for validation, to invoke QTP & set the test environment.

Optional Feature:


1. Maintaining result history separately, which can be maintain in such way that we can extract history detail of each test/module.
2. Generating mail at completion of each scheduled run with result & important messages of failure.

How to convert winrunner script to QTP

There are some tool available for converting winrunner scripts to qtp.

1. Win Quick (WinQuick is the only HP validated.)
2. QTP Genie
3. Test House
4. Zapit
5. Interoperate
for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

How to Creat Class in VB Script

Creating classes in VBScript is really no different than creating classes in any other programming language. The concept of an object is usually described as just about anything. When you think about it every thing around you is some sort of object. For example a house is an object. It has properties and methods. The properties could be that the house has 3 bedrooms, a garage, a pool, air conditioning etc. You can even break down the house into smaller objects, such as doors windows etc. A garage door may have methods that are controlled by a remote. The methods may be something like garageDoor.open or garageDoor.close. The garage door would be an object, and the method would be to open or close. Getting back to the Vb Script, lets see how we would write a simple class called Math that adds or subtracts two numbers. First let’s look at our parameters for the class.





Class Name: Math

Methods: add and subtract





Now before we actually create the class, lets just see how we would write the two methods:





Public Function add(afirst, asecond)

Dim output

output = afirst + asecond

add = output

End Function





Public Function subtract(sfirst, ssecond)

Dim output

output = sfirst - ssecond

subtract = output

End Function





Now we can define the class:





Class Math


End Class





Then just put them together:





Class Math


Public Function add(afirst, asecond)

Dim output

output = afirst + asecond

add = output

End Function





Public Function subtract(sfirst, ssecond)

Dim output

output = sfirst - ssecond

subtract = output

End Function


End Class

Wednesday, February 2, 2011

Download Free HP0-39 Dump

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/
1) Identify the recording mode, by which you can record the non-standard object in
QTP
A) Standard recording
B) Analog recording
C) Low level recording
D) None
2) By default, how many no of tables would be there in a script?

a) One
b) Two
c) Three
d) Four
3) By default, how many no of actions would be there in a script?

a) One
b) Two
c) Three
d) Four
4) The file extension of Local object repository file is

a) .MTR
b) .TSR
c) .QRS
d) None

5) The file extension of Shared object repository file is
a. .MTR
b. .TSR
c. .QRS
d. None

6) When a procedure is created in the Function Library editor, what is the extension of the file?

A. .INI
B. .TXT
C. .QFL
D. .VBS

7) What are the categories in the Step Generator?

E. Object, Operation, Value
F. Library, Built-in, Local Script
G. Operation, Arguments, Return Value
H. Test Objects, Utility Objects, Functions

8) In Test Settings -> Run the Data Table iteration options are for which data sheet?

I. Local
J. Global
K. Run-time Data Table
L. Design-time Data Table

9) What can you use to handle unpredictable testing exceptions?

M. A Do Loop
N. Recovery Scenario
O. IF Then statement
P. Select Case statement

10) In which command can you associate a function library to a test?

Q. Run Options
R. Test Settings
S. View Options
T. Function Definition Generator
11) To invoke the function which does not return any value, we can use

a. call function name
b. function name
c. Both A & B
d. None

12) The result of the checkpoints can be stored in a variable

a. True
b. False

13) Parameterization generally involves

a. Data table
b. Random number
c. Environment
d. Both A & B
e. Both A, B & C

14) The file which is used for recovering from the run time errors known as

i. QRS
ii. TSR
iii. PNG
iv. DAT

15) Among the following recording modes, which method uses both the objects and
mouse coordinates

a. Normal
b. Low level
c. Analog
d. All of the above

16) Where do you set the action iterations for a specified action?

a. Action Settings
b. Action Properties
c. Action Run Properties
d. Action Call Properties

17) Where do you mark an action as reusable?
a. Action Settings
b. Action Properties
c. Action Run Properties
d. Action Call Properties

18) After running a test that contains both input and output parameters, where can the results of an output parameter be found?

a. Local Data Sheet
b. Global Data Sheet
c. Run-time Data Table
d. Design-time Data Table


19) If you have a Virtual Object Collection stored on your machine, and you don’t want to use it
what you must do?
a. Disable Virtual Objects in Test Settings
b. Remove the Collection from your machine
c. Disable Virtual Objects in General Options
d. Remove the Collections from the Resources list
20) Which method for the Data Table utility object will allow you to retrieve information from
the Data Table during a test run?
a. Value
b. Import
c. GetCell
d. GetValue
21) Statement to return the value from the function
i. Return (return value)
ii. Exit (Return value)
iii. Function name = Return value
iv. None
22) constant “2” with the reporter statement returns
a. Pass
b. Fail
c. Done
d. Warning
23) The standard timing delay for windows application is
i. 20 seconds
ii. 60 seconds
iii. Infinite
iv. 100 seconds
24) The standard timing delay for web based application is
i. 20 seconds
ii. 60 seconds
iii. Infinite
iv. 100 seconds
25) In VB Script functions, which one is false among the following
a. Variables must be declared before use
b. Variables may not be declared before use
c. Variables may be declared without data types
None
26) What does the source property of a database checkpoint object represent?
A. The SQL query
B. The identification number of the database
C. The number of rows returned from the query
D. The connection string used to connect to the database
27) What is created, by default, with each new action?
A. Local Data Sheet, Global Data Sheet, Folder
B. Local Object Repository, Local Data Sheet, Folder
C. Global Data Sheet, Local Object Repository, Folder
D. Local Data Sheet, Global Data Sheet, Local Object Repository
28) What are the available environment variable types?
A. Built-in
B. User-defined
C. User-function
D. Built-in, User-defined
E. Built-in, User-function
29) If the Global Data sheet contains no data and the Local Datasheet contains two rows of data,
how many times will the test iterate?
A. 1
B. 2
C. 3
D. 5
30) What is the first thing that must be defined in a Recovery Scenario?
A. Trigger
B. Recovery Operation
C. Recovery Scenario Name
D. The Function used in the scenario
31) To count the no of rows in a table
a. getrowcount
b. Getlinecount
c. Getcount
d. Count
32) Object which is used for calling the win32 api functions in QTP, we use
i. extern
ii. description
iii. environment
iv. None
33) By default, the all actions in QTP are
a. non – reusable
b. reusable
c. external
d. None
34) The active screen images are stored in a file called
a. GIF
b. BMP
c. JPEG
d. PNG
35) To refer the global data sheet, we can use the statement
a. dtglobalsheet
b. Global
c. Both A & B
d. None
36) What are bitmap checkpoints sensitive to?
A. Image size and object type
B. Object type and image type
C. Screen resolution and object type
D. Screen Resolution and image size
37) If the Local Data sheet contains two rows of data, how many times will the action iterate, by
default?
A. 1
B. 2
C. 3
D. 5
38) How do you close the database session after examining the results of an SQL query?
A. Call the ADO.Close function
B. Use the close method for the RecordSet object
C. Set the RecordSet and Connection objects equal to Nothing
D. Use the close method for the RecordSet and Connection objects
39) What are the available trigger event types?
A. Pop-up window, object state, VBScript event
B. Object state, VBScript event, Application crash
C. Pop-up window, object state, test run error, QTP crash
D. Pop-up window, object state, test run error, Application crash
40) What is the keyword used to define how the counter variable in a For Next loop increments?
A. ++
B. Next
C. Skip
D. Step
41) Select Case statement is end with
i. end case
ii. exit case
iii. esac
iv. end select
42) To specify the “Not Equal to” in QTP, symbol used is
A. !=
B. <>
C. NOT =
D. ==
43) which one is the default data type of QTP
A. integer
B. String
C. Variant
D. Double
44) To differentiate similar objects in one screen, QTP uses
A. object identification
B. Smart identification
C. Object repository
D. Object spy
45) To use the non-standard windows object, we can go for
A. Object spy
B. Virtual objects
C. Object identification
D. None
46) What are the two most commonly used ADO objects?
A. Fields
B. Execute
C. Connection, RecordSet
D. Open, ConnectionString
47) How do you declare a constant?
A. Dim statement
B. Con statement
C. Const statement
D. Option Explicit statement
48) What method is used to retrieve the number of columns in the query results?
A. Fields.Count
B. Fields.Item(EOF)
C. Fields.Count(BOF)
D. Fields.Count.Value
49) To bypass the Object Repository you can:
A. Turn the Object Repository off
B. Use a programmatic description
C. Delete all objects in all repositories
D. Add the object to the Object Repository Manager
50) What does the ChildObjects method return?
A. A Collection object
B. A string true/ false
C. A Boolean TRUE/ FALSE
D. The number of objects matching the ChildObject description
51) To use the constant timing delay between process, QTP uses,
a. wait
b. pause
c. Synchronization point
d. None
52) To terminate the script execution, during running, QTP uses
a. Exit run
b. Stop run
c. Quit
d. None
53) We can access the objects of the application without using object repository.
a. True
b. False
54) Checkpoints statements can be manually added to the script without using menus.
a. True
b. False
55) while statement always end with
a. end while
b. End do
c. Wend
d. Loop
56) What object is used to read information from a text file?
a. Read
b. ReadLine
c. TextStream
d. FileSystem
e. OpenTextFile
57) If you are typing in Expert View and you type an object followed by a dot, what does th
QuickTest display?
a. Nothing
b. The arguments for that object
c. The methods and properties for that object
d. The child objects and methods for that object
58) By default, how does QuickTest pass arguments to the procedure?
a. ByVal
b. ByRef
c. ByArg
d. ByRes
59) What object is used to send information to test results at the completion of the test run
a. Result
b. Reporter
c. ReportEvent
d. ResultReport
60) If a procedure is defined in a test script, that procedure is accessible to which tests/ scripts?
a. Only to other procedures
b. It is not usable to any test scripts
c. The test script in which it is defined
d. Using the Step Generator, it is available to any test script
61) Do statement always end with
a. end while
b. End do
c. Wend
d. Loop
62) Utility to measure the timing delays between transactions, we use
a. synchronization
b. sync
c. services
d. wait
63) If the same object is present in the local and shared repository, QTP will refer which
one?
a. shared
b. Local
c. Both A & B
d. None
64) The default addins with QTP are
a. Active X
b. Visual Basic
c. Web
d. All of the above
65) Which one is not true about “Copy of action”
a. Tester can edit the script
b. Tester can’t edit the script
c. Tester can view the script
d. None
66) When does a Do loop statements evaluate for continuation?
A. At the end of the loop
B. At the start of the loop
C. At the start or the end of the loop
D. This loop uses a counter varaible
67) How can you retrieve the number of items in the list for a WebList object?
A. GetList
B. GetItem
C. GetItemsCount
D. GetROProperty
68) What is the difference between a subroutine and a function?
A. A subroutine can call itself; a function cannot
B. A function returns a value; a subroutine cannot
C. A function can accept arguments; a subroutine cannot
D. A subroutine can call other procedures; a function cannot
69) What method is used to send a run-time Data sheet to an Excel file?
A. Send
B. Export
C. SendSheet
D. ExportSheet
70) What looping statements are available in QuickTest?
A. While end, Do Loop, If Then
B. Switch Case, If Then, For Next
C. For Next, While end, Do Loop
D. For Next, Do Loop Switch Case
71) Which one is not true about “Call of action”
A. Tester can edit the script
B. Tester can’t edit the script
C. Tester can view the script
D. None
72) Which one is true about “Do” statement
i. End with “Loop while false”
ii. End with “Until True”
iii. End with “Wend”
d) Both A and B
73) Checkpoint which is being used for verifying the web page with W3C standard is
A. Bitmap checkpoint
B. Standard checkpoint
C. Accessibility checkpoint
D. XML checkpoint
74) Planning for the no of iteration for the action is done at
i. Action properties
ii. Action call properties
iii. Call to existing action
iv. None
75) To enter the non-executable statement in QTP , we use
A. single quotes
B. Rem
C. Both A and B
D. None
76) What does the GetTOProperty method do?
A. Retrieves the value of a property from a test object
B. Retrieves the available properties from a test object
C. Retrieves the value of a property from a run-time object
D. Retrieves the available properties from a run-time object
77) To use low-level recording, what must you do first?
A. Start a new test
B. Be in the Keyword view
C. Be recording in Normal mode
D. Click Low Level Recoding under the Automation Menu
78) What is the correct set of add-ins installed automatically with QuickTest 9.2?
A. Net, Web, Java
B. Web, SAP, Visual Basic
C. Active X, Visual Basic, Web
D. Active X, TE, Web Services
79) What information can be seen in the information pane?
A. Syntax errors
B. The test name and author
C. The QTP license information
D. The machine id and operating system
80) What does a breakpoint do?
A. Stops test execution at the specified step, after executing that step
B. Stops test execution at the specified step, before executing that step
C. Pauses test execution at the specified step, after executing that step
D. Pauses test execution at the specified step, before executing that step
81) Which of the following is an example of a missing resource?
A. An object
B. Run Results
C. A Regular Action
D. An External Action
82) What are the available step commands in QuickTest?
A. Step, step Into, Step Out
B. Step Into, Step Over, Step Out
C. Step Test, Step Action, Step Function
D. Run from Step, Debug from Step, Run from Step
83) When a test is run in update mode, what is updated?
A. The test results
B. The object descriptions
C. The action names in the test
D. The logical names in the test
84) What are the phases in the QuickTest workflow?
A. Plan, Record, Enhance, Run
B. Prepare, Record, Verify, Run
C. Plan, Create, Verify & Enhance
D. Prepare, Create, Verify & Enhance, Integrate
85) Why is low-level recording mode useful?
A. It records exact keyboard operations on an object.
B. It records exact coordinates of all mouse movements.
C. It uses the object repository to determine what methods can be used.
86) What are test object properties?
A. Those properties as defined in a description object.
B. Those properties as defined in Object Identification
C. Those properties displayed by an object at run-time
D. Those properties used in the Object Repository for an object identification
87) What is the function of the Object Repository Manager?
A. Assign variable names to test objects
B. View/ Make/ Modify a Local Object Repository
C. View/ Make/ Modify a Shared Object Repository
D. Define new test objects using programmatic descriptions
88) Where are virtual object collections stored?
A. In a Function Library
B. In the local Object Repository
C. In the Object Repository Manager
D. Dat folder inside of the QTP installation directory
89) In the Object Identification dialog box, which properties can be viewed?
A. The base filter and optional properties
B. The mandatory and optional properties
C. The base filter and assistive properties
D. The mandatory and assistive properties
90) Where do you turn Smart Identification IN?
A. The Object Repository
B. The Test Settings dialog
C. The General Options dialog
D. The Object Identification dialog
91) How do you know if Smart Identification has been used in a test?
A. The Smart Identification icon appears in the test results
B. The test results will show a run error, causing a test failure
C. The properties used by the object repository will be changed
D. The Object Repository will show the Smart Identification icon
92) What options are available to filter objects in the Target Object Repository pane when
merging object repositories?
A. Show all objects or Show only objects with conflicting object types
B. Show all objects or Show only objects with conflicting descriptions
C. Show only objects with conflicting logical names or Show only objects with conflicting
object types
D. Show only objects with conflicting logical names or Show only objects with conflicting
descriptions
93) What is the default ordinal identifier?
A. The location
B. The object id
C. The nativeclass
D. The index number
94) Which statement is used to associate a procedure with a test object class?
A. RegisterFunction
B. RegisterUserProc
C. RegisterUserFunc
D. RegisterProcedure

String functions in QTP

Manipulating String


Dim var
var = " hello Word "
MsgBox var
temp = Trim (var)
MsgBox temp
MsgBox var
temp1 = UCase(Trim (var))
MsgBox temp1
temp2 = LCase(temp1)
MsgBox temp2




Few more function for string


Dim temp
temp = "12 3456781 "


MsgBox (temp)
MsgBox (Len (temp))
MsgBox (Left (temp, 3))
MsgBox (right (temp, 3))
MsgBox (Mid (temp,2,3))
MsgBox (Mid (temp,1,3))
MsgBox (Mid (temp,5,2))
MsgBox (Trim (temp))
MsgBox (StrComp ("YES","yes",(0))) ' 0 is a case sensitive option
MsgBox (StrComp ("yes","ye",(1)))
MsgBox (String (34,"*"))
WScript.Echo (String (34,"*")) ' Run with both wscript n script option in CMD '
MsgBox (StrReverse ("HEllo"))

Time and date Functions in QTP

'MsgBox (Date ())


WScript.Echo (Date ())
WScript.Echo (Time ())
WScript.Echo Now ()
WScript.Echo Hour (Time)
WScript.Echo Month (Date)
WScript.Echo (Time ())
WScript.Echo MonthName (1)
WScript.Echo MonthName (12)
WScript.Echo second (time)
WScript.Echo Timer ()
WScript.Echo TimeSerial (13,56,8)
WScript.Echo Timevalue (Time)
WScript.Echo Weekday (Date)
WScript.Echo WeekdayName(Weekday(2))
WScript.Echo

Dowload Free .Net Framework

How To Make Career In QTP: Download free QTP Framwork

As per your demand, you can click below link for downloading the .Net Framework...

cheers!!!!!!!!

http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en