12-02-2009, 05:24 PM
Hi,
call the function as
And in the bpname function change to the "cons1=var.count" in to "bpname =var.count" now you try to run.
Wend
'Closing the browser ends'
call the function as
Code:
cons1 = bpname ("google","google")
And in the bpname function change to the "cons1=var.count" in to "bpname =var.count" now you try to run.
Code:
Set IE1=CreateObject("InternetExplorer.Application")
IE1.visible = True
IE1.navigate "www.google.com"
cons1 = bpname ("google","google") ' Calling the function bpname
If cons1 > 0 Then
reporter.ReportEvent micPass, "Passed","Links found"
else
reporter.ReportEvent micFail, "Failed","Links NOT found"
End If
'Closing the browser'
While Browser("CreationTime:=0").Exist
Browser("CreationTime:=0").Close
'Closing the browser ends'
Code:
''Start of the function bpname
Function bpname(bname, pname)
Set obj=description.Create
obj("html tag").Value ="A"
set var = browser("name:=" &bname).page("title:="&pname).ChildObjects(obj)
bpname =var.count
msgbox cons1
End Function
''end of the function bpname''