Monday, 6 March 2017

QTP Interview Questions - Part 1 !!!


[1]. Which environments are supported by QTP?

    QTP supports the following environments.


  • Active X 
  • People Soft
  • Terminal Emulator
  • Java
  • Siebel
  • .Net
  • Web
  • Visual Basic
  • SAP
  • Web Services
  • Visual Age
  • Oracle
  • Stingray
  • Power Builder


[2]. What are the Object Repositories supported by QTP?

QTP supports 2 types of Object Repositories.

01.Local Object Repository/ Per Action Object Repository

Local object repository is used by default. The file extension of local object repository is ".mtr"

02.Shared/ Global Object Repository:

Shared object repository is preferable while dealing with dynamic objects which are called in multiple tests. The file extension of shared object repository is ".tsr".

[3]. Can we call QTP test from another test using scripting?

Yes. We can call QTP test from another Test using scripting. To do this, we need to make the actions in the corresponding scripts re-usable. Then we can make call from the destination script.

[4]. What is action split and the purpose of using this in QTP?

Action split is used to divide the selected action into 2 parts. The main purpose of dividing the action to improve code re-use.

[5]. How QTP identifies Object?

QTP identifies any GUI object based on its corresponding properties. While recording, QTP will identify and store peculiar properties as defined in Object identification Settings[i.e., mandatory and assistive properties] in the object repository of GUI object.

QTP will compare the stored property values against the on-screen object property values, to uniquely identify the GUI during Run Time.

Sunday, 17 April 2016

Features Of Latest Version Of QTP/UFT 12.1!!!

The latest version of QTP/UFT(Unified Functional Testing) is 12.1. It supports the following.



  • OS:
  1.  Latest version of QTP supports Windows 8.1 and Windows Server 2012.
  1.   Supports Safari browser.
  • UFT Extension:
  1. UFT extension in chrome receives updates Automatically on Chrome.
  • Support For Run Time Application:
  1. Records and run Tests on Windows Run Time Application.
  1. Create Object Repositories with Windows Run Time Application.
  • Newly Supported Technologies:
  1. JDK 1.8
  1. XenDesktop 7
  1. SAP Web Dynapro
  • Extended Support For Other Technologies:
  1. Object identification and interaction with Siebel Web Applications, SAP Applications.
  1. New FlexTable Test Object methods available for advanced data grid controls.

Friday, 1 January 2016

AutoIt in Selenium Part 1!


In this article we are going to see the usage of AutoIt in Selenium. At the end of the article we'll be familiar in creating our own scripts for any windows application.

What is AutoIt?

AutoIt is a freeware automation language for Microsoft Windows, specifically designed for automating the Windows Graphical User Interface(GUI) and general scripting.

     It uses the combination of stimulated mouse movements, Key strokes and windows manipulation in order to automate tasks in a way not possible or reliable with programming languages like VBScripting,SendKeys.AutoIt will run on any Windows version and no specific runtime environment is required.

    It's an another automation tool which helps to automate Windows based application including Keyboard and mouse movements.Just like Selenium IDE, it's also gives us the recording capability which generates the scripts that can be used in our Test.

Features:
  • Mouse Movements: We may come across the situation which requires the exact mouse movements. AutoIt help us to stimulate the exact mouse movements.
  • KeyStrokes: We can't stimulate exact KeyStrokes using Selenium. But, AutoIt provides an option to stimulate the KeyStrokes like pressing enter key on any pop up/ entering username, password.
  • Easy To Learn: AutoIt is just like another scripting language and easy to use. AutoIt lists out all functions under menu with examples which can be referenced and used easily.
  • Non-Environment Based: AutoIt scripts can be compiled and executed on any version of Windows.We can easily convert autoIt script in .exe format which can be run on their own.
  • Windows Controls: Directly get information on and interact with check boxes, list boxes, status bars, edit boxes, buttons, combos without the risk of losing KeyStrokes. AutoIt also gives us an option to control the Windows which are not active.
  • Help Menu: Almost all menu options/functions are explained with detailed explanation and example which is very easy to use.Moreover lot of users are there to help us.
  • Windows Management: All actions like resize, move, hide, show, close and pretty much do what you want with Windows elements can be done with the help of AutoIt.
Download AutoIt:
  • Latest AutoIt version can be downloaded from here.

Thursday, 31 December 2015

How to send messages to all contacts in WhatsApp?

As many of us knew that we can't send messages to all contacts individually at a time from WhatsApp. To do this, WhatsApp has a feature called "Broadcast". By using this feature we can send messages to all contact "INDIVIDUALLY" at a go.
                      

     

In order to send messages to all contacts the following steps need to be followed.
  1. Open WhatsApp
  2. Navigate to Main Menu>Tap on "New broadcast".
  3. Tap on "+" icon and select the list of Contacts to which the messages need to be shared.
  4. Tap on "Done" and then Tap on "Create".
  5. Upon creating this broadcast group, WhatsApp will open the messaging window with the selected contacts as Recipients.
  6. Type the message and send it!.

Edit Broadcast Group:

In order to update the contacts(Remove/Add) the following steps need to be followed.
  1. Open the Broadcast list.
  2. Tap on Main Menu> Select Broadcast List info.
  3. Tap on "Add recipient" to add more contacts to the list.
  4. Tap and hold on the particular contact for few seconds and you'll be displayed with "Remove participant from Broadcast list".
WhatsApp Group Vs Broadcast List:


WhatsApp Group: All members in the group knows who all are the other members in the group.So, all members in the group knows all recipients.

Broadcast List:Its a private list.Recipients don't know the other members in the group. Each members in the list receives the messages as it was sent only to them.

Tuesday, 13 January 2015

Getting Off On The Right Foot With Your Test Automation Project Part-3!!!

Approaches For Solving Problems:

All the problems discussed in Part 1 and Part 2 have proven solutions that can help teams get through these challenges. Understanding how to approach these problems is critical to a team’s long term success.

Avoiding Locator Duplication:

Duplication in software explodes complexity and maintenance costs. Avoiding this duplication is critical as you evolve your test suite. It’s especially critical for your element locators. You can’t spend hours tracking down tens or hundreds of duplicate locators when, not if, your UI changes.Many commercial UI automation tools such as Telerik’s Test Studio or HP’s Quick Test Pro handle locator centralization for you. Those tools use variants of a repository to ensure locators are defined only once, with all tests referencing that central element repository in some fashion.Updating the repository ensures all tests get updated locator information as well.

If you’re writing your automation in coded solutions such as WebDriver, Watir, or some other API, then there are a number of approaches to simplify and handle locator definition. Teams
have long used centralized dictionaries to store name/value pairs for locator names and definitions. External settings files have also seen modest success, with each test having to load locators from this external file. Those approaches have worked well in the past; however, over the last three or four years a new approach has gradually evolved: the page object pattern. Page Object Pattern treats each page, or section of a page, as a unique class in code. Properties and methods from the page’s class represent elements and services of the page such as logging on or error messages. The Page Object Pattern
is a natural extension for developers familiar with good object-oriented development. Moreover, the various open source automation APIs have libraries and frameworks that
ease the effort around creating page objects. For example, Jeff Morgan’s Pages gem is a great addition to those writing WebDriver tests in Ruby. WebDriver’s various bindings also

include support for page objects in their native APIs.

Supporting Flexible Locator Strategies

Wherever possible, testers should generally prefer to use ID values for defining element locators. Per the HTML specifications, IDs are unique on a valid HTML page. This
ensures the automation script can quickly locate the desired element simply by scanning the DOM for that ID. It’s fast, it’s extremely flexible.

Unfortunately, some systems may not lend themselves to simple locator strategies. Frameworks and platforms may automate how they create ID values, for example, and they
may do it in a dynamic nature. In such cases it’s often possible for a developer to at least specify a prefix or suffix to the element.

If the developer can do that much, then it’s a snap to create a find logic searching for that unique value. Most commercial automation tools, and several popular open source APIs,
support defining ID-based locators via some form of “ends with,” “begins with,” “contains,” or similar approaches. This allows you to handle situations where a dynamically generated
ID has a unique suffix such as this: ctrl100_ctrl009_div_ctrl300_username.

In some cases you may not be able to use an ID for your locators. You may be working with a legacy UI which wasn’t designed with testability in mind. You may be working in a system which supports multiple widgets on a page, eliminating the ability to have unique IDs on those widgets.

These situations call for alternative approaches. You can look to name or class attributes, or you can carefully craft an XPath expression. Not all XPath is evil! It’s a tool which used wisely can be extremely beneficial. For example, it’s a snap to tie an input field to a neighboring label with XPath. Consider the following figure which shows a logon screen. The associated DOM section is highlighted below it in Firefox’s Firebug.


A simple, flexible XPath expression can be used to define the locator for that input field:

                               //label[text()=’Username’]/../input.

Locator strategies are completely unique to every system simply because each application’s UI is so wildly different from each other. You’ll need to learn how to create good locators in your own environments using the general principles shown in this section.

Solving Positional-Based Locators

In the table example shown earlier, it’s important to not rely on locators hard-wired to a specific row or column. Instead,understand how your particular automation tool or API can interact with the page. Look to create dynamic locators by querying objects to find elements underneath them match
particular criteria.

Here’s a snippet of an example in C# using WebDriver:

IWebElement table = browser.FindElement(By.XPath(“table_id”));
IWebElement targetRow = null;
IList<IWebElement> rows = table.FindElements(By.TagName(“tr”));
foreach (var row in rows)
{
if (row.Text.Contains(“Cobb”))
{
targetRow = row;
}
}

This approach ensures we’re still able to find the target row regardless of where it appears in the table. This block of code would still find the target row if it was in row one or 11.Likewise, clicking the Edit link shouldn’t be dependent on which column it appears in. Given the block above, we can
use a similar approach to find the Edit anchor by querying the target row we’d already located:

        IWebElement editLink =aRow.FindElement(By.LinkText(“Edit”));

Commercial tools offer up similar features, usually both via coded solutions and native tool functionality as well. At the end of the day, you need to understand how your tools or API
work, and leverage those features to ensure you’re crafting great locator strategies.

Resolving Dynamic Content Without Headaches

Locators are the single most important thing to understand in your system; however, dynamic content is a close second. The problem lies in the inability of automation tools to detect when an AJAX call or JQuery event is changing the content of the page. This problem spans all web automation tools from Test Studio to Selenium WebDriver. Events which cause a page load or refresh get handled by all modern automation tools, but the dynamic events are a different issue.

The common, tried-and-proven patter for creating rocksolid tests in dynamic content situations is to use explicit waits for the condition needed by the next step. A great example of this is from Microsoft’s ASP.NET AJAX control toolkit examples. The following figure shows a cascading
menu system. Each menu selection causes an AJAX call back to the server, which returns the items for the following menu based on the choice the user just made.

That tiny little server callback is what causes automation workers serious grief. It’s dynamic, it’s impacted by network conditions, and it’s always slightly different timing. Using explicit waits before interacting with a newly updated element are the key to saving your team’s sanity in these
situations. In the example above, you’d create an explicit wait for the Make dropdown to fully populate with its options, then select the particular option you want for that pass. The Model
option list would get the same treatment: an explicit wait for the exact contents to load, followed by the selection action. This pattern of an explicit wait coupled with an interaction is a
tried, proven strategy for every dynamic content situation. The pattern is the same regardless of whether you’re waiting on content or controls to appear on the DOM, or even an existing
control to change its state (inactive to active, eg).

Implementing waits in your test scripts is completely dependent on the tool or API you’re using. Telerik’s Test Studio uses a Wait step; WebDriver utilizes the WebDriverWait class in the support namespace. Other tools and APIs have similar features. Explicit waits eliminate the frustrating intermittent failures due to synchronization issues around dynamic content.

Helping Maintainability by Supporting Good Design

You’ve seen how good design for storing element locators helps teams create maintainable tests by eliminating duplication around element locator definitions. The same concept of test or method reusability is just as critical to good test case creation. The ability to compose elaborate tests from
smaller building blocks ensures teams aren’t wasting valuable time updating the same functionality across multiple tests when a part of the system’s workflow changes, for example. Design each test such that it’s granular, specific, and doesn’t rely on other test cases first. This enables you to reuse
functionality such as logging on to a system or entering customer data.

Composability and reuse don’t have to be at the page level, either. You can look to break down complex forms into small pieces of functionality designed to handle one specific responsibility such as customer identification, ticketing, etc.Careful reuse of functionality lets you write more accurate,
thorough tests at a much faster rate - and at the same time dramatically decreases maintainability costs.

KEEPING YOUR AUTOMATION SUITES SANE, STABLE, AND MAINTAINABLE

The approaches in this paper aren’t a magic panacea for everyone’s automation woes. UI automation is an incredibly hard problem, and it’s completely different for each application. You’ll have to learn the fundamentals of your application works, and you’re still responsible for ensuring you’re creating solid automation tests. Spend time learning how to get past the basic domain problems like locator strategy, dynamic content synchronization, and support for good test case design. That leaves you more time to focus on the real problem, which is how to deliver more great value to the projects you’re working on.

 
Back To Top