“Expected “{value}” on {selector}, got {other value}” Error

Error: “Expected “{value}” on {selector}, got {other value}”
Code: submission-value-mismatch

This error indicates a mismatch between the expected and actual values for a specific field. It suggests that the submitted data does not match the anticipated input, which can lead to incorrect form processing or validation failures.

Troubleshooting Steps:

  1. Verify Test Expectations
    • Expected Value: Ensure that the expected value in your test script is correctly defined. Double-check the test script to confirm the exact value that should be present within the specified field.
    • Actual Value: Compare the actual value received during the test with the expected value. Identify any discrepancies between the two.
  2. Check Form Inputs
    • Input Fields: Verify that the correct data is being inputted into the form fields. Ensure that the input fields are being targeted accurately in the test script. Example:
  3. Review Data Submission
    • Form Data: Ensure that the data being submitted is accurate and complete. Check for any issues that might alter the data before submission.
    • Data Encoding: Verify that the data encoding is consistent and does not introduce any discrepancies.
  4. Inspect for JavaScript Issues
    • Validation Scripts: Check for any client-side validation scripts that might be modifying the data before submission. Ensure that these scripts are functioning as expected.
    • Console Errors: Look for any JavaScript errors in the browser’s console that might affect data processing.
  5. Review Server-Side Processing
    • Server Validation: Ensure that server-side validation rules are correctly implemented and match the expected input criteria.
    • Data Handling: Verify that the server correctly processes and stores the submitted data without modifications.
  6. Check for Interference
    • Third-Party Plugins: Disable any third-party plugins temporarily to see if they are interfering with the data submission process. Some plugins might alter the data before it reaches the server.
    • Custom Scripts: Review any custom scripts that might be affecting the form submission. Ensure they are not introducing discrepancies between the expected and actual values.
  7. Test Environment Consistency
    • Environment Match: Ensure that the test environment mirrors the production environment as closely as possible. Differences in configurations or data can affect the submission process.
    • Data Consistency: Make sure that the data used in the test environment is consistent and reflective of real-world usage.

Additional Tips:

  • Wait for Data Processing: Adjust the test script in Checkview.io to wait for the data to be processed and verified before proceeding.
  • Robust Selectors: Use robust selectors that accurately target the input fields and data elements. Avoid overly generic selectors that might fail to identify the correct elements.
  • Debugging with Developer Tools: Use the browser’s developer tools to inspect the form inputs and understand why the actual values do not match the expected values. This can help identify issues with data entry or processing.
  • Professional Help: If issues persist, consider consulting with a web development expert or a testing specialist for a thorough analysis and tailored solutions.