01-08-2009, 07:30 PM
Hi! I'd like to select an item from the GlobalDataSheet which was laoded from an Oracle Database. This is my code:
The problem:
When I run this script and the QTP try to run this row: I get the following error message: Cannot identify the specified item of the AppFrame1$event$drpChannelID object. Confirm that the specified item is included in the object's item collection. Line (51): What's the problem? Anybody know? Please help me!!!
Code:
Dim objConn
Dim rs
Dim strConn
Dim strQuery
Set objConn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
strConn = "Driver={Microsoft ODBC for Oracle};Server=Something.HU;Uid=****;Pwd=*******; "
strQuery = "SELECT * FROM XX_bako"
objConn.Open strConn
rs.Open strQuery, objConn 'Csatlakozás ORACLE adott adatbázishoz ADODB-vel, és a SELECT * FROM XX_bako lekérdezés végrehajtása
datatable.GlobalSheet.addparameter"kécsatorna","" 'A GlobalDataSheet paraméterezése
datatable.GlobalSheet.addparameter"város",""
datatable.GlobalSheet.addparameter"név",""
datatable.GlobalSheet.addparameter"telszám",""
datatable.GlobalSheet.addparameter"RenNeve",""
datatable.GlobalSheet.addparameter"idotartam",""
datatable.GlobalSheet.addparameter"rendhely",""
datatable.GlobalSheet.addparameter"cel",""
datatable.GlobalSheet.addparameter"termek",""
datatable.GlobalSheet.addparameter"szegmens",""
datatable.GlobalSheet.addparameter"descr",""
datatable.GlobalSheet.addparameter"müsz",""
datatable.GlobalSheet.addparameter"tüsz",""
datatable.GlobalSheet.addparameter"CostCode",""
datatable.GlobalSheet.addparameter"Aji",""
Do while not rs.eof 'Ciklus segítségével feltöltjük a GlobalDataSheet megfelelő celláit az adatbázis rekordjaival
Browser("Browser").Page("Page").Link("Új igény létrehozása").Click
datatable.Value (1,dtGlobalSheet)=rs.fields("kécsatorna")
datatable.Value(2,dtGlobalSheet)=rs.fields("város")
datatable.Value(3,dtGlobalSheet)=rs.fields("név")
datatable.Value (4,dtGlobalSheet)=rs.fields("telszám")
datatable.Value(5,dtGlobalSheet)=rs.fields("RenNeve")
datatable.Value(6,dtGlobalSheet)=rs.fields("idotartam")
datatable.Value (7,dtGlobalSheet)=rs.fields("rendhely")
datatable.Value(8,dtGlobalSheet)=rs.fields("cel")
datatable.Value(9,dtGlobalSheet)=rs.fields("termek")
datatable.Value(10,dtGlobalSheet)=rs.fields("szegmens")
datatable.Value(11,dtGlobalSheet)=rs.fields("descr")
datatable.Value(12,dtGlobalSheet)=rs.fields("müsz")
datatable.Value(13,dtGlobalSheet)=rs.fields("tüsz")
datatable.Value(14,dtGlobalSheet)=rs.fields("CostCode")
datatable.Value(15,dtGlobalSheet)=rs.fields("Aji")
rs.movenext
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpChannelID").Select DataTable("kécsatorna", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpCityID").Select DataTable("város", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebEdit("AppFrame1$event$txtRequesterNa").Set DataTable("név", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebEdit("AppFrame1$event$txtRequesterPh").Set DataTable("telszám", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebEdit("AppFrame1$event$txtEventName").Set DataTable("RenNeve", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpDuration").Select DataTable("idotartam", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebEdit("AppFrame1$event$txtLocation").Set DataTable("rendhely", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpTargetID").Select DataTable("cel", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpProductID").Select DataTable("termek", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpSegmentID").Select DataTable("szegmens", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebEdit("AppFrame1$event$txtDescription").Set DataTable("descr", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebEdit("AppFrame1$event$txtInvitedClie").Set DataTable("müsz", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebEdit("AppFrame1$event$txtPlannedNewC").Set DataTable("tüsz", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebEdit("AppFrame1$event$txtCostCode").Set DataTable("CostCode", dtGlobalSheet)
Browser("Browser").Page("Page_2").WebButton("MENT").Click
Browser("Browser").Page("Page_2").Link("Új").Click
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpTypeID_grdG").Select DataTable("Aji", dtGlobalSheet)
k=DataTable("Aji", dtGlobalSheet)
If k="Kommunikációs támogatás" Then
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpGiftID_grdG").Select "Toll"
Else
If k="Ajándékok 1 (szóróajándékok)" Then
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpGiftID_grdG").Select "Bögre"
Else
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpGiftID_grdG").Select "Lufi"
End If
End If
Browser("Browser").Page("Page_2").WebEdit("AppFrame1$event$txtNumberOfPie").Set "43"
Browser("Browser").Page("Page_2").WebButton("ELKÜLD").Click
Browser("Browser").Page("Page_2").WebButton("JÓVÁHAGY").Click
Loop
objConn.Close
The problem:
When I run this script and the QTP try to run this row:
Code:
Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpChannelID").Select DataTable("kécsatorna", dtGlobalSheet),
Code:
"Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpChannelID").Select DataTable("kécsatorna", dtGlobalSheet)".