Hi Joshi, 

I don't understand your idea, but try this:

(there are 29 links on the page)

 

Browser("Google").Page("Google").Sync


Set oDesc = Description.Create()
oDesc("micclass").Value = "Link"
oDesc("html tag").Value = "A"


Set LnkCounters=Browser("Google").Page("Google").ChildObjects(oDesc)  ' 
collection
NumLinks=LnkCounters.Count
If NumLinks = 16 Then

   Reporter.ReportEvent micPassl, "Number of links", "User defined step passed"
 else 

 Reporter.ReportEvent micFail, "Number of links is: "& NumLinks , "User defined 
step  is NOT passed"

 End If



Ludmila.


 



Date: Fri, 28 Aug 2009 17:28:21 -0700
Subject: Re: Error in code
From: [email protected]
To: [email protected]


Hi Again,
 
One mistake is that it should be :
If NumLinks=16 and not == 16.
I corrected this.
But it still says Expected End of Statement for line 5, i.e the ReportEvent 
line.
Please help.
 
Thanks,
Joshi


On Fri, Aug 28, 2009 at 5:25 PM, RRJoshi Joshi <[email protected]> wrote:


Hi,
I am trying a simple scenario where in I want to count the number of links on 
Google webpage.
If the no.of links equals 16 then I want the Result as Pass in QTP Test 
Results, for this I am using ReportEvent.
However, there is some mistake in my code.
Could anyone please help resolve these?
 
Browser("Google").Page("Page_Google").Sync
Set LnkCounter=Browser("Google").Page("Page_Google").Object.links
NumLinks=LnkCounter.length
If NumLinks==16 Then
Reporter.Report Event  micPass, "No.of Links", "the user defined step passed."
End If
 
Thanks in advance!
 
-RRJoshi



_________________________________________________________________
HotmailĀ® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to