Subscribe by Email


Showing posts with label Run. Show all posts
Showing posts with label Run. Show all posts

Saturday, November 24, 2012

How do you schedule and run tests in Test Director?


In this article we shall see how the tests can be scheduled and run. 

By configuring the conditions the test director can be instructed to postpone the run of the current test till the completion of some other specified tests is over. For example, the test b is scheduled to be run only after the test a finishes with the execution and there is one more test c which is scheduled to run only if the test b passes.
Also, the tests a and b can be scheduled to be executed a day prior to the execution of the test c. the tests and their conditions are displayed by the execution flow in the form of a diagram. 

Steps to schedule tests in test Director

Follow the below mentioned steps to schedule a test run:
  1. Firstly, make sure that the test module is in the view mode and if it is  not then first enable it.
  2. Second step involves creation of a new test. Click on the execution flow tab in the test lab module. Choose a folder in the test sets tree and click on the ‘new test set’ option. You will get a ‘new test set’ dialog box. Type in the following details:
a)   Test set name
b)   Description
Once you are done click OK and the test set will be added to the test sets tree in the left pane by the test director.
  1. Add a test that you want to add to the test set created in the previous step. Using the ‘select tests’ button  to make the test director display the test plan tree in the right pane. Then, type the name of the test to be searched for in the find box in the test plan tree and click find button. Select the searched test and add it to the test set using the ‘add tests to test set’ button.
  2. Any number of tests can be added to the test set. To add the tests to the execution flow either simply drag them in to the execution flow area or double click on them.
  3. Add conditions using conditions tab. When you will click on the new button a ‘new execution condition’ dialog box will pop up. Select the required test and then passed option. This will instruct the test director to execute the next test only after the successful execution of the previous test. Click OK once done with this and the condition will be added to the run schedule of by the test director in the test dialog box.
  4. You can even add a dependency condition to the tests by clicking on the time dependency tab. You will get a field titled ‘run at specified time’, in that specify the date of execution and click OK. Clicking on OK will close the run schedule. The conditions will be displayed by the test director in the execution flow area.
  5. Further, if required, some execution condition can also be added to the tests.
  6. For rearranging the tests in a hierarchical way, click on the perform layout option. You can then view the dependencies between the tests clearly.  

How the tests are run in Test Director?

We get two options form the test director namely:
a)   Running tests manually and
b)   Automating the tests.
Follow the steps below for the manual execution of a test:
  1. Click on the test lab module to display the test lab module.
  2. From the test sets select the required test set.
  3. From the execution grid select the required test.
  4. Clicking on the run will open up a manual runner dialog box.
  5. To begin the test run click on the test run. Parameter values dialog box will open up.
  6. Assign the parameter values for the test.
  7. Click OK and test director will show up the manual runner. The step details dialog box will open up. Perform the execution process step by step.
  8. After running all the steps return to the default manual runner display. End the test run by clicking on the end of run button. 


Friday, November 23, 2012

How to run a test automatically in Test Director?


The whole testing process revolves around the execution of the tests. As the changes are introduced in to the software system or application, running tests either manually or automatically becomes mandatory so that the defects can be located and quality can be assessed. 

How are tests run?

- One starts the testing process with the creation of the tests and adding these tests to a test set. 
- Tests are grouped into test sets by the test director so that some specific goals can be achieved. 
- Execution process of the tests can be controlled via the various controls provided by the test director. 
- Along with these controls, there are certain conditions and settings which need to be configured for the execution of the tests as desired by the tester. 
- The date and time can also be scheduled when the tests will be executed. 
Once the tests have been defined the tester can begin with the execution of the tests. 
- Whenever the tests are executed manually, it is basically the test steps that were defined earlier during the test planning which are executed one by one. 
The steps are passed or failed by the tester depending up on whether there is a match between the expected results and the actual results. 
- For the automatic run of a test, the selected tool is directly opened by the test director and the test is run. 
- The result hence obtained is exported to the test director. 
- Setting conditions and specifying date and time for the execution of a test both can be done with the help of the execution flow tab.
- In the execution, one thing should be noticed which is that the condition is always dependent on the result of some other specified test in the same flow. 
Also, the sequence in which the tests are to be executed can be specified. 

In this article we shall see how the test execution can be automated. The tool selected for the execution of the tests is opened directly by the test director and the tests are run on either local or remote machine. It is either choice if you want to run all the tests or some specified ones. 

For running the tests automatically one of the following tools must be installed on the system:
a)   Astra quick test
b)   Quick test professional
c)   Winrunnner

Follow the below mentioned steps:
  1. Clicking on the test lab tab will display the test lab module. This is a must for the automation of the tests.
  2. The test set you want to execute automatically should be displayed in the execution grid. For doing this click on the execution grid tab and select the required test from the test sets tree.
  3. Select a test. For running the winrunner test select the required test or if you want to run an astra quick test or QTP test select the required one. Next clicking on the run button will open up the execution dialog box and the test will be displayed.
  4. Configure the test run settings and select the ‘run all tests locally’ option for running the tests on the local machine.
  5. For running the tests click on run tests and the tool will be opened automatically by the test director and the tests will be run. The execution progress can be viewed in the status column.
  6. Once the execution of the test is complete close the execution dialog box by clicking on the exit option.
  7. Also the summary of the test results can be viewed in the execution grid.


Saturday, October 6, 2012

How do u do batch testing in WinRunner & Is it possible to do in QTP, if so explain?


WinRunner provides you the facility of executing a certain batch of the unattended tests. This feature of the winrunner has proved to be quite useful especially in the situations when a large groups of tests have to be run over night i.e., an over night run. 

How to do batch testing in WinRunner?

- A batch test can be viewed as a test consisting of a test script which holds the calls to the other tests. 
- Such call statements execute each and every test called in the list and also save the result up on execution.
- A batch test may consist of n number of tests depending up on the need and requirement of the user. 
- A batch as such just seems like a normal test but with an unusual large number of calls. 
- A batch test can be run by using the option “run in batch mode”. 
- This option is available in the run category of the general dialog box which gets invoke just before the start of the execution of the test. 
- Whenever a test is run in batch mode, all of the messages that may be displayed during the test run are suppressed by the winrunner. 
- This is done so that the winrunner is able to run a batch test unattended. 
- The execution of the batch tests is therefore different from the regular, interactive test runs where you may come across several messages popping up on the screen. 
- In batch tests, this thing is not there and so a lot of time is saved. 
- The current chain of all the called tests can be viewed at a break point in the call chain pane available for viewing in the debug viewer window. 
- After the completion of the batch test run the winrunner makes the results available in the test results window. 
- Winrunner provides you the facility of running the batch test via command line.

Is it possible to do batch testing through QTP?

- The quick test professional is the successor of the winrunner and is quite advanced and efficient in many respects as compared to the winrunner. 
- Batch testing is possible in quick test professional. 
Difference lies in the way in which the batch testing is carried out here. 
- The quick test professional facilitates the batch testing service with the help of a separate built-in tool called the test batch runner or QTP batch testing tool. 
With this tool you can group the tests in to a number of batches which are then executed. 
- The result of this batch test run is made available in the test result viewer. 
- In quick test professional, batch wise viewing of the result is not possible. 
Results for individual tests have to be viewed. 
- For the execution of a test batch you need to open the path of the test batch and give the run command. 
- In quick test professional, other mercury products for batch testing can also be installed and used if one is not comfortable with the in built tool of the quick test professional i.e., the test batch runner. 
- For doing this you need to follow the below mentioned sequence:
Tools menu à options à run à check the check box “allow other mercury products” à apply à ok
- Even a partial batch test is also possible! 
- You just need to deselect the tests that you want to be executed. 
- MTM or multi test manager is another mercury product using which one can carry out batch testing. 


Saturday, September 29, 2012

What is Reporter.ReportEvent? What is GetRoProperty? (In QTP)


In this article we are going to discuss regarding the two main things namely:
  1. Reporter. Report event and
  2. GetRoproperty
As far as the purpose of the reporter object is concerned it is used for sending or reporting the information to the results of the test. With a reporter object the following tasks can be performed:
  1. For reporting of the status of the results of the tests like success, failure, warning, error and so on.
  2. For enabling or disabling reporting of the steps that immediately follow the executed statement.
  3. For retrieving the folder path where the results of the current tests can be stored.
  4. For retrieving the execution status at the current point of the execution process.
