Online Exam Quiz

questionQuestion  1 to 30

What is the default method to locate elements in Selenium?

  • ByName
  • ByTag
  • ByXPath
  • ByID
Mark for review

Which assertion library is used with Selenium and TestNG?

  • Log4j
  • Assert
  • JUnit
  • Fluent
Mark for review

Which file must be downloaded to automate Firefox?

  • geckodriver.exe
  • chromedriver.exe
  • edge.exe
  • webdriver.jar
Mark for review

Which annotation is used in PageFactory?

  • @FindElement
  • @FindBy
  • @Locator
  • @Element
Mark for review

Which WebDriver method is used to refresh the browser?

  • refresh()
  • reload()
  • reopen()
  • update()
Mark for review

Which option is used to check if an element is visible?

  • isShown()
  • isPresent()
  • isVisible()
  • isDisplayed()
Mark for review

How do you run tests in multiple browsers using Selenium?

  • Enable compatibility mode
  • Use WebDriverManager
  • Cross-browser test framework
  • Define capabilities for each browser
Mark for review

What happens if an assertion fails in TestNG?

  • Test halts
  • Skips test
  • Continues execution
  • Logs warning
Mark for review

What is the purpose of driver.getPageSource()?

  • Returns CSS
  • Returns JS
  • Returns complete HTML source
  • Returns headers
Mark for review

Which interface contains the click() method?

  • WebDriver
  • WebElement
  • By
  • Selector
Mark for review

What is XPath in Selenium?

  • A URL
  • A scripting language
  • A locator strategy
  • A plugin
Mark for review

What is Selenium?

  • A manual testing tool
  • A performance testing tool
  • A browser automation tool
  • A database testing tool
Mark for review

Which driver is used for Chrome automation in Selenium?

  • FirefoxDriver
  • SafariDriver
  • ChromeDriver
  • WebDriver
Mark for review

Which class is used to wait until an element is visible?

  • FluentWait
  • WebDriverWait
  • Timer
  • Clock
Mark for review

Which option is best for data-driven testing in Selenium?

  • Manual testing
  • Java files
  • Excel/CSV
  • API testing
Mark for review

Selenium WebDriver is:

  • A GUI-based tool
  • A library for browser automation
  • A commercial testing tool
  • A build tool
Mark for review

How do you scroll down a web page in Selenium?

  • pageDown()
  • driver.scroll()
  • JavaScriptExecutor
  • ScrollBy()
Mark for review

Which function in WebDriver returns list of elements?

  • findElement()
  • getElements()
  • fetchElements()
  • findElements()
Mark for review

What is the role of DesiredCapabilities in Selenium?

  • Launching browsers
  • Setting browser properties
  • Logging errors
  • Formatting output
Mark for review

What is the use of driver.getWindowHandle()?

  • Get session ID
  • Get tab ID
  • Get current window ID
  • Get cookies
Mark for review

What is the purpose of moveToElement() in Actions class?

  • Zoom element
  • Click element
  • Hover mouse
  • Hide element
Mark for review

What does driver.findElement(By.id("username")) do?

  • Returns a window
  • Returns a list
  • Returns a single web element
  • Returns page title
Mark for review

Which framework is useful for managing test data?

  • TestNG
  • Maven
  • DataProvider
  • Log4j
Mark for review

Which of the following interacts with HTML elements?

  • Actions
  • WebElement
  • Robot
  • WebDriverWait
Mark for review

How do you select an option from a dropdown in Selenium?

  • Using click()
  • Using getText()
  • Using Select class
  • Using mouse hover
Mark for review

Selenium tests are most stable when using:

  • XPath locators
  • Absolute paths
  • IDs and CSS selectors
  • Image recognition
Mark for review

How do you check the number of open tabs in Selenium?

  • driver.getWindowHandles().size()
  • driver.tabCount()
  • driver.getTabs()
  • countTabs()
Mark for review

Which of these is NOT handled by WebDriver directly?

  • Alerts
  • File uploads
  • Windows
  • Video streaming
Mark for review

Which command is used to run a TestNG suite?

  • mvn clean run
  • mvn test
  • java testng.xml
  • testng.run()
Mark for review

Which Selenium class is used for performing keyboard and mouse actions?

  • WebDriver
  • WebElement
  • Actions
  • Robot
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review