filmov
tv
TestNG Framework Tutorial | What Are Assertions in TestNG❓| Part-IV | LambdaTest
![preview_player](https://i.ytimg.com/vi/XHks-fvAq_4/maxresdefault.jpg)
Показать описание
Watch this video to learn what are TestNG assertions, the different types of TestNG assertions, and how you can use them while performing Selenium automation testing with TestNG.
🎯Vɪᴅᴇᴏ Cʜᴀᴘᴛᴇʀꜱ 👀
00:00 Introduction
02:48 View Assertions via TestNG Library
03:31 Walk Through Two Test Scripts
04:25 Set Up Test
06:04 Create 1st Test Script
08:18 Demo - Hard Assert
10:44 Create 2nd Test Script
16:44 Demo When Not Use Hard Assert
19:19 Demo - Soft Assert
21:15 Purpose of assertAll via Soft Assert
24:36 Recap
26:23 Conclusion
🚩 𝑾𝒉𝒂𝒕 𝒂𝒓𝒆 𝑻𝒆𝒔𝒕𝑵𝑮 𝒂𝒔𝒔𝒆𝒓𝒕𝒊𝒐𝒏𝒔?
➡ Assertions allow you to check whether the actual and expected results of a test case execution match, determining whether the test case is a pass or fail.
🚩 𝑾𝒉𝒂𝒕 𝒂𝒓𝒆 𝒕𝒉𝒆 𝒅𝒊𝒇𝒇𝒆𝒓𝒆𝒏𝒕 𝒕𝒚𝒑𝒆𝒔 𝒐𝒇 𝑨𝒔𝒔𝒆𝒓𝒕𝒊𝒐𝒏𝒔 𝒊𝒏 𝑻𝒆𝒔𝒕𝑵𝑮?
➡ To cater to different test requirements, TestNG supports two significant types of asserts:
✔️ 𝑯𝒂𝒓𝒅 𝑨𝒔𝒔𝒆𝒓𝒕: In TestNG, these are the default assertions. When any assert fails, the test case is stopped, and subsequent statements are not executed or validated.
✔️ 𝑺𝒐𝒇𝒕 𝑨𝒔𝒔𝒆𝒓𝒕: These are the opposite of hard assertions. When using soft assertions in TestNG, the test-case execution of subsequent steps continues even if an assert fails in the middle. These are used when we want to keep executing and see the results for all steps despite a few failures.
🚩 𝑾𝒉𝒂𝒕 𝒂𝒓𝒆 𝒕𝒉𝒆 𝒅𝒊𝒇𝒇𝒆𝒓𝒆𝒏𝒕 𝒂𝒔𝒔𝒆𝒓𝒕 𝒎𝒆𝒕𝒉𝒐𝒅𝒔 𝒊𝒏 𝑻𝒆𝒔𝒕𝑵𝑮?
▪ assertTrue: This assertion verifies whether the given condition is true.
▪ assertFalse: This assertion verifies whether the given condition is false.
▪ assertEquals: This assertion verifies if the actual and expected values are a match.
▪ assertNotEquals: This assertion verifies if the actual and expected are not a match.
▪ assertNotNull: This assertion is used to check whether a particular object is NULL or not.
📌𝑨𝒍𝒔𝒐, 𝒚𝒐𝒖 𝒘𝒊𝒍𝒍 𝒍𝒆𝒂𝒓𝒏 📃
🔸 What are the TestNG assertions?
🔸 How do you validate soft assertions in TestNG?
🔸 Is verify and soft assert the same?
🔸 Does TestNG support soft assertion?
**𝑹𝒆𝒍𝒂𝒕𝒆𝒅 𝑩𝒍𝒐𝒈𝒔 & 𝑫𝒐𝒄𝒔**
**𝑳𝒆𝒂𝒓𝒏𝒊𝒏𝒈 𝑯𝒖𝒃**
**𝑪𝒆𝒓𝒕𝒊𝒇𝒊𝒄𝒂𝒕𝒊𝒐𝒏𝒔**
Sign Up for LambdaTest! It’s FREE 🙌
Register Now to Avail Bonanza Offerings 💎
+ Test websites and web apps on 3000+ real browsers over LambdaTest cloud
+ Trusted By 1M+ users, 500+ enterprises and 130+ countries
+ Online scalable Selenium Grid to perform Manual as well as Automation Testing
+ 100 minutes of free Web + Mobile Automation Testing
+ 60 minutes of free Live Interactive Testing per month
+ 10 Screenshot Tests per month
+ 10 Responsive Tests per month (Test a page across 50+ Device configurations with a single click)
+ Unlimited free testing on LT Browser
**𝑬𝒙𝒑𝒍𝒐𝒓𝒆**
**𝑺𝒐𝒄𝒊𝒂𝒍**
#testngtutorial #lambdatest #testngassertions #seleniumtests #auotmationscripts #testngselenium #testngfeatures #testngbasics #testngcourse #learntestng
Disclaimer:
This video features materials protected by the Fair Use guidelines of Section 107 of the Copyright Act. All rights reserved to © 2022 LambdaTest. Any illegal reproduction of this content will result in immediate legal action.
🎯Vɪᴅᴇᴏ Cʜᴀᴘᴛᴇʀꜱ 👀
00:00 Introduction
02:48 View Assertions via TestNG Library
03:31 Walk Through Two Test Scripts
04:25 Set Up Test
06:04 Create 1st Test Script
08:18 Demo - Hard Assert
10:44 Create 2nd Test Script
16:44 Demo When Not Use Hard Assert
19:19 Demo - Soft Assert
21:15 Purpose of assertAll via Soft Assert
24:36 Recap
26:23 Conclusion
🚩 𝑾𝒉𝒂𝒕 𝒂𝒓𝒆 𝑻𝒆𝒔𝒕𝑵𝑮 𝒂𝒔𝒔𝒆𝒓𝒕𝒊𝒐𝒏𝒔?
➡ Assertions allow you to check whether the actual and expected results of a test case execution match, determining whether the test case is a pass or fail.
🚩 𝑾𝒉𝒂𝒕 𝒂𝒓𝒆 𝒕𝒉𝒆 𝒅𝒊𝒇𝒇𝒆𝒓𝒆𝒏𝒕 𝒕𝒚𝒑𝒆𝒔 𝒐𝒇 𝑨𝒔𝒔𝒆𝒓𝒕𝒊𝒐𝒏𝒔 𝒊𝒏 𝑻𝒆𝒔𝒕𝑵𝑮?
➡ To cater to different test requirements, TestNG supports two significant types of asserts:
✔️ 𝑯𝒂𝒓𝒅 𝑨𝒔𝒔𝒆𝒓𝒕: In TestNG, these are the default assertions. When any assert fails, the test case is stopped, and subsequent statements are not executed or validated.
✔️ 𝑺𝒐𝒇𝒕 𝑨𝒔𝒔𝒆𝒓𝒕: These are the opposite of hard assertions. When using soft assertions in TestNG, the test-case execution of subsequent steps continues even if an assert fails in the middle. These are used when we want to keep executing and see the results for all steps despite a few failures.
🚩 𝑾𝒉𝒂𝒕 𝒂𝒓𝒆 𝒕𝒉𝒆 𝒅𝒊𝒇𝒇𝒆𝒓𝒆𝒏𝒕 𝒂𝒔𝒔𝒆𝒓𝒕 𝒎𝒆𝒕𝒉𝒐𝒅𝒔 𝒊𝒏 𝑻𝒆𝒔𝒕𝑵𝑮?
▪ assertTrue: This assertion verifies whether the given condition is true.
▪ assertFalse: This assertion verifies whether the given condition is false.
▪ assertEquals: This assertion verifies if the actual and expected values are a match.
▪ assertNotEquals: This assertion verifies if the actual and expected are not a match.
▪ assertNotNull: This assertion is used to check whether a particular object is NULL or not.
📌𝑨𝒍𝒔𝒐, 𝒚𝒐𝒖 𝒘𝒊𝒍𝒍 𝒍𝒆𝒂𝒓𝒏 📃
🔸 What are the TestNG assertions?
🔸 How do you validate soft assertions in TestNG?
🔸 Is verify and soft assert the same?
🔸 Does TestNG support soft assertion?
**𝑹𝒆𝒍𝒂𝒕𝒆𝒅 𝑩𝒍𝒐𝒈𝒔 & 𝑫𝒐𝒄𝒔**
**𝑳𝒆𝒂𝒓𝒏𝒊𝒏𝒈 𝑯𝒖𝒃**
**𝑪𝒆𝒓𝒕𝒊𝒇𝒊𝒄𝒂𝒕𝒊𝒐𝒏𝒔**
Sign Up for LambdaTest! It’s FREE 🙌
Register Now to Avail Bonanza Offerings 💎
+ Test websites and web apps on 3000+ real browsers over LambdaTest cloud
+ Trusted By 1M+ users, 500+ enterprises and 130+ countries
+ Online scalable Selenium Grid to perform Manual as well as Automation Testing
+ 100 minutes of free Web + Mobile Automation Testing
+ 60 minutes of free Live Interactive Testing per month
+ 10 Screenshot Tests per month
+ 10 Responsive Tests per month (Test a page across 50+ Device configurations with a single click)
+ Unlimited free testing on LT Browser
**𝑬𝒙𝒑𝒍𝒐𝒓𝒆**
**𝑺𝒐𝒄𝒊𝒂𝒍**
#testngtutorial #lambdatest #testngassertions #seleniumtests #auotmationscripts #testngselenium #testngfeatures #testngbasics #testngcourse #learntestng
Disclaimer:
This video features materials protected by the Fair Use guidelines of Section 107 of the Copyright Act. All rights reserved to © 2022 LambdaTest. Any illegal reproduction of this content will result in immediate legal action.
Комментарии