There are many methods and properties that are associated with the reporter object and the reporter. Report event is one of them. 
Those methods and properties are as mentioned below:
  1. Reporter event method
  2. Filter property
  3. Run status property
Here the thing to be discussed is about the first one i.e., the reporter event method in detail. 
- This is the most commonly method that is used with the help of a reporter object. 
- It is certain that even if one has worked on quick test professional for a very short period of time then he/ she might have come across the use of this object. 
The syntax for using this object is as mentioned below:
Reporter. Reportevent event status, report step name, details [, image file path]

The event status can be one of the following:
  1. Mic Pass or 0: If the test step passes the run.
  2. Mic Fail or 1: If the test step fails the run.
  3. Mic done or 2: If the status of the test is not affected by the run of the test step.
  4. Mic warning or 3: If the status of the test is not affected by the run of the test step and a warning has to be issued.
- Next step i.e., the report step name represents the name of the step that is currently being executed. 
- The last aspect i.e., the details represent the details of the step as defined by the user. 
- The reporter. Report event can be used for reporting of the custom steps in the test results of the quick test professional.

- After the tests have been executed, the results can be stored in a text file or in an xls file via VBScript library functions. 
- It can be considered to be a kind of reporting mechanism of the quick test professional. 
- As the name itself specifies it means reporting an event to the test results. 

What is GetRoProperty in QTP?

- The GetRoproperty is used basically for the following two tasks:
  1. For returning the run time value or the current value of the test object property from the objects present in the software system or application.
  2. For retrieving the current property value during the run session of the object present in the software system or application.
- Actually GetRoProperty is one of the 4 methods provided by the quick test professional for working on the test object repositories and the other 3 are:
  1. GetToProperty
  2. SetToProperty
  3. GetToProperties
- Most of the developers often get confused with these methods and do not use the appropriate method for the situation. 
- For employing either of these methods, it is important that you should know and understand the details of the test object properties which can be identified by the quick test professional as a standard set of properties. 


Tuesday, September 18, 2012

How can you handle exceptions in QTP?


Exception handling is one of the major features of any test automation and testing software suite. The same is with the HP’s quick test professional which is also a test automation and software testing suite. 

How exceptions are handled in QTP?

- The exception handling thing is managed by the quick test professional by means of some recovery scenarios. 
- The basic goal of exception handling in quick test professional is to have the tests running even if some unexpected failure is encountered. 
- There is some memory space associated with the applications that are tested. 
- This memory space is hooked by the HP quick test professional and this in turn gives rise to some exceptions which may cause the quick test professional to falter, terminate and become unrecoverable. 
- The recovery scenarios used by the quick test professional come in built with the whole software package. 
- But it is not always beneficial to rely on the recovery scenarios rather it is always better if you can handle the exceptions and errors yourself. 
- A recovery scenario manager is also available which has an in – built wizard using which you yourself can define you very own recovery scenarios. 
- This wizard can be accessed by going to the tools menu and then selecting the option “recovery scenario manager”. 
- These recovery scenarios deal in three steps as stated below:
  1. Triggered events
  2. Recovery steps and
  3. Post recovery test run.
Some may think that using the recovery scenarios is the only option for handling the exception in quick test professional but it is not so.  

Another option is which involves the use of descriptive programming.
- This approach is better than the former option since using it your application can gain more visibility and robustness. 
- Though, the recovery manager can be used for many scenarios but some of the real time scenarios cannot be handled using it. 
- In such cases descriptive programming is the alternative. 
- Third option will be make use of the exception handling capabilities of the visual basic script like the following:
  1. Err object
  2. On error resume next
  3. On error go to 0 statements and so on.
- The last two can be used at the script level. 
- The in–built recovery scenario of the quick test professional supports only 4 exceptions:
  1. Object state exceptions
  2. Pop up exceptions
  3. Application crash exceptions and
  4. Test run error exceptions
- A simple example is when you play back the recorded script, the AUT screen is minimized and a run time error is generated as “object not visible”.
- A “test run handler” can be used for this. 
- Four trigger events have been defined during which the recovery manager is supposed to be used:
  1. When  a pop up window appears while an application is open for the test run,
  2. When the value or the state of a property of an object changes,
  3. When a step in the test run becomes unsuccessful or fails terribly, and
  4. When the open application itself fails while the test is in progress.
