Micro Focus QTP (UFT) Forums
General run Error - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: General run Error (/Thread-General-run-Error--7570)



General run Error - akhandesh - 08-22-2013

i am getting the General Run Error for below Code
and i have attached the Code as well.
Please can find out what the problem is please..??

can u any one suggest me the right answer please ...
please..

----------------------------------------------------------------------
Code:
For j=1 to datatable.GetSheet("OR1").GetRowCount

       datatable.GetSheet("OR1").SetCurrentRow(j)

       If datatable("name","OR1")=ObjectName Then

           If datatable("micclass","OR1")<>" " Then
               desc("micclass").value=datatable("micclass","OR1")
           End If

'           If datatable("html id","OR1")<>" " Then
'               desc("micclass").value=datatable("html id","OR1")
'           End If

           If datatable("class","OR1")<>" " Then
               desc("micclass").value=datatable("class","OR1")
           End If

           If datatable("innertext","OR1")<>" " Then
               desc("micclass").value=datatable("innertext","OR1")
           End If

     Set obj=Browser("creationtime:=0").page("title:=.*").ChildObjects(desc)

    Set FindObject=obj(0)
      'obj1=FindObject(obj)

       End If

   Next
End Function



RE: General run Error - basanth27 - 08-22-2013

Code:
Set FindObject=obj(0)

This wont work. obj per your description is an object and not an array.


RE: General run Error - akhandesh - 08-22-2013

So can u suggest me the right way to get the output for that code..??


RE: General run Error - akhandesh - 08-22-2013

After executing the below code..i am getting object does not support at highlighted lines..
please have a look at it..
and reply me.

Object doesn't support this property or method: 'FindObject(...).select'

Function file: C:\Program Files\HP\QuickTest Professional\Tests\func_Lib_1.vbs
Line (22): " FindObject(ObjectName).select Data"


Function openbrowser(iexplore)
systemutil.Run "iexplore"
End Function

Function navigate(url)
browser("creationtime:=0").Navigate "http://salesforce.com"
browser("creationtime:=0").Sync
End Function

Function input(ObjectName,data)
FindObject(ObjectName).Set "akhan"
input="pass"
End Function


Function Login(object)
FindObject(ObjectName).click
Login="pass"
End Function

Function SelectList(ObjectName,Data)
FindObject(ObjectName).select Data
SelectList="pass"
End Function

is anybody there to give me the answer for above code.??
please suggest something so that i get it worked.