Monday 30 September 2013

UFT/QTP- Synchronization


how to use sync method in qtp, sync in qtp, sync method in qtp, syntax for sync in qtp


Synchronization:

Synchronization point is nothing but time interface between Tool and Application build. Generally Synchronization point is to give waiting time to the tool before executing next step in Test script.

Different methods in QTP for Synchronization:

1. Wait statements.
2.  Exist Statements.
3. Sync Method (Only for WEB).
4. Inserting Synchronization points.
5. Increasing Tool default synchronization time.

Wait Statements:

Wait statements are used when we want QTP to wait for specified time, so that AUT completes its current operations.
Wait (n) statement waits for specified 'n' seconds.
Wait () statement without specifying the seconds will make QTP wait up to maximum time, even though operations is completed.

Example:

Systemutil.Run "iexplore.exe","http:\\www.gmail.com"

 ‘Wait for 5 sec for Gmail browser launch
Wait 5

 ‘Enter Email id in Username Field
Browser ("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Email").Set  "qtpworld.com"

 'Enter password in Password Field
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Passwd").Set  "qtp"

 'Cick on the Sign In Button
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebButton("name:=Sign in").Click

Exist Statements:

We can enter Exist statements to instruct QuickTest to wait for a window to open or an object to appear. Exist statements return a boolean value indicating whether or not an object currently exists.

Example:

Systemutil.Run "iexplore.exe","http:\\www.gmail.com"

 'Wait till Gmail browser exists
Do while  Browser("title:=Gmail: Email from Google").Exist(1) = False
 Wait 1
Loop

 'Enter  Email id in Username Field
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Email").Set  "qtpworld.com"

 'Enter password in Passowrd Field
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Passwd").Set  "qtp"

 'Cick on the Sign In Button
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebButton("name:=Sign in").Click

 Sync Method: (only for WEB)

Waits for the browser to complete current navigation operation.
Syntax:
Object hirearchy.Sync
Example:

 Systemutil.Run "iexplore.exe","http:\\www.gmail.com"

'Wait till Gmail browser launches
Browser("title:=Gmail: Email from Google").Sync

' Enter  Email id in Username Field
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Email").Set  "qtpworld.com"

 'Enter password in Password Field
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Passwd").Set  "qtp"

 'Cick on the Sign in Button
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebButton("name:=Sign in").Click

 Inserting Synchronization points:

Synchronization point is nothing but time interface between Tool and Application build. Generally Synchronization point is to give waiting time to the tool before executing next step in Test script.
Steps to follow for Inserting Synchronization points:

Position cursor in desired location-->QTP should be in recording mode-->Insert menu-->Synchronization point -->Show the object -->click OK-->select property name and Value (True)-->enter time in Milli seconds-->click OK-->Stop recording.

Increasing Tool default synchronization time:

Default Time in QTP is 20 Seconds.

Steps to follow for Increasing default synchronization time:

File-->settings-->run tab-->increase object synchronization time out-->Apply-->OK

Wednesday 4 September 2013

uft 11.5 trial version installation

Download UFT 11.5 Trial Version from HP

HP has released the latest version of QTP and it is being called HP Unified Functional Testing (UFT) 11.5. As mentioned in the previous article on the features of the new UFT 11.5, the trial version of UFT 11.5 is now available for download from HP website. The trial period of the software is 30 days.
You can either check the below video or follow the step by step approach (provided after the video) to download UFT 11.5 from HP website.

Steps to Download UFT (QTP) 11.5 from HP website

1) Go to UFT 11.5 download link. You will be navigated to the page shown in the below screenshot.



2) Click on the trial software section to expand it. Once expanded, you will see the links for various trial software that are currently available for download.




3) Click on ‘HP Unified Functional Testing 11.50 CC English SW E-Media Evaluation’link. You would be taken to a page where you would need to provide your personal details as shown below.


4) Enter all the mandatory details and then click on Next button at the bottom of the page. If all the details are filled in correctly, you will be navigated to the ‘Terms of Service’ screen as shown below.
5) Click on “I Agree” to move to the main download screen as shown in the below image.


6) Click on the Download link to download the software. The software will be downloaded as a ZIP file.
As shown in the above image also, the size of UFT 11.5 is around 1.7GB. Downloading the software will take 1-2 hours (depending upon the internet speed).

Tutorial - Go to Websites Script on UFT Mobile

uft mobile tutorial

The UFT version of this script, is split into three actions:
Pre:

The home command brings the phone to its idle state and it is recommended to start all scripts with it as they allow us to start from a known location.

Action:





This action loops over a data table, with a local data table and a call property running on all rows.
























WebBrowser.Goto

This command, opens the browser and directly it to a URL. The URL comes from the data table.
This command is available on Android and iOS devices.

















Wait

This command waits for the time specified to pass. It is used here to give the browser time to load the page. 
It is also possible to create a more advanced sync function that will check the screen of the phone to determine when the page has loaded.

Post




It is good practice to end the script in the home screen, so the home command is used at the ending as well as the beginning of the script

Mobile testing with UFT (QTP) 11.5

Mobile testing with UFT (QTP) 11.5

HP recently announced its official mobile test automation solution – UFT Mobile – jointly developed by HP and Perfecto Mobile. This solution allows users to naturally extend their existing HP Functional Testing and Application Lifecycle Management environment to mobile applications.

To address key challenges in testing mobile applications across multiple devices in a highly fragmented market, UFT Mobile leverages two specially designed capabilities with respect to object recognition and analysis. These features are known as Hybrid Object Support and Hybrid Test Automation (for closed operating systems like iOS).

Hybrid Object Support in HP UFT Mobile

UFT Mobile utilizes a hybrid approach to object recognition, combining the use of visual object analysis and object level analysis. Such an approach enables users to choose the most appropriate object recognition technique for a given script, based on the application’s complexity and various testing scenarios, without compromising quality.

Highlights:

Seamlessly leverage HP ALM suite for mobile and assure high quality deliverables for business critical mobile applications.

Streamline test development and execution (manual and automated testing) using patented ScriptOnce™ device-agnostic technology.

Ensure continuous delivery of your mobile project and perform product monitoring and analysis in production.

Access and test on real smartphones and tablets connected to live networks around the world, using perfecto mobile MobileCloud™ platform.

Rich Feature Set:

Full back-end integration with HP Quality Center – Native UFT scripting, data and report structures enable centralized test management and cross-organizational visibility of your mobile apps via HP Quality Center.

Native, image, text based and hybrid object recognition – Accurate and dynamic object recognition supports complex testing scenarios in a single script, facilitating the deployment of secure, device-agnostic mobile testing.

Secure cloud-based access to real devices - Access and test on hundreds of mobile devices from inside UFT.

Keyword-based mobile scripting – Device-agnostic, keyword-based scripting, along with high-level intelligent mobile-specific functions (e.g., press keys, open browser, select image, type text, etc.), enables fast and easy script creation, maintenance and porting across mobile platforms.

Rich image-enhanced reports - Complete testing information, including active screenshots and video recording, is embedded into the UFT report.