IMPORTANT: Dear friends, since google Changed their security policy on accessing the security apps, many of our folks got the access issues, I found a solution for that, I tested it, and it is working fine. I am trying to find some time to create a video with the solution, Will post it soon. Thanks a lot. Regards, .Click() automation Labs
I have just uploaded a video with the solutions, you can watch at : th-cam.com/video/e5yhvwOk__4/w-d-xo.html Feel free to post the issues in comments section. Thank you all.
HI There Great tutorial I must say. Just a question. How will we handle if our inbox has multiple unread emails of the same subject? how we will we ensure that we are clicking on the latest one
Hi, Thank you very much for your appreciation, it means a lot for me. I can see two solutions over here: Solution 1 : 1) First mark all the emails as Read before requesting OTP(If you want I can write a utility method to do so), so that you will have unread emails count as 0 2) Now once after requesting OTP check the unread email count should be >1 as shown below : List emailtext=emailUtils.getUnreadMessageByFromEmail(store, "Inbox", "account-security-noreply@accountprotection.microsoft.com", "Microsoft account password reset"); if (emailtext.size()pre_count) System.out.println("OTP Email is received"); else throw new Exception("No OTP Email is received");) 5) Now write the code to read the email and get the OTP List emailtext=emailUtils.getUnreadMessageByFromEmail(store, "Inbox", "account-security-noreply@accountprotection.microsoft.com", "Microsoft account password reset"); String regex= "[^\\d]+"; String[] OTP=emailtext.get(0).split(regex); Note : As i said index 0 email is always the latest one System.out.println("OTP is : "+OTP[1]); I hope I could able to answer you.. if any issues please raise in comments section I can get back at earliest. Thanks, .Click() Automation Labs
Thank you, I hope it should work, what you need to do is , provide right set of input parameters such as severname, port and credentials. Could you please provide what is your specific need ? Thanks . click () automation labs
I have written the same thin in text file correctly and save it in 'info.txt' format in Desktop. And put the whole path of info.text under the FileInputStream,But after execution its giving an error - PLEASE SPECIFY GMAIL_USERNAME IN PROPERTIES FILE.
Hello thanks for this video, Now I need to implement an automated test for Rest API which resends OTP every 60 seconds, how can I automate this I need a code to send otp the first time but if user try to send otp again before 6secs the api should return a message that i cant do it and i have to wait 60secs to do it
hi i need your help to know something. I used your methods and all working fine on eclipse. But i need to run this on jenkins through my git repository. So i tried many ways its getting me error in import this Emailutils bcoz this jar file is on our local machine. i tried to put this jar file on git repo it also didn't worked for me. Is there any dependency for this or any idea to resolve?
@@dotclickautomationlabs8078 hello sir i have a question can i automate twitch login with selenium as twitch always ask for otp when we login can u make a video on that or pls tell me here
@@dotclickautomationlabs8078 yes otp comes to gmail and in number format you can make a twitch account then log out and log in again to see how it works (i want this for my regular viewing a channel coz he gave rewards to people who view him)
@@FrustratedF Yes, we can do that , fwd me the OTP email that you have received to my email dotclicklabs@gmail.com so that I will see if any regular expression change required...
SelectorsHub is a tool to help you to write the Xpath is a simpler way but it is not an automated test tool, selenium is a powerful test automation tool.. Thanks .Click() automation Labs
Hi Sushma, is this issue is resolved?. I have to fetch OTP from and insert into input field as part of registration process. If it's sorted help me. Thanks
what's the issue you are facing, to add the jar files to maven follow the link dotclicklabs.blogspot.com/p/guide-lines-to-use-automation-utilities.html Thanks, .Click() automation Labs
Thanks for the detailed video. I see that in EmailUtils we are not using port anywhere though that property we are giving in configuration file. Actually my test is getting failed saying connection timed out. But if I do telnet IMAP.gmsil 587 , it connects so there is no firewall issue. But why is it failing with script . Please help
hello sir i have a question can i automate twitch login with selenium as twitch always ask for otp when we login can u make a video on that or pls tell me here
Hi, here is the customized code to retrieve the twitch OTP code : List emailtext=emailUtils.getUnreadMessageByFromEmail(store, "Inbox", "no-reply@twitch.tv", "Your Twitch Verification Code"); if (emailtext.size()
Hi Kumar , I am sorry code cannot be shared ,you can download the jar file from github.com/DotClickLabs/automationutils/raw/main/automationUtilities-pro-1.0.jar Thank you Regards, .click() labs
How can we read otp latest email if the email comes in a same thread. Example - let say Today we perform login operation. we received an email for the same. Now on the same day if I again perform login operation then this time that email received in a thread of previous email. Through this set of code the OTP which we get is same every time which is on the top of that thread i.e. the 1st email of the day. Or if the email on the top of the thread is not in expended form then that time we not able to fetch any OTP.
@@dotclickautomationlabs8078 That unread email is in the thread of the previous email from the same subject. so on entering that unread email we always get that 1st email received on the current day.
Hi, I did not tested it, however can you please give a try with below configuration details Host: SMTP.zoho.com Port :587 Username : your email address Pasword : your password
can you please check the email from, subject line and it should be unread mail in your email box, if you opened your email please mark it as unread. Thanks, .Click() Automation Labs
@@SumanKumari-mv9kp Please give your email details , it should have the blow values : gmail_username= yourmailid@gmail.com gmail_password= your gmail password gmail_port=587 gmail_from=yourmailid@gmail.com to=testautomationlabs3@gmail.com
I've written same thing in notepad correctly and save as 'info.txt' format in desktop.but after execution its giving an error like PLEASE SPECIFY GMAIL_USERNAME IN PROPERTIES FILE. Please suggest me that how can I excute this script. Shoul I save that file as 'info.properties' ?
You have written ....\\ config\\config-lab2.properties. so what is actually config, is it a simple folder where the 'cinfig-lab2. properties' is saved that contains Gmail details?
@@SumanKumari-mv9kp Hi, if you are finding difficulties via reading the config file, you can directly use it in your java class, below is the code to use in java class, for this you need not to have config.properties file defined. Properties prop =new Properties(); EmailUtils emailUtils = new EmailUtils(); prop.setProperty("to", "testautomationlabs2@gmail.com"); prop.setProperty("gmail_from", "@gmail.com"); prop.setProperty("gmail_username", "testautomationlabs3@gmail.com"); prop.setProperty("gmail_password", ""); prop.setProperty("gmail_port", "587"); Store store =emailUtils.connectToGmail(prop); List emailtext=emailUtils.getUnreadMessageByFromEmail(store, "Inbox", "account-security-noreply@accountprotection.microsoft.com", "Microsoft account password reset"); if (emailtext.size()
I am getting javax. Mail. MessagingException javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate Please suggest
Hi, i am getting protocol disable error. can you please help javax.mail.MessagingException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate); nested exception is: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
IMPORTANT: Dear friends, since google Changed their security policy on accessing the security apps, many of our folks got the access issues, I found a solution for that, I tested it, and it is working fine. I am trying to find some time to create a video with the solution, Will post it soon.
Thanks a lot.
Regards,
.Click() automation Labs
Please do it soon
Is it done. Kindly share the video link 🙏
I have just uploaded a video with the solutions, you can watch at : th-cam.com/video/e5yhvwOk__4/w-d-xo.html
Feel free to post the issues in comments section.
Thank you all.
HI There
Great tutorial I must say. Just a question. How will we handle if our inbox has multiple unread emails of the same subject? how we will we ensure that we are clicking on the latest one
Hi,
Thank you very much for your appreciation, it means a lot for me.
I can see two solutions over here:
Solution 1 :
1) First mark all the emails as Read before requesting OTP(If you want I can write a utility method to do so), so that you will have unread emails count as 0
2) Now once after requesting OTP check the unread email count should be >1 as shown below :
List emailtext=emailUtils.getUnreadMessageByFromEmail(store, "Inbox", "account-security-noreply@accountprotection.microsoft.com", "Microsoft account password reset");
if (emailtext.size()pre_count)
System.out.println("OTP Email is received");
else
throw new Exception("No OTP Email is received");)
5) Now write the code to read the email and get the OTP
List emailtext=emailUtils.getUnreadMessageByFromEmail(store, "Inbox", "account-security-noreply@accountprotection.microsoft.com", "Microsoft account password reset");
String regex= "[^\\d]+";
String[] OTP=emailtext.get(0).split(regex); Note : As i said index 0 email is always the latest one
System.out.println("OTP is : "+OTP[1]);
I hope I could able to answer you.. if any issues please raise in comments section I can get back at earliest.
Thanks,
.Click() Automation Labs
Awesome video, what if the OTP if to mobile number? Any solution for automation?
Very helpful video. Learn a lot. and Thanks for your help sir.
~Kanhiya
wow great work Thanks
Hi,
When we can expect latest video, it would be great help if we get the video ASAP.
Thanks in advance.
Good job my friend.
Thank you very much
Great video!! Could you please provide the link to download the JAR file?
Thank you , please refer the below link :dotclicklabs.blogspot.com/p/guide-lines-to-use-automation-utilities.html?m=1
@@dotclickautomationlabs8078 I can't get the jar file
Download it from here github.com/DotClickLabs/automationutils/raw/main/automationUtilities-pro-1.0.jar
Helpful .. Thanking you alot for great effort.. 🤝💐😊
Hello did you got otp
@@murlikalla Hello did you got otp
@@murlikalla 😳
Really helpful Sir, I would like to know if this will work for emails other than Gmail?
Thank you, I hope it should work, what you need to do is , provide right set of input parameters such as severname, port and credentials. Could you please provide what is your specific need ?
Thanks
. click () automation labs
I have written the same thin in text file correctly
and save it in 'info.txt' format in Desktop. And put the whole path of info.text under the FileInputStream,But after execution its giving an error - PLEASE SPECIFY GMAIL_USERNAME IN PROPERTIES FILE.
Hello
thanks for this video,
Now I need to implement an automated test for Rest API which resends OTP every 60 seconds, how can I automate this
I need a code to send otp the first time but if user try to send otp again before 6secs the api should return a message that i cant do it and i have to wait 60secs to do it
hi i need your help to know something. I used your methods and all working fine on eclipse. But i need to run this on jenkins through my git repository. So i tried many ways its getting me error in import this Emailutils bcoz this jar file is on our local machine. i tried to put this jar file on git repo it also didn't worked for me. Is there any dependency for this or any idea to resolve?
very good tutorial, thanks
Hi
Can I use same utility for Outlook as well?
Outlook , it will not work
When I print the List emailtext it prints null, so where is the email coming in the console from?
Helo sir, you are created class na they are email utilities and test utilities are blank or there are has any code na
No, it should have , can you share me the error you are getting ?
@@dotclickautomationlabs8078 how to import emailutilities
Use com.testing.framework.emailUtils, watch the video at 19:44 to know about this step
Hello I have one question what if the OTP comes in an image template is it possible to retrieve data from it?
Hi Akshat, unfortunately that is not possible with this utility.
Regards,
dotclicklabs
@@dotclickautomationlabs8078 hello sir i have a question can i automate twitch login with selenium as twitch always ask for otp when we login can u make a video on that or pls tell me here
@@FrustratedF Hellow, it depends on how you are getting the OTP, if OTP is coming to gmail then we can do that. can you elaborate more please?
@@dotclickautomationlabs8078 yes otp comes to gmail and in number format you can make a twitch account then log out and log in again to see how it works (i want this for my regular viewing a channel coz he gave rewards to people who view him)
@@FrustratedF Yes, we can do that , fwd me the OTP email that you have received to my email dotclicklabs@gmail.com so that I will see if any regular expression change required...
What is the difference between the Selenium and SelectorsHub?
SelectorsHub is a tool to help you to write the Xpath is a simpler way but it is not an automated test tool, selenium is a powerful test automation tool..
Thanks
.Click() automation Labs
@@dotclickautomationlabs8078 thank you for the info.
Sir !! , please help me out here, while debug i am getting null for emailText veriable, please suggest what i should do ?
Share me the screenshot, I will take a look at it
Great Solution, but not able to add jar to maven project , not able to import the EmailUtils , Kindly help me out
Hi Sushma, is this issue is resolved?. I have to fetch OTP from and insert into input field as part of registration process. If it's sorted help me. Thanks
what's the issue you are facing, to add the jar files to maven follow the link dotclicklabs.blogspot.com/p/guide-lines-to-use-automation-utilities.html
Thanks,
.Click() automation Labs
Can you please provide the link to download the java file? Thanks
Hi, you can download the jar file from : github.com/DotClickLabs/automationutils/raw/main/automationUtilities-pro-1.0.jar
Thanks for the detailed video.
I see that in EmailUtils we are not using port anywhere though that property we are giving in configuration file.
Actually my test is getting failed saying connection timed out.
But if I do telnet IMAP.gmsil 587 , it connects so there is no firewall issue.
But why is it failing with script .
Please help
Okie, let me recheck and confirm you
i got the error to read the otp from mail error is No appropriate protocol (protocol is disabled or cipher suites are inappropriate);
hello sir i have a question can i automate twitch login with selenium as twitch always ask for otp when we login can u make a video on that or pls tell me here
Hi, here is the customized code to retrieve the twitch OTP code :
List emailtext=emailUtils.getUnreadMessageByFromEmail(store, "Inbox", "no-reply@twitch.tv", "Your Twitch Verification Code");
if (emailtext.size()
@@dotclickautomationlabs8078 thanks sir
Hi, nice explanation.
In my case , it returns "null".
Please check you have unread emails with the given input parameters
@@dotclickautomationlabs8078
thanks for the reply. I have sent my result to your mail id. Please find the attachment.
I am on travel will get back to you aspa
@@felixrajan4804 in my case its showing no email received bt otp was there plz help me if your code is running
If that is the case , you might need to change the regular expression
emailutility where is that ? is it class?
Can we use the same utility to read email from outlook?
This will not work with outlook mails...
Can i take yopmail instead of gmail and if yes, what would be port
Hi,
I apologised to say that I have not tested it on yopmail, sorry
Regards
. click () automation Labs
Sir, how we can read otp if it comes on mobile number, how to automate that case. For ex- we have to login into website with mobile number and otp
That's not possible with this utility , I am sorry for that
How It will possible with python
hi i am getting connection failed error
not able to connect with gmail please help
I want this code please can provide where I can find it please
this video is for gmail verification what about mobile sms verification
Good Question, currently this utility does not have any support for SMD, I hope I will add that sooner
Thanks
dotclicklabs team
@@dotclickautomationlabs8078 it is not possible with smslib .which import in eclipse pom file
@@dippypanwar I am sorry I did not get your recent post, can you please elaborate?
Thanks,
.Click() automation Labs
I m using eclipse with selenium..can we use smslib.jar in this framework
Yes , why not .you can use that jar file
HI can we get the github link for the code, if you can post here will be helpful
Hi Kumar , I am sorry code cannot be shared ,you can download the jar file from github.com/DotClickLabs/automationutils/raw/main/automationUtilities-pro-1.0.jar
Thank you
Regards,
.click() labs
Hi , i am getting FileNotFoundException. I added correct path but still it is showing this error. Can u help me
Can you share me the code and error where you are facing the issue ?
Is there any way to automate voice call otp in selenium ??
Hi, I am sorry I think we do not have any as of now
Hello I have connection issue getting FileNotFoundException.
Please check your properties file path if you mentioned in the script
How can we read otp latest email if the email comes in a same thread.
Example -
let say Today we perform login operation. we received an email for the same. Now on the same day if I again perform login operation
then this time that email received in a thread of previous email.
Through this set of code the OTP which we get is same every time which is on the top of that thread i.e. the 1st email of the day.
Or if the email on the top of the thread is not in expended form then that time we not able to fetch any OTP.
First you need to read all the emails before attempting to login ,So that you will have a one unread Email and you will get that code ,
@@dotclickautomationlabs8078 That unread email is in the thread of the previous email from the same subject. so on entering that unread email we always get that 1st email received on the current day.
Hi, Can we read OTP from Zoho mail
Hi, I did not tested it, however can you please give a try with below configuration details
Host: SMTP.zoho.com
Port :587
Username : your email address
Pasword : your password
what about yopmail
sir get me the code for this please
i sent otp to my mail bt it showing no mail received plz help me for this
can you please check the email from, subject line and it should be unread mail in your email box, if you opened your email please mark it as unread.
Thanks,
.Click() Automation Labs
Give mobile otp automation test
I getting error with this method
What is under config file?
Actually I don't get that what's actually under the config property file so can you please tell me about that?
@@SumanKumari-mv9kp Please give your email details , it should have the blow values :
gmail_username= yourmailid@gmail.com
gmail_password= your gmail password
gmail_port=587
gmail_from=yourmailid@gmail.com
to=testautomationlabs3@gmail.com
I've written same thing in notepad correctly and save as 'info.txt' format in desktop.but after execution its giving an error like PLEASE SPECIFY GMAIL_USERNAME IN PROPERTIES FILE. Please suggest me that how can I excute this script. Shoul I save that file as 'info.properties' ?
You have written ....\\ config\\config-lab2.properties. so what is actually config, is it a simple folder where the 'cinfig-lab2. properties' is saved that contains Gmail details?
@@SumanKumari-mv9kp Hi, if you are finding difficulties via reading the config file, you can directly use it in your java class, below is the code to use in java class, for this you need not to have config.properties file defined.
Properties prop =new Properties();
EmailUtils emailUtils = new EmailUtils();
prop.setProperty("to", "testautomationlabs2@gmail.com");
prop.setProperty("gmail_from", "@gmail.com");
prop.setProperty("gmail_username", "testautomationlabs3@gmail.com");
prop.setProperty("gmail_password", "");
prop.setProperty("gmail_port", "587");
Store store =emailUtils.connectToGmail(prop);
List emailtext=emailUtils.getUnreadMessageByFromEmail(store, "Inbox", "account-security-noreply@accountprotection.microsoft.com", "Microsoft account password reset");
if (emailtext.size()
I am getting javax. Mail. MessagingException javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate
Please suggest
Video is not showing sir
Oh really ,what is the error you are getting?
Can you please help ne
Arun, what is the issue, can you please post here?
Hello sir my otp is reading but not entering the values in that section
Hi, i am getting protocol disable error. can you please help
javax.mail.MessagingException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate);
nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
I am also getting the same error did you get any solution on this? Please let me know
@@shwetarathod3394 I have used Java mail api to read OTP. it works for me.
@Sangeetha Anbu could you please provide me the url for java mail api?
Is this resolved I am also getting same error?
@Nukavalli Harsha Manikanta I have changed it to the latest one it's working