Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is wrong in this code - need help
#7
Solved: 11 Years, 4 Months ago
Hi,

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
Wend
'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''
Reply


Messages In This Thread
RE: What is wrong in this code - need help - by v_selvam - 12-02-2009, 05:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can some one check my code and tell me whats wrong in it. zakshah.12 3 3,876 03-06-2013, 03:26 AM
Last Post: newqtp
  Wrong column count sqadri 1 2,268 04-19-2012, 09:53 AM
Last Post: sshukla12
  Wrong number of arguments or invalid property assignment qtpro_exe 0 6,575 11-22-2011, 07:48 AM
Last Post: qtpro_exe
  The browser Application can't be launched. Possibly the URL is wrong.- Win.XP-IE 8. fonsecba 2 6,494 05-26-2011, 04:06 PM
Last Post: manmeet.singh81
Question .net testing, Object not found on object repository error, what am i doing wrong? ptreey 6 6,775 04-08-2011, 12:25 PM
Last Post: invertednz

Forum Jump:


Users browsing this thread: 1 Guest(s)