TestNG: How to Run Multiple Test Suites in Selenium (hard)

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

Which attribute is used to log the execution details in the console?

  • Parallel
  • thread-count
  • verbose (correct)
  • name

Which value can be used for the 'Parallel' attribute to run scripts parallel?

  • classes
  • tests
  • methods
  • suites (correct)

What is the default value of the 'Parallel' attribute?

  • classes
  • methods
  • suites
  • tests (correct)

What is the purpose of the 'name' attribute in TestNG?

<p>To specify the name of the suite (D)</p> Signup and view all the answers

What is the purpose of the 'thread-count' attribute in TestNG?

<p>To specify the number of threads for parallel execution (D)</p> Signup and view all the answers

What is the purpose of the 'verbose' attribute in TestNG?

<p>To specify the log level for execution details (A)</p> Signup and view all the answers

What is the value of the 'verbose' attribute to get more detailed and clearer log details in the console?

<p>10 (C)</p> Signup and view all the answers

What should be done to execute multiple tests in parallel using TestNG?

<p>Set the 'Parallel' attribute to the desired value (C)</p> Signup and view all the answers

What is the recommended way to execute the testng.xml file?

<p>Right click on the testng.xml and select 'Run as Testing' (B)</p> Signup and view all the answers

What does TestNG provide an option for?

<p>Executing multiple tests in a single configuration file (B)</p> Signup and view all the answers

Which method is used to log in to Flipkart?

<p>sendKeys() (C)</p> Signup and view all the answers

What is the CSS selector used to find the login form input for the user email in Flipkart?

<p>.fk-input.login-form-input.user-email (A)</p> Signup and view all the answers

Which method is used to search for a product in SnapDeal?

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

What is the CSS selector used to find the first item in the search results in SnapDeal?

<p>.gd-row.browse-grid-row:nth-of-type(1) &gt; div:nth-child(1)&gt;div&gt;div:nth-child(2)&gt;div&gt;a (A)</p> Signup and view all the answers

Which method is used to remove an item from the cart in SnapDeal?

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

Which method is used to accept an alert in SnapDeal?

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

Which method is used to log out from Flipkart?

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

Which method is used to maximize the browser window in SnapDeal?

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

Which method is used to set the implicit wait time in SnapDeal?

<p>implicitlyWait() (C)</p> Signup and view all the answers

Which method is used to navigate to a URL in SnapDeal?

<p>navigate() (C)</p> Signup and view all the answers

Which of the following is a benefit of running test methods, test classes, and test cases in parallel using TestNG?

<p>It reduces the execution time (A)</p> Signup and view all the answers

What is the purpose of the TestNG.xml file in TestNG?

<p>To configure test execution settings (B)</p> Signup and view all the answers

Which step is required to run multiple classes (suites) using TestNG?

<p>Create a TestNG.xml file (A)</p> Signup and view all the answers

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

<p>To initialize the test environment (B)</p> Signup and view all the answers

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

<p>To mark a method as a test method (A)</p> Signup and view all the answers

Which WebDriver is used in the code provided in the text?

<p>FirefoxDriver (C)</p> Signup and view all the answers

What is the purpose of the driver.manage().window().maximize() method in the code?

<p>To maximize the browser window (A)</p> Signup and view all the answers

What is the purpose of the driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS) method in the code?

<p>To set the implicit wait time (D)</p> Signup and view all the answers

What is the purpose of the driver.navigate().to("https://www.flipkart.com") method in the code?

<p>To navigate to the Flipkart website (D)</p> Signup and view all the answers

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

<p>To perform test cleanup (D)</p> Signup and view all the answers

Flashcards are hidden until you start studying

More Like This

Use Quizgecko on...
Browser
Browser