- All of the above mentioned 4 triggers are nothing but exceptions. 
The quick test professional can be instructed accordingly regarding how to recover from an unexpected event or failure that occurred during the test run in the application development environment. 
- Separate individual files can be created for different scenarios as per the requirements. 
- If you search the web you can find an advance qtp script that can attach as well as enable the recovery scenario file when the test run is in progress. 


Sunday, September 16, 2012

Can we record an application running on a remote machine using QTP? Explain the keyword CreateObject?


The quick test professional supports the recording of the applications be it on the same machine or on some remote system. The point is that recording on the same machine is much more feasible than compared to the recording what is done on applications installed on remote systems. 
Also the quality that is perceived in both the cases has a lot of difference. 
- The recording that is carried out on the same system is far better as compared to the recording that is carried out on some remote system. 
- For starting the record in quick test professional one just needs to click on the record button which will open up the record and run settings dialog box. 
- This box actually opens up automatically every time a new recording is started on a test.
- In this record and run settings dialog box, a tab is there which corresponds to the add - ins that are installed for the quick test professional software package as well have been loaded for the current test. 
- There is one more tab which is always available and is titled “windows application tab”.
- This tab can be used while operating in environments such as the following:
  1. Visual basic
  2. Active X
  3. Terminal emulators and so on.
- For any of those environments mentioned above the record and run settings are classified in to 2 groups as stated below:
  1. Record and run on a specific window: this option works for a particularly selected environment and is the recommended option by the quick test professional.
  2. Record and run on any window: this option works when it is not important to the user that whether or not the window belongs to a particular environment.
- If you are some one new to the quick test professional you can go for the default quick professional test settings. 
- Once you are done with these settings, it will always be used by the quick test professional while operating up on the additional record sessions on a particular test until and unless these settings are changed manually. 
- Quick test professional completes the recording in few steps and after completion the recording is saved.

How to record an application running on remote machine?

- A remote application can be recorded provided on one condition which is that the application which is to be recorded must be accessed through the local browser and not by using any remote browser such as citrix. 
- In some cases, it may happen that even by using the local browser you may not be able to record the application! 
- For such cases it will work if you install the application as well as quick test professional on the same machine.
- If you attempt to record on some application and find that you are unable to record anything then make sure that you completed the following steps properly:
  1. The application that you want to record is open and you have selected the record and run option for it. if the application is not open, the recording won’t take place.
  2. You have configured the record and run settings properly.
  3. You have selected the windows application tab.
Also, before you start recording the application you should know its type.
- If you are going to record web applications then make sure that you have the following add – ins installed:
  1. Web
  2. .net
  3. Active X
  4. .WPF
  5. Java and so on.

What does the keyword “createobject” is?

- This key word is used to create a reference to an automation object and to return the same. 
- The syntax for this is as follows:
Createobject ( name of the server, type, [,location] )
- Here, the server name denotes the name of the application to which the object belongs. 
- Location argument specifies the network server where the object has to be created. 


Wednesday, September 12, 2012

What are Virtual Objects in Quick Test Professional?


- The concept of the virtual objects in quick test professional comes in to light only when a failure in the identification of the object is encountered or some error is generated like “object not found”. 
- This happens because even after recording the actions during the time of play back, the quick test professional is experiencing some difficulties in the process of recognition of the object and this causes the whole script to fail. 
- A certain kind of object has been created in quick test professional in order to resolve the issues of the object recognition which has been termed as the “virtual objects”. 
- In some cases it happens that the quick test professional is unable to recognize the area of the object and therefore some other wizard is used for mapping the area of the object called the “virtual object wizard”. 
- All the virtual objects that are created during the course of object recognition are stored in the virtual object manager. 
- After the quick test professional has learned about the virtual object, it can record on the actual object very well. 
- A virtual object can be created easily by going to the tools menu, then selecting the virtual object list and then finally clicking on the new virtual object option. 
- Even though the virtual objects are very helpful there are some points about virtual objects to be noted:
  1. It is not possible to use the object spy on a virtual object.
  2. Only recording operation can be performed on virtual objects.
  3. You cannot treat labels and scroll bars as virtual objects.
- For disabling the virtual objects mode, simply go to the tools drop down list, and then go to options, then general, then check the option which says “disable recognition of virtual objects while recording”. 
- Using virtual objects is just one way of handling the issues of object recognition. The other two are:
  1. Analog recording and
  2. Low level recording.
