How to use Assertion in Selenium TestNG

  Рет қаралды 146,234

Mukesh otwani

Mukesh otwani

Күн бұрын

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 жыл бұрын
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 жыл бұрын
Despite the cold you made this video, it's a great motivation Mukeah Sir, Hats off to you .
@lil.hercules
@lil.hercules 3 жыл бұрын
your way of explaining things and using instantaneous suitable examples is amazing! thanks for the lecture Mukesh :)
@DeepakKumar2105
@DeepakKumar2105 6 жыл бұрын
Excellent videos. Very well explained.
@premprakashbhakhar5969
@premprakashbhakhar5969 7 жыл бұрын
thanks Mukesh .... examples used in ur videos are generally very easy to understand the concepts ...
@snehasingh9396
@snehasingh9396 7 жыл бұрын
Really nice tutorial Mukesh. Explained in a very simple way. Thanks! Kindly upload more.
@Mukeshotwani
@Mukeshotwani 7 жыл бұрын
Thanks Sneha :) Keep watching
@anupamajuktimath5783
@anupamajuktimath5783 7 жыл бұрын
Nice video, THANK YOU Sir ..... It helps a lot for fresher Please upload more videos
@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.
@bkoza28
@bkoza28 8 жыл бұрын
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
@Mukeshotwani
@Mukeshotwani 8 жыл бұрын
Hey Nagag :) thanks
@khansohel-Irshad
@khansohel-Irshad 5 жыл бұрын
Thank you Mukesh..You have described in a very simple way.
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Thank you Sohel I am glad you liked it 😊
@subhashhadimani4415
@subhashhadimani4415 6 жыл бұрын
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.
@atkuriajaykumar3701
@atkuriajaykumar3701 Жыл бұрын
Good explanation very useful 👍🏻
@Mukeshotwani
@Mukeshotwani Жыл бұрын
Glad it was helpful!
@maheshsheelvant7040
@maheshsheelvant7040 8 жыл бұрын
Very informative sir. Very impressed the way you teach. It helps me a lot. Thank you ..
@Mukeshotwani
@Mukeshotwani 8 жыл бұрын
Most welcome Mahesh and keep visiting.
@Lakshmi-7799
@Lakshmi-7799 Жыл бұрын
Thank you very much ur explanation is extraordinary
@Mukeshotwani
@Mukeshotwani Жыл бұрын
Thanks and welcome
@kishorejakkam6857
@kishorejakkam6857 7 жыл бұрын
excellent videos,Thanks Mukesh..
@Mukeshotwani
@Mukeshotwani 7 жыл бұрын
Thanks Kishore :)
@gauravsukhija7817
@gauravsukhija7817 3 ай бұрын
thank you for sharing knowledge
@Mukeshotwani
@Mukeshotwani 3 ай бұрын
Thank you
@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?
@subasishmohanty5016
@subasishmohanty5016 3 жыл бұрын
Nice explanation
@induk6679
@induk6679 5 жыл бұрын
Hi Mukesh, Is assertion testNG dependant? I mean, I can use assertions concept only in testNG?
@ppatel332
@ppatel332 6 жыл бұрын
Mr Mukesh the way you explain is really helpful. Thank you sir. 🙏
@Mukeshotwani
@Mukeshotwani 6 жыл бұрын
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)
@nidakhurasani147
@nidakhurasani147 6 жыл бұрын
Hi Mukesk, I need to verify whether the image displayed is picture or video...?can u suggest me what to use..?
@suryakantchavan7061
@suryakantchavan7061 8 жыл бұрын
Just awesome !!!!!!!!!!!
@Mukeshotwani
@Mukeshotwani 8 жыл бұрын
Hey Suryakant, Thank you
@ajinkyagadekar7406
@ajinkyagadekar7406 6 жыл бұрын
Thanks Mukesh it helped me, Can you please create Video on TestNG with Try catch.
@kumarchandrayog615
@kumarchandrayog615 8 жыл бұрын
Assertion explained very assertively. I am impressed.
@Mukeshotwani
@Mukeshotwani 8 жыл бұрын
+Kumar Chandra Yog Hey Kumar thank you so much... keep visiting😃
@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.
@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.
@ashishpatil8092
@ashishpatil8092 Жыл бұрын
This is helpful video sir , one request for you --- can you one video publish on string class ?
@servpreetsingh6087
@servpreetsingh6087 6 жыл бұрын
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/
@jampanisunitha
@jampanisunitha 7 жыл бұрын
thank you
@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
@snehav2332
@snehav2332 7 жыл бұрын
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 жыл бұрын
nice explanation
@Mukeshotwani
@Mukeshotwani 7 жыл бұрын
Thanks Bharat
@asisharavind655
@asisharavind655 4 жыл бұрын
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 жыл бұрын
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 kzfaq.info/get/bejne/iNulrNeV0cWqZIk.html
@stephenrajvlogs4275
@stephenrajvlogs4275 6 жыл бұрын
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/
@AnilKishorSharman
@AnilKishorSharman 2 жыл бұрын
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 🤔🤔
@sonalipradhan6050
@sonalipradhan6050 7 жыл бұрын
Hi Mukesh pl answer how to attach javadoc in the element to see the content?
@Mukeshotwani
@Mukeshotwani 7 жыл бұрын
Hi Sonali Kindly check below video kzfaq.info/get/bejne/qrSafpmQ2sjQqps.html
@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
@dinil_TCR
@dinil_TCR 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😓😓
@cheerfulchunkies4866
@cheerfulchunkies4866 3 жыл бұрын
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.
@Lakshmi-7799
@Lakshmi-7799 Жыл бұрын
🙏🙏🙏
@antoniogervasio1
@antoniogervasio1 7 жыл бұрын
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
@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
@pragtigupta5675
@pragtigupta5675 8 жыл бұрын
thx a lot.
@Mukeshotwani
@Mukeshotwani 8 жыл бұрын
Your welcome Pragti Keep visiting.
@ashishkumar-ne4cd
@ashishkumar-ne4cd 6 жыл бұрын
Thanks
@nilamkolekar364
@nilamkolekar364 7 жыл бұрын
got wat is assert...thanx mukesh
@Mukeshotwani
@Mukeshotwani 7 жыл бұрын
Cheers Nilam
@anshukaurav2896
@anshukaurav2896 7 жыл бұрын
plz use static or non static in assertion give the boyh example soft and hard assert with webdriver use also.......
@arjundiwan9651
@arjundiwan9651 4 жыл бұрын
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 :(
@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 kzfaq.info/get/bejne/lZ2Ifcifudy2Y2g.html
@TheRammohan1
@TheRammohan1 7 жыл бұрын
Thank you Mukesh.
@k.nreddy5973
@k.nreddy5973 3 жыл бұрын
Why we do not use main method in TestNG
@gulamazum7726
@gulamazum7726 3 жыл бұрын
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
@kaursidhu5761
@kaursidhu5761 Жыл бұрын
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
@mandarvedpathak1565
@mandarvedpathak1565 7 жыл бұрын
how to check login credentials in testng?
@Mukeshotwani
@Mukeshotwani 7 жыл бұрын
HI Mandar, TestNG is testing framework. For login you have to use Selenium
@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.
@mohmashooqdowlati7933
@mohmashooqdowlati7933 4 жыл бұрын
I like the way you teach Mukesh, but cleaning the Nose obviously not so pleasant. thanks
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Sorry for that Mashooq
@dilshodkhan1695
@dilshodkhan1695 7 жыл бұрын
Second option is giving me error
@Mukeshotwani
@Mukeshotwani 7 жыл бұрын
Can you please explain error?
@avinashchaudhari6564
@avinashchaudhari6564 7 жыл бұрын
please make sure to increase volume....
@Mukeshotwani
@Mukeshotwani 7 жыл бұрын
Avinash Chaudhari kindly use headphones
@ammarkhan280
@ammarkhan280 4 жыл бұрын
10:10 onwards video quality is not good...anyone else facing the issue or is it only me
@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 жыл бұрын
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 жыл бұрын
really funny accent of Eng
@Mukeshotwani
@Mukeshotwani 2 жыл бұрын
What about the content?
@azatska
@azatska 2 жыл бұрын
@@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 жыл бұрын
@@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
Soft Assertion in TestNG in Selenium Webdriver
6:53
Mukesh otwani
Рет қаралды 65 М.
How to Implement TestNG listeners in Selenium Webdriver
24:22
Mukesh otwani
Рет қаралды 152 М.
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 52 МЛН
How to Capture Screenshot in Selenium Webdriver
26:03
Mukesh otwani
Рет қаралды 201 М.
TestNG Tutorial #4 - How to Use Assertion in Selenium TestNG
13:24
Software Testing Mentor
Рет қаралды 54 М.
Taking ScreenShot ONLY for Failed Tests in Selenium using TestNG Listener
32:12
Naveen AutomationLabs
Рет қаралды 116 М.
How to Handle Frames in Selenium Webdriver
27:03
Mukesh otwani
Рет қаралды 113 М.
What are GetWindowHandle and GetWindowHandles in Selenium? | Selenium Basics
12:42
How to Use Selenium, TestNG With Gradle (Build Automation Tool)
33:52
Naveen AutomationLabs
Рет қаралды 13 М.