Skip to main content

KaneAI - Assertions

The Assertion Feature in KaneAI enhances test execution control by transitioning from soft assertions (which allow tests to proceed despite failures) to hard assertions, where test execution stops immediately upon failure. This feature ensures that failures are logged with detailed remarks, providing better debugging insights. However, users retain flexibility by marking specific assertions as soft, allowing test execution to continue selectively.

Key Features

  • Hard Assertions : Test execution halts immediately upon assertion failure, marking the test as failed.
  • Soft Assertions : Specific assertions can be marked as soft, allowing test execution to continue despite failures.
  • Detailed Failure Logging : Every failed assertion logs comprehensive failure remarks for better debugging.
  • Improved Test Control : Users can customize assertion behavior based on test requirements.

Step-by-Step Guide

Step 1: Initiate a Test Session

  • Log in to your LambdaTest account.
  • Click on Create a Web / App Test to start a new session within Kane AI.
kaneai

Step 2: Perform an Assertion test

  • Create an assertion step and KaneAI will perform a visual query to detect if the specified test is valid or not.
  • If the assertion passes, it is marked as Assertion True.
  • If the assertion fails it will be marked as Assertion Failed.
kaneai

Step 3: Configure Hard Assertion

  • Click on the assertion step where the test failed.
  • Toggle the button to enable or disable the Hard assertion:
  • If enabled, test execution stops immediately on failure.
  • If disabled, the test continues execution despite the failure.
  • Save the configuration and proceed.
kaneai

Step 4: Review and Execute the test

  • Navigate to the Test Manager to view the summary of executed tests.
  • Review the steps performed, and click on the save button.
  • Navigate to the Code tab, your code is generated to run on HyperExecute.
  • Click on the button Run on HyperExecute.
kaneai

Step 5: Monitor the Test Execution

  • Veriy your test results in the logs as shown below:
kaneai

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles