Browser("Las Vegas Hotels - Las").Page("Vegas Hotels -
Hotels").Link("Luxor") ......here Luxor is a hotel and this
is recognised as a link. I have many hotels like Luxor,
Palms etc which are all displayed as link...How do I
parametrize this by using webtable functions??? ASAP



Browser("Las Vegas Hotels - Las").Page("Vegas Hotels - Hotels").Link("Lux..

Answer / amarendra kothuru

If you want to recognize, no of links like Luxor, then the
following code explain you how to perameterize it.

This is the query you are using to recognize Luxor.
Browser("Las Vegas Hotels - Las").Page("Vegas Hotels -
Hotels").Link("Luxor")

Using Descriptive programming and data Driven approach you
can Perameterize it

Create a column in Globalsheet as CityName and enter the
Citie names in it.


Code:
ExcelSheetRoiwCount = DataTable.GetSheet
("Global").GetRowCount
For var_i = 1 to ExcelSheetRoiwCount
DataTable.SetCurrentRow(var_i)
CityName = DataTable("CityName","Globalsheet")
Result = Browser("Las Vegas Hotels - Las").Page("Vegas
Hotels - Hotels").Link("name:=&CityName).Exist(1)
If Result = True Then
Reporter.ReportEvent micPass, "City name " & CityName
& "found", "Passed"
Else
Reporter.ReportEvent micFail, "City name " & CityName
& "not found", "Failed"
End If
Next


It above code verifies the city names you have specified in
Excel Globalsheet exist in the application as Links or not.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More QTP Interview Questions

If an application name is changes frequently i.e while recording it has name, in this case how does QTP handles?

1 Answers  


Explain about random testing of 500 test cases?

1 Answers   IBM,


When u ll use Record Button in QTP?Is VB script is Mandatory in QTP? What is Meaning of Frame("v1")?

1 Answers   TCS,


what is review

0 Answers  


what is the difference between testing and debugging?

2 Answers  






How to import a test case present in ".xls" file to TD under a Test set?

0 Answers  


how i will connect oracle or microsoft acess database through manually written Script

2 Answers   Aurigo,


We have 10 page.In first page we 2 popup and next page we 3 popup window......(windows name is different)how can we handle the all the popups without using recovery scenario

1 Answers   HK, TCS,


How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?

0 Answers  


wt is the xtension of the QTP result view file?

4 Answers  


How good are you in writing VBscript code for your application? Can you completely write VBscrit for your project with out using recording mode in QTP?

3 Answers   CTS,


How do you handle XML exceptions in QTP (Here it is Exception, not the checkpoint)

2 Answers   CFC, CTS,


Categories