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
intermediate2:00remaining
Key difference in architecture between Cypress and Selenium
Which statement best describes the architectural difference between Cypress and Selenium?
Attempts:
2 left
💡 Hint
Think about where the test code executes relative to the browser.
✗ Incorrect
Cypress runs its test code inside the browser, giving it direct access to DOM and network, while Selenium uses WebDriver to communicate externally.
❓ Predict Output
intermediate2: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'); });
Attempts:
2 left
💡 Hint
Check the official example.com title and Playwright API usage.
✗ Incorrect
The code navigates to example.com, retrieves the page title correctly, logs it, and asserts it matches 'Example Domain'.
❓ assertion
advanced2: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')
Attempts:
2 left
💡 Hint
Remember the Cypress chaining syntax for assertions.
✗ Incorrect
Cypress uses the should command to assert conditions like visibility.
🔧 Debug
advanced2: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?
Attempts:
2 left
💡 Hint
Consider timing issues and element readiness in UI tests.
✗ Incorrect
Flaky failures often happen when tests interact with elements before they are loaded or visible. Waiting or explicit waits help.
❓ framework
expert2: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?
Attempts:
2 left
💡 Hint
Consider browser support and built-in features for modern web apps.
✗ Incorrect
Playwright supports Chromium, Firefox, and WebKit with automatic waiting and network interception, making it ideal for modern cross-browser testing.