Saturday, November 22, 2014

What is the General Process of Capturing Tool Tip via QTP ?

General Process of Capturing Tool Tip via QTP:
1. Hover your mouse to check whether UI element has any tool tip assosiated with it.
2. If Yes, Use 'Object Spy' and check properties which contain Tool Tip Value.
3. Mostly, you will fing Tool Tip in 'Title' Property.
4. Use GetRoProperty to fetch the value.

Ways to Capture Tool Tip via QTP
There are 4 ways by which we can capture Tool Tip in QTP. These are from:
1. Link 2. Image 3. X Path 4. CSS

1. With Link ( If there is any link on a website and you hower the mouse over the Link, a tool Tip appears. Now, how to capture the same with our tool.
msgbox Browser ("Edit Experise- QTPExpertise"). Browser: Edit  Experise- QTPExpertise
Page ("Edit Experise- QTPExpertise"). |__ Page:  Edit Experise- QTPExpertise
Frame ("Result"). |__Frame: Result
Link ("Expore More"). |__Link: Explore More" GetRoProperty ("title")
                                                                                ______________________________________
Properties | Operation ______________________________________
o   Native o   Identification
Properties | Values
outertext |
target |
text |
title | QTP Expertise Homepage
________________________________________________________________________________
From Image 
( If there is any image on a website and you hower the mouse over the image, a tool Tip appears. Now, how to capture the same with our tool).
msgbox Browser ("Yahoo!"). Bowser: Yahoo!
Page ("Yahoo"). |__ Page: Yahoo
Webelement ("India").  |__ Web element: India
GetRoProperty ("title")
_________________________________________________________________________________
Using X Path
(Suppose you are creating account and there are informations like First name, Middle name & Last Name where Middle Name is optional. How to capture the same)
First Name*
Middle Name (optional)
Last Name*
To Capture, Middle Name, whic is optional, Here, we will take the help of X Path. We will follow the steps below:
- Open this link in Google Chrome Browser.
- Right Click on the page and click 'Inspect Element'.
- Use Little magnifying glass on left and inspect 'middle name edit box'.
- Highlight the row > Right Click > Copy X Path
          ( Suppose it is //*[@id='ss2'])

It will look like:
msgbox Browser (" WebAccount: Tooltip"). Page ("WebAccount: Tooltip").
webelement ("xpath := //*[@id='ss2']").
GetRoProperty ("innerhtml")
_________________________________________________________________________________
Using CSS 
(Suppose you are creating account and there are informations like First name, Middle name & Last Name where Middle Name is optional. How to capture the same)
 First Name*
 Middle Name (optional)
 Last Name*
 To Capture, Middle Name, which is optional, Here, we will take the help of CSS. We will follow the steps below:
 - Open this link in Google Chrome Browser.
 - Right Click on the page and click 'Inspect Element'.
 - Use Little magnifying glass on left and inspect 'middle name edit box'.
 - Highlight the row > Right Click > Copy CSS Path
 ( Suppose it is //*[@id='dp2'])

It will look like:
msgbox Browser (" WebAccount: Tooltip"). Page ("WebAccount: Tooltip").
webelement ("csspath := //*[@id='dp2']").
GetRoProperty ("innerhtml")

No comments:

Post a Comment