Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I want to know how to use outlook to test mails (the mail has a link that needs to be clicked to approve or deny the request). How do I write this in Selenium Webdriver in c#. I am quite new to selenium. I would like to learn how to auomate the testing in C#. Please do share your knowledge with me.

Something related to this thread. Is mail testing with selenium possible?

share|improve this question
    
Welcome to SQA Stack Exchange Yvette. Would you like to test in the web version of outlook, or the desktop application. –  Lyndon Vrooman Sep 18 '12 at 14:37
1  
why do you think you need Outlook to test the mails ? What exactly are you trying to test - that the content of a mail is a valid link ? –  Phil Kirkham Sep 18 '12 at 15:13
    
Please proof read your question for basic typing errors before posting to make it readable for others increasing people's interest to post an answer. Something like "ro" for "to" can easily be corrected. –  Suchit Parikh Sep 19 '12 at 21:57

2 Answers 2

When people think about test automation, far too often, they think of Selenium and the like. Libraries like Selenium, Webdriver, WATiR, however, will only help in a browser.

If you want to do this in Outlook, and with C#, you will not need those libraries. You may instead want to look to use Microsoft.Office.Interop.Outlook.

I had a similar problem a while ago, with the answer here. That might get you onto a good start.

share|improve this answer
    
Hi Lyndon, i read your post. Do you mind helping me on how to incorporate the code[your outlook code mentioned on the link] into my code. –  Yvette Sep 18 '12 at 15:49
    
Definitely go with C# or other .NET tools with Outlook. In my experience with SilkTest and Outlook, Outlook does not play well at all with third-party automation tools. –  joshin4colours Sep 18 '12 at 16:52

You have a few options. You could automate Outlook like Lyndon has linked to in his answer, or you could use a web email account instead and use a tool like Selenium to automate it, or probably the most efficient and simple way would be to use an SMTP library that can receive e-mails and programatically parse the responses and open the link in a browser.

EDIT: I meant IMAP library (to receive an email). SMTP is used for sending mail. Here's some documentation on using IMAP to access e-mail from a gmail account: https://developers.google.com/google-apps/gmail/xoauth2_libraries

share|improve this answer
    
+1 on the SMTP library. I would not recommend involving any third party tool if you can help it and that includes any kind of email client. If all you need to do is click a link, take the shortest path possible. Otherwise the minute your webmail client is updated, you will have to update your tests to compensate. –  Trish Khoo Sep 24 '12 at 14:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.