Test Automation Tools MCQs

  1. Which of the following is a popular web automation tool?
    a) Selenium
    b) JUnit
    c) PyTest
    d) NUnit
    View Answer

    Correct answer: A — Selenium

  2. Cypress tests are written in which language?
    a) Java
    b) Python
    c) JavaScript
    d) Ruby
    View Answer

    Correct answer: C — JavaScript

  3. Selenium WebDriver supports automation for:
    a) Multiple browsers
    b) Only Chrome
    c) Only Firefox
    d) Only Edge
    View Answer

    Correct answer: A — Multiple browsers

  4. Which Selenium method is used to click a button?
    a) element.click()
    b) element.press()
    c) element.execute()
    d) element.run()
    View Answer

    Correct answer: A — element.click()

  5. Cypress automatically waits for:
    a) DOM elements to load
    b) CI/CD pipelines
    c) Docker containers
    d) Monitoring logs
    View Answer

    Correct answer: A — DOM elements to load

  6. Selenium locators include:
    a) ID, Name, XPath, CSS
    b) Log, Monitor, Deploy, Run
    c) Test, Suite, Case, Group
    d) File, Path, Config, Env
    View Answer

    Correct answer: A — ID, Name, XPath, CSS

  7. Cypress supports running tests in:
    a) Headless mode
    b) Only GUI mode
    c) Only IDE mode
    d) Only console mode
    View Answer

    Correct answer: A — Headless mode

  8. Selenium Grid is used for:
    a) Distributed test execution
    b) Logging
    c) Monitoring
    d) Deployment
    View Answer

    Correct answer: A — Distributed test execution

  9. Which of the following is NOT a Selenium locator?
    a) By.id
    b) By.name
    c) By.xpath
    d) By.mock
    View Answer

    Correct answer: D — By.mock

  10. Cypress uses which command to visit a URL?
    a) cy.visit()
    b) cy.url()
    c) cy.open()
    d) cy.load()
    View Answer

    Correct answer: A — cy.visit()

  11. What will be printed?
    1 import org.openqa.selenium.WebDriver;
    2 import org.openqa.selenium.chrome.ChromeDriver;
    3 public class EduinqSelenium {
    4 public static void main(String[] args) {
    5 WebDriver driver = new ChromeDriver();
    6 System.out.println("Eduinq Selenium Test");
    7 driver.quit();
    8 }
    9 }
    a) Eduinq Selenium Test
    b) ChromeDriver
    c) No output
    d) Error
    View Answer

    Correct answer: A — Eduinq Selenium Test

  12. Cypress command to get an element by CSS selector is:
    a) cy.get()
    b) cy.find()
    c) cy.locate()
    d) cy.search()
    View Answer

    Correct answer: A — cy.get()

  13. Selenium supports programming languages like:
    a) Java, Python, C#, Ruby
    b) Only Java
    c) Only Python
    d) Only C#
    View Answer

    Correct answer: A — Java, Python, C#, Ruby

  14. Cypress supports assertions using:
    a) Chai and Mocha
    b) JUnit
    c) NUnit
    d) unittest
    View Answer

    Correct answer: A — Chai and Mocha

  15. Selenium IDE is used for:
    a) Record and playback of tests
    b) Monitoring logs
    c) Deploying applications
    d) Running CI/CD pipelines
    View Answer

    Correct answer: A — Record and playback of tests

  16. Cypress supports mocking network requests using:
    a) cy.intercept()
    b) cy.mock()
    c) cy.stub()
    d) cy.fake()
    View Answer

    Correct answer: A — cy.intercept()

  17. Selenium Grid enables:
    a) Parallel test execution
    b) Sequential logging
    c) Monitoring dashboards
    d) Deployment pipelines
    View Answer

    Correct answer: A — Parallel test execution

  18. Cypress supports screenshots using:
    a) cy.screenshot()
    b) cy.capture()
    c) cy.image()
    d) cy.photo()
    View Answer

    Correct answer: A — cy.screenshot()

  19. Selenium WebDriver is an interface for:
    a) Browser automation
    b) Database management
    c) Logging
    d) Monitoring
    View Answer

    Correct answer: A — Browser automation

  20. Cypress supports video recording using:
    a) Built-in functionality
    b) External plugins only
    c) Manual scripts
    d) Not supported
    View Answer

    Correct answer: A — Built-in functionality

  21. Which of the following is true about Selenium?
    a) It automates browsers
    b) It monitors logs
    c) It deploys applications
    d) It runs CI/CD pipelines
    View Answer

    Correct answer: A — It automates browsers

  22. Cypress supports retrying assertions automatically:
    a) True
    b) False
    c) Only in headless mode
    d) Only in GUI mode
    View Answer

    Correct answer: A — True

  23. Selenium supports locating elements using:
    a) XPath
    b) SQL
    c) JSONPath
    d) ConfigPath
    View Answer

    Correct answer: A — XPath

  24. Cypress supports running tests in CI using:
    a) cypress run
    b) cypress ci
    c) cypress pipeline
    d) cypress deploy
    View Answer

    Correct answer: A — cypress run

  25. Selenium supports handling alerts using:
    a) driver.switchTo().alert()
    b) driver.alert()
    c) driver.getAlert()
    d) driver.findAlert()
    View Answer

    Correct answer: A — driver.switchTo().alert()

  26. Cypress supports waiting for elements using:
    a) cy.wait()
    b) cy.pause()
    c) cy.sleep()
    d) cy.delay()
    View Answer

    Correct answer: A — cy.wait()

  27. Selenium supports taking screenshots using:
    a) TakesScreenshot interface
    b) Screenshot class
    c) Capture interface
    d) Photo class
    View Answer

    Correct answer: A — TakesScreenshot interface

  28. Cypress supports stubbing functions using:
    a) cy.stub()
    b) cy.fake()
    c) cy.mock()
    d) cy.replace()
    View Answer

    Correct answer: A — cy.stub()

  29. Selenium supports handling multiple windows using:
    a) driver.getWindowHandles()
    b) driver.getWindows()
    c) driver.findWindows()
    d) driver.switchWindows()
    View Answer

    Correct answer: A — driver.getWindowHandles()

  30. Cypress supports environment variables using:
    a) cypress.json
    b) cypress.env
    c) cypress.config
    d) cypress.ini
    View Answer

    Correct answer: A — cypress.json

  31. What will be printed?
    1 describe('Eduinq Cypress Test', () => {
    2 it('prints message', () => {
    3 cy.log('Eduinq Automation');
    4 });
    5 });
    a) Eduinq Automation
    b) prints message
    c) No output
    d) Error
    View Answer

    Correct answer: A — Eduinq Automation

  32. Selenium supports implicit waits using:
    a) driver.manage().timeouts().implicitlyWait()
    b) driver.waitImplicit()
    c) driver.setWait()
    d) driver.timeout()
    View Answer

    Correct answer: A — driver.manage().timeouts().implicitlyWait()

  33. Cypress supports explicit waits using:
    a) cy.wait(time)
    b) cy.pause(time)
    c) cy.sleep(time)
    d) cy.delay(time)
    View Answer

    Correct answer: A — cy.wait(time)

  34. Selenium supports handling frames using:
    a) driver.switchTo().frame()
    b) driver.getFrame()
    c) driver.findFrame()
    d) driver.frame()
    View Answer

    Correct answer: A — driver.switchTo().frame()

  35. Cypress supports fixtures using:
    a) cy.fixture()
    b) cy.data()
    c) cy.load()
    d) cy.file()
    View Answer

    Correct answer: A — cy.fixture()

  36. Selenium supports executing JavaScript using:
    a) JavascriptExecutor
    b) ScriptRunner
    c) JSExecutor
    d) CodeRunner
    View Answer

    Correct answer: A — JavascriptExecutor

  37. Cypress supports clearing cookies using:
    a) cy.clearCookies()
    b) cy.deleteCookies()
    c) cy.removeCookies()
    d) cy.dropCookies()
    View Answer

    Correct answer: A — cy.clearCookies()

  38. Selenium supports maximizing browser window using:
    a) driver.manage().window().maximize()
    b) driver.maximize()
    c) driver.windowMax()
    d) driver.fullScreen()
    View Answer

    Correct answer: A — driver.manage().window().maximize()

  39. Cypress supports clearing local storage using:
    a) cy.clearLocalStorage()
    b) cy.deleteLocalStorage()
    c) cy.removeLocalStorage()
    d) cy.dropLocalStorage()
    View Answer

    Correct answer: A — cy.clearLocalStorage()

  40. Selenium supports navigating back using:
    a) driver.navigate().back()
    b) driver.goBack()
    c) driver.back()
    d) driver.previous()
    View Answer

    Correct answer: A — driver.navigate().back()

  41. Cypress supports navigating to previous page using:
    a) cy.go('back')
    b) cy.back()
    c) cy.previous()
    d) cy.navigateBack()
    View Answer

    Correct answer: A — cy.go('back')

  42. Selenium supports navigating forward using:
    a) driver.navigate().forward()
    b) driver.goForward()
    c) driver.forward()
    d) driver.next()
    View Answer

    Correct answer: A — driver.navigate().forward()

  43. Cypress supports navigating forward using:
    a) cy.go('forward')
    b) cy.forward()
    c) cy.next()
    d) cy.navigateForward()
    View Answer

    Correct answer: A — cy.go('forward')

  44. Selenium supports refreshing the page using:
    a) driver.navigate().refresh()
    b) driver.refresh()
    c) driver.reload()
    d) driver.pageRefresh()
    View Answer

    Correct answer: A — driver.navigate().refresh()

  45. Cypress supports reloading the page using:
    a) cy.reload()
    b) cy.refresh()
    c) cy.pageReload()
    d) cy.restart()
    View Answer

    Correct answer: A — cy.reload()

  46. Selenium supports closing the current window using:
    a) driver.close()
    b) driver.quit()
    c) driver.exit()
    d) driver.end()
    View Answer

    Correct answer: A — driver.close()

  47. Selenium supports quitting the entire browser session using:
    a) driver.quit()
    b) driver.close()
    c) driver.exit()
    d) driver.end()
    View Answer

    Correct answer: A — driver.quit()

  48. Cypress supports clearing cookies and local storage together using:
    a) cy.clearCookies(); cy.clearLocalStorage()
    b) cy.deleteCookies(); cy.deleteLocalStorage()
    c) cy.removeCookies(); cy.removeLocalStorage()
    d) cy.dropCookies(); cy.dropLocalStorage()
    View Answer

    Correct answer: A — cy.clearCookies(); cy.clearLocalStorage()

  49. Selenium supports selecting dropdown options using:
    a) Select class
    b) Dropdown class
    c) Option class
    d) Choice class
    View Answer

    Correct answer: A — Select class

  50. Which of the following best describes test automation tools?
    a) They automate browser and application testing
    b) They deploy applications
    c) They monitor logs
    d) They run CI/CD pipelines only
    View Answer

    Correct answer: A — They automate browser and application testing

Quick Links to Explore