How to use Assertion in Selenium TestNG

Поделиться
HTML-код
  • Опубликовано: 26 июн 2024
  • In this video ,we will see What is Assert in TestNG/ Selenium and How to use Assertion in Selenium TestNG.
    Assert will help to verify the expected vs actual value.
    ~-~~-~~~-~~-~
    Please watch: "How To Create Maven build For Selenium Framework"
    • How To Create Maven bu...
    ~-~~-~~~-~~-~

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

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

    You are geneius when it comes to explaining any concepts. You are one of the best teachers I have ever been taught, Thank you.

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

      Thank you so much Nishant bhai, it means alot to me.😍

  • @nikhil2255
    @nikhil2255 6 лет назад +2

    Despite the cold you made this video, it's a great motivation Mukeah Sir, Hats off to you .

  • @lil.hercules
    @lil.hercules 3 года назад +1

    your way of explaining things and using instantaneous suitable examples is amazing! thanks for the lecture Mukesh :)

  • @atkuriajaykumar3701
    @atkuriajaykumar3701 Год назад +1

    Good explanation very useful 👍🏻

  • @premprakashbhakhar5969
    @premprakashbhakhar5969 7 лет назад

    thanks Mukesh .... examples used in ur videos are generally very easy to understand the concepts ...

  • @Lakshmi-7799
    @Lakshmi-7799 Год назад +1

    Thank you very much ur explanation is extraordinary

  • @DeepakKumar2105
    @DeepakKumar2105 6 лет назад

    Excellent videos. Very well explained.

  • @snehasingh9396
    @snehasingh9396 7 лет назад +3

    Really nice tutorial Mukesh. Explained in a very simple way. Thanks! Kindly upload more.

  • @gauravsukhija7817
    @gauravsukhija7817 2 месяца назад +1

    thank you for sharing knowledge

  • @subhashhadimani4415
    @subhashhadimani4415 6 лет назад +4

    Wonderful explaination sir, and one more thing in your classes is the key point of the topic is clear and easy to understand.

    • @Mukeshotwani
      @Mukeshotwani  6 лет назад

      Hi Subhash, Thanks a ton :) keep Learning.

  • @khansohel-Irshad
    @khansohel-Irshad 5 лет назад +1

    Thank you Mukesh..You have described in a very simple way.

    • @Mukeshotwani
      @Mukeshotwani  5 лет назад

      Thank you Sohel I am glad you liked it 😊

  • @elixirautomation
    @elixirautomation 8 лет назад

    A very effective way of teaching, It'z very helpful. Thanks a lot.

    • @Mukeshotwani
      @Mukeshotwani  8 лет назад

      +Abhilash Sharma Your most welcome Abhilash let me know if any help from my side.

  • @anupamajuktimath5783
    @anupamajuktimath5783 7 лет назад

    Nice video, THANK YOU Sir ..... It helps a lot for fresher Please upload more videos

  • @bkoza28
    @bkoza28 8 лет назад +1

    Thanks Mukesh...very informative!! keep uploading such videos...helps a lot

    • @Mukeshotwani
      @Mukeshotwani  8 лет назад

      +Bhaumik Oza Welcome Bhaumik will upload more videos soon. Keep visiting.

  • @nagagsalka5371
    @nagagsalka5371 8 лет назад

    Hey Mukesh, Thanks to you .......................I am always benefited from your clips, i never stop visiting
    regards
    Nagag

  • @ppatel332
    @ppatel332 6 лет назад +1

    Mr Mukesh the way you explain is really helpful. Thank you sir. 🙏

    • @Mukeshotwani
      @Mukeshotwani  6 лет назад +1

      Your most welcome Parthiv. Keep in touch and let me know if any help from my side. 🙏

    • @raogaru306
      @raogaru306 5 лет назад

      Sir, Your tutorials are awesome. What are the sources of jobs available for TestNG(work from home)

  • @kishorejakkam6857
    @kishorejakkam6857 7 лет назад +1

    excellent videos,Thanks Mukesh..

  • @maheshsheelvant7040
    @maheshsheelvant7040 8 лет назад

    Very informative sir. Very impressed the way you teach. It helps me a lot. Thank you ..

    • @Mukeshotwani
      @Mukeshotwani  8 лет назад +1

      Most welcome Mahesh and keep visiting.

  • @ashishpatil8092
    @ashishpatil8092 Год назад

    This is helpful video sir
    , one request for you --- can you one video publish on string class ?

  • @kumarchandrayog615
    @kumarchandrayog615 8 лет назад

    Assertion explained very assertively. I am impressed.

    • @Mukeshotwani
      @Mukeshotwani  8 лет назад

      +Kumar Chandra Yog Hey Kumar thank you so much... keep visiting😃

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

    Nice explanation

  • @archanashirsat4686
    @archanashirsat4686 7 лет назад

    Hi Mukesh,
    Thanks for this video. I was searching what is the difference between " “assert” , “verify” and “waifFor”" ? Do you have any video for this?

  • @servpreetsingh6087
    @servpreetsingh6087 6 лет назад +1

    Hi Mukesh,
    ur videos are super awsome with such a gr8 knowledge,
    Please please arrange the same in a order or name them with the integer value so that any one can view it in oder coz we don't know the course content and it creates confusion by watching it in random order. hope u got what i mean to say

    • @Mukeshotwani
      @Mukeshotwani  6 лет назад

      Hi Servpreet
      Thank you so much for such a nice comment.
      you can follow them in below order learn-automation.com/selenium-webdriver-tutorial-for-beginners/

  • @induk6679
    @induk6679 5 лет назад

    Hi Mukesh,
    Is assertion testNG dependant? I mean, I can use assertions concept only in testNG?

  • @ajinkyagadekar7406
    @ajinkyagadekar7406 6 лет назад

    Thanks Mukesh it helped me, Can you please create Video on TestNG with Try catch.

  • @suryakantchavan7061
    @suryakantchavan7061 8 лет назад

    Just awesome !!!!!!!!!!!

  • @Lakshmi-7799
    @Lakshmi-7799 Год назад +1

    🙏🙏🙏

  • @nidakhurasani147
    @nidakhurasani147 6 лет назад

    Hi Mukesk, I need to verify whether the image displayed is picture or video...?can u suggest me what to use..?

  • @jampanisunitha
    @jampanisunitha 7 лет назад +1

    thank you

  • @snehav2332
    @snehav2332 7 лет назад +1

    Hi Mukesh, i noticed one point saying that "Assert is like validation/verification stage in testNG" without using any TestNG framework or class, cant we use assert directly?

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад

      Yes but you need to write so many line of code for that. Better to use some existing test framework.

  • @bharatvarshney2666
    @bharatvarshney2666 7 лет назад +1

    nice explanation

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

    Hello Mukesh. I'm getting the below error while trying to run the Assertion test cases:
    Error: Unable to initialize main class org.testng.remote.RemoteTestNG
    Caused by: java.lang.NoClassDefFoundError: com/beust/jcommander/ParameterException
    I tried to uninstall TestNG from the eclipse and re-install it but it didn't work out. Can you please provide me a solution.

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

      Hi Ashish, which TestNG version u are using? Please use 6.14.3

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

    on Amazon.com I searched for Nikon. I sorted from price from high to low. And selected 2nd item from list to see the details. Now From details I want to check (verify with assert) that product topic contains text “Nikon D850”. What should be the line of code using selenium and java? Can you guide on this? Thank you in advance.

  • @SauravKumar-hr9zk
    @SauravKumar-hr9zk 7 лет назад +1

    Hello Mukesh,
    I have one doubt, in my script i am getting the page title and it contains a big link i want to verify just just part of that link using assert statement. let say if the link is --Shop online for mobiles,electronics,fashion & more @ Flipkart. I want to check whether the title contains flipkart or not so how to apply assert in that condition

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад

      Hi Saurav,
      This video will guide you
      ruclips.net/video/Ruuytdl_F4U/видео.html

  • @Swap_G
    @Swap_G 7 лет назад

    HI Mukesh, I am observing issue with using soft Assert. The scenario is like this
    All necessary TestNG, selenium, java classes are imported
    import class1
    Public class2{
    @Test (priority =1)
    Public static void Testcase_1{
    class1.method1();
    class1.method2();
    }
    @Test(Priority =2)
    public static void Testcase_2{
    some_other_methods();
    }
    }
    The Problem here is Testcase_1 will be considered pass if both methods class1.method1() and class1.method2() will go through. Now what happens if class1.method1() fails somehow, TestNG framework break the Testcase_1 and does not execute class1.method2(). It directly executes Testcase_2 without executing class1.method2(). I tried SoftAssert also, but still no luck. can you help me.
    I found one way is that breaking class1.method2() also in a separate test case, but that will be a kind of hack, and i am looking for some other way to do it.

  • @stephenrajvlogs4275
    @stephenrajvlogs4275 6 лет назад +1

    Hi Mukesh.. Hope your doing well.. Could you please let know me how to see your videos sequentially(one Topic after another) ?

    • @Mukeshotwani
      @Mukeshotwani  6 лет назад

      Hi Stephen I am good. You can follow tutorials in below sequence.
      learn-automation.com/selenium-webdriver-tutorial-for-beginners/
      learn-automation.com/advance-selenium-webdriver-tutorials/

  • @sonalipradhan6050
    @sonalipradhan6050 7 лет назад +1

    Hi Mukesh
    pl answer
    how to attach javadoc in the element to see the content?

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад +1

      Hi Sonali Kindly check below video ruclips.net/video/tNjK6_ublzg/видео.html

  • @nilamkolekar364
    @nilamkolekar364 7 лет назад +1

    got wat is assert...thanx mukesh

  • @amitkamath9091
    @amitkamath9091 7 лет назад

    if int a=100;
    and i want to validate if value of A is greater than 0 or not then what will be my assertion syntax
    O/P should be TRUE if A value is greater than 0

  • @hemanth859
    @hemanth859 6 лет назад

    Can u make a Video Regarding Merging two or Three Data Providers,SO that it Should data From Excel Sheet.it will be veryHelp ful Thankyou

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

    Hi sir thanks for all the support,
    I've complete all the setup but at the end when using "assert" in program it showing "Assert can not be resolved" downloaded testng as well
    Please guide me through it

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

      Hi Mate, please use testng latest dependency using maven project.

  • @antoniogervasio1
    @antoniogervasio1 7 лет назад +1

    HI Mukesh, your tutorials are great! but can you help me solve a doubt please, Can I reuse the same browser, instead of opening a new one each time my test with selenium webdriver starts? And if it can be done, can you please put a tutorial please!. thanks.

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад

      NO Mate Selenium start fresh session each time.

    • @bhimanagoudparakanahalli8963
      @bhimanagoudparakanahalli8963 6 лет назад

      Mukesh otwani can I write initialise browser in beforeClass method ,so that the browser opens up only once and tests will continue to run for that class. After each test I will logout, and before each test I will login

    • @DeepaRochani
      @DeepaRochani 6 лет назад

      before suite will be suitable for your solution

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

    This is nice tutorial
    But I want to know that
    When i tick the check of spicejet
    On listing page only spicejet flight
    Available not indigo or AirAsia

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

    Hi Mukesh.. Is there any way to check if actualValue > expectedValue thru assertion ?

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

      Yes you can use either soft assert or hard assert

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

      @@Mukeshotwani I did not find AssertGreaterThan 🤔🤔

  • @anshukaurav2896
    @anshukaurav2896 7 лет назад

    plz use static or non static in assertion give the boyh example soft and hard assert with webdriver use also.......

  • @TheRammohan1
    @TheRammohan1 8 лет назад

    HI Mukesh..thank you for this class.
    Can you explain "Data Providers" in TestNG

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад

      Hey Ram I have covered the same in below video ruclips.net/video/_7XJenTvR34/видео.html

    • @TheRammohan1
      @TheRammohan1 7 лет назад

      Thank you Mukesh.

  • @pragtigupta5675
    @pragtigupta5675 8 лет назад

    thx a lot.

    • @Mukeshotwani
      @Mukeshotwani  8 лет назад

      Your welcome Pragti Keep visiting.

  • @ashishkumar-ne4cd
    @ashishkumar-ne4cd 6 лет назад

    Thanks

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

    How to write condition for drop-down .. drop down automatically continually changed.. how to write condition for always select first index ... Plzz rly me broo

  • @dinud999
    @dinud999 5 лет назад

    Actually what is the use of assertions?
    Is it used for checking any words or digit that match or contains in that particular webpage ?
    I didn't get the core idea😓😓

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

    how do I use this test ng assertion on jMeter? thanks.

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

      Hey Gulam Azum JMeter have different type of assertion like below
      BeanShell Assertion
      BSF Assertion
      Compare Assertion
      Duration Assertion
      HTML Assertion
      JSR223 Assertion
      MD5Hex Assertion
      Response Assertion
      Size Assertion
      SMIME Assertion
      XML Assertion
      XML Schema Assertion
      XPath Assertion

  • @praveen420ify
    @praveen420ify 7 лет назад

    Voice in this video is so low that I could not hear even though I connected my laptop to out speaker. Content is awesome but Please make video with audible sound

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад

      Notes will make sure next time audio is good.

  • @mandarvedpathak1565
    @mandarvedpathak1565 7 лет назад +1

    how to check login credentials in testng?

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад

      HI Mandar,
      TestNG is testing framework. For login you have to use Selenium

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

    really nice .but sound is very very less.Raise your vice brother

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

      Hi Arjun, in recent videos voice quality is better, thats old video so my mic had some issues :(

  • @k.nreddy5973
    @k.nreddy5973 3 года назад

    Why we do not use main method in TestNG

  • @kaursidhu5761
    @kaursidhu5761 Год назад +1

    Hi sir ,how can we can assertion if image is displayed or not?

    • @Mukeshotwani
      @Mukeshotwani  Год назад

      Hi Sidhu we have method called is displayed which returns true or false. You can apply assert on that. If you want to verify image is correct or not then capture src attribute of image and then make api call and get the status. If response is in 2xx or 3xx category then image is correct else fail the test.

    • @kaursidhu5761
      @kaursidhu5761 Год назад

      Thanq u sir for quick reply… how to make api call?for image testing .
      Any video for that . I can go through that video then

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

    I like the way you teach Mukesh, but cleaning the Nose obviously not so pleasant. thanks

  • @avinashchaudhari6564
    @avinashchaudhari6564 7 лет назад +2

    please make sure to increase volume....

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад +6

      Avinash Chaudhari kindly use headphones

  • @dilshodkhan1695
    @dilshodkhan1695 7 лет назад +1

    Second option is giving me error

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

    10:10 onwards video quality is not good...anyone else facing the issue or is it only me

  • @radhikabejawada7291
    @radhikabejawada7291 7 лет назад

    Hello sir,
    When I Test the application, i'm getting this error.
    org.openqa.selenium.ElementNotVisibleException: Element is not visible (WARNING: The server did not provide any stacktrace information).
    Why i'm getting this Error. help me to solve the problem
    Thanks in advance

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад

      Hey Radhika, no problem kindly check below link which will solve your issue learn-automation.com/solve-elementnotvisibleexception-in-selenium-webdriver/

    • @radhikabejawada7291
      @radhikabejawada7291 7 лет назад

      Thanks...........

  • @divyakumar3488
    @divyakumar3488 7 лет назад

    Step-1- Go to https:www.wellsfargo.com/mortgage/manage-account/disaster-recovery/ 
    Step-2- Verify "Learn More..." link exists(There were two learn more links we have to identify liks in particular section.)
    Step-3- If 1st "Learn More... " link does not exist still continue execution to next step.
    Step-4- If 2nd link does not exist stop the execution 
    Step-5- If second link exist click on link & verify the header of next page. 
    how do i perform this using assertion. i am new to selenium please help me.

    • @divyakumar3488
      @divyakumar3488 7 лет назад +1

      i think i have to use some if condition if link exist or not. i am really confused.

    • @Mukeshotwani
      @Mukeshotwani  7 лет назад

      is this fixed?

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

    im getting low voice..Im hearing this lecture without connecting any headset

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

    really funny accent of Eng

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

      What about the content?

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

      @@Mukeshotwani plz don't be angry to my comments as I'm also not Englishman, living in Astana, I cannot to explain why for Us hard hear that kind of pronunciation, but actually Ur info absolutely useful for understanding.

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

      @@azatska thank you Azatia loved your honesty. Best of luck. Keep learning.

  • @MyWalia
    @MyWalia 6 лет назад

    There is hardly any voice in ur videos...pls make it with better sound

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

    Sound is too low,not useful this vedio