RSS Feed

Monthly Archives: May 2017

7 Important Points You Should Remember About Virtual Objects

Posted on

1. A group of virtual objects that is stored in the Virtual Object Manager under a descriptive name is known as virtual object collection.

2. Virtual objects for analog or low-level recording are not supported by QuickTest.

3. Recognition of virtual objects can be disabled without deleting them from the Virtual Object Manager.

4. Virtual objects can only be used when recording and running a test. Any type of checkpoint on a virtual object cannot be inserted.

5. The virtual object collections shown in the Virtual Object Manager are stored on your computer and not with the tests that include virtual object steps. This means that if you use a virtual object in a test step, the object will be recognized during the run session only if it is run on a computer containing the appropriate virtual object definition. To copy your virtual object collection definitions to another computer, copy the contents of your \dat\VoTemplate folder (or individual .vot collection files within this folder) to the same folder on the destination computer.

6. Virtual objects can only be defined for objects on which you can click or double-click and that record a Click or DblClick step. Otherwise, the virtual object is ignored. For example, if you define a virtual object over the WinList object, the Select operation is recorded, and the virtual object is ignored.

7. You cannot use the Object Spy to view the properties of Virtual objects.

How to add object repository in qtp

Posted on

How to add object repository in qtp

Hi friends, I got very good response from you on my previous post “object repository in qtp”. So today also I am going to give you some advance knowledge in context to object repository in QTP.
I am going to teach you two following things in context to object repository.

1. How to add object repository in qtp manually.
2. How to add or load object repository in qtp during runtime.

Procedure to add object repository in qtp manually

1. Go to Edit->Action->Action Properties window.
2. Than switch to “Associated Repositories” Tab.
3. Click on “+” sign.
4. Now click on right most side button and add object repository file (in .tsr format)

Procedure to add object repository in qtp during run time:

Just write following lines of code in your script.
——————————————————————————–

Dim qtApp

Set qtApp = CreateObject(“QuickTest.Application”)

qtApp.Test.Actions(1).ObjectRepositories.Add “C:\Repository1.tsr”
———————————————————————————

Note: Above script will add “Repository1.tsr” file to your test during run time. Please note that this object repository file will be loaded during run time so you can see it attached only during run time. During stop mode you will not be able to see attached object repository.

If you want to verify that object repository is added or not during runtime you can verify. When your script is in running mode just Go to Debug->Pause and then you can verify by going to Edit->Action->Action Properties and then associated repository tab.

Agile Testing Mindset And The Role Of The Agile Tester!!

Posted on

Agile tester in an agile team plays a very important role towards the end product quality testing. He or she should be able to collaborate well within the agile team members and other project’s stakeholders. In order to collaborate well with the team members, the tester is expected to have an agile mindset in terms of testing skills and other quality assurance activities that a tester should perform as being a part of the agile team.

Agile Testing Mindset:

To play a role of agile tester, the tester should have the Agile testing mindset which will help him to break free from the traditional project methodologies such as SDLC, V model, waterfall etc. In order to develop the correct mindset, the agile tester should possess the following characteristics.

  • Prevention is better than cure”. An agile tester should be focused on preventing defects rather than finding defects.
  • An agile tester should provide the Quality Assistance over the Quality Assurance.
  • An agile tester should not believe in enough testing but should believe in the continuous testing approach instead of starting testing at the last moment.
  • An agile tester should not play as an individual player but the agile team player and should work closely with the whole team in collaboration.
  • Responsibility wise in agile testing mindset, it should be team responsibility instead of an individual tester responsibility.
  • Testing focus should be on automation rather than manual testing when it comes to regression.
  • An agile tester should prefer the Exploratory Testing over the Scripted Testing approach.
  • It is not SDLC methodology therefore; agile user stories from product owner should be used for customer requirement gathering over the traditional requirements specification.
  • When it comes to web testing, the focus should be on Technical, API Testing and GUI Testing in order to ensure complete end to end testing.
  • The mindset of an agile tester is to make sure that the software is built correctly instead of breaking the software like Monkey testing.
  • An agile testing approach does not wait for the testing phase to start therefore, with the agile mindset the tester should be involved into testing as early as possible.
  • An agile testing approach does not require providing the detailed testing report after the end of testing instead Short Feedback helps the team to get the idea that they are building the software in the right direction. This approach gives lots of time to fix the defect if it is identified in the early stage as a short feedback.

