02-12-2016, 12:03 PM
hello sir,
im facing problem with my code in qtp keyword driven frame work.
each time i run my script ,it throws an general run error and im unable to click on any links in web applications mainly with,
Set FindObject=obj(0)
please help me to solve this, i have attached the code here,
Function FindObject(ObjectName)
Set Desc=Description.Create
For ObjNumber=1 to DataTable.GetSheet("OR").GetRowCount
DataTable.GetSheet("OR").SetCurrentRow(ObjNumber)
If DataTable("name","OR")=ObjectName Then
If DataTable("micclass","OR")<>"" Then
Desc("micclass").value=DataTable("micclass","OR")
End If
If DataTable("html_id","OR")<>"" Then
Desc("html id").Value=DataTable("html_id","OR")
End If
If DataTable("class","OR")<>"" Then
Desc("class").value=DataTable("class","OR")
End If
If DataTable("innertext","OR")<>"" Then
Desc("innertext").Value=DataTable("innertext","OR")
End If
If DataTable("value","OR")<>"" Then
Desc("value").Value=DataTable("value","OR")
End If
Set Obj=Browser("creationtime:=0").Page("title:=.*").ChildObjects(Desc)
Set FindObject=Obj(0)
End If
Next
End Function
im facing problem with my code in qtp keyword driven frame work.
each time i run my script ,it throws an general run error and im unable to click on any links in web applications mainly with,
Set FindObject=obj(0)
please help me to solve this, i have attached the code here,
Function FindObject(ObjectName)
Set Desc=Description.Create
For ObjNumber=1 to DataTable.GetSheet("OR").GetRowCount
DataTable.GetSheet("OR").SetCurrentRow(ObjNumber)
If DataTable("name","OR")=ObjectName Then
If DataTable("micclass","OR")<>"" Then
Desc("micclass").value=DataTable("micclass","OR")
End If
If DataTable("html_id","OR")<>"" Then
Desc("html id").Value=DataTable("html_id","OR")
End If
If DataTable("class","OR")<>"" Then
Desc("class").value=DataTable("class","OR")
End If
If DataTable("innertext","OR")<>"" Then
Desc("innertext").Value=DataTable("innertext","OR")
End If
If DataTable("value","OR")<>"" Then
Desc("value").Value=DataTable("value","OR")
End If
Set Obj=Browser("creationtime:=0").Page("title:=.*").ChildObjects(Desc)
Set FindObject=Obj(0)
End If
Next
End Function