How to capture dynamic objects in qtp like mark up text
Answers were Sorted based on User's Feedback
Answer / sanju
by usng smart identification method or by using descriptive
programming
Is This Answer Correct ? | 6 Yes | 4 No |
Answer / 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 |
How to create Reusable and Multiple Actions?
How can we use the "CreateObject("Shell.Application")" in QTP and what is the definition and purpose of it?
If an application name is changes frequently i.e while recording it has name "Window1" and then while running its "Windows2" in this case how does QTP handles?
Please can you give where can we get good QTP Training at Hi-Tech city Hyderabad?
After geting the modules where we generate the script ie in qtp or notpad ?
Hi, I have a login page. To login in that page I need to have a valid username and password, which is stored in database. I imported that table to my DataTable in QTP (Global sheet). Now I need to write a code in qtp so that I can login only with valid username and data. my condition is : I want to get username and password from inputbox(which i did) and click on login button- which should verify the datatable for username and password and if value is present only then lofin else stop the testing. DataTable contains columns : LoginName and Password Code: Rowcount= DataTable.GetSheet("Global").GetRowCount msgbox "RowCount= " &RowCount,1 CurrentRow= DataTable.SetCurrentRow(1) Do Browser("").Page("").Frame("Frame").WebEdit("ctl10$ct l00$ctl00$UserName$ctl").Set DataTable("LoginName",1) Browser("").Page("").Frame("Frame").WebEdit("ctl10$ct l00$ctl00$Password$ctl").Set DataTable("Password",1) Browser("").Page("").Frame("Frame").Link("Login").Cli ck CurrentRow=CurrentRow+1 Loop Until CurrentRow>Rowcount Can anyone help? Thanks, Priya
I need to pull the data from the page which in row, column vice into excel sheet, how can it be done using QTP? eg: Name Dept xyz gdty i need the same data to be exported in excel sheet.
wt is the xtension of the QTP result view file?
Explain about Hybrid Framework
In automation testing Can we retest virtual object in the application after getting new version from the developers, is there any property will change for that object or it won't.?
how are environment variables used in real time projects (testing)?what answer should be given about this in interview.need real time explanation breifly?thnx in advance.
QTP identified the object but not performing the desired action???what could be the reason?????