ALLInterview.com :: Home Page KalAajKal.com
 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                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
To count the no of links present in the yahoo home page i 
have written the script like this
Set fileSysObject=createobject("Scripting.FileSystemObject")
Set linksFileName=fileSysObject.opentextfile
("D:\samplelinkfile.txt",2,true)
Set linkDescObj=description.Create
linkDescObj("micclass").value="Link"
Set noOfLinks=browser("yahoo").Page("Yahoo!
India").ChildObjects(linkDescObj)

For i=0 to noOfLinks.count-1
	linkName=noOfLinks(i).getROProperty("name")
	linksFileName.writeline(linkName)
Next
linksFileName.close
Set fileSysObject=nothing

While running the script it showing error that 
object "yahoo"isnot found in the object repository.
Is there any setting before running the script? if yes what 
is the steps for it.Im using QTP9.0   

 Question Submitted By :: Er.jayanta
I also faced this Question!!     Rank Answer Posted By  
 
  Re: To count the no of links present in the yahoo home page i have written the script like this Set fileSysObject=createobject("Scripting.FileSystemObject") Set linksFileName=fileSysObject.opentextfile ("D:\samplelinkfile.txt",2,true) Set linkDescObj=description.Create linkDescObj("micclass").value="Link" Set noOfLinks=browser("yahoo").Page("Yahoo! India").ChildObjects(linkDescObj) For i=0 to noOfLinks.count-1 linkName=noOfLinks(i).getROProperty("name") linksFileName.writeline(linkName) Next linksFileName.close Set fileSysObject=nothing While running the script it showing error that object "yahoo"isnot found in the object repository. Is there any setting before running the script? if yes what is the steps for it.Im using QTP9.0
Answer
# 1
Yes, this will give an error if you dont have the objects 
(Browser and page) in the OR. So, here is what you can 
do...open a new test and record any operaiton on yahoo page 
and then later remove the steps generated in Expert view by 
reocrding and later paste this code...i think this should 
work
 
Is This Answer Correct ?    0 Yes 1 No
Rico
 
  Re: To count the no of links present in the yahoo home page i have written the script like this Set fileSysObject=createobject("Scripting.FileSystemObject") Set linksFileName=fileSysObject.opentextfile ("D:\samplelinkfile.txt",2,true) Set linkDescObj=description.Create linkDescObj("micclass").value="Link" Set noOfLinks=browser("yahoo").Page("Yahoo! India").ChildObjects(linkDescObj) For i=0 to noOfLinks.count-1 linkName=noOfLinks(i).getROProperty("name") linksFileName.writeline(linkName) Next linksFileName.close Set fileSysObject=nothing While running the script it showing error that object "yahoo"isnot found in the object repository. Is there any setting before running the script? if yes what is the steps for it.Im using QTP9.0
Answer
# 2
Hello buddy,

Do not bother about this type of small errors.

No need to open new test and record on yahoo page and again 
pasting that code here in your code. all these long 
process.ofcourse it may work. as a QTP profession you have 
to go in efficient way. 

Follow this steps.

Once you got that error message.

1. Just Open OR
2. Click on Add Objects button
3. Select your desired objects here (Links your case)
4. Click on Ok

go back to your test and run your test now. 

if it not runs, delete your "browser("yahoo").page
("yahoo")... all these things

just add this code
systemutil.Run "www.yahoomail.com"
Set noOfLinks=browser("Yahoo! Mail: The best").Page("Yahoo! 
Mail: The best").ChildObjects(linkDescObj)

it will work. no probs

All the best
 
Is This Answer Correct ?    1 Yes 0 No
Baba
 
 
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
i ve an excel in a QC folder. Thru my QTP script i want to open that excel in runtime. I am running this script from QC itself TCS4
how can i pass parameters into function? Livetek3
Can u explain about QTP framework ACS9
Hi, is it possible for recording shortcut key during record session? The application on which I am working is web based application. This application has several shortcut key associated with menu option. I have succesfully recorded all menu option but unable to record shortcut key.  1
Hi All Below is my script which i made for lgin into Flight.exe. SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open" Dialog("Login").WinEdit("Agent Name:").Set DataTable ("p_Text", dtGlobalSheet) Dialog("Login").WinEdit("Agent Name:").Type micTab Dialog("Login").WinEdit("Password:").SetSecure DataTable ("p_Text1", dtGlobalSheet) Dialog("Login").WinButton("OK").Click If Dialog("Login").Dialog("Flight Reservations").WinButton ("OK").exist Then Dialog("Login").Dialog("Flight Reservations").WinButton ("OK").Click datatable.Value(3)= "Incorrect password. Please try again" Dialog("Login").WinButton("CANCEL").Click elseif Dialog("Login").Dialog("Flight Reservations").WinButton("OK").exist Then Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click datatable.Value(3)="Please enter agent name" Dialog ("Login").WinButton("CANCEL").Click elseif Dialog("Login").Dialog("Flight Reservations").WinButton("OK").exist then Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click datatable.Value(3)= "Please enter password" Dialog("Login").WinButton ("CANCEL").Click else Window("Flight Reservation").Move 309,146 datatable.ExportSheet "C:\Raj\Result.xls" ,1 Window("Flight Reservation").Close End If I want to capture the Message string from Dialog("Login").Dialog("Flight Reservations" Also pls let me know if this is the right way to do the script for login. Pls provide some script for login Flight.exe Thanks in advance Raj Dhiman  1
How can we redirect QTP results in to a excel sheet after the execution Virtusa2
I have two actions in my QTP test and two iterations in my DataSheet. I want to execute the Action 1 for the two iterations only after which i want to exceute the next Action2. How is this possible?  2
How can we display the names of the buttons in the toolbar of a webpage  1
Hello Guys, Can anybody Explain me about Automation framework?? and how can we prepareAutomation Framework using QTP Sapient3
Can we create test script with out Step Generator?  4
Please Clarify if smartidentfication is used at runtime when qtp does not recogonize the objects Ordain-Solutions2
if my application shows 100 records and in my database having 200 records how i can validate using QTP tool?plz exp. in detail? Wipro1
is it possible to map an image as standard Object or u've to treat as virtual? how to map an Dynamic image into standard object?  1
how to click the link in webpage by using QTP Script????????  2
WHAT IS THE USE OF "FUNCTION GENERATOR" IN QTP?  2
Today only i joined in this site. Can u please tell me definition of parameterization. and how i can do the parameterization?  3
Hi Friends, If you got one Bug , and you are insert that bug in bug tracking tool , and you need to attach SC's (screen shots) also. how to tae SC's , in your organization any separate tools available to take SC's. please provide Ans. its urgent... Thanx in advance  3
Can any one tell the different properties and values of differnt objects like Browser,Page,link,webedit,webcombobox,webradio botton,webcheckbox and web button.Because I am facing a lot of problems in interviews with Descriptive Programing.I never worked on web Application...Pls help any one as soon as possible....  2
Give answer with example what is orthogonal array testing technique? CTS1
How to Import data from a ".xls" file to Data table during Runtime.  1
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com