Basic funda of QA (Testing )

"No Standards for Testing only the Best Practices"
Showing posts with label Testing. Show all posts
Showing posts with label Testing. Show all posts

Monday, September 22, 2008

31) How to make QTP to recognise the activeX controls

1) In the Expert View, you can use the Object property to activate the method for an ActiveX control. The list of available methods depends on the ActiveX control.

2)QuickTest records and runs steps on ActiveX controls as it does on any other object.

Using the Insert>Step Option , we can activate ActiveX control methods, retrieve and set the values of properties and check the object exists.

It is recommended that to begin recording session before opening the application containing the ActiveX controls on which you want to record.

32) what to do if the tree view is not recognised by QTP

U've something called "Object Mapping" under Object Identification. This is only for Standard Windows Class. U can map the Tree View to WinTreeView and then try recording. It works.

33) what is meant by external files in QTP.

.vbs files are called as external files.

.Vbs,Excel,dlls and any other files that for importing,Processing and Resulting can be treated as External files in QTP

34) what is keyword driventest ?


Keyword driven test has been introduced in QTP 8.0. Its like tree view. Keyword driven implies that the script can be created easily through keyword View.

35) How can an object from a per action repository be called to another per action repository?

It is possible through shared repository only

36)How you write scripts in QTP? What's the main process in QTP? How do you run scripts in QTP?

Main process in QTP is Recording, stores the properties in object repository then Running the script and then Test Results.

Recording: QTP 'looks' at the object on which we are recording and stores it as a test object, determining in which test object class it fits like standard window dialog box or web button etc. Then for each test object class, QTP has list of mandatory properties that it always learns. When we record an object, QTP learns these default property values, and then 'looks' at the rest of the objects in the page , to distinguish and identify the object uniquely.If not it adds assistive properties , one ny one, to the description, until it has compiled a unique description.If no assistive properties are not available , it adds a special 'ordinal identifier' such as objects location on the screen.

Running the scripts: While running the script, QTP searches for a run time object that exactly matches the description of the test object it learned while recording. If it is not matching, QTP uses ' smart identification' mechanism to identify the object.

We can run the scripts from Test>Run After running the script we can see the Test Results also .

37) What is the command in QTP to invoke IE Brow?

InvokeApplication "The path of the browser EXE file"

The following example uses the InvokeApplication function to open Internet Explorer.

InvokeApplication "E:\Program Files\Plus!\Microsoft Internet\IEXPLORE.EXE"

38) I am new to QTP, please tell me how to invoke an application in QTP.

For Ex:
In winrunner we use syntax's like "web_url_valid, web_browser_invoke", like the same way i want in QTP.

Else please let me know where can i find these syntaxs in QTP. Use SytemUtil Object's Run Method

ex:SystemUtil.Run "iexplore" will open the IE Browser.

39) How would u manipulate the script so that when the test is run it takes a new login name?

External datatable can be used for the login name so that it takes a new login name whenever the test is run. You can parameterize the values in the Gobal data table sheet, whatever the number of rows you enter in this data table will instruct QuickTest to run same number of new login name you've enter. You need to do only parameterize the login window object in object repository and there you need to specify datatable parameter name or else qtp specify default papramter name

40) How can i add a action (external action) programatically?

1) its not possible :( 2)if action is reusable then only u can call only in other test with "runaction" command and in folder option u hv to gv information regarding test from where u r takin action.u can do it programatically also. 3)You can add an external Action programatically using the Command

RunAction ActionName, [IterationMode , IterationRange]

Before you can use the RunAction statement in the Expert View for an external action, you must first call or copy the external action into your test by choosing Insert > Copy of Action or Call to Action. If the external action does not exist in your test, the RunAction statement is not recognized.

Example

The following example calls the SearchFlight action, and runs all iterations of the action.

Call RunAction "SearchFlight", rngIterations, rngAll

41) what is meant by SOURCE CONTROL ?

It is used to hold all the bulids of diff versions

42) how and what kind of Vb functions do u use in qtp?

1. User Defined2. Pre Defined

