Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Weblist Select from DB
#1
Not Solved
Hi! I'd like to select an item from the GlobalDataSheet which was laoded from an Oracle Database. This is my code:

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),
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):
Code:
"Browser("Browser").Page("Page_2").WebList("AppFrame1$event$drpChannelID").Select DataTable("kécsatorna", dtGlobalSheet)".
What's the problem? Anybody know? Please help me!!!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Webtable objects recognise as weblist in UFT 12.5 Sharad Kumar 0 1,184 12-06-2018, 04:57 PM
Last Post: Sharad Kumar
  how to select value from google search box dropdown +QTP prajyot 0 2,925 06-28-2017, 06:30 PM
Last Post: prajyot
  QTP identifying WebList as WebEdit and an Element passion77 3 8,463 01-27-2014, 10:21 PM
Last Post: supputuri
  How to populate data in weblist using excel vijifun 1 3,350 12-05-2013, 12:06 PM
Last Post: basanth27
  Unable to select an item from weblist and unable to enter text in edit box estherindu 5 9,707 05-15-2012, 12:07 AM
Last Post: viswa

Forum Jump:


Users browsing this thread: 1 Guest(s)