30 Questions
Which attribute is used to log the execution details in the console?
verbose
Which value can be used for the 'Parallel' attribute to run scripts parallel?
suites
What is the default value of the 'Parallel' attribute?
tests
What is the purpose of the 'name' attribute in TestNG?
To specify the name of the suite
What is the purpose of the 'thread-count' attribute in TestNG?
To specify the number of threads for parallel execution
What is the purpose of the 'verbose' attribute in TestNG?
To specify the log level for execution details
What is the value of the 'verbose' attribute to get more detailed and clearer log details in the console?
10
What should be done to execute multiple tests in parallel using TestNG?
Set the 'Parallel' attribute to the desired value
What is the recommended way to execute the testng.xml file?
Right click on the testng.xml and select 'Run as Testing'
What does TestNG provide an option for?
Executing multiple tests in a single configuration file
Which method is used to log in to Flipkart?
sendKeys()
What is the CSS selector used to find the login form input for the user email in Flipkart?
.fk-input.login-form-input.user-email
Which method is used to search for a product in SnapDeal?
sendKeys()
What is the CSS selector used to find the first item in the search results in SnapDeal?
.gd-row.browse-grid-row:nth-of-type(1) > div:nth-child(1)>div>div:nth-child(2)>div>a
Which method is used to remove an item from the cart in SnapDeal?
findElement()
Which method is used to accept an alert in SnapDeal?
accept()
Which method is used to log out from Flipkart?
logout()
Which method is used to maximize the browser window in SnapDeal?
manage()
Which method is used to set the implicit wait time in SnapDeal?
implicitlyWait()
Which method is used to navigate to a URL in SnapDeal?
navigate()
Which of the following is a benefit of running test methods, test classes, and test cases in parallel using TestNG?
It reduces the execution time
What is the purpose of the TestNG.xml file in TestNG?
To configure test execution settings
Which step is required to run multiple classes (suites) using TestNG?
Create a TestNG.xml file
What is the purpose of the @BeforeClass annotation in TestNG?
To initialize the test environment
What is the purpose of the @Test annotation in TestNG?
To mark a method as a test method
Which WebDriver is used in the code provided in the text?
FirefoxDriver
What is the purpose of the driver.manage().window().maximize() method in the code?
To maximize the browser window
What is the purpose of the driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS) method in the code?
To set the implicit wait time
What is the purpose of the driver.navigate().to("https://www.flipkart.com") method in the code?
To navigate to the Flipkart website
What is the purpose of the @AfterClass annotation in TestNG?
To perform test cleanup
TestNG: Running Multiple Test Classes in Parallel with TestNG.xml
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free