cancel
Showing results for 
Search instead for 
Did you mean: 

TestComplete_Read specific subject title email and click link available within the same email.

Highlighted
Contributor

TestComplete_Read specific subject title email and click link available within the same email.

Hello Team,

 

Looking for some advise and guideline in order to automate outlook inbox i.e. "How to interact with outlook using test complete ?",

 

Our web application has to interact with outlook atleast 3-4 times in order to proceed for further door of application without this user will not able to make progress.

 

Currently i'm somehow  using record and playback (R&P)option able to access specific email and able to click on specific link available within the same email ,

 

However its not always the case as it working for me only when test complete meets the certain condition i.e, It needed a specific email to be available at certain position , so using record and playback(R&P) scripts working sometimes only in order to read outlook email , the basis operations i'm performing using this R&P  option are :

1)Login with outlook,

2)Go to inbox option

3)Search specific subject title email

4)Select the unread and newly dropped email (probably first email of the inbox)

5)Read the email and click on link available within that email body and

6)Logout from outlook.

 

Really appreciate if someone suggest me how to do this task either using pure coding or record and playback option.

 

Thanks in advance 

 

~Amit

 

2 REPLIES 2
Highlighted
Community Hero

Re: TestComplete_Read specific subject title email and click link available within the same email.

Outlook provides Rest API calls for getting your emails. Using this you can grab your mails as JSON response.

https://msdn.microsoft.com/en-us/office/office365/api/mail-rest-operations

 

you can filter the results using their select or filter comments.

 

TestComplete provides an option to do the request response.

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqhttprequest/index.html

 

This gives you some hope that you can actually verify the or get value of the mail without outlook installed.

If you start your analysis from this point, you will be able to found a answer for you


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Community Hero

Re: TestComplete_Read specific subject title email and click link available within the same email.

So I don't think there is a good way for this to work with R&P, but you can access your inbox and folders and search through them via scripting and OleObject. 

 

If you're using JavaScript here is a little snippet that will search the specific inbox of an account for a subject that contains a specified search term.

 

function searchOutlook(accountName,searchTerm) {
 const outlook =  Sys.OleObject("Outlook.Application");
 const mapi = outlook.GetNamespace("MAPI");
 const inbox = mapi.Folders.Item(accountName);
 const messages = inbox.Folders.Item("Inbox");
 for(let i = 1; i < messages.Items.Count; i++) {
   if(messages.Items.Item(i).Subject.search(searchTerm) > -1) {
     Log.Message("Found Email At Position: " + i);
     messages.Items.Item(i).Display();
     break;
   }
 } 
}

Thanks,
Carson

Click the Accept as Solution button if my answer has helped
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare images using the Region Checkpoint

See replies!

Converting UTC TimeDate in an Excel file

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors