write a function to read the items from Combobox of Flight
Reservation
application and save in excel.

Answers were Sorted based on User's Feedback



write a function to read the items from Combobox of Flight Reservation application and save in ex..

Answer / kishan

allItems=Browser().page().webComboBox().getROProperty("all
items")

arr=split(allItems," ")

'create excel appl object
set xlo=CreateObject("Excel.Application")\
xlo.visible=True

set wbo=xlo.Workbooks.open("D:\QTP\TestData\abcdef.xls")
set wso=xlo.worksheets("Sheet1")

for i=0 to ubound(arr)

j=i+1
wso.cells(j,1)=arr(i)

next

Is This Answer Correct ?    5 Yes 0 No

write a function to read the items from Combobox of Flight Reservation application and save in ex..

Answer / lavanya

This too works....


r=1
Function Fly_from()

Window("Flight Reservation").Activate
Window("Flight Reservation").WinComboBox("Fly From:").Drag 10,10
List =Window("Flight Reservation").WinComboBox("Fly From:").GetRoProperty("all items")
Cnt=Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount
msgBox List
msgBox Cnt
For i=0 To Cnt-1
Wso.cells(r,1).value=Window("Flight Reservation").WinComboBox("Fly From:").GetItem(i)
r=r+1
Next

End Function


Set odesc=CreateObject("excel.application")
odesc.visible=True
odesc.workbooks.open "path of excel file to store the list items"
Set Wso=odesc.worksheets("Sheet1")


call Fly_from()

Is This Answer Correct ?    2 Yes 0 No

write a function to read the items from Combobox of Flight Reservation application and save in ex..

Answer / pushkar1206

a=browser("vtiger CRM - Commercial").Page("vtiger CRM - Commercial").WebList("login_theme").GetROProperty("all items")
b=split(a,";")
Set obj=createobject("excel.application")
Set obj2=obj.Workbooks.Open("C:UserspushkarDesktopBook1.xls")
Set obj3=obj2.Worksheets("Sheet1")
For i=0 to ubound(b)
j=i+1
obj3.cells(j,1)=b(i)
obj2.Save
Next

Is This Answer Correct ?    0 Yes 0 No

write a function to read the items from Combobox of Flight Reservation application and save in ex..

Answer / pushkar1206

It is very important too save workbook else sheet will be empty.

Is This Answer Correct ?    0 Yes 0 No

write a function to read the items from Combobox of Flight Reservation application and save in ex..

Answer / gourav

can anyone plz tell me the answer to this question?

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

What is parameter in qtp?

0 Answers  


How can we conduct U-I Testing by using QTP??????

0 Answers  


wt is memory leakage?

6 Answers   BSL,


I am verifying the actual vs the input value to make sure that they been entered correctly. In the Global Sheet I have a column called Customer with the multiple names in each row and now I am trying to capture the value during runtime under the column name Customer_in_Apps. Somewhat it works but during runtime the values are being stored in each column vs each row i.e., Customer_in_Apps, Customer_in_Apps1. Automatically it add columns instead of rows. row=datatable.getsheet("Global").GetRowCount for x=1 to row datatable.getsheet("Global").SetCurrentRow(x) Window("Customer Desktop").Window("Customer Tracking (Privacy").WinObject("TreeView20WndClass").Click 92,244 runtimevalue = .VbTreeView("vbname:=AppServerTree").GetROProperty("Selectio n") Val1=Datatable.Value("Customer",dtGlobalSheet) Val2 = Datatable.GlobalSheet.AddParameter("Customer_in _Apps",runtimevalue) If (trim(Val2)=trim(Val1)) Then Reporter.ReportEvent micPass, "Customer validation successful", "Actual Value: " &Val1&vbcrlf& "Customer Value: " &_Val2 else Reporter.ReportEvent micFail, "Customer validation unsuccessful", "Actual Value: " &Val1&vbcrlf& "Customer Value: " &Val2 End If Next

3 Answers  


what is Supplemental Objects ?

0 Answers  






i have to pass the testcases into userid anf password of gmail login page using functions you can take your own testcaseslike userdid should take only lowerletters it should not take special charactors and uppercase letters and password should take only numericvalues it should not take alphanumeric and alphabets

2 Answers  


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

3 Answers   IBM,


what are the different data driven types?

6 Answers  


what are the challenges do we face while testing webbased applcations using the automation tool QTP or any?

4 Answers   BirlaSoft,


How to recognize and read data from pdf file using Descriptive Programming in QTP?

1 Answers   Satyam,


Why a framework is needed?? Plaese post your answers ASAP

3 Answers   ACC, FD, Mphasis,


If created one virtual object? Next time I changed the window position will it work?

0 Answers  


Categories