# TestPage data type
> Version: _Available or changed with runtime version 1.0._
Represents a variable type that can be used to test Page Application Objects.
## Instance methods
The following methods are available on instances of the TestPage data type.
Method name|Description
testpage-cancel-method|Gets the Cancel system action.
testpage-caption-method|Gets the caption of the test page.
testpage-close-method|Closes an open test page.
testpage-edit-method|Gets the Edit system action.
testpage-editable-method|Gets the runtime value of the Editable property on a test page.
Expand(Boolean)<testpage-expand-method>|Expands rows on a test page.
FindFirstField(TestField, Any)<testpage-findfirstfield-method>|Finds the first field in the data set that is displayed on a test page.
FindNextField(TestField, Any)<testpage-findnextfield-method>|Finds the next field in the data set that is displayed on a test page.
FindPreviousField(TestField, Any)<testpage-findpreviousfield-method>|Finds the previous field in the data set that is displayed on a test page.
testpage-first-method|Sets the current row of the test page as the first row in the data set.
GetField(Integer)<testpage-getfield-method>|Gets a field on a test page.
GetValidationError([Integer])<testpage-getvalidationerror-method>|Gets the list of all validation error that occurred on a test page as a string.
GoToKey([Any,...])<testpage-gotokey-method>|Finds the row in a data set on the test page that is identified by the specified values.
GoToRecord(Record)<testpage-gotorecord-method>|Finds the specified record in a data set on a test page.
testpage-isexpanded-method|Specifies if rows on a test page are expanded.
testpage-last-method|Sets the current row of the test page as the last row in the data set.
testpage-new-method|Sets the current row of the test page to an empty row in a data set.
testpage-next-method|Sets the current row of the test page as the next row in the data set.
testpage-no-method|Gets the No system action.
testpage-ok-method|Gets the OK system action.
testpage-openedit-method|Opens a test page in edit mode.
testpage-opennew-method|Opens a blank test page in edit mode.
testpage-openview-method|Opens a test page in view mode.
testpage-prev-method|Sets the current row of the test page as the previous row in the data set.
testpage-previous-method|Sets the current row of the test page as the previous row in the data set.
[RunPageBackgroundTask(Integer [, var Dictionary of [Text, Text]] [, Boolean])](testpage-runpagebackgroundtask-method.md)|Runs the page background task codeunit in a child session and waits for its completion. Note that page background task completion triggers are not invoked by default; see parameter "RunCompletionTriggers".
testpage-trap-method|Traps the next test page that is invoked and assigns it to the test page variable.
testpage-validationerrorcount-method|Gets the number of validation errors that occurred on the test page.
testpage-view-method|Gets the View system action.
testpage-yes-method|Gets the Yes system action.
## Related information
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/testpage/testpage-data-type, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/testpage/testpage-data-type/
