12-23-2010, 09:39 PM
I am facing another problem with Split now.
I have captured the text = " Frankfurt TO New York"
the text come from run time datatable.
text= datatable.Value("Select_a_Flight_MercuryOutput_Text_out",dtglobalsheet)
I used following split function
Here Myarr(0) displayed the value as Frankfurt TO New York ?
and Myarr(1) displayed following error.
The test run cannot continue due to an unrecoverable error.
Subscript out of range: '[number: 1]'
Line (16): "msgbox Myarr(1)".
Please find the below code
---------------------------------------------------------------------------------
I have captured the text = " Frankfurt TO New York"
the text come from run time datatable.
text= datatable.Value("Select_a_Flight_MercuryOutput_Text_out",dtglobalsheet)
I used following split function
Code:
Myarr=split(text,"TO")
msgbox Myarr(0)
msgbox Myarr(1)
Here Myarr(0) displayed the value as Frankfurt TO New York ?
and Myarr(1) displayed following error.
The test run cannot continue due to an unrecoverable error.
Subscript out of range: '[number: 1]'
Line (16): "msgbox Myarr(1)".
Please find the below code
---------------------------------------------------------------------------------
Code:
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "mercury"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "4d136083f7eb3294cfee0f9766e331cd0c781dde"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 34,13
For i=1 to Datatable.GetRowCount
datatable.SetCurrentRow(i)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select DataTable("p_Item", dtGlobalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toPort").Select DataTable("p_Item1", dtGlobalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 57,16
'Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebElement("Frankfurt to New York").Output CheckPoint("Frankfurt to New York")
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Output CheckPoint("Select a Flight: Mercury Tours")
text= datatable.Value("Select_a_Flight_MercuryOutput_Text_out",dtglobalsheet)
msgbox text
Dim a,b,text
Myarr=split(text,"TO")
msgbox Myarr(0)
msgbox Myarr(1)
Browser("Welcome: Mercury Tours").Back
Next