Jump to content

Outlook Test


Recommended Posts

I did the following in vbs but i need help converting it to autoit. I am trying to perform the below functions such as sending an email in outlook and also opening up someone's calendar. I would like to be able to get a response time on each of these items, and that is why i am trying to convert it. Everyone told me that autoit could handle it much better than .vbs, so if anyone has any hints, tips etc on how would be the best way to do gather response time for opening up a calendar and or sending an email to yourself then please let me know.

'The following sets the environment

set wshShell = WScript.CreateObject("WScript.Shell")

'The following opens up the outlook client

wshShell.Run "outlook.exe", 1, False

'The following "pauses" the program until outlook is open

winexist = false

do while winexist = false

winexist = wshShell.AppActivate("Inbox - Microsoft Outlook")

loop

WScript.sleep 10000

'The following generates a test email to a particular user

wshShell.sendkeys "^(n)"

WScript.Sleep 1000

WshShell.SendKeys "username@gmail.com"

WScript.Sleep 1000

WshShell.SendKeys "{TAB 3}"

WScript.Sleep 1000

WshShell.SendKeys "Synthetic Email Test"

WScript.Sleep 1000

WshShell.SendKeys "%(s)"

WScript.Sleep 5000

'do while winexist =false

' winexist = wshShell.AppActivate("username - Calendar - Microsoft Outlook")

'The following opens up username Calendar

WshShell.SendKeys "%(f)"

WScript.Sleep 1000

WshShell.SendKeys "o"

WScript.Sleep 1000

WshShell.SendKeys "o"

WScript.Sleep 1000

WshShell.SendKeys "username"

WScript.Sleep 1000

WshShell.SendKeys "{TAB}"

'line54

WScript.Sleep 1000

WshShell.SendKeys "{UP}"

WScript.Sleep 1000

WshShell.SendKeys "{UP}"

WScript.Sleep 1000

WshShell.SendKeys "{ENTER}"

WScript.Sleep 20000

'The following changes the focus back to the Mail view

WshShell.SendKeys "%(g)"

WScript.Sleep 1000

WshShell.SendKeys "m"

WScript.Sleep 1000

'The following resets the calendar to the original owner

WshShell.SendKeys "%(f)"

WScript.Sleep 1000

WshShell.SendKeys "o"

WScript.Sleep 1000

WshShell.SendKeys "o"

WScript.Sleep 1000

WshShell.SendKeys "username"

WScript.Sleep 1000

WshShell.SendKeys "{TAB}"

WScript.Sleep 1000

WshShell.SendKeys "{UP}"

WScript.Sleep 1000

WshShell.SendKeys "{UP}"

WScript.Sleep 1000

WshShell.SendKeys "{ENTER}"

'The following closes outlook in order to prepare for the next cycle

WshShell.SendKeys "%(F)"

WScript.Sleep 5000

WshShell.SendKeys "x"

Link to comment
Share on other sites

Use TimerInit and TimerDiff to get the response time.

You should also do a search here at the forum to find out how to make it with COM, it's much better and more reliable or use _INetMail()

;The following opens up the outlook client

Run("outlook.exe", "", @SW_MAXIMIZE)

;The following "pauses" the program until outlook is open

WinWaitActive("Untitled")


sleep (10000); no need to

;The following generates a test email to a particular user
; use controlsend instead of send

Send("^n")
Sleep (1000)
Send("username@gmail.com")
Sleep (1000)
Send("{TAB 3}")
Sleep (1000)
Send( "Synthetic Email Test")
Sleep (1000)
Send( "!s")
Sleep (5000)

;do while winexist =false
; winexist = wshShell.AppActivate("username - Calendar - Microsoft Outlook")

;The following opens up username Calendar

Send("!f")
Sleep (1000)
Send( "o")
Sleep (1000)
Send( "o")
Sleep (1000)
Send( "username")
Sleep (1000)
Send( "{TAB}")
Sleep (1000)
Send( "{UP}")
Sleep (1000)
Send( "{UP}")
Sleep (1000)
Send( "{ENTER}")
Sleep (20000)

;The following changes the focus back to the Mail view

Send( "!g")
Sleep (1000)
Send( "m")
Sleep (1000)

;The following resets the calendar to the original owner

Send( "!f")
Sleep (1000)
Send( "o")
Sleep (1000)
Send( "o")
Sleep (1000)
Send( "username")
Sleep (1000)
Send( "{TAB}")
Sleep (1000)
Send("{UP}")
Sleep (1000)
Send( "{UP}")
Sleep (1000)
Send( "{ENTER}")

;The following closes outlook in order to prepare for the next cycle

Send( "!F")
Sleep (5000)
Send( "x" )
Edited by Pain
Link to comment
Share on other sites

I figured out how to convert my .vbs script, now i just need to figure out how to actually record how long it takes to say open a calendar or send / recieve the email. I would like to output that information to a text file on the localhost. Any help would be appreciated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...