After all it is “Attitude that makes the altitude”. Therefore, if a tester has the above Agile testing mindset then definitely he or she is a perfect fit to the project’s agile team.

Role Of The Agile Tester:

So far, we have discussed about the agile testing mindset, now let’s grill on the various roles of the agile tester. An agile tester is responsible for the following roles.

  • First of all, an agile tester should comply with the agile project methodology i.e. the active participation in daily standup meetings, joining session based on the grooming on user stories, retrospectivesteam meetings, continuous improvement suggestion to make the process the best.
  • Active collaboration with the agile team which involves the developers, business stakeholders, etc. which may help in making the requirements on the product functionality crystal clear and help the testing team to widen the scope of testability.
  • Clear understanding of the agile testing strategy at the project level.
  • Close working with the product owner in order to capture the acceptance criteria which will later evolve into the acceptance tests.
  • Measurement of the overall test coverage that the acceptance tests cover.
  • Well versed with the use and implementation of the automation testing tool in order to help in the regression testing.
  • Setting up of the test environments, test data for functional and the volume testing and the maintenance of the existing test cases and scenarios.
  • Execution and the development of the automation test scripts to automate the acceptance tests.
  • Preparing the test report and sending the report across the agile team. So that the team isinformed about the defect and the testing progress on the current product.
  • If as an agile tester you are leading a team then it comes under your role to coach or train the testing team so that they can collaborate well in the current testing expedition.
  • An agile tester should help in testing sign off from the stakeholders for the project release and should also participate in iteration planning for the product testing.

 

An agile tester should not forget that though it is working in collaboration with the developers as an agile team but still he or she is a tester and should comply with testing roles and health online pharmacy without prescription responsibility with the appropriate testing mindsets. A tester failed to follow the above roles and responsibilities may result in insufficient testing and hence the failed software end product.

The following could be the risk to the organization with the agile testing methodologies.

  • As we know, testers work in collaboration with the development team then it may happen that they lose their testing mindset and start thinking as a developer. Both has different mindset should follow their assigned responsibilities in order to develop the correct software product.
  • Being a tester, one should not hesitate to escalate inappropriate or ineffective practices within the team. No matter whether the tester is collaborating in the best way with the developer, the incorrect thing which cannot be made correct and therefore, should be discussed in the Daily scrum meetings.
  • In agile methodologies, the sprint is of the short duration. The small sprint may sometime result in sparing very less time for tester to test the developed product in the current sprint or to run the complete regression.

All the above risks should be well discussed with the agile team as a part of the daily meeting.

Over to you:

In this article, we have discussed about the various roles and the agile mindset that an agile tester should possess in order to become an asset to the agile team.

QTP Tutorial – Using Virtual Objects and Recovery Scenarios in QTP Tests

Posted on

Virtual Objects in QTP

Do you see Object not found error while running QTP tests? Well, this is because during playback QTP can’t recognize non-standard objects. To solve this object recognition problem we use Virtual Objects. Using Virtual Object Wizard we can map these unrecognized objects to standard class which then can be used as standard object to record the test.

How to solve object recognition problem in QTP?

Example of Virtual Object:
Here is a scenario: I am recording a test on a Microsoft word document. I activate the already opened MS word doc and I click on any of the icons in the top menu. For example, I click on “Format Painter”. The code that gets recorded into QTP is:

1 Window("Microsoft Word").WinObject("NetUIHWND").Click 132,120
2 Window("Microsoft Word").WinObject("NetUIHWND").Click 672,101

In cases like this we would go for a virtual object. By definition, a virtual object is an object that is recognized by QTP as non-standard but is instructed explicitly by the tester to behave like a standard object.

Virtual Object Wizard Steps:

Step #1) Go to the menu option “Tools->Virtual Objects-> New Virtual Object” and click “Next” in the following window.

Before you hit “Next” take a minute the read what this wizard will do.

Virtual Objects

Step #2) Here you will find a list of classes. You can choose any class depending on how the object in your application is behaving like. In our case, the “Format Painter” Icon is more like a button. So I am going to choose “Button” from the list.

Virtual Objects

Step #3) In this screen you can mark the screen where the object is on your AUT. Click “Mark Object” and choose the object from your AUT.

Virtual Objects

Step #4) The width and height values for the marked object will be populated once the selection is made. Hit “Next”

Virtual Objects

Step #5) You can now configure the way in which you would want the selected object to be recognized with reference to its parent. As you can see, you have a choice to see identify it based on its parent alone or the entire hierarchy. I am just going to keep the default values and click “Next”

Virtual Objects

Step #6) Give your virtual object a name and add it to a collection (nothing but a consolidated list of Virtual objects). I keep the default  values and click “Finish”

Virtual Objects

This completes the process for creation of a Virtual object.

Step #7) Go to “Tools->Virtual Objects->Virtual Object Manager”. Here you can see all the collections that are available and the objects within them.

Virtual Objects

Clicking on “New” will take you back to the creation process that we have just seen. You can delete a collection using the “Delete” button.

Once you are done creating the virtual object, repeat the recording process on your AUT for the same object. This is how the code looks:

1 Window("Microsoft

Word").WinObject("NetUIHWND").VirtualButton("button").Click

Now you will be able to perform all the operations on this VirtualButton that you can on a standard button object.

A few points to note:

1) This feature is not available for Analog and low level recording modes.

2) From the example you can see that the virtual object completely relies on the width and height factors, so it is not highly reliable.

3) To disable QTP from recognizing the virtual objects while recording, choose the option “Disable recognition of virtual objects while recording’ under “Tools->Options->General”.

Virtual Objects

Recovery Scenario in QTP

At times when you are trying to login to your Gmail account, assume a pop-up window comes up and you will be asked to confirm your security information. This does not happen every time you login. If your test is to login to Gmail account and as soon as you enter the user ID, password, hit the Sign In button and if your QTP test is expecting to arrive at your inbox your test is going to fail if the security information screen comes up randomly.

To handle cases like this we use the ‘Recovery Scenarios”.

Steps to create Recovery Scenario in QTP:

————

Step #1) Go to “Resources -> Recovery scenario manager” , click on the “New Scenario” icon.

Recovery scenario

Step #2) Click Next

Recovery scenario

Step #3) The trigger for this to start could be one of the following options. Choose according to your scenario. In our case I will choose, Pop-up window. The other options are self explanatory.

Recovery scenario

Step #4) Using the “Pointed hand” option, choose the window that you would want to add.

Recovery scenario

Step #5) Define the recovery option by clicking on the “Next” icon below:

Recovery scenario

Step #6) Choose one from the list. I am going to choose “Keyword or mouse operation”. The options in this screen are really easy to understand. So choose accordingly.

Recovery scenario

Step #7) I am going to go with the default settings and click Next. The recovery operation gets added to the list. If you need to add more than one recovery operation you can keep the corresponding checkbox checked and click Next. It will take you back to the screen in Step number: 5. Or if you are done, you can simply uncheck the checkbox and click on “Next”. That is what I am going to do.

Recovery scenario

Step #8) Now you will have to define the post recovery operations.  All the options are as their names indicate. I am going to choose “Proceed to next step”. Click Next

Recovery scenario

Step #9) Enter the scenario name, description and click Next

Recovery scenario

Step #10) It provides a gist of your scenario. As you can see, there are 3 parts to a recovery scenario. The Trigger, Recovery operation and post recovery operations. You can choose to add this scenario to the current test or to all tests by choosing the relevant checkboxes. I am going to keep them unchecked at this point because I want to show how a tester can associate them to a test explicitly. Click “Finish”

Recovery scenario

Step #11) The scenario we just created will appear in the list. Save and close.

Recovery scenario

Step #12) Associating the recovery scenario. Open a test, in the “Resources” pane, right click on “Associated Recovery scenarios”, right click and choose “Associate recovery scenario”. Browse for the scenario and click “Add Scenario”. The chosen scenario will appear in the list in the Resources pane.

Recovery scenario

