none
How to capture Microsoft Outlook mail items using Coded UI test RRS feed

  • Question

  • I have a Autonomy/IManage (Document management system) application which is integrated in Microsoft outlook which provides you the result as a different mail items section in columns like title,version of document, author etc. I need to automate this application using Coded UI, but I am not able to click on the results which comes like an inbox results as another mail item section.I also tried to click on the mail item in the inbox , but it's only able to capture the outer grid of mail items panel but not not particular item.

    I searched on the net to find an alternative other than plug in to capture those results , but not able to find apart from coded UI extension plugin.

    Could somebody please suggest a way to capture the items?

    Thanks in Advance..

    Tuesday, July 10, 2012 7:44 AM

Answers

  • i;m using testcomplete for UI test automation for outlook and i think codedui tests from MS is the same. In general outlook is very un-friendly for such tests and official recommendation from test complete is to check for mails, etc. using OOM (outlook API), so i guess you will have to do the same.
    Tuesday, July 10, 2012 8:18 AM

All replies

  • i;m using testcomplete for UI test automation for outlook and i think codedui tests from MS is the same. In general outlook is very un-friendly for such tests and official recommendation from test complete is to check for mails, etc. using OOM (outlook API), so i guess you will have to do the same.
    Tuesday, July 10, 2012 8:18 AM
  • In the beginning when I started automating outlook , I tried with Test Complete tool , but it was not capturing the mail items from Microsoft outlook. It was only able to detect the left panel and not the center panel which has the mail items.

    Did you able to capture the mail items with Test Complete?

    Tuesday, July 10, 2012 10:59 AM
  • as i wrote above - i automate clicking and filling text boxes, etc with standard test complete stuff, but to check if mail arrived in inbox, etc, i use OOM in test complete.
    Tuesday, July 10, 2012 6:16 PM
  • Hi,

    I did it through OOM. I used the sender's emailaddress and the email subject to find a mail. The code is as follows.

    private void SelectMail(string addressTag, string subject)

    {
    Outlook.Application app = new Outlook.Application();
    Outlook.Explorer explorer = app.ActiveExplorer();
    explorer.ClearSelection();

    string senderEmail = Utils.Setting.Get(addressTag);

    IEnumerable<Outlook.MailItem> selectedMails = from Outlook.MailItem mailItem in explorer.CurrentFolder.Items
     where mailItem.SenderEmailAddress == senderEmail && mailItem.Subject == subject
     select mailItem;
    Outlook.MailItem mail = selectedMails.FirstOrDefault<Outlook.MailItem>();

    explorer.AddToSelection(mail);
    }


    Thanx
    Babu A.



    • Edited by Babu_Pers Friday, October 5, 2012 6:34 AM
    • Proposed as answer by Babu_Pers Friday, October 5, 2012 6:34 AM
    Friday, October 5, 2012 6:33 AM