## open gmail and check inbox if any
new mail by linear fraemworkDim iTodayMailsiTodayMails = 0'Open GMailSystemUtil.Run
"iexplore.exe", "http://www.gmail.com"'Page SyncBrowser("Gmail").Page("Gmail").Sync'Login to GmailBrowser("Gmail").Page("Gmail").WebEdit("UserName").Set "valid gmail
login id"Browser("Gmail").Page("Gmail").WebEdit("Password").Set "valid gmail
password"'Page SyncBrowser("Inbox").Page("Inbox").Sync'Search for emails received today in
your inbox'Logic - The mails received today will
have only time in the last(8th) column.'Time is always followed by am or pm.
So the code check for the last 2 characters and matches it with am or pm.For iR = 1 to 50 sLastColumnText
=
Browser("Inbox").Page("Inbox").Frame("Frame").WebTable("Emails").GetCellData(iR,8) sLast2Characters
= Right(sLastColumnText, 2) If sLast2Characters =
"am" or sLast2Characters = "pm" Then iTodayMails
= iTodayMails + 1 Else 'Exit
For End IfNext'Report the number of mails
received todayReporter.ReportEvent micPass,
"Total Emails Received Today - " & iTodayMails, ""'Sign out from GMailBrowser("Inbox").Page("Inbox").Frame("Frame").Link("SignOut").ClickBrowser("Gmail").Page("Gmail").Sync'Close the browserBrowser("Gmail").Close()*****************************************************************
Driver Script created using QTP AOM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
Dim testCasePath, resultPathtestCasePath
= "D:\QTP\QTP Framework Samples\QTP Linear Framework Demo\GMail
Inbox1"resultPath
= "D:\QTP\QTP Framework Samples\QTP Linear Framework Demo\Result"'Open
QTPSet qtpApp =
CreateObject("QuickTest.Application")'If
QTP is not open then open QTP applicationIf qtpApp.launched <> True Then qtpApp.LaunchEnd If'Make
the QuickTest application visibleqtpApp.Visible
= True'Set
QuickTest run optionsqtpApp.Options.Run.ImageCaptureForTestResults
= "OnError"qtpApp.Options.Run.RunMode
= "Fast"qtpApp.Options.Run.ViewResults
= True'Open
the test in read-only modeqtpApp.Open
testCasePath, TrueWScript.Sleep
2000'set
run settings for the testiSet qtpTest = qtpApp.Test'Instruct
QuickTest to perform next step when error occursqtpTest.Settings.Run.OnError
= "NextStep"'Create
the Run Results Options objectSet qtpResult =
CreateObject("QuickTest.RunResultsOptions")'Set
the results locationqtpResult.ResultsLocation
= resultPath'Run
the testWScript.Sleep
3000qtpTest.Run
qtpResult |
No comments:
Post a Comment