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 (495)
 Load Runner interview questions  Load Runner Interview Questions (486)
 QTP interview questions  QTP Interview Questions (3474)
 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 (382)
Question
How to get Links count in an web application,without 
descriptive programming?
 Question Submitted By :: Vamcit
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to get Links count in an web application,without descriptive programming?
Answer
# 1
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 ?    6 Yes 4 No
Chaitu
 
  Re: How to get Links count in an web application,without descriptive programming?
Answer
# 2
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 ?    3 Yes 0 No
Saidev
 
 
 
  Re: How to get Links count in an web application,without descriptive programming?
Answer
# 3
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
 
  Re: How to get Links count in an web application,without descriptive programming?
Answer
# 4
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
 
  Re: How to get Links count in an web application,without descriptive programming?
Answer
# 5
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
 
  Re: How to get Links count in an web application,without descriptive programming?
Answer
# 6
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
 
  Re: How to get Links count in an web application,without descriptive programming?
Answer
# 7
'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 0 No
Kalyan
 
  Re: How to get Links count in an web application,without descriptive programming?
Answer
# 8
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
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
Hi, My Application in Microsoft Dynamic Navision, is it compitibale with QTP? if yes then let me know...and also let me know is there any other automation tool availabe to automate Microsoft Dynamic Navision. Thanks Sandip. +91-9714177088   1
Can any one give me some basic VB script used in QTP ?As i am new in QTP.Give sample VB script used in QTP? PLZ   3
Dim ExcelSheet Set ExcelSheet = CreateObject("Excel.Application") excelsheet.application.visible = true ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A, row 1" ' Save the sheet. ExcelSheet.SaveAs "C:\DOCS\TEST.XLS" ' Close Excel with the Quit method on the Application object. ExcelSheet.Application.Quit after run this script i am getting error"The test cannot continue due to unrecoverable error"   3
is it possible to check the text displayed in the tool tip using QTP? if so, how?   6
with out object repository i need to launch IE and then navigate to a login page and then operate the objects within the page. How will be the script? Ordain-Solutions 3
How to call .vbs functions in QTP? plz Explain indetail Wipro 3
want to learn real time automation project(QTP)?   1
What is action required by QTP if a popup message is coming in exsisting script and now it is not coming. The script is having code to deal with popup message now when we run the script now the popup i snot coming according to new build, instead of changing the code what we can do? Verizon 7
Pls answer this: What is the difference between a subroutine and a function? A. A subroutine can call itself; a function cannot B. A function returns a value; a subroutine cannot C. A function can accept arguments; a subroutine cannot. D. A subroutine can call other procedures; a function cannot.   1
hello everyone, can anybody please tell me what are the different recording modes of QTP, and where these recording modes are present in QTP 9.2. Thanks in advance, Gaytri   7
Can you expect major bugs in Net banking Application?   1
if you run one test script in internetexplorer the same test you run in mozilla ffirefox is it possible or not how is it. Satyam 1
 
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