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 types of object repositories? Which one is you are using?
Do you know how to connect database? Can you tell me the procedures?
Consider one application is open, clicking one menu will open another application in another browser. QTP does not catch the URL of the second browser(second application). can we capture it ?
hi in real time who will execute the qtp test scripts? my faculty said, in a companty automation testers are written the test scripts and manual testers are execute the test scripts...IS IT RIGHT OR NOT?
what is the difference between the modular framework and datadriven frame work
How to get Traceability matrix from TD?
Hi Guys, I want to place all of my values which i am getting it from a loop in to a global shee. For that i had written the script like this For i = 1 to ECOs-1 ECO = List(i).GetROProperty("innertext") DataTable.AddSheet("ECOList") DataTable.GetSheet("ECOList").AddParameter "ECOList",ECO AbortECO = DataTable.GetSheet("ECOList").GetParameter ("ECOList").Value msgbox AbortECO DataTable.GetSheet("ECOList").SetNextRow Using the above script, whenever the loop iterates it is creating new column "ECOLIST" in the sheet called "ECOLIST". It means, the values are displaying in the column wise even though i added the script " DataTable.GetSheet("ECOList").SetNextRow" . The cursor is not moving to the next line. Anybody help me out how to pass the values from script to the excel(Global/Local) sheet. Pls let me know @ nbabu11@gmail.com if you are not clear about the question.
I want to know what are QTP functons and what are VB script functions. What is the difference between them.When we have to use these functions.
How to modify the text checkpoint?
Could anyone help me for the below scenario: i am using the descriptive programming for my account, in which we have to generate the contract in the MS-word. when i generate this doc, we need to click on enable macros to continue further. but i am unable to make qtp to click on this. if anybody faced the problem like this??? pls help to get it resolved? Thanks in advance
How to use output values in qtp ?
How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?
Why do you create a text checkpoint on a Web application? What is the purpose of the Close method?
What is qtpro? What is a quick test professional?
how to do the batch testing in test director using manual testing procedure?