TestNG Groups: Include, Exclude with Example – Selenium Tutorial (Medium)
30 Questions
0 Views

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</p> Signup and view all the answers

    Which scenario involves excluding a test case?

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

    Which scenario involves including specific test cases?

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

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

    <p>3</p> Signup and view all the answers

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

    <p>tc03EnterCredentials</p> Signup and view all the answers

    Which test case is not associated with any group parameter?

    <p>tc02VerifyLoggedInPage</p> Signup and view all the answers

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

    <p>tc05VerifyHyperlinks</p> Signup and view all the answers

    Which types of test designs does TestNG cover?

    <p>Functional and UI tests</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</p> Signup and view all the answers

    When do we use groups in TestNG?

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

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

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

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

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

    What are the logical names used for groups in TestNG?

    <p>bonding and strong_ties</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</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</p> Signup and view all the answers

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

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

    What can be encapsulated in a package in TestNG?

    <p>A group of classes</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</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</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</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</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</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</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</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</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</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</p> Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser