Skip to content

Testing with Bqurious > Actions

Email

Email actions help you to perform various actions on your mail account.

An Email protocol is a process by which an email client accesses the information contained in an email account.

The email protocols available in BQ platform are :

  1. IMAP
  2. POP3
  3. SMTP

Suppose you wish to verify that a particular subject exists in a specific folder.

Structure :

setMailConnection <parameters>

setCurrentFolder <parameters>

verifySubjectExists <parameters>

ActionParametersExample Usage
copyLinkWithText Web, Mobile


---

To copy the link text (mentioned in Parameter 2) from message content of the mail having subject (mentioned in Parameter 1) in variable name (mentioned in parameter 3).

> [!IMPORTANT] This is useful in situations like checking if user received the correct registration link or not. The link with text can be copied in a variable and compared with the expected value.
Param 1 : Subject of the mail Param 2 : Text on link Param 3 : Variable name to storeExample:
copyLinkWithText : <Subject : Welcome to bqurious> <Link Text : www.bqurious.com> <In variable : MSGCONTENT>
Copies the link text www.bqurious.com from message content in mail having subject Welcome to bqurious in variable name MSGCONTENT
copyMessageCount Web, Mobile


---

To copy the total number of messages in variable (mentioned in Parameter 1).
Param 1 : Variable name to store the message countExample:
copyMessageCount : <In Variable : MSGCOUNT>
Copies the total number of messages in variable name MSGCOUNT
copyUnreadMessageCount Web, Mobile


---

To copy the total number of unread messages in variable (mentioned in Parameter 1).
Param 1 : Variable name to store the unread message countExample:
copyUnreadMessageCount: <In Variable : UNREADMSGCOUNT>
Copies the total number of unread messages in variable name UNREADMSGCOUNT
copyMessageWithSubject Web, Mobile


---

To copy the message from the mail having subject (mentioned in Parameter 1) in variable name (mentioned in parameter 2).
Param 1 : Subject of the mail Param 2 : Variable name to store the messageExample:
copyMessageWithSubject : <Subject : Welcome to bqurious> <In Variable : MSGCONTENT>
Copies the message from the mail having subject Welcome to bqurious in variable name MSGCONTENT
copyUrlAtIndex Web, Mobile


---

To copy the URL, from the mail body with subject (mentioned in parameter 1), at index (index mentioned in parameter 3) into the variable (mentioned in parameter 2).
Param 1 : Subject of the mail Param 2 : Variable name to store Param 3 : Index of the urlExample:
copyUrlAtIndex : <Subjec: HELLO > <In Variable : bqVar> <Index : 2>
Copies url at index 2 from the mail body with subject HELLO into variable bqVar
copyValueFromMailSubject Web, Mobile


---

To store the value between left boundary (mentioned in parameter 3) and right boundary (mentioned in parameter 4) of subject (mentioned in parameter 1) into variable (mentioned in parameter 2).
Param 1 : Subject of the mail Param 2 : Variable name to store Param 3 (Optional) : Left Boundary Param 4 (Optional) : Right BoundaryExample:
copyValueFromMailSubject : <Subject : New Case :> <In Variable : caseNumber> <Left Boundary : Case :> <Right Boundary : >
Copies the value between the left boundary ‘Case :’and right boundary (not provided in this case) from subject New Case : in variable caseNumber
replyToEmail Web, Mobile


---

To reply an email identified with subject (mentioned in Parameter 2) with connection string (mentioned in Parameter 1) with message (mentioned in Parameter 3).

> [!IMPORTANT] This will require SMTP type connection string in order to send an email.
Param 1 : Connection string for email Param 2 : Subject of the mail Param 3 : Mail contentExample:
Suppose the Email Connect variable created is EmailConn1 with values *SMTP
replyAllToEmail Web, Mobile


---

To reply-all an email identified with subject (mentioned in Parameter 2) with connection string (mentioned in Parameter 1) with message (mentioned in Parameter 3).

> [!IMPORTANT] This will require SMTP type connection string in order to send an email.
Param 1 : Connection string for email Param 2 : Subject of the mail Param 3 : Mail contentExample:
Suppose the Email Connect variable created is EmailConn1 with values *SMTP
setMailConnection Web, Mobile


---

To connect email server with connection string (mentioned in Parameter 1).
Param 1 : Connection string for email

> [!IMPORTANT] Use Email Connect to store the connection values in a variable & use the variable (as global variable) in param 1
Example:

> [!IMPORTANT] Email Connection String format : Type
sendEmail Web, Mobile


---

To send an email with connection string (mentioned in Parameter 1) to email address (mentioned in Parameter 2).

> [!NOTE] This will require SMTP type connection string in order to send an email.
Param 1 : Connection string for email Param 2 : Mail id to send email from Param 3 : Mail id to send email to Param 4 : Mail id of the person to be kept in CC Param 5 : Subject of the mail Param 6 : Mail contentExample:
Suppose the Email Connect variable created is EmailConn1 with values *SMTP
setSearchModeExact Web, Mobile


---

To set the search mode as Exact to find the text in email.

> [!NOTE] If Exact is not set then search will be case-insensitive and fuzzy.
Example:
setSearchModeExact
Finds the text in email by exact text.
setSearchModePartial Web, Mobile


---

To set the search mode as Partial to find the text in email.
Example:
setSearchModePartial
Finds the text in email by partial text
setCurrentFolder Web, Mobile


---

To set the default folder (mentioned in Parameter 1) to search in mail server.
Param 1 : Name of the current folderExample:
setCurrentFolder: <Folder Name : SENT>
Sets the SENT folder as default in mail server for searching text
verifyMessageCount Web, Mobile


---

To verify the total number of messages is value (mentioned in Parameter 1).
Param 1 : Total number of messagesExample:
verifyMessageCount : <Total Messages : 1000>
Verifies the total number of messages is 1000
verifyUnreadMessageCount Web, Mobile


---

To verify the total number of unread messages is value (mentioned in Parameter 1).
Param 1 : Total number of unread messagesExample:
verifyUnreadMessageCount : <Total unread Messages : 1000>
Verifies the total number of unread messages is 1000
verifySubjectExists Web, Mobile


---

To verify if mail exists with subject (mentioned in Parameter 1).
Param 1 : Subject of the mailExample:
verifySubjectExists : <Subject : Welcome to Bqurious>
Verifies if mails exists with subject Welcome to Bqurious
verifyLinkWithTextExist Web, Mobile


---

To verify the link text (mentioned in Parameter 2) from message content of the mail having subject (mentioned in Parameter 1) exists.
Param 1 : Subject of the mail Param 2 : Text on linkExample:
verifyLinkWithTextExist : <Subjet : Welcome to bqurious > <Link Text: www.bqurious.com>
Verifies the link text www.bqurious.com from message content in mail with subject as Welcome to bqurious.
verifyUrlWithTextExist Web, Mobile


---

To verify the URL (mentioned in parameter 2), from the mail body with subject (mentioned in parameter 1).
Param 1 : Subject of the mail Param 2 : Text to verifyExample:
verifyUrlWithTextExist : <Subject : HELLO> <Text to verify : http://www.bqurious.com>
Verifies url <http://www.bqurious.com> in the mail body with subject HELLO
verifyTextExistsInMailBody Web, Mobile


---

To verify the text (mentioned in Parameter 2) exists in email body having subject (subject mentioned in Parameter 1).
Param 1 : Subject of the mail Param 2 : Text to verifyExample:
verifyTextExistsInMailBody : <Subject : Welcome Mail> <Text to verify : Welcome to Bqurious>
Verifies text Welcome to Bqurious exists in email body having subject Welcome Mail