Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

Showing posts with label MindMaps in QTP. Show all posts
Showing posts with label MindMaps in QTP. Show all posts

XPath Object Identification in UFT descriptive programming

UFT also supports XPATH and css together with descriptive programming, object repository and DOM for object Identification.

Xpath stands for Xml Path. Below are some XPath examples to be used with UFT. Xpath and css are most widely used object identification way in selenium also.


Xpath examples:

Id: 

Browser(...).Page(...).weblink("xpath:=//a[@id='linkuft']").click

Attribute Value:

Browser(...).Page(...).weblink("xpath:=//a[@Atttribute='goodclass']").click

text:

Browser(...).Page(...).weblink("xpath:=//a[text()='UFT']").click 

partial attribute value

Browser(...).Page(...).weblink("xpath:=//a[starts-with(@attribute,'goodclass']").click

Browser(...).Page(...).weblink("xpath:=//a[contains(@attribute,'goodclass']").click

Browser(...).Page(...).weblink("xpath:=//a[ends-with(@attribute,'goodclass']").click


To know details on what is CSS and XPath and how to capture CSS or xpath of an element. refer to

XPath and CSS for selenium/UFT

We can use tools like firebug/firepath or IE developer tool to identify the xpath/css of an element.

xpath is really useful when element is not identified diretly based on Object repository properties and used to
identify an element based on relative element existence based on other elements in the tree.

Environment variable in UFT : 10 Key points

1. Definition - Environment variables are variables used across QTP Scripts/ all actions in a script/recovery scenario/function libraries in a UFT script.
Understand them as global variables for UFT Test Scripts.

2. Types of Environment Variables:
Environment variables are of 2 types: 
a. Built in Variables
b. User Defined Variables

3. Built -in variables are defined in QTP and can provide information on the QTP scripts and the operating system.

4. User Defined variables are again be divided into two types: 
       a. User Defined - Internal - defined at test level by adding a new environment parameter.
       b. User Defined - External - imported for an external xml file with parameters and values for parameters defined in the external file.




5. Steps to add user defined environment variables:

a.) In the test in which environment variable are to be added, Go to file -> Settings -> Environment.
b.) In variable type, select user defined. 
c.) Click on + icon, and add a new parameter with name and value.

6. To import from external file, check checkbox to load from external file and provide the path of the external file.

7. Environment variable for external file can be imported through code as shown below:

fileName = Environment.ExternalFileName

if (fileName = "") Then

    Environment.LoadFromFile("C:\testEnv.xml")

End If

8. Access and update environment variable in the script:


''Acessing an environment variable:

Testval =  Environment.Value("testing")

''Updating an user defined variable

Environment.Value("testing") = "testing2"

9. Example of environment variable xml file


<Environment>
 <Variable>
  <Name>Environment1</Name>
  <Value>ValueA</Value>
 </Variable>
 <Variable>
  <Name>Variable2</Name>
  <Value>ValueB</Value>
 </Variable>
</Environment>


10. Useful Reference: 


http://gareddy.blogspot.in/2010/12/qtp-environment-variables.html

http://qaautomationqtp.blogspot.in/2013/05/environment-variables-in-qtp.html

Summary

environment variable summary


Mind Maps: Add-ins in Unified functional testing

Mind Maps: Add-ins in Unified functional testing

In this article mindmap for Add-ins in UFT is explained:


1. Web Add-in Extensibility extends Web  Add-in to customize how UFT recognizes  and interacts with different types of controls

2. We can add or remove add-ins associated  with test in UFT

3. UFT license enables the use of all UFT add-ins.

4. Add-ins in UFT are broadly classified as web  based and windows based application support

5. UFT add-ins help you to create and run tests  and business components on applications  in a variety of development environments.

6. We can define run and record setting for each  of the environment once the add-in is loaded

Mindmap explaining automation framework

In this mind map, we will discuss on automation framework in QTP explaining:


What is automation framework, what are different types of framework, what are key features of an automation framework and expectations from an automation framework:


Mindmap explaining automation framework

Content in the mindmap:
Automation  Framework in QTP
1. Set of Guidelines
1.1 Coding standards
1.2 Structure of test Data
1.3 Folder structure
1.3.1 Test Scripts
1.3.2 Test Libraries
1.3.3 Test Data
1.3.4 Test results
1.4 Object Repositories


2. Decisions
2.1 Decide automation framework to be used
2.2 Decide object Identification technique
2.3 Decide on set of automation guidelines

3. Framework Types
3.1 Linear
3.1.1 Script created by recording on AUT
3.1.2 Script creation is simple, fast and require minimal knowledge
3.1.3 No reusability of code and  high maintenance cost
3.2 Functional Decomposition
3.2.1 Divide test into logical groups or functions
3.2.2 Reusability of code is better
3.2.3 Scripts cannot be run with multiple set of data
3.3 Data Driven
3.3.1   Test data stored in external files drives automation by executing scripts with multiple sets of data
3.3.2 Covers multiple scenario with same script and change in data does not require change in scripts
3.3.3 Additional effort of creating test data and good knowledge of tool for resource
3.4 Keyword Driven
3.4.1 Object, action and arguments are maintained in an excel sheet in form of keywords
3.4.2 Highly reusable code can be used across applications. Once framework is created, easy to create test scripts.
3.4.3 Initial investment in creating framework is high and understanding framework for new user is comparably difficult
3.5 BPT Framework
3.5.1 BPT Components linked together to create test script using Quality center.
3.5.2 Easier for business users to create scripts
3.5.3 License cost of BPT and dependency on QC
3.6 Hybrid Framework
3.6.1 Uses best features of various frameworks
3.6.2 Highly robust and maintainable if properly implemented
3.6.3 Require skilled automation experts.


4. Great Expectations
4.1 Framework should Support Versioning Controlling for files
4.2 should be executed in different environments
4.3 minimal change in script for object changes
4.4 Robust and easy to interpret reporting system
4.5 Should have strong error handling and recovery scenarios

MindMap: Testing Process in QTP

In this article, we will discuss the mindmap for testing process in QTP (the same approach can be used with other tools also).Below are the steps in the testing process for QTP to be followed:
  • Analyse the application under test
  • Perform a proof of concept for understanding automation feasibility.
  • Design the automation test strategy and automation framework
  • Create test scripts and integrate with external tools like quality center or ALM.
  • Execute test scripts.
  • Define strategy for support and maintenance of automation suite.

Testing process in QTP/ UFT
MindMap explaining testing process in QTP