Step #13) Also, you can go to “File->Settings->Recovery” and add the scenarios you would like. Here you can also choose the options as to how often you would like it to run. You can choose to run it, On Error, On Every Step or Never.

Step #14) The extension for a recovery scenario file is “.qrs”

This concludes our discussion on Virtual Objects and Recovery scenarios. I would recommend the tester to use various combinations of Trigger, Recovery and post recovery operations when practicing the recovery scenarios.

QTP Tutorial – QTP Smart Object Identification, Sync Point, and Test Result Analysis

Posted on

Smart Identification:

Assume a situation when no object matches or multiple objects match the recorded description for an object during run time, how does QTP handle it?

QTP has a mechanism in place for cases exactly like this. If the recorded description does not enable QTP to identify the specified object in a step, and a smart identification definition is defined (and enabled) for the object, QTP tries to identify the object using “Smart identification”.

Let us see how this works with some examples.  For every object there are Primary Properties and Secondary properties.

Example 1: Object with the recorded description is not found.

On a page there was a button and the following are properties:
a) Primary: Name
b) Secondary: Abs x,y

While recording the “Name” property was “Login ID”. Due to some changes to the application, the “Name” property is now changed to “User ID”. In this case, QTP will find a button with a different description and it should fail if it considers the primary properties alone.

But in cases like this when the primary properties don’t match then it checks the secondary ones and if they match it recognizes the object. In this case, it is going to recognize the button by its X and Y co-ordinates.

Example 2: QTP was supposed to find a page X and there are 2 pages with similar browser settings.

In this case too, it tries to use the “name” or other properties to find the right page/pages and works accordingly.

The above 2 are examples of cases where QTP engages the smart identification mechanism.

  • The Test results will also show if a step employed Smart identification to run successfully.
  •  If QTP cannot find the object despite Smart Identification, then the test fails.

For most of the objects, QTP provides a default Base filter properties (Primary) and Optional filter properties (Secondary) that it checks if we enable Smart identification for them. The user does have an option to edit what properties to consider too. To do so, go to “Tools->Object Identification”. Choose the relevant Environment from the drop down and choose the Object Class. Once you chose it, check the “Enable Smart Identification” and click “Configure”.

Smart identification

Click Add or Remove

Smart identification

Select the properties as required:

Smart identification

Make your selection and Click OK when done.

Smart identification

The above process will ensure that the next time it has difficulty identifying an object of this class, it will employ smart identification to do so.

Also, for most of the objects “Smart identification” is turned ON by default. You can see where this is the case for a certain object by accessing it in the OR under “Additional details” part of its object properties.

It is set to “True” if enabled and “False” if disabled.

You could also choose to enable or disable Smart identification entirely for a test run. Choose “File->Settings->Run->Disable Smart Identification during the run session” option.

Synchronization point:

Consider this program,

1 SystemUtil.Run "iexplore.exe", "http://www.gmail.com"
2 Browser("Gmail: Email from Google").page("Gmail: Email from Google").Sync
3 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "swatiseela"
4 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Passwd").SetSecure "sfgs686898"
5 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebButton("Sign in").Click
6 Browser("Gmail: Email from Google").Page("Gmail - Inbox").Link("Sign out").Click

In an ideal world, as soon as you hit the “Sign in” button in the gmail login page, the “Inbox” should get displayed without any delays. That means, the state of the application is ready for the last statement in our example to be executed immediately after the last but one statement runs.

But in real time, due to many reasons applications don’t always load at the same pace. If we do not instruct QTP to wait a certain while before it moves on. More specifically until an object attains a certain state.

A synchronization point is used to instruct QTP to wait until a particular object property achieves the value you specify.

On inserting a sync point a “Wait Property” statement is inserted into the test.

1 Browser("Gmail: Email from Google").Page("Gmail - Inbox"). Link("Sign out").WaitProperty “Visibile”,true,20

