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

What is qtpro?

1 Answers  


How do you capture tooltip using QTP?

1 Answers  


In QTP how to interact tool and application build?

2 Answers  


What is a Patch in QTP?

1 Answers  


Syntax for how to call one script from another? and Syntax to call one "Action" in another?

3 Answers  


Explain xml checkpoints.

1 Answers  


OR is full with objects but i want to add 5 more objects,but i tried merging files,shared mode and descriptive ,iwont work.is there any alternative for that

6 Answers   CTS,


What are the Features & Benefits of Quick Test Pro ?

0 Answers   Crea,


anyone can explain about "Hybrid framework" in QTP

5 Answers  


How can you connect the database with QTP?

3 Answers  


How to map Test cases to the script? Please do anwser urgently?Thanks

3 Answers  


What will be the test script in QTP to test a ComboBox where a user has to select more than two items????

8 Answers   L&T,


Categories