- Basically, the virtual objects help in the recognition of the objects that do behave like standard objects but still cannot be identified by the quick test professional. 
- Such objects are mapped to standard classes with the help of virtual object mapping wizard. 
- The user actions on the virtual objects are emulated by the quick test professional during the run session. 
- The virtual object is portrayed as a standard class object in the test results. 
The virtual object wizard allows you to select the standard object class to which the object has to be mapped and then the boundaries of the virtual object can be marked with the help of the cross hair pointer. 
- After being done with this, a test object can be selected to be the parent of the virtual object. 
- The group of all virtual objects stored under one descriptive name is termed as the virtual objects collection. 
- While using the virtual objects during a run session always make sure that the size and location of the application window are exactly same as they were in the recording mode. 
- If it is not taken care of the coordinates of the virtual object may vary affecting the success of the whole run session. 
- Another point to be noted is that it is not possible to insert any check points on a virtual object. 
- For performing an operation on the active screen on a virtual object it is required that you first record it, save its properties in the description in the object repository. 


Friday, August 24, 2012

How do you invoke an application using TSL?


Test scripts of all the tests that are created via the winrunner are composed in a special programming language developed by the mercury interactive called the test script language or TSL. 
The generation of the test scripts in test script language (TSL) takes place while the recording of the test is in progress. Each line of the winnrunner test script that is written in TSL language is called a TSL statement and like in other languages each statement ends in semi colon. 
Most of the features of the TSL make it much like the C language but overall if we see, creating tests in TSL is quite easy as compared to writing tests in C. 

In this article we are going to discuss about how an application can be invoked using the TSL scripts.
- The TSL allows you to define a message in the test script of the test and have it delivered to the test results window through the winrunner. 
- For sending a message to the test results window, the below mentioned statement can be added in the test script:
Report_msg( message );
- The message may contain a variable, a string or a combination of both of them depending up on the desire of the user. 
- Applications can be started or invoked from a test script very easily. 
- The winrunner provides you a function for starting or invoking an application. - This function has been named as the “invoke_application” function. 
- The very presence of this function makes it quite easy for the testers to invoke the same or the other application that is being tested. 
- Mostly, it happens that you require to invoke the software application that is being test during the start up of the winrunner. 
- The application software that is being tested can be invoked very easily every time you start the winrunner software by just making an simple addition to the start up test that you are having at hand. 
- This addition is of the function that we discussed above i.e., the invoke_application. 
- The invoke_application can be added to the start up test and the application will be started by the winrunner.

(Startup tests or functions are those tests and functions which are run and executed by the winrunner before it starts running other main tests or functions. They mark the beginning of the winrunner testing.)

- If you are unable to add this statement to the test script of the start up test there is no need to worry as there is one more way for invoking the application being tested in winrunner.
-There is a “run” tab available in the test properties dialog box of the winrunner. 
- This run tab can also be used for invoking an application. 
- Clicking on this you can invoke the application at the beginning of some test run.
- If the run tab also fails then you have one more way of invoking the application being tested which involves the use of the system statement to start an application.
Now let us see what the syntax for the invoke_application function is, it has been stated below:
Invoke_application ( file, command_option, working_dir, show );

The explanation for the above function syntax can be given as following:
- The full path of the application software to be invoked is designated by the file.
- The command line options that are to be applied are designated by the command_option parameter.
- The working directory of the supplication software is designated by the work_dir.
- Lastly, what shall be the appearance of the main window of the application when it is open is designated by the show.


Tuesday, August 21, 2012

When do you use Break Points? What is Toggle Break Points? How it differ from Break points?


What you got to do when you are in need of pausing a test run in between its execution? 
- Break points are used to mark such points in the test script where you want the test to be paused. 
- Break points have proved to be a very useful tool in the discovery of the flaws that might be present in a test script. 
- A break point marker marks the break point present in the test script. 
- This break point marker resides in the left margin of the test scripts.
- The test run is paused by the winrunner whenever it encounters a break point. 
- On a particular break point following tasks can be carried out:
  1. The effects of the test run can be examined.
  2. The current value of the variables can be viewed.
  3. Any necessary changes can be made.
  4. Test can be continued to further execution.

