Web Functional Testing > Function Reference > Adding Email Functions

Adding Email Functions

Tags:  

Description : E-Mail functions will be useful to fetch and check the mail properties, if the application send a mail.

Where to use E-Mail Functions can be used ?
 
 Following is the scenario where E-Mail Functions can be used,
 
  • To validate the email properties send to an E-Mail id by the web application.
How to insert E-Mail Functions in the script ?
  • Click the "Insert Built-in Function" link available above the script editor
  • In the "Built-in-Function" window, select the "E-Mail Functions" in the "Category" combo.
  • Select the appropriate function to be used in the "Functions" combo.
  • Configure the values for function arguments and click on "Paste" button to add the function to the script.
Following are the various functions available in the E-Mail Functions,
  1. checkMailProperty
  2. fetchMails
  3. getMailCount
  4. getMailProperty


checkMailProperty
 

 Function Description:

 

 Use this function to check the mail property.

 

 How to Define:

 checkMailProperty("<Property_to_check>","<Condition>","<value_of_the_property>",<index_of_the_mail>,"<property_to_check>","<condition>","<Value_of_the_property>",<time_out>)

 Example:

 
fetchMails("pop","user1","user1",110)

 

                result = checkMailProperty("To","equals","qengine-support@adv.com",1,"Subject","contains","Support",10)

 

                In the above case, the mails will be fetched from the "pop" mail incoming server , from the account user1. Then the obtained mails will be validated for the given property.

 Return Values:

                0 - For Success
                1 - For Failed

fetchMails
Function Description:

 Use this function to fetch the mails from the incoming server from the given user account

 How to Define:

          fetchMails("<Incoming_mail_server>","<user_account>","<password_of_account>","<mail_server_port>","<Delete_Mails_After_Fetching>")

Example:

              
fetchMails("pop","user1","user1",110,"true")
                In the above case, the mails will be fetched from the "pop" mail incoming server, from the account user1. If the last parameter set to true, then the mails will be deleted in the mail server.
Return Values:
                Void

getMailCount
Function Description:

 Use this function to fetch the mails from the incoming server and get the number of mails received for the account matching given property.

 How to Define:

                getMailCount("<Mail_Property>","<condition>","<property_value>","<time_out")
Example:

 
             fetchMails("pop","user1","user1",110)               
               
result = getMailCount("From","equals","qengine@adventnet.com",10)
               
             In the above case, the mails will be fetched from the "pop" mail incoming server, from the account user1 and then mail matching the given property will be counted and returned.

Return Values:
                Integer - number of mail matching the given property


getMailProperty
Function Description: 

                Use this function to fetch the mails from the incoming server and get the specific mail property of the mail received.

How to Define:

                getMailProperty("<mail_property_to_match>","<condition>","<property_value>","<property_to_get>","<index_of_the_mail>","<time_out>")

Example:
             
fetchMails("pop","user1","user1",110)               
               
result = getMailProperty("From","equals","qengine@adventnet.com","Subject","1"10)

                In the above case, the mails will be fetched from the "pop" mail incoming server, and the mail property of the matching mail  will be taken.
Return Values:
             String -  Mail property of the fetched  mail.

0 Comments  Show recent to old
Post a comment


 RSS of this page

Copyright © 2009, Zoho Corporation. All Rights Reserved.