Question :Selenium tests _____________.
DOS applications
Browser-based applications
GUI applications
None of the above
Correct Answer : Browser-based applications
Question :What is called that scale for large test suites or test suites that must be run in multiple environments?
Selenium-Grid
Selenium RC
Selenium Web driver
Selenium NG
Correct Answer : Selenium-Grid
Question :What does the term DOM refers to ?
Dynamic Object Model
Document Object Model
Data Object Model
Document Flow Object Model
Correct Answer : Document Object Model
Question :What is a test suite made of ?
Test packs
Tests
Test blocks
Test pattern
Correct Answer : Tests
Question :Select the component which is NOT part of Selenium suite.
Selenium IDE
Selenium RC
SeleniumGrid
Selenium Web
Correct Answer : Selenium Web
Question :Select the Browser which is supported by Selenium IDE
Google chrome
Opera mini
Mozilla Firefox
Internet Explorer
Correct Answer : Mozilla Firefox
Question :Select the operating system which is NOT supported by Selenium IDE.
Unix
Linux
Windows
Solaris
Correct Answer : Unix
Question :The Web driver is used
To execute tests on the HtmlUnit browser.
To design a test using Selenese
To quickly create tests
To test a web application against Firefox only.
Correct Answer : To execute tests on the HtmlUnit browser.
Question :The Selenium IDE is used
To create customized test results.
To deploy your tests across multiple environments using Selenium Grid
To test with HTMLUnit
To test a web application against Firefox only.
Correct Answer : To test a web application against Firefox only.
Question :The Selenium RC is used
To run your test against different browsers (except HtmlUnit) on different operating systems.
To create tests with little or no prior knowledge in programming.
To test a web application against Firefox only.
To run a huge test suite, that can be executed on multiple machines.
Correct Answer : To run your test against different browsers (except HtmlUnit) on different operating systems.
Question :Select the method which selects the option at the given index.
selectByIndex()
selectIndex()
selectedByIndex()
selectByIndexes()
Correct Answer : selectByIndex()
Question :The Selenium
Provides professional customer support
Test Reports are generated automatically
Comes with a built-in object repository
Cannot access elements outside of the web application under test
Correct Answer : Cannot access elements outside of the web application under test
Question :Which command can be used to enter values onto text boxes?
sendsKeys()
sendKey()
sendKeys
sendKeys()
Correct Answer : sendKeys()
Question :The Actions commands
are commands that directly interact with page elements.
are commands that allow you to store values to a variable.
are commands that verify if a certain condition is met.
All the above
Correct Answer : are commands that directly interact with page elements.
Question :Which component of Selenium can create customized test results.
Web driver
Selenium RC
Selenium IDE
Selenium Grid
Web driver
Question :Select the command which is used to pause execution until the specified element becomes present.
waitForElementPresent
waitForPagePresent
waitForTablePresent
waitForFieldPresent
waitForElementPresent
Question :Select the command which is used to pause execution until the page is loaded completely.
waitForPageToLoad
waitForElementPresent
waitForPage
waitForLoad
waitForPageToLoad
Question :Select the syntax to locate an element using inner text.
css=tag:contains(“inner text”)
css=tag:value(“inner text”)
css=tag:attributes(“inner text”)
css=tag:class(“inner text”)
Correct Answer : css=tag:contains(“inner text”)
Question :What is TestNG?
TestNextGeneration
TestNewGenerlization
TestNewGeneration
TestNextGenerations
Correct Answer : TestNextGeneration
Question :Select the variation which finds elements based on the driver’s underlying CSS selector engine in Web driver Selenium.
By.cssSelected
By.cssSelection
By.cssSelector
By.Selectcs
Correct Answer : By.cssSelector
Question :Select the variation which locates elements by the value of the “name” attribute in Web driver Selenium
By.name
By.nametag
By.tagname
By.nametags
Correct Answer : By.name
Question :Select the variation which locates elements by the value of their “id” attribute in Web Driver Selenium
By.id
By.idno
By.id_no
By.tag_id
Correct Answer : By.id
Question :Select the Get command which fetches the inner text of the element that you specify in Web driver Selenium.
getinnerText()
get_in_Text()
get_inner_Text()
getText()
Correct Answer : getText()
Question :Which Navigate command takes you forward by one page on the browser’s history in Web driver Selenium.
navigate.forward()
navigate().forward()
navigate()_forward()
navigate_forword()
Correct Answer : navigate().forward()
Question :Select the method which clears all selected entries in Web driver Selenium.
dselectAll()
deselect_All()
dselect_All()
deselectAll()
Correct Answer : deselectAll()
Question :Method which selects the option which displays the text matching the parameter passed to it
selectVisibleText()
selectByVisibleText()
select_VisibleText()
select_ByVisibleText()
Correct Answer : selectByVisibleText()
Question :Select the method which performs a context-click at the current mouse location.
click_Context()
context.Click()
contextClick()
context_Click()
Correct Answer : contextClick()
Question :Which command should be used to confirm that test will pass in the future, when new element is added after page loaded?
waitForElementPresent
pause
assertElementPresent
None of these
Correct Answer : waitForElementPresent
Question :Which command is used to extend the time limit of WAITFOR command?
Extend waitFor (time in sec)
waitFor (time in sec) extend
setTimeout (time in sec)
setTimeout.
Correct Answer : setTimeout.
Question :___________ finds the item ending with the value passed in. This is the equivalent to the XPath ends-with. Is concern with?
^=
$=
*=
&=
Correct Answer : $=
Question :In Selenium, Following Axis is related to:
Selects all the siblings after the current element
Selects all elements that follow the closing tab of the current elements.
Selects all of the siblings before the current element
Selects all elements that are before the current element
Selects all elements that follow the closing tab of the current elements.
Question :The // tells the query that
It needs to stop at the first element that it finds.
This is comment
The path of the file or folder
All of these
It needs to stop at the first element that it finds.
Question :In regular Expression * quantifier refers to:
0 or more of the preceding character.
1 or more of the preceding character
0 or 1 of the preceding character
All of these
0 or more of the preceding character.
Question :Which regular expression sequence that loosely translates to “anything or nothing?”
.* (dot star)
*. (star dot)
“?
*+
.* (dot star)
Question :Which process use the JavaScript to find an element?
By DOM query
BY XPath query
BY CSS sector
All of these
Correct Answer : By DOM query
Question :If you wanted to access the element that has the text “This element has an ID that changes every time the page is loaded” in it, then which of the following is used:
//div[contains(@id,’time_’)]
//div[contains(@id_time())]
//div[parameter(@id_time())]
//div[parameter(@id,’time_’)]
Correct Answer : //div[contains(@id,’time_’)]
Question :To delete a cookie we need to call the deleteCookie method, passing in two parameters.
The first parameter is the name of the cookie, and the second parameter is where it was created.
The first parameter is where it was created, and the second parameter is the name of cookie.
None of these
A and B
Correct Answer : The first parameter is the name of the cookie, and the second parameter is where it was created.
Question :What is the default port number used by hub in selenium?
4444
2222
1111
3333
Correct Answer : 4444
Question :Which two commands you use to validate a button?
VerifyTextPresent and assertTextPresent
VerifyElementPresent and assertElementPresent
VerifyAlertPresent and assertAlertPresent
VerifyAlert and assertAlert
Correct Answer : VerifyElementPresent and assertElementPresent
Question :Selects all the parent, grandparent, and so on of the element is related to which axis name in Selenium:
Ancestor
Preceding
Parent
All of these.
Correct Answer : Ancestor
Question :What is the latest version of Selenium WebDriver?
4.0
3.0
2.0
1.0
Correct Answer : 4.0
Question :Which command is used to open a web page in Selenium WebDriver?
open()
start()
get()
load()
get()
Question :How can you find an element by its ID using Selenium WebDriver?
findElement(By.id('elementId'))
getElementById('elementId')
findElementById('elementId')
getElement(By.id('elementId'))
findElement(By.id('elementId'))
Question :Which method is used to type text into an input field using Selenium WebDriver?
type()
sendKeys()
setText()
enterText()
sendKeys()
Question :What is the command to click on a button using Selenium WebDriver?
click()
press()
tap()
select()
Correct Answer : click()
Question :Which method is used to submit a form using Selenium WebDriver?
submitForm()
sendForm()
submit()
clickForm()
Correct Answer : submit()
Question :How do you switch to a new window or tab using Selenium WebDriver?
switchToWindow()
switchToTab()
switchToNewWindow()
switchTo().window(handle)
Correct Answer : switchTo().window(handle)
Question :How do you handle alerts in Selenium WebDriver?
handleAlert()
acceptAlert()
switchToAlert()
dismissAlert()
Correct Answer : switchToAlert()
Question :How do you perform mouse hover action using Selenium WebDriver?
hover()
mouseHover()
moveToElement()
moveMouseTo()
Correct Answer : moveToElement()
Question :Which method is used to clear the contents of an input field using Selenium WebDriver?
clear()
reset()
delete()
remove()
Correct Answer : clear()
Question :What is the command to select an option from a dropdown using Selenium WebDriver?
select()
choose()
pick()
click()
Correct Answer : select()
Question :How do you get the current URL of the web page using Selenium WebDriver?
getCurrentURL()
getURL()
fetchURL()
retrieveURL()
Correct Answer : getCurrentURL()
Question :Which method is used to maximize the browser window using Selenium WebDriver?
maximizeWindow()
maximize()
fullscreen()
setMaximized()
Correct Answer : maximize()
Question :How do you perform the double-click action using Selenium WebDriver?
doubleClick()
clickTwice()
performDoubleClick()
doubleTap()
Correct Answer : doubleClick()
Question :What is the command to refresh the web page using Selenium WebDriver?
refresh()
reload()
update()
navigate().refresh()
Correct Answer : navigate().refresh()
Question :How do you handle frames using Selenium WebDriver?
switchToFrame()
switchFrame()
frameTo()
switchTo().frame()
Correct Answer : switchTo().frame()
Question :Which method is used to get the text of an element using Selenium WebDriver?
text()
getValue()
getText()
innerText()
Correct Answer : getText()
Question :What is the command to close the current window using Selenium WebDriver?
close()
quit()
exit()
end()
Correct Answer : close()
Question :How do you capture screenshots using Selenium WebDriver?
captureScreenshot()
takeScreenshot()
getScreenshot()
screenshot()
Correct Answer : takeScreenshot()
Question :What is the correct way to wait for an element to be clickable using Selenium WebDriver?
waitForClickable()
waitUntilClickable()
waitUntilElementClickable()
WebDriverWait(driver, timeout).until(ExpectedConditions.elementToBeClickable(element))
Correct Answer : WebDriverWait(driver, timeout).until(ExpectedConditions.elementToBeClickable(element))
Question :How do you handle multiple windows or tabs using Selenium WebDriver?
getWindowHandles()
getWindowIds()
getWindowNames()
getAllWindowHandles()
Correct Answer : getWindowHandles()
Question :Which method is used to execute JavaScript code using Selenium WebDriver?
executeJS()
runScript()
executeScript()
executeJavaScript()
Correct Answer : executeScript()
Question :How do you scroll down to the bottom of the web page using Selenium WebDriver?
scrollDown()
scrollToBottom()
scrollToEnd()
scrollBy(0, document.body.scrollHeight)
Correct Answer : scrollBy(0, document.body.scrollHeight)
Question :What is the correct way to check if a checkbox is selected using Selenium WebDriver?
isChecked()
isSelected()
isMarked()
isClicked()
Correct Answer : isSelected()
Question :How do you handle keyboard events using Selenium WebDriver?
handleKeyboard()
sendKeys()
typeKeys()
keyboardEvent()
Correct Answer : sendKeys()
Question :Which method is used to drag and drop elements using Selenium WebDriver?
dragAndDrop()
dragDrop()
performDragAndDrop()
dragTo()
Correct Answer : dragAndDrop()
Question :How do you handle HTTP basic authentication using Selenium WebDriver?
handleAuthentication()
authenticate()
setCredentials()
authenticateUsing()
Correct Answer : authenticateUsing()
Question :What is the correct way to switch to the default content from a frame using Selenium WebDriver?
switchToDefaultContent()
switchToDefault()
switchToMainFrame()
switchTo().defaultContent()
Correct Answer : switchTo().defaultContent()
Question :How do you handle mouse events using Selenium WebDriver?
handleMouse()
mouseEvent()
performMouseAction()
mouseAction()
Correct Answer : performMouseAction()
Question :Which method is used to get the CSS value of an element using Selenium WebDriver?
getCssValue()
fetchCssValue()
getStyle()
cssProperty()
Correct Answer : getCssValue()
Question :How do you handle SSL certificate errors using Selenium WebDriver?
handleSSLError()
acceptSSLCertificate()
trustSSLCertificate()
acceptInsecureCerts()
Correct Answer : acceptInsecureCerts()
Question :What is the command to navigate to a URL using Selenium WebDriver?
navigateTo()
goTo()
loadURL()
get()
get()
Question :How do you perform right-click context menu action using Selenium WebDriver?
rightClick()
contextClick()
performContextClick()
rightTap()
contextClick()
Question :Which method is used to check if an element is enabled using Selenium WebDriver?
isEnabled()
isClickable()
isActivated()
isDisabled()
isEnabled()
Question :How do you handle file uploads using Selenium WebDriver?
uploadFile()
chooseFile()
sendKeys()
sendFile()
sendKeys()
Question :What is the command to get the title of the web page using Selenium WebDriver?
getTitle()
fetchTitle()
getPageTitle()
getWindowTitle()
getTitle()
Question :How do you handle file uploads using Selenium WebDriver?
driver.uploadFile('file_path')
driver.sendKeysToElement('file_path')
driver.setFileInput('file_path')
driver.uploadFileToElement('file_path', element)
driver.uploadFileToElement('file_path', element)
Question :Which method is used to select an option from a dropdown using Selenium WebDriver?
selectDropdownOptionByText(element, 'option_text')
selectDropdownOptionByIndex(element, index)
element.selectByVisibleText('option_text')
element.selectByValue('option_value')
element.selectByVisibleText('option_text')
Question :How do you handle multiple windows or tabs in Selenium WebDriver?
driver.switchToNewWindow()
driver.switchToWindow(index)
driver.switchToNextWindow()
driver.switchToWindow(handle)
driver.switchToWindow(handle)
Question :What is the correct way to wait for an element to be visible using Selenium WebDriver?
driver.waitForElementVisible(element)
driver.waitUntilElementVisible(element)
wait.until(ExpectedConditions.visibilityOf(element))
wait.until(elementToBeVisible(element))
wait.until(ExpectedConditions.visibilityOf(element))
Question :How do you handle browser cookies using Selenium WebDriver?
driver.setCookie(cookie)
driver.addCookie(cookie)
driver.updateCookie(cookie)
driver.deleteCookie(cookie)
driver.addCookie(cookie)
Question :What is the correct way to handle basic authentication pop-ups in Selenium WebDriver?
driver.handleAuthentication(username, password)
driver.authenticate(username, password)
driver.switchTo().alert().authenticateUsing(new UserAndPassword(username, password))
driver.switchTo().alert().setCredentials(username, password)
driver.switchTo().alert().authenticateUsing(new UserAndPassword(username, password))
Question :How do you handle mouse hover actions in Selenium WebDriver?
driver.hoverOverElement(element)
driver.moveToElement(element)
actions.moveToElement(element).perform()
actions.hover(element).perform()
Correct Answer : actions.moveToElement(element).perform()
Question :What is the correct way to execute JavaScript code using Selenium WebDriver?
driver.executeScript('javascript_code')
driver.runScript('javascript_code')
driver.executeJavaScript('javascript_code')
driver.runJavaScript('javascript_code')
Correct Answer : driver.executeScript('javascript_code')
Question :How do you handle alerts and pop-ups in Selenium WebDriver?
driver.handleAlert('accept')
driver.acceptAlert()
driver.dismissAlert()
driver.handleAlert('dismiss')
Correct Answer : driver.acceptAlert()
Question : What is the correct way to scroll to an element using Selenium WebDriver?
driver.scrollToElement(element)
driver.scrollIntoView(element)
actions.scrollIntoView(element).perform()
actions.moveToElement(element).perform()
Correct Answer : actions.moveToElement(element).perform()
Question : How do you handle keyboard key presses in Selenium WebDriver?
actions.keyDown(Keys.ENTER).perform()
actions.sendKeys(Keys.ENTER).release().perform()
actions.sendKeys(Keys.ENTER).perform()
actions.keyDown(Keys.ENTER).release().perform()
Correct Answer : actions.sendKeys(Keys.ENTER).perform()
Question : What is the correct way to simulate browser navigation using Selenium WebDriver?
driver.navigate().to('url')
driver.navigate().back()
driver.navigate().refresh()
driver.navigate().forward()
Correct Answer : driver.navigate().to('url')
Question : How do you handle frames and iframes in Selenium WebDriver?
driver.switchToFrame(frame)
driver.switchTo().frame(frame)
driver.switchTo().frame(index)
driver.switchToFrame(index)
Correct Answer : driver.switchTo().frame(frame)
Question : What is the correct way to take a screenshot using Selenium WebDriver?
driver.takeScreenshot('file_path')
driver.getScreenshotAs('file_path')
driver.saveScreenshot('file_path')
driver.captureScreenshot('file_path')
Correct Answer : driver.getScreenshotAs('file_path')
Question : How do you handle SSL certificate errors in Selenium WebDriver?
driver.acceptSSLCertificate()
driver.handleSSLCertificateError('proceed')
driver.handleSSLCertificateError('cancel')
driver.ignoreSSLCertificateError()
Correct Answer : driver.acceptSSLCertificate()
Question : What is the correct way to simulate mouse double-click using Selenium WebDriver?
actions.doubleClick(element).perform()
actions.mouseDoubleClick(element).perform()
actions.doubleClickAndHold(element).perform()
actions.doubleClickAndHold(element).release().perform()
Correct Answer : actions.doubleClick(element).perform()
Question :How do you handle geolocation prompts in Selenium WebDriver?
driver.setGeolocation(location)
driver.allowGeolocationPrompt(true)
driver.dismissGeolocationPrompt()
driver.handleGeolocationPrompt('allow')
Correct Answer : driver.handleGeolocationPrompt('allow')
Question : What is the correct way to check if an element is present and visible using Selenium WebDriver?
driver.isElementDisplayed(element)
driver.isElementPresent(element)
driver.isElementVisible(element)
element.isDisplayed()
Correct Answer : element.isDisplayed()
Question : How do you handle drag and drop actions in Selenium WebDriver?
actions.dragAndDrop(source, target).perform()
actions.clickAndHold(source).moveToElement(target).release().perform()
actions.dragAndDropByOffset(source, x, y).perform()
actions.clickAndHold(source).moveByOffset(x, y).release().perform()
Correct Answer : actions.dragAndDrop(source, target).perform()
Question :What is the correct way to handle page navigation timeouts in Selenium WebDriver?
driver.setPageLoadTimeout(timeout)
driver.manage().timeouts().pageLoadTimeout(timeout, TimeUnit.SECONDS)
driver.setLoadTimeout(timeout)
driver.manage().timeouts().setPageLoadTimeout(timeout, TimeUnit.SECONDS)
Correct Answer : driver.manage().timeouts().pageLoadTimeout(timeout, TimeUnit.SECONDS)
Question : Which type of framework promotes the use of data-driven testing in Selenium?
Keyword-driven framework
Hybrid framework
Data-driven framework
Page Object Model
Correct Answer : Data-driven framework
Question : What is the primary purpose of the Page Object Model (POM) in Selenium?
Managing browser sessions
Creating modular and reusable code
Handling multiple windows
Generating test reports
Correct Answer : Creating modular and reusable code
Question : In the TestNG framework, which annotation is used to mark a method as a test case?
@BeforeMethod
@Test
@AfterClass
@DataProvider
Correct Answer : @Test
Question : Which framework facilitates the parallel execution of test cases in Selenium?
JUnit
TestNG
NUnit
Cucumber
Correct Answer : TestNG
Question : What is the purpose of the "assert" statements in testing frameworks like TestNG or JUnit?
Pause test execution
Generate logs
Verify expected outcomes
Manage browser instances
Correct Answer : Verify expected outcomes
Question : Which type of framework combines the features of both data-driven and keyword-driven frameworks?
Modular framework
Page Object Model (POM)
Hybrid framework
Behavior-Driven Development (BDframework
Correct Answer : Hybrid framework
Question : What is the purpose of a testNG.xml file in TestNG framework?
Define test scenarios
Store test data
Configure test execution settings
Manage page objects
Correct Answer : Configure test execution settings
Question : In Selenium, which design pattern is commonly used to create an instance of a browser driver?
Singleton pattern
Observer pattern
Factory pattern
Builder pattern
Correct Answer : Factory pattern
Question : Which framework facilitates behavior-driven testing in Selenium projects?
JUnit
TestNG
Cucumber
NUnit
Correct Answer : Cucumber
Question : What is the purpose of the "dataProvider" annotation in TestNG?
Manage test data
Perform assertions
Define test scenarios
Handle browser sessions
Correct Answer : Manage test data
Question : Which design pattern is associated with the concept of encapsulating an object's behavior in Selenium?
Singleton pattern
Page Object Model (POM)
Observer pattern
Composite pattern
Correct Answer : Page Object Model (POM)
Question : Which framework allows the execution of test scripts across different browsers and platforms in Selenium Grid?
TestNG
JUnit
Selenium WebDriver
TestNG with parallel execution
Correct Answer : Selenium WebDriver
Question : What is the primary purpose of the "tearDown" method in testing frameworks like JUnit or TestNG?
Set up test data
Close browser sessions
Perform assertions
Define test scenarios
Correct Answer : Close browser sessions
Question : Which annotation is used to mark a method that runs before every test case in TestNG?
@BeforeSuite
@BeforeTest
@BeforeMethod
@BeforeClass
Correct Answer : @BeforeMethod
Question : In the context of Selenium, what does the term "WebDriverEventListener" refer to?
A design pattern for managing browser sessions
A component for handling AJAX calls
An interface for capturing events during test execution
A utility for managing cookies
Correct Answer : An interface for capturing events during test execution
Question : Which design pattern in Selenium promotes the creation of flexible and maintainable test scripts by separating concerns?
Singleton pattern
Observer pattern
Page Object Model (POM)
Factory pattern
Correct Answer : Page Object Model (POM)
Question : Which method is used to take screenshots in Selenium WebDriver?
captureScreenshot()
takeScreenshot()
captureScreen()
getScreenshot()
Correct Answer : takeScreenshot()
Question : In a Selenium project, which framework is commonly used for managing and organizing test data?
JUnit
TestNG
Apache POI
Selenium Grid
Correct Answer : Apache POI
Question : Which design pattern is commonly used to implement the concept of parallel test execution in Selenium Grid?
Observer pattern
Singleton pattern
Factory pattern
Decorator pattern
Correct Answer : Factory pattern
Question : What is the purpose of the "@FindBy" annotation in the Page Object Model (POM)?
Identifying test methods
Locating web elements
Defining test data
Handling test dependencies
Correct Answer : Locating web elements
Question : Which Selenium WebDriver method is used to switch to a different frame within a web page?
switchToFrame()
switchToWindow()
switchToAlert()
switchTo().frame()
Correct Answer : switchTo().frame()
Question : What is the primary purpose of the "SoftAssertions" library in testing frameworks like TestNG?
Handling exceptions
Generating test reports
Performing assertions without stopping the test execution on failure
Managing browser sessions
Correct Answer : Performing assertions without stopping the test execution on failure
Question : In Selenium, which type of locator is used to find web elements by their link text?
CSS selector
XPath
ID
LinkText
Correct Answer : LinkText
Question : Which testing framework is commonly associated with the concept of "test suites" in Selenium projects?
JUnit
TestNG
NUnit
Cucumber
Correct Answer : TestNG
Question : What is the primary purpose of the "WebDriverWait" class in Selenium?
Managing browser sessions
Executing JavaScript code
Explicitly waiting for a certain condition before proceeding with the test
Switching between windows
Correct Answer : Explicitly waiting for a certain condition before proceeding with the test
Question : Which method is used to perform mouse hover actions in Selenium WebDriver?
hover()
moveToElement()
mouseOver()
performHover()
Correct Answer : moveToElement()
Question : What is the purpose of the "TestBase" class in a Selenium project?
Managing test data
Executing test cases
Serving as a base class for common functionalities shared across test classes
Handling browser sessions
Correct Answer : Serving as a base class for common functionalities shared across test classes
Question : Which annotation is used to mark a method that runs after every test case in TestNG?
@AfterSuite
@AfterTest
@AfterMethod
@AfterClass
Correct Answer : @AfterMethod
Question : In Selenium, what is the purpose of the "Actions" class?
Managing browser sessions
Performing advanced user interactions like drag-and-drop
Executing JavaScript code
Switching between frames
Correct Answer : Performing advanced user interactions like drag-and-drop
Question : Which method is used to select an option from a dropdown menu in Selenium WebDriver?
click()
selectByIndex()
setValue()
chooseOption()
Correct Answer : selectByIndex()
Question : Which design pattern is commonly used for creating dynamic and flexible object repositories in Selenium projects?
Factory pattern
Singleton pattern
Prototype pattern
Decorator pattern
Correct Answer : Factory pattern
Question : What is the purpose of the "@BeforeSuite" annotation in TestNG?
Set up test data
Execute test cases
Perform actions before the entire test suite
Configure test execution settings
Correct Answer : Perform actions before the entire test suite
Question : In Selenium WebDriver, which method is used to simulate keyboard actions such as pressing keys?
type()
sendKeys()
setText()
enterKey()
Correct Answer : sendKeys()
Question : What is the purpose of the "extentReports" library in Selenium projects?
Managing test data
Generating test reports
Performing assertions
Handling browser sessions
Correct Answer : Generating test reports
Question : Which Selenium WebDriver method is used to navigate backward in the browser history?
navigateToBack()
goBack()
back()
previousPage()
Correct Answer : back()
Question : What is the purpose of the "Apache POI" library in Selenium projects?
Performing database operations
Managing test data
Generating test reports
Handling Excel files
Correct Answer : Handling Excel files
Question : Which annotation is used to mark a method that runs before the entire test suite in TestNG?
@BeforeSuite
@BeforeTest
@BeforeClass
@BeforeMethod
Correct Answer : @BeforeSuite
Question : Which class in Selenium is used to set browser-specific settings for Chrome?
ChromeSettings
ChromeDriver
ChromeOptions
ChromeBrowserSettings
ChromeOptions
Question : Which of the following methods is used to add an argument to ChromeOptions?
addPreference()
addArguments()
setCapability()
addExtensions()
addArguments()
Question : Which capability in DesiredCapabilities is used to run Chrome in headless mode?
headless
disable-gpu
chromeOptions.headless
chrome.switches
headless
Question : How can you set a custom download directory in Chrome using ChromeOptions?
options.addPreference("download.default_directory", path);
options.setDownloadDirectory(path);
options.addArguments("download.default_directory", path);
options.setExperimentalOption("prefs", prefs);
options.setExperimentalOption("prefs", prefs);
Question : Which method is used to merge ChromeOptions with DesiredCapabilities in Selenium WebDriver?
options.merge(capabilities);
capabilities.setOptions(options);
options.addCapabilities(capabilities);
capabilities.merge(options);
options.merge(capabilities);
Question : What is the purpose of using setCapability() method in DesiredCapabilities?
To set system properties.
To define test data.
To set browser-specific capabilities.
To configure WebDriver timeouts.
To set browser-specific capabilities.
Question : Which of the following is the correct way to disable the "Save Password" prompt in Chrome using ChromeOptions?
options.addArguments("disable-password-manager");
options.setCapability("disable-password-saving", true);
options.setExperimentalOption("prefs", {"credentials_enable_service": false});
options.setPreference("disablePasswordManager", true);
options.setExperimentalOption("prefs", {"credentials_enable_service": false});
Question : Which ChromeOptions argument is used to start Chrome maximized?
--start-maximized
--maximize
--start-fullscreen
--window-size=1920,1080
--start-maximized
Question : How do you add an extension to Chrome using ChromeOptions?
options.setExperimentalOption("extensions", extensionPath);
options.addExtensions(new File(extensionPath));
options.addArguments("--load-extension=" + extensionPath);
options.setCapability("chrome.loadExtension", extensionPath);
options.addExtensions(new File(extensionPath));
Question : Which of the following is a valid DesiredCapabilities property for enabling logging in Chrome?
capabilities.setCapability("loggingPrefs", "ALL");
capabilities.setCapability("goog:loggingPrefs", "ALL");
capabilities.setCapability("chromeOptions.loggingPrefs", "ALL");
capabilities.setCapability("browserLogging", "ALL");
capabilities.setCapability("goog:loggingPrefs", "ALL");
Comments
Post a Comment