TestNG Groups: Include, Exclude with Example – Selenium Tutorial (Medium)

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which group parameter is associated with the first test case?

  • strong_ties
  • none (correct)
  • both
  • bonding

Which test case is tagged with both 'strong_ties' and 'bonding' groups?

  • tc02VerifyLoggedInPage
  • tc01LaunchURL
  • tc04VerifyLoggedInPage (correct)
  • tc03EnterCredentials

Which scenario involves removing the group tag from the running XML?

  • Scenario 4
  • Scenario 1 (correct)
  • Scenario 3
  • Scenario 2

Which scenario involves running test cases specific to a particular group?

<p>Scenario 2 (D)</p> Signup and view all the answers

Which scenario involves excluding a test case?

<p>Scenario 3 (B)</p> Signup and view all the answers

Which scenario involves including specific test cases?

<p>Scenario 4 (B)</p> Signup and view all the answers

How many test cases are associated with the 'bonding' group?

<p>3 (B)</p> Signup and view all the answers

Which test case is tagged with the 'strong_ties' group?

<p>tc03EnterCredentials (D)</p> Signup and view all the answers

Which test case is not associated with any group parameter?

<p>tc02VerifyLoggedInPage (B)</p> Signup and view all the answers

Which test case is associated with both 'bonding' and 'strong_ties' groups?

<p>tc05VerifyHyperlinks (A)</p> Signup and view all the answers

Which types of test designs does TestNG cover?

<p>Functional and UI tests (B)</p> Signup and view all the answers

How can you run single or multiple packages in TestNG?

<p>By creating XML and running it through maven (D)</p> Signup and view all the answers

When do we use groups in TestNG?

<p>When we want to ignore some test cases (B)</p> Signup and view all the answers

What are the two mechanisms supported in TestNG for grouping test cases?

<p>Include and exclude (A)</p> Signup and view all the answers

What is the syntax for using groups in the XML file?

<p>@Test (groups = { 'group_name' }) (D)</p> Signup and view all the answers

What are the logical names used for groups in TestNG?

<p>bonding and strong_ties (B)</p> Signup and view all the answers

What is the purpose of using the 'exclude' mechanism in TestNG?

<p>To ignore (not execute) some test cases (D)</p> Signup and view all the answers

What is the purpose of using the 'include' mechanism in TestNG?

<p>To include specific test cases in a group (A)</p> Signup and view all the answers

What is the purpose of creating an XML file for TestNG?

<p>To configure testng.xml file (C)</p> Signup and view all the answers

What can be encapsulated in a package in TestNG?

<p>A group of classes (C)</p> Signup and view all the answers

What is the purpose of the XML file in the Maven framework?

<p>To store information about one or more tests (C)</p> Signup and view all the answers

What is the purpose of the @Test annotation in TestNG?

<p>To define a Java class as a TestNG method (C)</p> Signup and view all the answers

What is the purpose of the 'exclude' tag in the TestNG XML?

<p>To exclude specific test cases (C)</p> Signup and view all the answers

What is the purpose of the 'include' tag in the TestNG XML?

<p>To include specific test cases (A)</p> Signup and view all the answers

What is the purpose of the 'groups' attribute in the @Test annotation?

<p>To assign test methods to specific groups (A)</p> Signup and view all the answers

What is the purpose of the 'tc01LaunchURL' method in the TC_Class1 class?

<p>To initialize the browser and launch the URL (B)</p> Signup and view all the answers

What is the purpose of the 'tc02VerifyLaunchPage' method in the TC_Class1 class?

<p>To verify the presence of the home page heading (C)</p> Signup and view all the answers

What is the purpose of the 'tc03EnterCredentials' method in the TC_Class1 class?

<p>To enter the username and password on the login form (A)</p> Signup and view all the answers

What is the purpose of the 'tc04VerifyLoggedInPage' method in the TC_Class1 class?

<p>To verify the presence of the Manager ID on the user dashboard (C)</p> Signup and view all the answers

What is the purpose of the 'tc05VerifyHyperlinks' method in the TC_Class1 class?

<p>To verify the presence of additional links on the user dashboard (B)</p> Signup and view all the answers

Flashcards are hidden until you start studying

More Like This

Use Quizgecko on...
Browser
Browser