Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exporting drop down values in Excel
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi All,
I am trying to export run time drop down values to excel. I am able to export but not as expected.
In flight reservation We have Fly From and Fly TO drop down,
When we select particular City from Fly From, same City should not display in Fly TO.
I want the result in excel as
from to
Denver Frankfurt
Denver London
Denver Los Angeles
Denver Paris
Denver Portland
Denver San Francisco
Denver Seattle
Denver Sydney
Denver Zurich
Zurich Denver
Zurich Frankfurt
Zurich London
Zurich Los Angeles

so on....

but i am getting values as

from to
Denver Frankfurt
London
Los Angeles
Paris
Portland
San Francisco
Seattle
Sydney
Zurich
Zurich Denver
Will any one help on this ?
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Make sure that you are passing the two parameters every time.
Thanks,
SUpputuri
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
I am trying with following scripts, but still not get expected result.

Code:
dim i,f,x
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "derfs"
Dialog("Login").WinEdit("Password:").SetSecure "4cc3c6e3f379b4bebf919e0c56d8d4ad4172027c"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").ActiveX("MaskEdBox").Type "111910"
f=Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount
datatable.AddSheet("output").AddParameter "from", ""
datatable.AddSheet("output").AddParameter"to",""
For i=0 to f-1 step 1
x=Window("Flight Reservation").WinComboBox("Fly From:").GetItem(i)
DataTable.Value("from","output") = x
t=Window("Flight Reservation").WinComboBox("Fly To:").GetItemsCount
For j=0 to t-1 step 1
t=Window("Flight Reservation").WinComboBox("Fly To:").GetItem(j)
DataTable.Value("to","output") = t
DataTable.SetCurrentRow(j+1)
If x <>t Then
Reporter.ReportEvent 0,"Res","Test Passed"
Else
Reporter.ReportEvent 1,"Res","Test Failed"
End If
Next
next
DataTable.ExportSheet "G:\QTP Result\Exported files\Get values form both drop down.xls","output"
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi
Change the code inside the j loop as:
Code:
t=Window("Flight Reservation").WinComboBox("Fly To:").GetItem(j)
DataTable.Value("to","output") = t
DataTable.SetCurrentRow(j+1)
If x <>t Then
Reporter.ReportEvent 0,"Res","Test Passed"
Else
Reporter.ReportEvent 1,"Res","Test Failed"
End If
DataTable.Value("from","output") = x
Next
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
@Everyone - Please wrap your code in the tags to make it readable, refer posting guidelines.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help for copying values from one excel to another excel vinodhiniqa 0 1,356 07-06-2017, 05:33 PM
Last Post: vinodhiniqa
  How import final calculated values by cell formula from Excel not the formula itself. qtped 1 4,850 01-17-2017, 04:05 PM
Last Post: sagar.raythatha
  Need to verify the drop down values based on condition santhoshmscsoftware 1 2,904 05-04-2016, 11:28 PM
Last Post: supputuri
Smile Importing Excel sheet - Reference Values are not recognized michiusa69 3 7,877 01-23-2015, 02:36 AM
Last Post: lkng2001
  Drag and drop issue excellentpawan123 0 2,744 01-13-2015, 05:04 PM
Last Post: excellentpawan123

Forum Jump:


Users browsing this thread: 1 Guest(s)