06-11-2012, 09:44 AM
Hi,
Yes it is possible.Sample code is shown below.The below code will add all the items in "departing from" list to the excel sheet "List.xls"
*Note :For the code to run properly
Yes it is possible.Sample code is shown below.The below code will add all the items in "departing from" list to the excel sheet "List.xls"
Code:
list=Browser("Browser").Page("Find a Flight: Mercury").WebList("fromPort").GetROProperty("all items")
arrItems=split(list,";")
Set oExcelApp=CreateObject("Excel.Application")
oExcelApp.visible=True
oExcelApp.Workbooks.open "D:\List.xls"
oExcelApp.Workbooks(1).Activate
Set oExcelSheet=oExcelApp.ActiveWorkbook.WorkSheets(1)
oExcelSheet.activate
For i=lbound(arrItems) to ubound(arrItems)
oExcelSheet.Cells(i+1,1)=arrItems(i)
Next
oExcelApp.WorkBooks(1).Save
oExcelApp.quit
Set oExcelApp=nothing
Set oExcelSheet=nothing
- Open http://newtours.demoaut.com/mercuryreservation.php
- Login with user id: mercury and pwd :mercury
- Add the object "Departing from" list item to the object respository.
- Make sure that the List.xls is created in 'D' Drive