Schedule Automated Tests with Quality Inspector

Skip to main content

Schedule Automated Tests with Quality Inspector

You are here:

This example reviews how to schedule tests automatically. Create a work center test that runs automatically every morning. For your setup, configure the information to suit your needs.

Ensure you have a source configuration for the required record

  1. Navigate to Quality Inspector Source Configuration List in Business Central.
  2. Select New and modify the following fields in the General section:
    • Code: WORKCENTER
    • Description: Work Center Example
    • State: Enabled
    • From Table: Work Center
  3. Modify the fields in the What Information Should be Added to the Test section:
    • From Field Name: No.
    • To Field Name: Document No.

Now you can use the work center as a record to create your tests.

Create a Quality Inspection Template to use for automated tests

  1. Navigate to Test Templates in Business Central.
  2. Select New and modify the following fields in the General section:
    • Code: EXAMPLE
    • Description: 5S Work Center Example
  3. Select Add Field(s) To This Template and select Next.
  4. Modify the following fields:
    • Description: Have unnecessary items in your workspace been removed? (Press Enter after inserting.)
    • Short name (Field Code): (auto populates with “HAVEUNNECESSARYITEMS”)
    • What type of data is it?: A choice from a list
  5. Select Next.
  6. Input “YES” on the first line and “NO” on the second line in the Code field.
  7. Select Finish.
  8. Select Add Field(s) To This Template and select Next.
  9. Modify the following fields:
    • Description: Are tools, materials, and equipment arranged for a good workflow? (Press Enter after inserting.)
    • Short name (Field Code): (auto populates with “RETOOLSMATERIALSANDE”)
    • What type of data is it?: A choice from a list
  10. Select Next.
  11. Input “YES” on the first line and “NO” on the second line in the Code field.
  12. Select Finish.
  13. Select Test Generation Rules.
  14. Select the Table field, select “Work Center”, and select OK.

Verify the test code and publish the code unit

To use the code example below, you need the following pre-requisite:

  • A Quality Inspector Source configuration record for the work center (if you do not have one).
  • A Quality Inspection Template with the metrics you would like to collect.
  • A Quality Inspection Test Generation Rule that tells the system which Quality Inspection Template you want to use in which circumstances.

Review the test’s code with this example. The codeunit that does the work is described like this:

Copy to Clipboard

Once you have the pre-requisite configuration and have published your codeunit, you can create a Job Queue Entry to schedule a test using that codeunit.

Configure the test schedule and run the test

  1. Navigate to Job Queue Entries in Business Central.
  2. Select New.
  3. Modify the following fields:
    • Object Type to Run: Codeunit
    • Object ID to Run: 50700 (the codeunit we created)
    • Parameter String: 100
  4. Modify the Recurrence section as needed (e.g., Run on Tuesdays with 7:00:00 AM Starting Time)
  5. Select Run once (foreground) and select Yes to test.
  6. Select OK and view the created test.
  1. Select Set Status to Ready.
  2. Select Log Entries (if test has run) to view the successful test run.

Video

The following video goes through the process of scheduling automated tests with Quality Inspector.

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Need help?

Leave A Comment

Table of Contents
Go to Top