How to use Assertion in Selenium TestNG

Поділитися
Вставка
  • Опубліковано 11 гру 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.😍

  • @gauravsukhija7817
    @gauravsukhija7817 8 місяців тому +1

    thank you for sharing knowledge

  • @nikhil2255
    @nikhil2255 7 років тому +2

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

  • @Lakshmi-7799
    @Lakshmi-7799 2 роки тому +1

    Thank you very much ur explanation is extraordinary

  • @atkuriajaykumar3701
    @atkuriajaykumar3701 Рік тому +1

    Good explanation very useful 👍🏻

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

  • @lil.hercules
    @lil.hercules 4 роки тому +1

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

  • @premprakashbhakhar5969
    @premprakashbhakhar5969 7 років тому

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

  • @snehasingh9396
    @snehasingh9396 7 років тому +3

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

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

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

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

  • @kumarchandrayog615
    @kumarchandrayog615 8 років тому

    Assertion explained very assertively. I am impressed.

    • @Mukeshotwani
      @Mukeshotwani  8 років тому

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

  • @nagagsalka5371
    @nagagsalka5371 8 років тому

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

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

  • @DeepakKumar2105
    @DeepakKumar2105 7 років тому

    Excellent videos. Very well explained.

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

  • @kishorejakkam6857
    @kishorejakkam6857 7 років тому +1

    excellent videos,Thanks Mukesh..

  • @ashishpatil8092
    @ashishpatil8092 2 роки тому

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

  • @archanashirsat4686
    @archanashirsat4686 8 років тому

    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?

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

    • @KishoreMP3Studio
      @KishoreMP3Studio 3 роки тому

      @@Mukeshotwani I did not find AssertGreaterThan 🤔🤔

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

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

  • @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
      ua-cam.com/video/Ruuytdl_F4U/v-deo.html

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

  • @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 ua-cam.com/video/tNjK6_ublzg/v-deo.html

  • @nidakhurasani147
    @nidakhurasani147 7 років тому

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

  • @ajinkyagadekar7406
    @ajinkyagadekar7406 7 років тому

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

  • @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 7 років тому

      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 7 років тому

      before suite will be suitable for your solution

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

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

  • @induk6679
    @induk6679 6 років тому

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

  • @Lakshmi-7799
    @Lakshmi-7799 2 роки тому +1

    🙏🙏🙏

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

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

  • @bharatvarshney2666
    @bharatvarshney2666 7 років тому +1

    nice explanation

  • @suryakantchavan7061
    @suryakantchavan7061 8 років тому

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

  • @hemanth859
    @hemanth859 7 років тому

    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

  • @nilamkolekar364
    @nilamkolekar364 7 років тому +1

    got wat is assert...thanx mukesh

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

  • @anshukaurav2896
    @anshukaurav2896 8 років тому

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

  • @jampanisunitha
    @jampanisunitha 8 років тому +1

    thank you

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

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

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

  • @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 ua-cam.com/video/_7XJenTvR34/v-deo.html

    • @TheRammohan1
      @TheRammohan1 8 років тому

      Thank you Mukesh.

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

  • @gulamazum7726
    @gulamazum7726 4 роки тому +1

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

    • @Mukeshotwani
      @Mukeshotwani  4 роки тому

      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

  • @mohmashooqdowlati7933
    @mohmashooqdowlati7933 4 роки тому +1

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

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

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

  • @pragtigupta5675
    @pragtigupta5675 8 років тому

    thx a lot.

    • @Mukeshotwani
      @Mukeshotwani  8 років тому

      Your welcome Pragti Keep visiting.

  • @k.nreddy5973
    @k.nreddy5973 3 роки тому

    Why we do not use main method in TestNG

  • @ammarkhan280
    @ammarkhan280 5 років тому

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

  • @ashishkumar-ne4cd
    @ashishkumar-ne4cd 7 років тому

    Thanks

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

  • @dilshodkhan1695
    @dilshodkhan1695 7 років тому +1

    Second option is giving me error

  • @avinashchaudhari6564
    @avinashchaudhari6564 7 років тому +2

    please make sure to increase volume....

    • @Mukeshotwani
      @Mukeshotwani  7 років тому +6

      Avinash Chaudhari kindly use headphones

  • @harithareddy5594
    @harithareddy5594 3 роки тому

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

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

  • @subasishmohanty5016
    @subasishmohanty5016 3 роки тому

    Nice explanation