Results 1 to 2 of 2
  1. #1

    Verifying data in database as part of automated testing

    I have a general question around best practices and what is typically done in automated testing with Selenium (or others).

    Lets say we had to test a registration process which has three pages:
    1. A registration page where the users provides their details (name, address etc.) and clicks submit
    2. A confirmation page which confirms that the registration is complete
    3. A failure page if the registration failed.

    Normally, when automating the test, I have been coding that if the confirmation page is displayed then the test has passed.

    My question is if the automated test also check the database to verify that the details were correctly saved before considering that the test has passed. How would you approach this?

  2. #2
    SQA Knight
    Join Date
    May 2006
    Playa Del Rey, California, United States
    Generally verifying using the Database is a bad idea. Makes your test very brittle and vulnerable to schema changes. Ideally, you'll want to use an API call to make that verification, even if you need to create one for testing.

    If that is not an option, another option is to import the developer's data models they're using in their ORM so that you don't have to maintain the data mappings.
    David Lai
    SDET / Consultant
    LinkedIn profile



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:34 PM.

Copyright BetaSoft Inc.