How to capture dynamic objects in qtp like mark up text
Answer Posted / deven
To capture the value of a dynamic object in a web
application GetROProperty method is executed. In order to
capture the value of an object and that too of a dynamic
object then we will use the GetROProperty which means Get
Run Time Object Property and we need to decide which
property we want to capture. This can be text innertext etc.
I would list down a sample code for gmail to count unread
emails from any account.
Since the inbox count is dynamic and ever changing from
account to account i have used descriptive programming so
that this piece of code can be run for any gmail account.
The prerequisite is that you log in to your gmail account
and then run this script
This script prints the number of unread emails in the inbox.
inboxcount = Browser("title: Gmail.*").Page("title:
Gmail.*").Link("innertext: Inbox.*").getroproperty
("innertext")
If inboxcount = "Inbox" Then
Print "No Unread Emails"
ExitAction
Else
emailcount = replace(inboxcount, "Inbox","") 'replaces
inbox with space
emailcount = trim(emailcount) 'removes all the spaces
emailcount = replace(emailcount, "(","")
emailcount = replace(emailcount, ")","")
Print "You have "&emailcount& " unread emails in your inbox"
End If
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the steps involved in the recovery scenario wizard?
What is checking bitmaps?
What is a checkpoint? How many check points are there in qtp?
Explain different recording modes?
How many ways we can parameterize data in quicktest professional?
what is the hierarchy to use properties in descriptive programming
How to get the particular property value?
I need Major Help with a Script I recorded in QTP 9.5. I am recording scripts for a Web-based application(s) I have all the URLs for each application in Excel spreadhsheet so that QTP can pull that particular application from the spreadsheet and run it. The problem is QTP isn't recognizing one particular URL so when I hit run in QTP to run this script it opens the internet Explorer but isn't open the URL I have in the Excel spreadsheet. I've retyped the URL and still QTP won't open this Particular one for some reason. The site its self is working fine but for whatever reason QTP won't open it. How do I resolve this? I have a deadline of next Friday the 7th to complete this task so please help me in any way you can. Thanks in advance
How to use userdifined environment variables.Once we created in Environment tab which is at File--> Settings-- >Environment-->Userdifined
Limitations in QTP?
How to create a standard checkpoint ?
What is a recovery scenario?
Are Shared ORs read-only?
hi i have 4 yrs exp in manual and automation testing using QTP i need sample resumes plz can u send this mail id pbre1980@gmail.com
How the exception handling can be done using quicktest professional (qtp)?