Mail Notification using Selenium - selenium

I have a doubt like ... Can we use mails in automation(selenium).For ex, I am submitting a form , can we use selenium
- to send email
- to verify whether email has been received by that recepient and can we process that through selenium
I have read like we should not automate with gmail as per aggreement.I am not sure about this .

It's possible. You can use Java Mail API to achieve this.
Otherwise use public email systems like Mailinator. By using the API, we can fetch email content. Please read API docs for more info.
Similar question asked before.

Related

Registration process with mail confirmation in Selenium

I have question about registration process in selenium. Which way is best to do it if we must click activation link in received email? Which method is used by commercial QA teams?
I am thinking about this problem and I want to use sites like '10 minutes mail', is that a good way?
There's any other options? I can't use same mail multiple times.
Creating new 'true' mail every time will be difficult and will take too much time, there will be captcha problems etc
you can use a mailbox as registration mail, which supply API to read mail content in inbox, rather than only can from UI. Therefore you can easier to get the activation link and send http request to simulate click activation link.
Try using regular gmail account, there is a trick with '+' character and You can re-use multiple times, and mail is getting received on same account.
So You can use like this: open gmail with desired address, eg. address testmail#gmail.com, so You can reuse it in following iterations:
testmail+1#gmail.com
testmail+2#gmail.com
...
testmail+test1#gmail.com
testmail+test2#gmail.com
and so You can have...lot of accounts. I've used this method and its quite sufficient.

How to know if user has seen a message sent by my bot in Telegram?

I'm developing a Telegram bot, and I want to know whether a user, that has started a private chat with my bot, has seen a certain message sent by bot, and to know when has he seen it.
Is it possible to do so?
Thank you very much.
That's currently not possible.
I'm using this solution.
Create a channel specially for your bot
Let your robot send message from this channel to users, you can use forward method.
Now you can see how many users have seen your message
Telegram Bot API has limit functionality. There is absolutely no way to get message view count at the time of this comment.
Usually TDLib can be used instead of Telegram Bot. It is Telegram client library. You can use it directly or make it as services for BOT to call.
For example. use TdApi.GetMessage to get the message, and the returned message has field of interactionInfo which contains forwardCount or viewCount.
perhaps this answer help you :
in the end of your message place
link example : yoursite.com\checkvisit.php?id=1234
when user open message link automatic run for telegram ...
you can understand message was read
you must in checkvisit.php set to check db if id exist and not read set it to read
then id in db remove or disable
but this method simple - telegram must add 1 parameter to return this
sorry my english not good
it is not possible yet , you might want to search for Madeline bot

How can i test using multiple users , a sign up page with OTP using jmeter

My website has an OTP authentication at the time of registering to the website. I need to pass the otp that is send to both email id and mobile number into the next page, register and do rest steps in the website. I need to do it with 500 users. Please help me, if there is any solutions
You can use JMeter's Mail Reader sampler (maybe in combination with Regular Expression Extractor) to get the OTP from the email message generated by your system, store it into a JMeter Variable and use in login request.
See How to Create a JMeter Script to Check Email During Registration AND Grab the Confirmation URL article for detailed steps.
If you need do to it for 500 users I guess you'll need to have 500 email accounts, so you might need to use CSV Data Set Config to read keep email/password pairs from .csv file.

Send email to pushbullet?

The website "PushBullet.com" is webwashed(filtered) by our proxy, at work.
But I really need to send some notifications to my devices.
Is there a way to send them thru the good old email protocol ?
So there is no officially supported feature for this, but you can sort of fake it using the existing email-to-push feature.
Send a push to an email address that is not a pushbullet account, such as yourgmailaccount+randomstring#gmail.com. It will have a from address of someotherrandomstring#pushbulletuseremail.com.
You can then send emails to that address, and they should show up in your pushes list.
Proposed method with random strings in email address doesn't work.
This method works. Not an email, just pure notification as required.
The library developer suggests also command line notification send. Simple and handy.
I was looking to do something similar so I could get pushbullet notifications from cron jobs, and came across this:
https://github.com/side2k/email2pb
I haven't gotten a chance to try it yet but I think this will do what you're wanting. Just tested it, and it works really well if you're able to run a postfix server.
I use Zapier for this (you can do it with a free account).
Set up a Zap to search for new mail under a label (I use "pushbullet-notify"), and send any message there to Pushbullet.
Then in Gmail just create filters for any mails you want PB notifications on, applying the same label.
The notification may be delayed up to 15 minutes from the time the email is received and labeled (free accounts check every 15 minutes).

Record confirmation email

Using Selenium IDE(HTML), I'm recording an registering under one website, and a confirmation email will be sent when the sign up is successful.
This confirmation message will be sent to my gmail. I was recording to check in my gmail using Selenium-Ide but I can't record.So I want to know how to record in gmail using selenium?
Well where is the email going?
Gmail?
Yahoo?
Some other web page?
The above four questions is important! Because, let's say you want to check confirmation email to your gmail if so you need to go to gmail url and you need to record Login and assert things.
I will be show you a example with gmail.
I want to check in my gmail if so
command open
Target https://mail.google.com/
this one need to add to your test. Because of you need to go to new page so you need to use open command.
Have a look at PutsBox. You can send an email to whatever-you-want#putsbox.com, wait for a few seconds (SMTP stuff ins't instantaneous) then check your email via http://preview.putsbox.com/p/whatever-you-want/last.
This post tutorial shows some examples.