TestNG: How to Run Multiple Test Suites in Selenium (hard)
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 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</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</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</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</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</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'</p> Signup and view all the answers

    What does TestNG provide an option for?

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

    Which method is used to log in to Flipkart?

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

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

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

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

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

    Which method is used to accept an alert in SnapDeal?

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

    Which method is used to log out from Flipkart?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    More Like This

    Use Quizgecko on...
    Browser
    Browser