How to Execute Failed Test Cases in TestNG: Selenium WebDriver (easy)
30 Questions
1 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 tool is used to create a Selenium project?

  • Java
  • Linux
  • Eclipse (correct)
  • TestNG

What is the purpose of TestNG?

  • To run only failed test cases
  • To convert and execute a Selenium project
  • To execute TestNG via Command Line (correct)
  • To create a Selenium project

How can you run only failed test cases?

  • By creating a Selenium project
  • By executing TestNG via Command Line
  • By running testng-failed.xml file from Command line (correct)
  • By converting and executing a Selenium project

What is the first step to prepare a Selenium project in Eclipse?

<p>Create a Java project (D)</p> Signup and view all the answers

What does the 'src' folder represent in Eclipse?

<p>The project structure (D)</p> Signup and view all the answers

What is the purpose of selecting 'package' in Eclipse?

<p>To create a new package (A)</p> Signup and view all the answers

What is the superclass for the newly created class in Eclipse?

<p>java.lang (B)</p> Signup and view all the answers

What is the purpose of TestNG in the context of the tutorial?

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

What is the purpose of the 'TestProject' java project?

<p>To prepare the Selenium project (C)</p> Signup and view all the answers

What is the purpose of the 'com.test' package in Eclipse?

<p>To create a new package (A)</p> Signup and view all the answers

Which button do you need to click to create the class DemoA?

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

What is the purpose of the code 'Driver.manage().window().maximize();'?

<p>It maximizes the browser window (D)</p> Signup and view all the answers

What does the code 'driver.get(https://www.google.co.in);' do?

<p>It enters 'https://www.google.co.in' in the URL field (B)</p> Signup and view all the answers

What does the code 'driver.findElement(By.name(“q”)).sendKeys(“Hi”);' do?

<p>It enters 'Hi' in the search box (B)</p> Signup and view all the answers

What is the purpose of adding the Selenium-standalone jar file to the project?

<p>To remove errors in the code (C)</p> Signup and view all the answers

What is the purpose of the 'lib' folder in the project?

<p>To execute the testng.xml file from eclipse (B)</p> Signup and view all the answers

What is the purpose of converting the DemoA and DemoB classes into a testng.xml file?

<p>To execute the code in the classes (A)</p> Signup and view all the answers

What is the purpose of the 'testng.xml' suite file?

<p>To execute the code in the classes (C)</p> Signup and view all the answers

What is the purpose of the 'Parallel Mode' in the testng.xml file?

<p>To execute the code in parallel (A)</p> Signup and view all the answers

What happens when you click on 'run as TestNG Suite' for the testng.xml file?

<p>The code in the classes is executed (D)</p> Signup and view all the answers

Which command is used to execute TestNG via command line?

<p>java –cp &quot;path of lib folder present in workspace*; path of bin folder present in project workspace; path of testng.jar file present in lib folder of project workspace&quot; org.testng.TestNG testng.xml (A)</p> Signup and view all the answers

What is the purpose of the 'test-output' folder?

<p>To store the test execution reports (A)</p> Signup and view all the answers

What happens when you run the 'testng-failed.xml' file from command line?

<p>Only failed test cases are executed (A)</p> Signup and view all the answers

What is the purpose of the 'log' method in the Reporter class?

<p>To store logging information (A)</p> Signup and view all the answers

What is the purpose of the 'Parallel Mode' in the testng.xml file?

<p>To execute test cases in parallel (A)</p> Signup and view all the answers

How can you run only failed test cases through Eclipse?

<p>Right-click on the testng-failed.xml file and click on 'run as TestNG Suite' (B)</p> Signup and view all the answers

What is the purpose of the TestNG reports?

<p>To display the test results (C)</p> Signup and view all the answers

What is the purpose of the 'lib' folder in the project?

<p>To store third-party libraries (D)</p> Signup and view all the answers

What is the purpose of converting test classes into a testng.xml file?

<p>To group and execute multiple test cases (B)</p> Signup and view all the answers

What is the purpose of the 'resource' option in the properties window?

<p>To specify the location of the project (B)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser