Option explicit
Dim u,p,k,i,nomp,x,y,j,eur,it,aur
'associate functions file
Executefile("F:\QTP\gml.vbs")
'launching site
launch
'log in site
u="EMAIL ID"
p="ENCRYPTED PASSWORD"
login u,p
'click inbox
inbx
k=9
Do
With browser("title:=.*")
With .page("title:=.*")
nomp=.webtable("name:=t").GetRoproperty("rows")
End With
End With
nomp=(nomp+27)*4
'count no of unread mails in single page
For i=28 to nomp-83 step 4
With browser("title:=.*")
With .page("title:=.*")
x=.webelement("html tag:=TD","index:="&i).object.currentstyle.backgroundColor
If x="#ffffff" Then
eur=eur+1
End If
End With
End With
Next
'check whether older mails exist or not
With browser("title:=.*")
With .page("title:=.*")
y=.webelement("html tag:=B","index:="&k).getroproperty("innertext")
End With
End With
'click older mails link
If y="Older ›" Then
With browser("title:=.*")
With .page("title:=.*")
.webelement("html tag:=B","index:="&k).click
End With
End With
Else
Exit do
End If
If k<>11 Then
k=K+1
end if
Loop while 2>1 'infinite loop
'getting site showing count
With browser("title:=.*")
With .page("title:=.*")
x=.link("name:=Inbox.*").GetROProperty("innertext")
End With
End With
aur=mid(x,8,len(x)-8)
aur=cint(aur)
If aur=eur Then
msgbox("Test Passed")
else
msgbox("Test Failed")
End If
'sign out and arrange for next user login
sgnf
Dim u,p,k,i,nomp,x,y,j,eur,it,aur
'associate functions file
Executefile("F:\QTP\gml.vbs")
'launching site
launch
'log in site
u="EMAIL ID"
p="ENCRYPTED PASSWORD"
login u,p
'click inbox
inbx
k=9
Do
With browser("title:=.*")
With .page("title:=.*")
nomp=.webtable("name:=t").GetRoproperty("rows")
End With
End With
nomp=(nomp+27)*4
'count no of unread mails in single page
For i=28 to nomp-83 step 4
With browser("title:=.*")
With .page("title:=.*")
x=.webelement("html tag:=TD","index:="&i).object.currentstyle.backgroundColor
If x="#ffffff" Then
eur=eur+1
End If
End With
End With
Next
'check whether older mails exist or not
With browser("title:=.*")
With .page("title:=.*")
y=.webelement("html tag:=B","index:="&k).getroproperty("innertext")
End With
End With
'click older mails link
If y="Older ›" Then
With browser("title:=.*")
With .page("title:=.*")
.webelement("html tag:=B","index:="&k).click
End With
End With
Else
Exit do
End If
If k<>11 Then
k=K+1
end if
Loop while 2>1 'infinite loop
'getting site showing count
With browser("title:=.*")
With .page("title:=.*")
x=.link("name:=Inbox.*").GetROProperty("innertext")
End With
End With
aur=mid(x,8,len(x)-8)
aur=cint(aur)
If aur=eur Then
msgbox("Test Passed")
else
msgbox("Test Failed")
End If
'sign out and arrange for next user login
sgnf
No comments:
Post a Comment