Micro Focus QTP (UFT) Forums
DP-counting mails - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: DP-counting mails (/Thread-DP-counting-mails)



DP-counting mails - priya - 04-01-2008

hi ankur. I h've read u r blog. It is very interesting
It is very useful.thank q so much.
i have one doubt. can u tell me the ans
how can we count the no. of unread mails in gmail inbox by using descriptive programming
i h've tryied but am not getting and count will change when new mail recieved.
thank you


RE: DP-counting mails - durairajravindran - 05-26-2008

Dear Priya,

Please try this one after that your doubt will be clarified.

Please execute the below steps:
1. Login to the gmail.
2. Click on the checkpoint for inbox after that get the celldata.
3. Finally impliment the below logic

Code:
Browser("Gmail: Email from Google").Page("Gmail - Inbox (1859)").Frame("v1").WebTable("Inbox (1859)").Check CheckPoint("Inbox (1859)")
x=Browser("Gmail: Email from Google").Page("Gmail - Inbox (1859)").Frame("v1").WebTable("Inbox (1859)").GetCellData(2,1)
z= mid(x,8)
msgbox z
counts=left(z,len(z)-1)
msgbox counts


Thanks & Regards,
Durai


RE: DP-counting mails - Anshoo Arora - 06-03-2008

Try this:

Code:
sText = Browser("micclass:=Browser").WebElement("innertext:=Inbox.*", "html tag:=B", "index:=0").GetROProperty("innertext")

leftParan = InStr(1, sText, "(")
rightParan = InStr(1, sText, ")")
numOfMails = Mid(sText, leftParan + 1, rightParan - leftParan - 1)

MsgBox numOfMails