How to use Break Points?

- To continue the execution of the test after completing the task to be carried out on the break point the “run from arrow” command can be given and the test will restart from the break point. 
- Once, it gets in to the execution process again it will continue to execute until and unless it encounters another break point or till the test is complete. 
- One thing that should always be taken care of is to make sure that the winrunner is out of batch mode otherwise it won’t pause. 
- For winrunner to pause on break points, it is mandatory that it comes out of the batch mode. 
- If it is not, it is sure to ignore the break points. 
- There are 3 main uses of the break points:
  1. They are used to suspend the test run at a particular point so that the state of your software system or application can be inspected.
  2. They are used for monitoring the entries that are there in the watch list.
  3. They are used to mark certain points throughout the test script for the stepping purpose by using the step commands.

Types of Break Points

We have two types of break points as mentioned below:
  1. Break at location point: This break point makes the test to stop at some line number specified by the user in a test script and
  2. Break in function point: This break point makes the test to stop whenever a functioned specified by the user is called in a loaded compiled module.
The break points that you define in a session remain active for that particular winrunner session only. Once you terminate that particular winrunner then you must redefine the break points to continue the debugging of the test script in the successive session.

Toggle Break Point and how they differ from normal break point

- Toggle break point command is used whenever you have to set a break at the location break point. 
- For doing this, you just need to move the point of insertion to that line of the test script where according to your desire the test must stop executing. 
- Now go to the debug menu and click on the option “toggle break point” or you can simply go for the button entitled toggle break point. 
- Once you have clicked on this you can observe a symbol of break point towards the left margin of the current window of the winrunner. 
- This break like other break points is also listed in the break points list.
- There is just one simple difference which is that the toggle break points automatically make use of the pass count of 0 and if some other pass count is required these break points can be easily modified. 


What is meant by Step and Step into in WinRunner?


Winrunner provides certain run commands commonly known as the winrunner run commands which help in the execution of your test cases. Whenever a test is in the process of running, it is marked by an execution arrow in the left margin of the test scripts indicating that particular TSL statement has been interpreted. 
The winrunner provides 6 typical run commands which have been mentioned below:

1. Run from top: There is also a button corresponding to this command called the “from top” button and clicking on this will cause the active test to start running from the first line of its test script. If another test is called by a test then the test script of the called test is also displayed by the winrunner. The execution takes place till the last line in the test script has been entered.

2. Run from arrow: There is also a button corresponding to this command called the “from arrow” button and clicking on this will cause the active test to start running from that line of the test script which has been marked by an execution arrow. In rest of aspects, this command shares a lot common with the previous mentioned command.

3. Run minimized commands: These commands help in making sure that the entire screen is available to the software system or application that is being tested. Actually, when you use the minimize commands the winrunner window is shrunk to an icon while the test keeps on executing. When the test comes to an end or is paused or stopped the winrunner grows back to its usual size. The following are the available run minimized commands:
        a)   Run minimized > from arrow command and
        b)   Run minimized > from top command

    4. Stop command
   5. Pause command: This command is used whenever there is a need for the temporary suspension of the test run.
   6. Step commands: These commands help in the execution of a single TSL statement in a test script. Buttons called step buttons are also available for these step commands. Step commands available are:
           a)   Step command
           b)   Step into command
           c)   Step out command
           d)   Step to cursor command 
   
   We shall now discuss these step commands in detail. 
    - After a test has been created, it should be checked that whether or not it runs smoothly without giving any errors in logic as well as in syntax. 
   - The step commands come very handy for the detection and isolation of the defects present in the test script. 
    
    With the help of step command, a single line of the test script can be executed. You can either choose the step command or go for step button for the execution of the current line of the script which has been marked by the execution arrow.

- With the help of step into command, another user defined function as well as test can be called and displayed as well. 
- If a function is called by the current line of the active test script then the function settings and startup applications are not implemented. 
- Later, the step out or step commands can be used for a continuous run of the test.
   - The step out command is often applied in conjunction with the step into command i.e., it is used only after you have entered the user defined function or test and thus completes the execution of the user defined function or the called test. 
   Now what if you want to run a particular portion of the test script? Here in such cases you can use the step in to cursor command. 
   - This command helps in executing a portion of the test script that has been selected by the user. 











Facebook activity