How to Execute Failed Test Cases in TestNG: Selenium WebDriver (hard)
29 Questions
2 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 class should be created first?

  • Both classes can be created simultaneously
  • DemoB
  • It doesn't matter
  • DemoA (correct)

What does the following code do?

Driver.manage().window().maximize();

  • Open a new browser window
  • Minimize the browser window
  • Close the browser window
  • Maximize the browser window (correct)

What does the following code do?

driver.get(https://www.google.co.in);

  • Opens the specified URL in a new tab
  • Closes the browser window
  • Navigates to the specified URL (correct)
  • Redirects to the homepage

What does the following code do?

driver.findElement(By.name(“q”)).sendKeys(“Hi”);

<p>Finds an element by name and sends the text 'Hi' (A)</p> Signup and view all the answers

What is the purpose of the 'lib' folder?

<p>To store both testNG and selenium jar files (C)</p> Signup and view all the answers

What is the purpose of the testng.xml file?

<p>To create a suite of test cases (B)</p> Signup and view all the answers

What does the 'testNG' option do?

<p>Converts Java files to TestNG files (D)</p> Signup and view all the answers

What does the 'Parallel Mode' option do?

<p>Executes the test cases in parallel (B)</p> Signup and view all the answers

What is the purpose of adding jar files in the lib folder?

<p>To execute the program from the command prompt (B)</p> Signup and view all the answers

What is the purpose of the 'Finish' button?

<p>To save the changes (B)</p> Signup and view all the answers

Which option correctly describes the first step to create a Selenium project in Eclipse?

<p>Create a new Java project by clicking on 'New Java Project' (B)</p> Signup and view all the answers

What is the purpose of executing TestNG via command line?

<p>To run only failed test cases (D)</p> Signup and view all the answers

Which step is required to run the testng-failed.xml file from the command line?

<p>Execute TestNG via command line (B)</p> Signup and view all the answers

What is the purpose of the 'src' folder in the project structure?

<p>To store the source code files (C)</p> Signup and view all the answers

Which option correctly describes the fourth step to create a Selenium project in Eclipse?

<p>Browse the 'src' folder and select package (C)</p> Signup and view all the answers

What is the purpose of the 'class' option in Eclipse?

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

Which option correctly describes the third step to create a Selenium project in Eclipse?

<p>Right click on the project and select 'New' (B)</p> Signup and view all the answers

What is the purpose of executing TestNG via command line?

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

Which step is required to run the testng-failed.xml file from the command line?

<p>Execute TestNG via command line (A)</p> Signup and view all the answers

What is the purpose of the 'src' folder in the project structure?

<p>To store the source code files (D)</p> Signup and view all the answers

Which option correctly describes the fourth step to create a Selenium project in Eclipse?

<p>Browse the 'src' folder and select package (A)</p> Signup and view all the answers

What is the purpose of the 'class' option in Eclipse?

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

Which option correctly describes the third step to create a Selenium project in Eclipse?

<p>Right click on the project and select 'New' (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 (D)</p> Signup and view all the answers

How do you run only failed test cases through Eclipse?

<p>Right click on the java project, select the refresh option, and then run the testng-failed.xml file as a testNG suite. (D)</p> Signup and view all the answers

How do you run failed test cases from Command Line?

<p>Open the command prompt, go to the project workspace, and run the command: java –cp &quot;path of lib folder present in workspace\*; path of bin folder present in project workspace; path of testing.jar file present in lib folder of project workspace&quot; org.testng.TestNG test-output/testng-failed.xml (C)</p> Signup and view all the answers

What does TestNG generate in its standard report?

<p>How many test cases are there, how many test cases are passed, how many test cases are failed, and how many test cases are skipped. (D)</p> Signup and view all the answers

What is one of the features provided by TestNG?

<p>Assigning priority to the test cases. (D)</p> Signup and view all the answers

How can you execute a specific test case separately in TestNG?

<p>If any of the test case fails while executing multiple test cases, you can execute that specific test case separately. (D)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser