requirement is for combo box

your expected value is str= "Denver.Frankfurt.London.Los
Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich"

ar = Window("Flight Reservation").WinComboBox("Fly
From:").GetContent

your actual value is : that shows data in combo box



how can u test the both data is correct or not by using
split function


Answer Posted / reddy prasad

i did like this

invokeapplication "C:\Program Files\Mercury
Interactive\QuickTest
Professional\samples\flight\app\flight4a.exe"
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set "rahju"
Dialog("Login").WinEdit("Password:").SetSecure
"4e885f53fbeeaf29c0e9c986b7a420312f7b66bc"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").ActiveX("MaskEdBox").Type
"111111"
str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San
Francisco.Seattle.Sydney.Zurich"
msgbox str
x=split(str,".")
msgbox "by spliting the string into substring 0 is : " &
x(0)
msgbox "by spliting the string into substring 1 is : " &
x(1)
msgbox "by spliting the string into substring 2 is : " &
x(2)
msgbox "by spliting the string into substring 3 is : " &
x(3)
msgbox "by spliting the string into substring 4 is : " &
x(4)
msgbox "by spliting the string into substring 5 is : " &
x(5)
msgbox "by spliting the string into substring 6 is : " &
x(6)
msgbox "by spliting the string into substring 7 is : " &
x(7)
msgbox "by spliting the string into substring 8 is : " &
x(8)
msgbox "by spliting the string into substring 9 is : " &
x(9)
Window("Flight Reservation").WinComboBox("Fly From:").Select
"Los Angeles"
ar = Window("Flight Reservation").WinComboBox("Fly
From:").GetContent
'ar = Window("Flight Reservation").WinComboBox("Fly
From:").GetROProperty("text")

str=Array( "Denver","Frankfurt","London","Los
Angeles","Paris","Portland","San
Francisco","Seattle","Sydney","Zurich")
If ar = x(9) Then
msgbox "pass"
else
msgbox "fail"
End If
Window("Flight Reservation").Close


but no result

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you identify the browser and its information using the qtp script?

579


How to run a test using quicktest professional (qtp)?

538


how to write the descriptive programming in QTP for remove the object value and substitute, with a variable then call the validation from excel

1901


Hi I have exp in manual testing and planning to move in automation testing qtp(9.2).So can help me how to automate customer relationship management tool using qtp and vb script this tool already developed so how can I test it whatever maintaining by development team like documents,various options just give the whole life cycle thanks in advance

1539


Hi, I have 2 dropdown listboxes called region and city/area. It needs to select one region(Santa Clara) and one city/Area (Sunnyvale).So I put this in the for loop and I am storing the Items in the variable called itemname. The regions value will get changed,so I used reg expression for this regions. This is my code Browser("MLSListings.com").Page("MLSListings.com").Link("ยป County/Area").Click Browser("MLSListings.com").Page("MLSListings.com").WebList ("regions").Check CheckPoint("regions") ListSize=Browser("MLSListings.com").Page ("MLSListings.com").WebList("regions").GetTOProperty("items count") For i = 1 To ListSize-1 Itemname =Browser("MLSListings.com").Page ("MLSListings.com").WebList("regions").GetItem(i+1) Browser("MLSListings.com").Page("MLSListings.com").WebList ("regions").Select Itemname ................. If I run the script,I am getting the following error, Cannot identify the specified item of the regions object. Confirm that the specified item is included in the object's item collection. Any Help? Thank you, Uma

1344






How to break the object spy ?

659


can any body tell me how i create a simple script and apply output value on it .pls send me a step by step process

1279


Mention the test steps of qtp.

537


If the weblist is identified as webelement,and by clicking on webelement if the values are displayed,and if the values the values also identified as webelement.then how to fetch the values through script?

4692


I have 5 save buttons in 5 tabs . The tabs are placed one after the other. My object repository have these added as 5 save buttons with name sav1, save 2, save 3 , save 4, save 5 .all are getting highlighted from OR but they are not getting clicked. After spying each button all the properties are same except First button Index 0 html id:=btnSaveTab1 outerhtml:=", Second button "html id:=btnSave "outerhtml:=", Third button "html id:=", outerhtml:=",

1351


What if recovery scenarios is also failed for identify the alert ? (We are handling unexpected popup through recovery scenarios but if still recovery scenarios also failed than what should be the approach)

1009


How to perform cross platform testing and cross browser testing using qtp? Can you explain giving some example?

542


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

742


Is any limitation to xml checkpoints?

555


How to Test the mainframe application?

1818