43) how can u discribe the basic flow of automation with conditional and programatic logic?

I think ur Question is Executing of operators flow in the automation code if the question is that then my answer is

For example:

z = 78 * (96 + 3 + 45)

There are five operators in this expression: =, *, (), +, and another +. According to the rules of operator precedence, they are evaluated in the following order: (), +, +, *, =.

1. Evaluation of the expression within the parentheses occurs first. Within the parentheses, there are two addition operators. Since the addition operators both have the same precedence, they are evaluated from left to right. 96 and 3 are added together first, then 45 is added to this total, resulting in a value of 144.

2. Multiplication occurs next. 78 is multiplied by 144, resulting in a value of 11232.

3. Assignment occurs last. 11232 is assigned to z.

44) HOW CAN I IMPLEMENT ERROR HANDLING IN QTP,I KNOW WITH RECOVERY MANAGER BUT HOW PLZ GIVE ME DETAILED TO HOW TO HANDLE GIVING AN EXAMPLE?

U can do it thru Recovery Manager..

Eg... Suppose there is an Edit box called Uname n PWD... Just type in uname n don't enter in PWD..

It displays a pop up msg called plz,,enter PWD... Then stop recording..

Go to Recovery MGR and call POPUP exception handling./../

45) Give one example where you have used Regular Expression?

1)for the date format "dd/mm/yyyy" the equivalent regular expression would be

Set regExp_Term = New RegExp
regExp_Term.pattern = "11/11/1981"
validation=regExp_Term.test("date to be validated")

if validation="True" Then

-----------------

End If

2)We can use Regular Expression where ever required, like in my Web Testing, my browser name changes oftnely, so I used Regular expression in Name property like...

Set Browser= (Title:=Browser.*)

3) generaly regular expressions r used when the data is dynamically changing . for example take a flights application in the QTP samples. we can use regular expression for the Date field ,FaxOrder no,etc

Winrunner FAQ's - Part I

1) How you used WinRunner in your project?

a. Yes, I have been WinRunner for creating automates scripts for GUI, functional and regression testing of the AUT.

2) Explain WinRunner testing process?

a. WinRunner testing process involves six main stages

i. Create GUI Map File so that WinRunner can recognize the GUI objects in the application being tested

ii. Create test scripts by recording, programming, or a combination of both. While recording tests, insert checkpoints where you want to check the response of the application being tested.

iii. Debug Test: run tests in Debug mode to make sure they run smoothly

iv. Run Tests: run tests in Verify mode to test your application.

v. Update mode: run tests to update expected results…in exp folder..

vi. View Results: determines the success or failure of the tests.

vii. Report Defects: If a test run fails due to a defect in the application being tested, you can report information about the defect directly from the Test Results window.

3) What is contained in the GUI map?

a. WinRunner stores information it learns about a window or object in a GUI Map. When WinRunner runs a test, it uses the GUI map to locate objects. It reads an object’s description in the GUI map and then looks for an object with the same properties in the application being tested. Each of these objects in the GUI Map file will be having a logical name and a physical description.

b. There are 2 types of GUI Map files.

i. Global GUI Map file: a single GUI Map file for the entire application

ii. GUI Map File per Test: WinRunner automatically creates a GUI Map file for each test created.

4) How does WinRunner recognize objects on the application?

a. WinRunner uses the GUI Map file to recognize objects on the application. When WinRunner runs a test, it uses the GUI map to locate objects. It reads an object’s description in the GUI map and then looks for an object with the same properties in the application being tested.

5) Have you created test scripts and what is contained in the test scripts?

a. Yes I have created test scripts. It contains the statement in Mercury Interactive’s Test Script Language (TSL). These statements appear as a test script in a test window. You can then enhance your recorded test script, either by typing in additional TSL functions and programming elements or by using WinRunner’s visual programming tool, the Function Generator.

6) How does WinRunner evaluates test results?

a. Following each test run, WinRunner displays the results in a report. The report details all the major events that occurred during the run, such as checkpoints, error messages, system messages, or user messages. If mismatches are detected at checkpoints during the test run, you can view the expected results and the actual results from the Test Results window.

7) Have you performed debugging of the scripts?

a. Yes, I have performed debugging of scripts. We can debug the script by executing the script in the debug mode. We can also debug script using the Step, Step Into, Step out functionalities provided by the WinRunner.

8) How do you run your test scripts?

a. We run tests in Verify mode to test your application. Each time WinRunner encounters a checkpoint in the test script, it compares the current data of the application being tested to the expected data captured earlier. If any mismatches are found, WinRunner captures them as actual results.

9) How do you analyze results and report the defects?

a. Following each test run, WinRunner displays the results in a report. The report details all the major events that occurred during the run, such as checkpoints, error messages, system messages, or user messages. If mismatches are detected at checkpoints during the test run, you can view the expected results and the actual results from the Test Results window. If a test run fails due to a defect in the application being tested, you can report information about the defect directly from the Test Results window. This information is sent via e-mail to the quality assurance manager, who tracks the defect until it is fixed.

10) What is the use of Test Director Software?

a. TestDirector is Mercury Interactive’s software test management tool. It helps quality assurance personnel plan and organize the testing process. With TestDirector you can create a database of manual and automated tests, build test cycles, run tests, and report and track defects. You can also create reports and graphs to help review the progress of planning tests, running tests, and tracking defects before a software release.

11) How you integrated your automated scripts from TestDirector?

a. When you work with WinRunner, you can choose to save your tests directly to your TestDirector database or while creating a test case in the TestDirector we can specify whether the script in automated or manual. And if it is automated script then TestDirector will build a skeleton for the script that can be later modified into one which could be used to test the AUT.

12) What are the different modes of recording?

a. There are two type of recording in WinRunner.

i. Context Sensitive recording records the operations you perform on your application by identifying Graphical User Interface (GUI) objects.

ii. Analog recording records keyboard input, mouse clicks, and the precise x- and y-coordinates traveled by the mouse pointer across the screen.

13) What is the purpose of loading WinRunner Add-Ins?

a. Add-Ins are used in WinRunner to load functions specific to the particular add-in to the memory. While creating a script only those functions in the add-in selected will be listed in the function generator and while executing the script only those functions in the loaded add-in will be executed else WinRunner will give an error message saying it does not recognize the function.

14) What are the reasons that WinRunner fails to identify an object on the GUI?

a. WinRunner fails to identify an object in a GUI due to various reasons.

i. The object is not a standard windows object.

ii. If the browser used is not compatible with the WinRunner version, GUI Map Editor will not be able to learn any of the objects displayed in the browser window.

15) What do you mean by the logical name of the object.

a. An object’s logical name is determined by its class. In most cases, the logical name is the label that appears on an object.

16) If the object does not have a name then what will be the logical name?

a. If the object does not have a name then the logical name could be the attached text.

17) What is the different between GUI map and GUI map files?

a. The GUI map is actually the sum of one or more GUI map files. There are two modes for organizing GUI map files.

i. Global GUI Map file: a single GUI Map file for the entire application

ii. GUI Map File per Test: WinRunner automatically creates a GUI Map file for each test created.

b. GUI Map file is a file which contains the windows and the objects learned by the WinRunner with its logical name and their physical description.

18) How do you view the contents of the GUI map?

a. GUI Map editor displays the content of a GUI Map. We can invoke GUI Map Editor from the Tools Menu in WinRunner. The GUI Map Editor displays the various GUI Map files created and the windows and objects learned in to them with their logical name and physical description.

19) When you create GUI map do you record all the objects of specific objects?

a. If we are learning a window then WinRunner automatically learns all the objects in the window else we will we identifying those object, which are to be learned in a window, since we will be working with only those objects while creating scripts.

20) What is the purpose of set_window command?

a. Set_Window command sets the focus to the specified window. We use this command to set the focus to the required window before executing tests on a particular window.

Syntax: set_window (, time);

The logical name is the logical name of the window and time is the time the execution has to wait till it gets the given window into focus.