So your new program is going to look something like this: (line #6 below)

1 SystemUtil.Run "iexplore.exe", "http://www.gmail.com"
2 Browser("Gmail: Email from Google").page("Gmail: Email from Google").Sync
3 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "swatiseela"
4 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Passwd").SetSecure "sfgs686898"
5 Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebButton("Sign in").Click
6 Browser("Gmail: Email from Google").Page("Gmail - Inbox"). Link("Sign out").WaitProperty “Visible”,true,1000
7 Browser("Gmail: Email from Google").Page("Gmail - Inbox").Link("Sign out").Click

It can be inserted while recording using the menu option “Insert->Synchronization Point”.  Choose the Object to insert the sync point.

Synchronization point

Enter the value as required:

Synchronization point

This is the statement that gets inserted:

1 Browser("Gmail - Inbox").Page("Gmail - Inbox").Link("Sign out").WaitProperty "visible", true, 10000

Running a test

1) Automation->Run or F5 typically runs the entire test.

2) You can run a part of the test by choosing “Automation->Run Current Action” option

3) You can run a test from a certain point in your test by choosing “Automation->Run From Step” option.

4) As soon as you choose any of the above ways to run a test, you will be promoted to choose the location where you would like the test results to be stored. You can choose the folder by choosing the first option in which case, the results will be stored for every instance of the test run. But if you choose the next option, temporary folder, the results get overwritten and only the latest test run result will be stored in the folder chosen. In terms of memory, it is advisable to use the second option while testing your QTP test. Unless you want every test run results, do not choose the first option because obviously it is going to use up a lot of space.

————

Running a test

5) Input parameters:  If the test input parameters were defined for this test, this tab is the place where you provide them.

Running a test

6) You can also run a couple of tests all at once in a batch. QTP has a “Batch Runner” tool. It is also an external tool just like a “Password encoder tool” that we discussed earlier.

7) To launch go to “Programs > QuickTest Professional > Tools > Test Batch Runner”. Create a batch (.mtb) using icon1.

Running a test

8) Once creating a list is done, run the batch using icon2 icon. After the batch run is complete, you can view the results for each test in its default test results folder (<test folder>\res#\report).

Test results:

In our articles so far, whether we are discussing data table iteration, checkpoints, smart identification or in general the test step run , the Test results is the place you get to see whether something was successful or not.

Apart from the above, the test results can hold the screenshot of your AUT when a failure occurs. This depends on the settings at “File->Settings->Run”.

The tester can print and export test results.

To make test results more understandable the user can write his comments into the test results.

For example, if a certain condition fails in your test you might want to write in the test results that “Did not work for the value X”. You can do so by using the “reporter.reportevent” statement. The following is the syntax:

Reporter.Reportevent(Event Status,Reporter step name, details)

Event status: MicPass, MicFail,MicWarning,MicDetail, the next two parameters can be any text that helps include further detail.

If this is my statement and I run it:

reporter.ReportEvent micPass,”Swati’s First Step”,”Passed coz I told it to pass …”

The test results are going to look like this: (click to enlarge image)

Test results

Transactions:

Since this is not a very widely used feature, I am going to do a high level introduction here.

Typically, a test is divided into transactions when you have to measure how long it takes to run a certain section of it.

It is also used when a QTP test is to be used by Load Runner or Business Process Monitor. In either of these cases, your test has to be recorded in terms of a transaction and anything outside of it will be ignored.

You can start a transaction from QTP using “Insert->Start Transaction”. Give it a name, choose if you want it before or after the current step and choose OK.

Transactions

Services.StartTransaction “TransactionTest” – Gets inserted. Now I will record a login into Gmail.com.

Once you are done recording. Choose “Insert->End Transaction”. Click OK.

Transactions

Services.EndTransaction “TransactionTest” – gets inserted.

This is the code:

Transactions

Now I will run this test. Let us see how the test results look. The results will show a summary in terms of time taken to finish the transaction.

Transactions

Silent Test runner:

Another tool that QTP provides is the Silent Test runner. This enables the tester to run his test without having to launch QTP. It also helps simulate QTP runs from load runner and verify it compatibility with the same.

It will not work if QTP is already open and another test is running via it.

Use Start > Programs > QuickTest Professional > Tools > Silent Test Runner menu command to invoke it. Select the test and click “Run Test”

Silent Test runner

This is how it looks while running the test:

Silent Test runner

Once it is completed:

Silent Test runner

Test Run log:

Silent Test runner

The “Transaction Summary” will be activated if the test contains at least one transaction.

%d bloggers like this: