QTP Script to Get Count of Unread Yahoo Messages

Descriptive Programming to find number of unread messages in yahoo mail

SystemUtil.Run"iexplore","http://www.yahoomail.com"
Set g=Browser("name:=Yahoo.*").Page("title:=Yahoo.*")
g.WebEdit("name:=login").Set "xyz"
g.WebEdit("name:=passwd").Set "abc"
g.WebButton("name:=Sign In").Click
a=g.Link("name:=Inbox.*").getroproperty("innertext")
b=len(a)
If b=5 Then
Msgbox"u have zero unread messages"
else
c=mid(a,8,len(a)-1)
d=left(c,len(c)-1)
msgbox "number of unread messages=" &d
End If

6 comments:

Sanath Sharma said...

I can not read the unread mails no using the descriptive program

SystemUtil.Run"iexplore","http://www.yahoomail.com"
Set g=Browser("name:=Yahoo.*").Page("title:=Yahoo.*")
g.WebEdit("name:=login").Set "xyz"
g.WebEdit("name:=passwd").Set "abc"
g.WebButton("name:=Sign In").Click
a=g.Link("name:=Inbox.*").getroproperty("innertext")
b=len(a)
If b=5 Then
Msgbox"u have zero unread messages"
else
c=mid(a,8,len(a)-1)
d=left(c,len(c)-1)
msgbox "number of unread messages=" &d
End If


the following error

Run Error Cannot identify the object "[ Link ]" (of class Link). Verify that this object's properties match an object currently displayed in your application.
Line (7): "a=g.Link("name:=Inbox.*").getroproperty("innertext")".
Failed 6/12/2008 - 14:12:22


Am using the New Version of Y!mail
hope your script was for Old/Classic version
pl do change the script accordingly

Thanks
sanathsharma@gmail.com

F n K said...

Yes Sanath this script is for older version.Very soon i will post script for new version.

F n K said...

Sanath take help of object spy and get link properties.

In my system new version of Ymail is not working so i am not able to post that script.

Unknown said...

hi sanath. try this for gamil u will get the ans.

SystemUtil.Run"iexplore","http://www.gmail.com"
Set g=Browser("name:=Gmail.*").Page("title:=Gmail.*")
g.WebEdit("name:=Email").Set "asdf"
g.WebEdit("name:=passwd").Set "asdf"
g.WebButton("name:=Sign In").Click
a=g.frame("name:=v1").webtable("name:=webtable","class:=cv").webelement("innerhtml:=Inbox.*","html tag:=B").getroproperty("innertext")
b=len(a)
If b=5 Then
Msgbox"u have zero unread messages"
else
c=mid(a,8,len(a)-8)
msgbox "number of unread messages="&c
End If

Unknown said...

i checked the gmail code throwing an error

Cannot find the "[ WebElement ]" object's parent "[ Frame ]" (class Frame). Verify that parent properties match an object currently displayed in your application.
on a=obg.frame("name:=v1").webtable("name:=webtable","class:=cv").webelement("innerhtml:=Inbox.*","html tag:=B").getroproperty("innertext")".

Hari said...

This is the latest Google Script and it works fine. Perfectly displays Gmail unread counter.

Related Posts Plugin for WordPress, Blogger...

Fun and Knowledge