Continuous Test Orchestration And Execution Platform Online

Perform automated and live-interactive testing on 3000+ real desktop and mobile devices online.

How to Debug Failures in Cypress tests?

Cypress is a JavaScript-based end-to-end testing framework used to test web applications. It is designed to simplify writing, debugging, and maintaining tests for web applications.

There are several ways to Debug failure in Cypress test automation, such as:

  • Cypress debugger: The Cypress debugger lets you go through your tests while inspecting variables and the application's state at each stage. To open a debugger, you can add “debugger” or “cy.debug()” in your test code.
  • .pause() command: .pause() command in Cypress will enable you to inspect that each command has desired effect by inspecting the web application, the DOM, the network, or any storage.
  • consol.log() statement: You can use the consol.log() statement in your test script to print out debugging information.
  • Remove time-sensitive variables: Cypress is flake resistant; however, using time-sensitive variables can cause flakiness issues.
  • Use the command log: The command log in Cypress testing shows the command lists you have used in your test script. With the help of a command log, you can track what commands are used and their orders.
LambdaTest

Test your websites, web-apps, or mobile apps seamlessly with LambdaTest.

Start Free Testing
LambdaTest

Earn resume-worthy Selenium certifications that help you land a top job.

Learn More
LambdaTest

Test your web or mobile apps

Test orchestration and execution cloud of 3000+ browsers and OS

Support

24/7 support

Security

Enterprise grade security

Cloud

Fastest test execution cloud