Selenium Framework - Part 35 - Creating your own Exception

Поделиться
HTML-код
  • Опубликовано: 16 янв 2025

Комментарии • 44

  • @manikannanmarimuthu9232
    @manikannanmarimuthu9232 4 года назад +3

    Finaly understood about to create customize exception. Thanks for sharing some amazing stuff.

    • @TestingMiniBytes
      @TestingMiniBytes  4 года назад +2

      Thanks a lot nanba.
      Katrathu kai alavu. Keep Learning. ✌️

  • @supriyassampath1419
    @supriyassampath1419 3 года назад +3

    Amazing industry standard framework explanation. I would recommend everyone who wants to learn industry level framework standard they will find it here. This has helped me a lot Amuthan.i have not seen anywhere who has explained exception handling so crisp and clear, even paid videos.
    I have a question
    Inside catch block can I use
    Log.error(" some error message"
    And
    Throw new runtime exception ("some error message")

    • @TestingMiniBytes
      @TestingMiniBytes  3 года назад

      Why do you want to log it there.? What is thr purpose of it.? Instead pass it to the runtime exception. It ll take care of logging

    • @supriyassampath1419
      @supriyassampath1419 3 года назад +1

      @@TestingMiniBytes thank you. Yes, runtime exception will serve the purpose of displaying the message.

    • @skaLife
      @skaLife 2 года назад

      I totally agree and acknowledge - "i have not seen anywhere who has explained exception handling so crisp and clear, even paid videos." - @Supriya
      This is an ultimate playlist totally for absolutely FREE. Until and unless you spent so many hours rectifying the issues, that you face while working with Exception Handling, and thereby learn from them, it will be tough to understand the knowledge.
      @Amuthan has compiled all those Exception Handing points into a 2 hours video. Thanks very much Amuthan.

  • @lka5968
    @lka5968 3 года назад

    Another great video Amuthan.Thank you.

  • @vinothkumars4333
    @vinothkumars4333 3 года назад +1

    Great explanation bro

  • @jaykavin2215
    @jaykavin2215 4 года назад +1

    Amazing content 👏👏👏

  • @subhadeepchakraborty4236
    @subhadeepchakraborty4236 3 года назад +1

    This is great work Amuthan!!
    Please keep coming up with such kind of contents.
    Big fan of your channel 🙌🙌🙌

  • @jaysree3678
    @jaysree3678 3 года назад +2

    Able to understand core JAva concepts much better through your videos.

  • @shrutimendiratta7785
    @shrutimendiratta7785 2 года назад +1

    How to handle situation where we get NosuchElementException from selenium but the actual root cause is button has not been clicked due to some reasons and failed to land to next page to check visibility of another element. Here when the element(button) has not been clicked the program should terminate there itself with throwing exception that element has not been clicked.

    • @TestingMiniBytes
      @TestingMiniBytes  2 года назад

      Please ask your questions in the telegram group with the code, screenshot and error message. Thanks.

  • @rajasekharmaddigalla1463
    @rajasekharmaddigalla1463 4 года назад +1

    Hi Amuthan, there are 2 private videos in playlist, are they some thing related to this frame work ?

  • @kranthikumarkatta9588
    @kranthikumarkatta9588 4 года назад +2

    Bro may I know how many videos still pending for completion of the selenium course .....
    Can we know what has covered and what still pending for interview point of view and subject point of view

    • @TestingMiniBytes
      @TestingMiniBytes  4 года назад +4

      Hi Kranthi,
      We have almost covered a basic framework. But I am planning to integrate this with docker, elastic search, kibana, aws and all the Java 8 concept.
      Apart from that I am also planning to include design patterns into the selenium framework.
      So I dont have an exact number as of today. But these are all planned to be covered :)

    • @kranthikumarkatta9588
      @kranthikumarkatta9588 4 года назад +2

      @@TestingMiniBytes thank you so much and you are really awesome the way you teach and the way you direct us.. thank you

    • @TestingMiniBytes
      @TestingMiniBytes  4 года назад +2

      @@kranthikumarkatta9588 I am glad that i could be of some help.
      Thanks for active commenting. I really appreciate that.
      Since i was teaching virtually, feedback is essential for me to improvise 👍
      I request everyone to like, comment and share your views. 🙏

    • @bkumarj6450
      @bkumarj6450 4 года назад +1

      @@TestingMiniBytes why your channel is different from others is teaching interesting and different concept where others channels won’t.. and the content you mentioned like docker integration and java 8 created more interest in me.. eagerly waiting for your next videos 🙏🏻

    • @TestingMiniBytes
      @TestingMiniBytes  4 года назад +2

      @@bkumarj6450 Thanks a lot again kumar. Yes, they are all getting cooked. Will be served as hot as possible. 👍

  • @kranthikumarkatta9588
    @kranthikumarkatta9588 4 года назад +1

    Hi , you said you gonna make a separate video on hard coding ofTRY AND CATCH OF which MAKES US TO SEE THE CODE VERY CLOGGING AND UGLY ,, are you going to add a new class and adding that in separate folder...so you can recall that method by using get ????
    I didn't seen that you made that part till now

    • @TestingMiniBytes
      @TestingMiniBytes  4 года назад

      That was covered in the video try with resources. Can you please check that out.

  • @manoharch1203
    @manoharch1203 3 года назад +1

    HI Amuthan, Can you please create one video on where we have used/Implemented it in your framework.
    Thanks :)

    • @TestingMiniBytes
      @TestingMiniBytes  3 года назад

      Please watch the next parts of the video so that you can understand how to use in the framework

  • @9745754904
    @9745754904 4 года назад +1

    Thanks.amruthan for this amazing concept. Just One doubt.. Do we need to use try catch in Page class Or test class to.handle selenium.exceptions,if yes how to do it.in a effective way

    • @TestingMiniBytes
      @TestingMiniBytes  4 года назад

      You will get your answer in the upcoming videos. Please keep watching the videos mate. 👍
      Happy learning 👍

    • @9745754904
      @9745754904 4 года назад

      @@TestingMiniBytesthanks Amruthan... Iam Waiting !!!😀

    • @TestingMiniBytes
      @TestingMiniBytes  4 года назад

      @@9745754904 Part 36 to part 39 are already available.

    • @9745754904
      @9745754904 4 года назад +1

      @@TestingMiniBytes oh OK..thanks Amruthan...im yet to watch those...

  • @ajitcs2937
    @ajitcs2937 6 месяцев назад

    hey @TestingMiniBytes although concept is very good i encountered a problem i made the runtime exception for config file key value not prsent that eg url
    but when i run i saw browser opening and then nothing happened prog got terminated due to our custom runtime exception but browser didnt close beacuse abrupt termination

  • @aryan436
    @aryan436 3 года назад +1

    Hello Amuthan,
    Does this mean that it is better to create a separate Java class for all the common exceptions we might face in framework?

    • @TestingMiniBytes
      @TestingMiniBytes  3 года назад +1

      Yes so that you can understand the errors clearly. If selenium guys have not created those exceptions like elementnotinteractable, elelementnotvisible, staleelementreferenceexceptipn and so on it will be difficult for us to maintain a framework.

  • @askomdch
    @askomdch 4 года назад +1

    Do this in your catch block and you will have printed the complete stacktrace in your runtime exception. This will give you the exact line of code in the method that caused the exception.
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    e.printStackTrace(pw);
    throw new runtimeException(sw.toString());

    • @TestingMiniBytes
      @TestingMiniBytes  4 года назад

      Yes Om. But here i thought of enriching the exception. I just tried it on the fly lol.
      Most of the time, we are not actually interested in top level logging. We can even remove certain stack trace elements and just print what is actually needed.
      Anyway thanks a lot for your feedback. 👍

  • @xoda345
    @xoda345 2 года назад

    Hi amuthan, using custom exception we will not be getting the JVM thrown exception. Without that how would we know what exactly is the issue for the failure ?? Also solution to this exception can be found in stack overflow etc sites but if we make custom made exception then we will not get those because those solution are associated with the runtime exception. Please suggest.

    • @TestingMiniBytes
      @TestingMiniBytes  2 года назад

      You can also append the actually thrwon exception

    • @xoda345
      @xoda345 2 года назад

      @@TestingMiniBytes how to do that? Using getStackTrace method?

  • @rahulsiva7204
    @rahulsiva7204 4 года назад +1

    Please make video on log4j

    • @TestingMiniBytes
      @TestingMiniBytes  4 года назад +1

      Hi Rahul,
      To be frank log4j is a component that we generally have in the framework but does not benefits us much.
      We are using extent reports for the logging and I think that is suffice to rectify the issues.
      I will take your feedback, reassess and make a video if it is really needed.
      Thanks for asking 👍🙏

  • @sagars3332
    @sagars3332 3 года назад

    Hi bro my java version is 11 got some doubts in Exception handling..
    when I am inserting line 1 inside try with resource block then on exception it is going to catch block and printing all customized stack trace......but inside try with resource block when I am using only fi(which we can do only after java version 9)
    then it is not entering catch block...but I am not able to find the reason for it can you help please..sorry for bit big lengthy text
    //---------->line1--FileInputStream fi=new FileInputStream(new File(FrameworkConstants.getExcelfilepath()));
    try(FileInputStream fi=new FileInputStream(new File(FrameworkConstants.getExcelfilepath())))
    {
    //reading m excel data as map
    }
    catch(FileNotFoundException e)
    {
    System.out.println("inside Filenot found exception");
    StackTraceElement[] a=e.getStackTrace();
    System.out.println("a[0] is"+a[0]);
    a[0]=new StackTraceElement("com.opentesting.utils.ExcelUtils", "readExceldatainmap", "ExcelUtils.java", 67);
    e.setStackTrace(a);
    throw new RuntimeException("The file path is invalid",e);
    }

  • @ShilluReact
    @ShilluReact 24 дня назад

    thanks for the video , but too many adds are irrupting in between

    • @TestingMiniBytes
      @TestingMiniBytes  24 дня назад

      @@ShilluReact you can watch this playlist in my website testingminibytes.com
      And ads are controlled by RUclips and not me.