ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Testing >> Automation Testing >> QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions (496)
 Load Runner interview questions  Load Runner Interview Questions (486)
 QTP interview questions  QTP Interview Questions (3506)
 Test Director interview questions  Test Director Interview Questions (161)
 Rational TestSuite interview questions  Rational TestSuite Interview Questions (106)
 Silk Test interview questions  Silk Test Interview Questions (59)
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions (386)
Question
How to get Links count in an web application,without 
descriptive programming?
 Question Submitted By :: QTP
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
You can just palce page check point on that page,it will
give you the details like number of images ,number of links
etc in the page.
 
Is This Answer Correct ?    4 Yes 0 No
Saidev
 
Answer
# 2
This Script is Helpfull to count the No.of links in a web
page

Step1: Set Objects = Browser("BrowserName").Page
("PageName").ChildObjects

Step2: Objectcount = Objects.count
Linkcount = 0
Step3: For i = 1 to Objectcount-1

Link = Objects(i).GetROProperty("micclass")
If Link = "Link" Then
Linkcount = Linkcount+1
msgbox Linkcount
End If
Next
msgbox Linkcount ' It show total number links
 
Is This Answer Correct ?    7 Yes 5 No
Chaitu
 
 
 
Answer
# 3
Hi guys
Here we have to use the description object.Its working with
me.Just try it out.



Set oDesc = Description.Create()
oDesc("micclass").Value = "Link"
Set Lists = Browser("Google").Page("Google").ChildObjects
(oDesc)
NumberOfLists = Lists.Count()
linkcnt = 0
For i = 0 To NumberOfLists - 1
linkcnt = linkcnt+1

Next
msgbox linkcnt

Regards
raghava
 
Is This Answer Correct ?    2 Yes 0 No
Raghava
 
Answer
# 4
here is an example to get the link count in google page
Just try out this

SystemUtil.Run ("www.google.com")
Set Links = Browser("title:=.*").Page("title:=.*").Object.Links
Msgbox "Total links: " & Links.Length
 
Is This Answer Correct ?    1 Yes 0 No
Priya
 
Answer
# 5
POSTED BY -CHAITU
This Script is Helpfull to count the No.of links in a web
page

Step1: Set Objects = Browser("BrowserName").Page
("PageName").ChildObjects

Step2: Objectcount = Objects.count
Linkcount = 0
Step3: For i = 1 to Objectcount-1

Link = Objects(i).GetROProperty("micclass")
If Link = "Link" Then
Linkcount = Linkcount+1
msgbox Linkcount
End If
Next
msgbox Linkcount ' It show total number links
--------------
This code is not working.

Check it out.
Link = Objec(i).GetROProperty("micclass")
Error is here.
 
Is This Answer Correct ?    1 Yes 1 No
A
 
Answer
# 6
'Hi, we can use "innertext" as a unique property of link.
'Name may be changes in the runtime. And we can use the
index number to identify the link in the execution.
(NOTE:-We dont use index to retrive the child objects.why
because each child object have different index number.)

TRY THIS CODE:--------THIS WIL WORK FINE.

set olink=description.create()
oDesc("micclass").Value = "Link"
set chobj=browser().page().childobjects(olink)
n=chobj.count

msgbox n

for i=0 to n-1
val1=chobj(i).getroproperty("innertext")
msgbox val1
Next


Any doubts----mail to------ mskalyan.smile@gmail.com
 
Is This Answer Correct ?    1 Yes 1 No
Kalyan
 
Answer
# 7
Hi friends,

set odesc=description.create()
set odesce("htmltag").value="a"
set lists=browser("b.name").page("p.name").childobjects
(odesc)
set counter=lists.count
msgbox "total no.of links"& counter
for i=0 to counter-1 step 1
set link=lists(i).getroproperty("name")
msgbox link,0,"curren link is"
Next


The above script works correctly.
 
Is This Answer Correct ?    0 Yes 2 No
Venkatesh.m
 
Answer
# 8
Hi Friends ,
Above Ans #5 gives syntax mismatch error.
Find below correct code.

set odesc=description.create()
oDesc("micclass").Value = "Link"
set lists=browser("Welcome: Mercury Tours").page("Find a
Flight: Mercury").childobjects(odesc)
counter=lists.count
msgbox counter
for i=0 to counter-1 step 1
name=lists(i).getroproperty("name")
msgbox name,0,"curren link is"
Next
 
Is This Answer Correct ?    0 Yes 2 No
Sudhir
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
wt is automation framework? give explonation? Mindlance 1
Expalin Text/Text Area Checkpoint Crea 1
what is a active x control?can any one brief me about active x controls   1
What is Reusable component is QTP...Anybody can answer it..Thanks in advance... Siemens 8
how to validate email?email ie correct or not ?with below conditions. 1)before @(symbol) only alphbates and min 4 char to max 15 chars. 2)before @(symbol) only alphabates dont use ant special chars or numarics 3) after @(symbol) only one dot(.)symbol for ex:abc@gmail.com it is valid email or not based above conditons Aspire 2
How to Get the Run-time value of an object under that web app under Test to the local data table sheet of that Action?   2
How does u create new test sets in TD? Crea 1
QTP Testing Process?   1
In QTP I have a parameter in a datatable that is a sentence. I need to take the last word from the sentence and enter it into a field in a web application. How can I setup a parameter to enter in just a portion of the parameter (last word of the sentence) instead of the entire paramater (whole sentence).   2
there are having 10 checkboxes..how can i check only first 5 check boxes by using descriptive programing.. HealthAsyst 9
DIFFERENT RUN MODE IN QTP..1-VERIFY MODE 2-UPDATE MODE 3- dEBUG MODE. My question is in whic sitution we use these modes Explain me with example   1
I dont know how to configure non standard objects to standard objects in QTP9.2 can i have someone explain me in breify? Wipro 3
 
For more QTP Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com