0
0
Selenium Javatesting~10 mins

Test suites (testng.xml) in Selenium Java - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the root element of a TestNG suite in testng.xml.

Selenium Java
<[1] name="SampleSuite">
</[1]>
Drag options to blanks, or click blank then click option'
Atest
Bclasses
Csuite
Dpackage
Attempts:
3 left
💡 Hint
Common Mistakes
Using as root element instead of
Using or as root element
2fill in blank
medium

Complete the code to define a test inside the suite in testng.xml.

Selenium Java
<suite name="SampleSuite">
  <[1] name="LoginTests">
  </[1]>
</suite>
Drag options to blanks, or click blank then click option'
Apackage
Bsuite
Cclass
Dtest
Attempts:
3 left
💡 Hint
Common Mistakes
Using inside instead of
Using or as test container
3fill in blank
hard

Fix the error in the code to correctly specify a test class in testng.xml.

Selenium Java
<suite name="SampleSuite">
  <test name="LoginTests">
    <classes>
      <[1] name="tests.LoginTest" />
    </classes>
  </test>
</suite>
Drag options to blanks, or click blank then click option'
Atest
Bclass
Cclasses
Dpackage
Attempts:
3 left
💡 Hint
Common Mistakes
Using instead of for a single class
Using or inside
4fill in blank
hard

Fill both blanks to include two test classes inside a test in testng.xml.

Selenium Java
<suite name="SampleSuite">
  <test name="RegressionTests">
    <classes>
      <[1] name="tests.HomeTest" />
      <[2] name="tests.ProfileTest" />
    </classes>
  </test>
</suite>
Drag options to blanks, or click blank then click option'
Aclass
Btest
Csuite
Dpackage
Attempts:
3 left
💡 Hint
Common Mistakes
Using different elements like or inside
Mixing and elements
5fill in blank
hard

Fill all three blanks to define a suite with two tests, each having one test class in testng.xml.

Selenium Java
<[1] name="FullSuite">
  <[2] name="SmokeTests">
    <classes>
      <[3] name="tests.SmokeTest" />
    </classes>
  </[2]>
  <test name="SanityTests">
    <classes>
      <class name="tests.SanityTest" />
    </classes>
  </test>
</[1]>
Drag options to blanks, or click blank then click option'
Asuite
Btest
Cclass
Dpackage
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up and elements
Using instead of for test classes