0
0
Cypresstesting~20 mins

Cypress vs Selenium vs Playwright comparison - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of Cypress vs Selenium vs Playwright
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Key difference in architecture between Cypress and Selenium
Which statement best describes the architectural difference between Cypress and Selenium?
ACypress and Selenium both run inside the browser but use different scripting languages.
BSelenium runs inside the browser and controls it directly, while Cypress operates outside the browser using WebDriver protocol.
CBoth Cypress and Selenium run outside the browser but use different protocols to communicate.
DCypress runs inside the browser and controls it directly, while Selenium operates outside the browser using WebDriver protocol.
Attempts:
2 left
💡 Hint
Think about where the test code executes relative to the browser.
Predict Output
intermediate
2:00remaining
Output of a Playwright test snippet
What will be the output of this Playwright test code snippet when run?
Cypress
import { test, expect } from '@playwright/test';

test('check page title', async ({ page }) => {
  await page.goto('https://example.com');
  const title = await page.title();
  console.log(title);
  expect(title).toBe('Example Domain');
});
ALogs 'Example Domain' and test passes
BLogs 'Example Domain' but test fails due to wrong assertion
CThrows an error because page.title() is not a function
DTest times out because page.goto() never resolves
Attempts:
2 left
💡 Hint
Check the official example.com title and Playwright API usage.
assertion
advanced
2:00remaining
Correct assertion syntax in Cypress for element visibility
Which Cypress assertion correctly verifies that a button with id 'submit-btn' is visible on the page?
Cypress
cy.get('#submit-btn')
Acy.get('#submit-btn').should('be.visible');
Bcy.get('#submit-btn').assert('visible');
Ccy.get('#submit-btn').expect('visible');
Dcy.get('#submit-btn').check('visible');
Attempts:
2 left
💡 Hint
Remember the Cypress chaining syntax for assertions.
🔧 Debug
advanced
2:00remaining
Identify the cause of flaky test in Selenium
A Selenium test intermittently fails with a 'NoSuchElementException' when trying to click a button. Which is the most likely cause?
AThe button's locator is incorrect and never matches any element.
BThe browser driver is outdated and incompatible with the browser version.
CThe test tries to click the button before it is present or visible on the page.
DThe test script has a syntax error causing it to stop early.
Attempts:
2 left
💡 Hint
Consider timing issues and element readiness in UI tests.
framework
expert
2:00remaining
Choosing the best framework for cross-browser testing with modern features
You need a testing framework that supports modern JavaScript features, runs tests in multiple browsers including Chromium, Firefox, and WebKit, and provides automatic waiting and network interception. Which framework best fits these requirements?
ACypress
BPlaywright
CSelenium WebDriver
DJest
Attempts:
2 left
💡 Hint
Consider browser support and built-in features for modern web apps.