How to Automate OTP number using Selenium

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 158

  • @dotclickautomationlabs8078
    @dotclickautomationlabs8078  2 ปีที่แล้ว +3

    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

    • @navenesa3961
      @navenesa3961 2 ปีที่แล้ว

      Please do it soon

    • @ankurrathour7235
      @ankurrathour7235 7 หลายเดือนก่อน

      Is it done. Kindly share the video link 🙏

  • @dotclickautomationlabs8078
    @dotclickautomationlabs8078  ปีที่แล้ว

    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.

  • @e2eautomation248
    @e2eautomation248 3 ปีที่แล้ว +1

    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

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว +2

      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

  • @freeguy2418
    @freeguy2418 2 ปีที่แล้ว

    Awesome video, what if the OTP if to mobile number? Any solution for automation?

  • @automationtest2251
    @automationtest2251 3 ปีที่แล้ว

    Very helpful video. Learn a lot. and Thanks for your help sir.
    ~Kanhiya

  • @Psai4456
    @Psai4456 2 ปีที่แล้ว +1

    wow great work Thanks

  • @ShivaKumar-vc3nk
    @ShivaKumar-vc3nk ปีที่แล้ว

    Hi,
    When we can expect latest video, it would be great help if we get the video ASAP.
    Thanks in advance.

  • @arunx20042003
    @arunx20042003 3 ปีที่แล้ว +1

    Good job my friend.

  • @alekha007
    @alekha007 3 ปีที่แล้ว +2

    Great video!! Could you please provide the link to download the JAR file?

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว +2

      Thank you , please refer the below link :dotclicklabs.blogspot.com/p/guide-lines-to-use-automation-utilities.html?m=1

    • @shilkacp1878
      @shilkacp1878 ปีที่แล้ว

      @@dotclickautomationlabs8078 I can't get the jar file

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  ปีที่แล้ว

      Download it from here github.com/DotClickLabs/automationutils/raw/main/automationUtilities-pro-1.0.jar

  • @krishnatheo
    @krishnatheo 2 ปีที่แล้ว

    Helpful .. Thanking you alot for great effort.. 🤝💐😊

  • @anoopjain2608
    @anoopjain2608 3 ปีที่แล้ว

    Really helpful Sir, I would like to know if this will work for emails other than Gmail?

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      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

    • @SumanKumari-mv9kp
      @SumanKumari-mv9kp 3 ปีที่แล้ว

      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.

  • @rehameid2213
    @rehameid2213 ปีที่แล้ว

    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

  • @Sjtgeseeker
    @Sjtgeseeker 8 หลายเดือนก่อน

    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?

  • @johndang9921
    @johndang9921 2 ปีที่แล้ว

    very good tutorial, thanks

  • @radhasubbu7476
    @radhasubbu7476 2 ปีที่แล้ว +1

    Hi
    Can I use same utility for Outlook as well?

  • @rishabhsingh3315
    @rishabhsingh3315 2 ปีที่แล้ว

    When I print the List emailtext it prints null, so where is the email coming in the console from?

  • @murlikalla
    @murlikalla 2 ปีที่แล้ว

    Helo sir, you are created class na they are email utilities and test utilities are blank or there are has any code na

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  2 ปีที่แล้ว

      No, it should have , can you share me the error you are getting ?

    • @murlikalla
      @murlikalla 2 ปีที่แล้ว

      @@dotclickautomationlabs8078 how to import emailutilities

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  2 ปีที่แล้ว

      Use com.testing.framework.emailUtils, watch the video at 19:44 to know about this step

  • @akshatsaxena1678
    @akshatsaxena1678 3 ปีที่แล้ว +1

    Hello I have one question what if the OTP comes in an image template is it possible to retrieve data from it?

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว +1

      Hi Akshat, unfortunately that is not possible with this utility.
      Regards,
      dotclicklabs

    • @FrustratedF
      @FrustratedF 3 ปีที่แล้ว

      @@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
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      @@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?

    • @FrustratedF
      @FrustratedF 3 ปีที่แล้ว

      @@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)

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      @@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...

  • @kritishah1659
    @kritishah1659 3 ปีที่แล้ว +1

    What is the difference between the Selenium and SelectorsHub?

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      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

    • @kritishah1659
      @kritishah1659 3 ปีที่แล้ว +1

      @@dotclickautomationlabs8078 thank you for the info.

  • @amazingclubs5349
    @amazingclubs5349 ปีที่แล้ว

    Sir !! , please help me out here, while debug i am getting null for emailText veriable, please suggest what i should do ?

  • @sushmachecka8688
    @sushmachecka8688 2 ปีที่แล้ว

    Great Solution, but not able to add jar to maven project , not able to import the EmailUtils , Kindly help me out

    • @radhasubbu7476
      @radhasubbu7476 2 ปีที่แล้ว

      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

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  2 ปีที่แล้ว

      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

  • @johndang9921
    @johndang9921 2 ปีที่แล้ว

    Can you please provide the link to download the java file? Thanks

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  2 ปีที่แล้ว

      Hi, you can download the jar file from : github.com/DotClickLabs/automationutils/raw/main/automationUtilities-pro-1.0.jar

  • @sarikonchada5758
    @sarikonchada5758 2 ปีที่แล้ว

    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

  • @hemailayaraja2905
    @hemailayaraja2905 9 หลายเดือนก่อน

    i got the error to read the otp from mail error is No appropriate protocol (protocol is disabled or cipher suites are inappropriate);

  • @FrustratedF
    @FrustratedF 3 ปีที่แล้ว

    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
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      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()

    • @FrustratedF
      @FrustratedF 3 ปีที่แล้ว

      @@dotclickautomationlabs8078 thanks sir

  • @felixrajan4804
    @felixrajan4804 3 ปีที่แล้ว

    Hi, nice explanation.
    In my case , it returns "null".

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว +1

      Please check you have unread emails with the given input parameters

    • @felixrajan4804
      @felixrajan4804 3 ปีที่แล้ว

      @@dotclickautomationlabs8078
      thanks for the reply. I have sent my result to your mail id. Please find the attachment.

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      I am on travel will get back to you aspa

    • @mrunaliauchar6278
      @mrunaliauchar6278 3 ปีที่แล้ว

      @@felixrajan4804 in my case its showing no email received bt otp was there plz help me if your code is running

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      If that is the case , you might need to change the regular expression

  • @sonalidash8965
    @sonalidash8965 ปีที่แล้ว

    emailutility where is that ? is it class?

  • @vidhya.balaji
    @vidhya.balaji 2 ปีที่แล้ว

    Can we use the same utility to read email from outlook?

  • @lessonwise3178
    @lessonwise3178 3 ปีที่แล้ว

    Can i take yopmail instead of gmail and if yes, what would be port

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      Hi,
      I apologised to say that I have not tested it on yopmail, sorry
      Regards
      . click () automation Labs

  • @harshrana2605
    @harshrana2605 2 ปีที่แล้ว

    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

  • @swapnilmhapankar8499
    @swapnilmhapankar8499 2 ปีที่แล้ว

    How It will possible with python

  • @testingpassport5378
    @testingpassport5378 2 ปีที่แล้ว

    hi i am getting connection failed error
    not able to connect with gmail please help

  • @pavankumarpakaraddi
    @pavankumarpakaraddi 2 ปีที่แล้ว

    I want this code please can provide where I can find it please

  • @dippypanwar
    @dippypanwar 3 ปีที่แล้ว +2

    this video is for gmail verification what about mobile sms verification

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว +1

      Good Question, currently this utility does not have any support for SMD, I hope I will add that sooner
      Thanks
      dotclicklabs team

    • @dippypanwar
      @dippypanwar 3 ปีที่แล้ว

      @@dotclickautomationlabs8078 it is not possible with smslib .which import in eclipse pom file

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว +1

      @@dippypanwar I am sorry I did not get your recent post, can you please elaborate?
      Thanks,
      .Click() automation Labs

    • @dippypanwar
      @dippypanwar 3 ปีที่แล้ว

      I m using eclipse with selenium..can we use smslib.jar in this framework

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว +1

      Yes , why not .you can use that jar file

  • @manikumar-ix7sr
    @manikumar-ix7sr 2 ปีที่แล้ว

    HI can we get the github link for the code, if you can post here will be helpful

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  2 ปีที่แล้ว

      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

  • @priyapattem8389
    @priyapattem8389 2 ปีที่แล้ว

    Hi , i am getting FileNotFoundException. I added correct path but still it is showing this error. Can u help me

  • @karpagamvenkatesan8202
    @karpagamvenkatesan8202 2 ปีที่แล้ว

    Is there any way to automate voice call otp in selenium ??

  • @FX__Pratham
    @FX__Pratham 3 ปีที่แล้ว

    Hello I have connection issue getting FileNotFoundException.

  • @kanhiyakumar7203
    @kanhiyakumar7203 2 ปีที่แล้ว

    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
      @dotclickautomationlabs8078  2 ปีที่แล้ว

      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 ,

    • @kanhiyakumar7203
      @kanhiyakumar7203 2 ปีที่แล้ว

      @@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.

  • @flynavatechnologies5917
    @flynavatechnologies5917 3 ปีที่แล้ว

    Hi, Can we read OTP from Zoho mail

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      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

  • @chinmayk2657
    @chinmayk2657 9 หลายเดือนก่อน

    what about yopmail

  • @pavankumarpakaraddi
    @pavankumarpakaraddi 2 ปีที่แล้ว

    sir get me the code for this please

  • @mrunaliauchar6278
    @mrunaliauchar6278 3 ปีที่แล้ว

    i sent otp to my mail bt it showing no mail received plz help me for this

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      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

  • @jshanmukeshyadav1788
    @jshanmukeshyadav1788 2 ปีที่แล้ว

    Give mobile otp automation test

  • @pavankumarpakaraddi
    @pavankumarpakaraddi 2 ปีที่แล้ว

    I getting error with this method

  • @SumanKumari-mv9kp
    @SumanKumari-mv9kp 3 ปีที่แล้ว

    What is under config file?

    • @SumanKumari-mv9kp
      @SumanKumari-mv9kp 3 ปีที่แล้ว

      Actually I don't get that what's actually under the config property file so can you please tell me about that?

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว

      @@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

    • @SumanKumari-mv9kp
      @SumanKumari-mv9kp 3 ปีที่แล้ว

      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' ?

    • @SumanKumari-mv9kp
      @SumanKumari-mv9kp 3 ปีที่แล้ว

      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?

    • @dotclickautomationlabs8078
      @dotclickautomationlabs8078  3 ปีที่แล้ว +1

      @@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()

  • @shwetarathod3394
    @shwetarathod3394 2 ปีที่แล้ว

    I am getting javax. Mail. MessagingException javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate
    Please suggest

  • @aradhyasolankivlog576
    @aradhyasolankivlog576 ปีที่แล้ว

    Video is not showing sir

  • @ArunKumar-bw2cf
    @ArunKumar-bw2cf 2 ปีที่แล้ว

    Can you please help ne

  • @ArunKumar-bw2cf
    @ArunKumar-bw2cf 2 ปีที่แล้ว

    Hello sir my otp is reading but not entering the values in that section

  • @sangeethaanbu1543
    @sangeethaanbu1543 2 ปีที่แล้ว

    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)

    • @shwetarathod3394
      @shwetarathod3394 2 ปีที่แล้ว

      I am also getting the same error did you get any solution on this? Please let me know

    • @sangeethaanbu1543
      @sangeethaanbu1543 2 ปีที่แล้ว

      ​@@shwetarathod3394 I have used Java mail api to read OTP. it works for me.

    • @shwetarathod3394
      @shwetarathod3394 2 ปีที่แล้ว

      @Sangeetha Anbu could you please provide me the url for java mail api?

    • @rishabhsingh3315
      @rishabhsingh3315 2 ปีที่แล้ว

      Is this resolved I am also getting same error?

    • @rishabhsingh3315
      @rishabhsingh3315 2 ปีที่แล้ว

      @Nukavalli Harsha Manikanta I have changed it to the latest one it's working