Micro Focus QTP (UFT) Forums
Descriptive program - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Descriptive program (/Thread-Descriptive-program)



Descriptive program - RPS_QTP - 09-26-2012

Code:
Set objLink = Description.Create()
objLink("micclass").value = "Link"
Count=0
Set AllLinks = Browser("title:=Gmail.*").Page("title:=Gmail .*").ChildObjects(objLink)
For i=0 to AllLinks.Count-1
boldTag=AllLinks(i).GetROProperty("innerhtml")
If instr(boldTag,"<B>")<>0 AND instr(boldTag,"class=ts")<>0 Then
     Count=Count+1
End If
Next
msgbox "You have " & Count &" unread mail(s)"


@above code

im getting General Run Error Message


RE: Descriptive program - newqtp - 01-21-2013

Code:
sLink=Browser("opentitle:=Gmail.*").Page("title:=Inbox.*").Link("name:= Inbox.*").GetROProperty("innertext")
iEmails = Split(sLink, " ")(1) 'have total number of unread email count as (3)
iEmails = Replace(iEmails, "(", "") 'this statement replace first ( to blank, now iEmails have partial number as 3)
iEmails = Replace(iEmails, ")", "") 'replace ) to blank space statement as 3

Msgbox "You Have " & iEmails & "unread mails(s)"

I hope this work out for.