How to use Assertion in Selenium TestNG

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

ความคิดเห็น • 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 7 ปีที่แล้ว +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 :)

  • @snehasingh9396
    @snehasingh9396 7 ปีที่แล้ว +3

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

    • @Mukeshotwani
      @Mukeshotwani  7 ปีที่แล้ว +1

      Thanks Sneha :) Keep watching

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

  • @gauravsukhija7817
    @gauravsukhija7817 6 หลายเดือนก่อน +1

    thank you for sharing knowledge

  • @Lakshmi-7799
    @Lakshmi-7799 ปีที่แล้ว +1

    Thank you very much ur explanation is extraordinary

  • @premprakashbhakhar5969
    @premprakashbhakhar5969 7 ปีที่แล้ว

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

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

  • @nagagsalka5371
    @nagagsalka5371 8 ปีที่แล้ว

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

  • @khansohel-Irshad
    @khansohel-Irshad 6 ปีที่แล้ว +1

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

    • @Mukeshotwani
      @Mukeshotwani  6 ปีที่แล้ว

      Thank you Sohel I am glad you liked it 😊

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

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

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

    Good explanation very useful 👍🏻

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

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

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

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

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

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

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

      Yes you can use either soft assert or hard assert

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

      @@Mukeshotwani I did not find AssertGreaterThan 🤔🤔

  • @DeepakKumar2105
    @DeepakKumar2105 6 ปีที่แล้ว

    Excellent videos. Very well explained.

  • @kumarchandrayog615
    @kumarchandrayog615 8 ปีที่แล้ว

    Assertion explained very assertively. I am impressed.

    • @Mukeshotwani
      @Mukeshotwani  8 ปีที่แล้ว

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

  • @anupamajuktimath5783
    @anupamajuktimath5783 7 ปีที่แล้ว

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

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

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

  • @induk6679
    @induk6679 6 ปีที่แล้ว

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

  • @nidakhurasani147
    @nidakhurasani147 6 ปีที่แล้ว

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

  • @kishorejakkam6857
    @kishorejakkam6857 7 ปีที่แล้ว +1

    excellent videos,Thanks Mukesh..

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

  • @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
      th-cam.com/video/Ruuytdl_F4U/w-d-xo.html

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

  • @ajinkyagadekar7406
    @ajinkyagadekar7406 7 ปีที่แล้ว

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

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

    Nice explanation

  • @stephenrajvlogs4275
    @stephenrajvlogs4275 7 ปีที่แล้ว +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  7 ปีที่แล้ว

      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/

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

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

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

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

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

  • @suryakantchavan7061
    @suryakantchavan7061 8 ปีที่แล้ว

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

    • @Mukeshotwani
      @Mukeshotwani  8 ปีที่แล้ว

      Hey Suryakant, 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.

  • @jampanisunitha
    @jampanisunitha 8 ปีที่แล้ว +1

    thank you

  • @dinil_TCR
    @dinil_TCR 6 ปีที่แล้ว

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

  • @anshukaurav2896
    @anshukaurav2896 7 ปีที่แล้ว

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

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

  • @TheRammohan1
    @TheRammohan1 8 ปีที่แล้ว

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

    • @Mukeshotwani
      @Mukeshotwani  8 ปีที่แล้ว

      Hey Ram I have covered the same in below video th-cam.com/video/_7XJenTvR34/w-d-xo.html

    • @TheRammohan1
      @TheRammohan1 8 ปีที่แล้ว

      Thank you Mukesh.

  • @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 th-cam.com/video/tNjK6_ublzg/w-d-xo.html

  • @Lakshmi-7799
    @Lakshmi-7799 ปีที่แล้ว +1

    🙏🙏🙏

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

  • @mohmashooqdowlati7933
    @mohmashooqdowlati7933 4 ปีที่แล้ว +1

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

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

  • @arjundiwan9651
    @arjundiwan9651 5 ปีที่แล้ว +2

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

    • @Mukeshotwani
      @Mukeshotwani  5 ปีที่แล้ว

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

  • @pragtigupta5675
    @pragtigupta5675 8 ปีที่แล้ว

    thx a lot.

    • @Mukeshotwani
      @Mukeshotwani  8 ปีที่แล้ว

      Your welcome Pragti Keep visiting.

  • @nilamkolekar364
    @nilamkolekar364 7 ปีที่แล้ว +1

    got wat is assert...thanx mukesh

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

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

  • @ashishkumar-ne4cd
    @ashishkumar-ne4cd 6 ปีที่แล้ว

    Thanks

  • @k.nreddy5973
    @k.nreddy5973 3 ปีที่แล้ว

    Why we do not use main method in TestNG

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

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

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

  • @ammarkhan280
    @ammarkhan280 5 ปีที่แล้ว

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

  • @dilshodkhan1695
    @dilshodkhan1695 7 ปีที่แล้ว +1

    Second option is giving me error

    • @Mukeshotwani
      @Mukeshotwani  7 ปีที่แล้ว

      Can you please explain error?

  • @avinashchaudhari6564
    @avinashchaudhari6564 7 ปีที่แล้ว +2

    please make sure to increase volume....

    • @Mukeshotwani
      @Mukeshotwani  7 ปีที่แล้ว +6

      Avinash Chaudhari kindly use headphones

  • @radhikabejawada7291
    @radhikabejawada7291 8 ปีที่แล้ว

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

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

    • @radhikabejawada7291
      @radhikabejawada7291 8 ปีที่แล้ว

      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?

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

  • @nekkantivenkateswararao1386
    @nekkantivenkateswararao1386 4 ปีที่แล้ว

    Sound is too low,not useful this vedio

  • @MyWalia
    @MyWalia 6 ปีที่แล้ว

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

  • @bharatvarshney2666
    @bharatvarshney2666 7 ปีที่แล้ว +1

    nice explanation