Resource icon

POP Protocol to retrieve email from mailbox

  • perf-test.com need your contributions to build up a strong repository of performance engineering resources.

To retrieve an email from gmail using loadrunner

Prerequisite : A working gmail account with password.

We created a script using POP3 Protocol in loadrunner and used following code to retrieve the emails

Code:
//int totalMessages;
    pop3_logon("Login", "URL=pop3s://{PUserID}:{PPassword}@pop.gmail.com:995","STARTTLS",LAST);
    //pop3_logon("Login", "URL=pop3://user0004t:my_pwd@techno.merc-int.com", LAST );
    // List all messages on the server and receive that value
    //totalMessages = pop3_list("POP3", LAST);
    // Display the received value (It is also displayed by the pop3_list function)
//    lr_log_message("There are %d messages.\r\n\r\n", totalMessages);
    // Retrieve 5 messages on the server without deleting them
    pop3_retrieve("POP3", "RetrieveList=1:2:3:4", "DeleteMail=false", "SaveTo=test",LAST);
    pop3_logoff();

Using the above code we were successfully able to retrieve email number 1, 2, 3, 4 from our gmail id.

Note - My Gmail ID got blocked after 2 days - So be careful while testing with your gmail account.
Author
admin
Views
94
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from admin