Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
qtp query ,pls help me
#1
Not Solved
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
Reply
#2
Not Solved
Instead of Using it check this simple script
Code:
Set Des_Obj = Description.Create
Des_Obj("micclass").Value = "Link"
Set link_col = Browser("micclass:=Browser").Page("micclass:=Page").ChildObjects(Des_Obj)
a = link_col.count
For i = 0 to a-1
  tag = link_col(i).GetROProperty("name")
  href = link_col(i).GetROProperty("url")
  Browser("micclass:=Browser").Navigate href
  Reporter.ReportEvent 0, "Tag Details  " &href, "Link Status"
Next
Reply
#3
Not Solved
Write the code of the QTP between code tags
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Value with forward slash(/) not identified by QTP - Pls help ra.dineshkumar@gmail.com 0 2,537 11-24-2013, 02:38 AM
Last Post: ra.dineshkumar@gmail.com

Forum Jump:


Users browsing this thread: 1 Guest(s)