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
Explain different types of checkpoints?
What are the recording modes in wave event?
Tell me about your project? please help me how to tell about insurance project
Without integrating QC/Testdirector with QTP, is it possible to keep track of the defects?If yes how? How to export QTP results to an excel sheet?
How can we retrieve the Bug Ids which are open&Reopen in status through QTP scrit?Please find the script which i tried... Dim objBugFactory, objBug Dim BugId Set TDConnection = QCUtil.TDConnection Set objBug = TDConnection.BugFactory If QCUtil.IsConnected then Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.TDConnection.ServerName + chr (13) +"Project: " + QCUtil.TDConnection.ProjectName + chr (13) + "Domain: " + QCUtil.TDConnection.DomainName Reporter.ReportEvent 0, "Current time on server is","==>" & TDConnection.ServerTime Else Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center" End If If mybug.Status="Open" Then BugId=mybug.DefectId MsgBox BugId End If 'OR**********************************--------------------- -----********************************** If Bug_Fields("BG_STATUS").Value ="Open" Or "Re Open"Then BugId=Bug_Fields("BG_BUG_ID").Value MsgBox BugId End If
What is standalone database?
can i change the runtime properties of an object ? How can i check if a parameter exists in database ?
What are the features and benefits of quick test pro (qtp 8.0)?
Explain different recording modes?
Can anybody let me know how to test the Drag and drop feature of the column in a .net application...eg..i hav to test the drag and drog feature of a table(swftable) in a application..plze help!!
What is TOM in QTP?
Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?
I want to do QTP Certification what is the pattern of Question paper.
Does QTP have any limitations?Can it work with all kinds of programming languages like java,springs,ajax ,hybernet?Also does it work well with windows 7.What are its other limitations
How is recording done when a application is over lapping the QTP application it gives a message object not recorded