1. Describe the bug
When running AL tests directly from Visual Studio Code RequestPageHandler procedures are not being executed. However, the same tests run correctly and the RequestPageHandler executes as expected when using the Test Runner Framework in the Business Central client.
2. To Reproduce
Steps to reproduce the behavior:
- Create a test codeunit with a test procedure that calls a report with RunModal()
- Declare a RequestPageHandler in the test's HandlerFunctions attribute
- Use the VS Code "Run Test" or "Debug Test" to execute the test directly from the editor
- The RequestPageHandler procedure does not execute
Minimal code snippet demonstrating the issue:
codeunit 60060 MyTestCodeunit
{
Subtype = Test;
[Test]
[HandlerFunctions('RequestPageHandler')]
procedure RequestPageHandlerTest()
var
Customer: Record Customer;
CustomerDetailTrialBal: Report "Customer - Detail Trial Bal.";
begin
Customer.FindFirst();
CustomerDetailTrialBal.SetTableView(Customer);
Commit();
CustomerDetailTrialBal.RunModal(); // Trigger RequestPageHandler
Error('Unreachable!');
end;
[RequestPageHandler]
procedure RequestPageHandler(var CustomerDetailTrialBal: TestRequestPage "Customer - Detail Trial Bal.")
begin
// Do Stuff
Error('Test Error from Request Page Handler');
end;
}
3. Expected behavior
When running the test from VS Code, the RequestPageHandler should be invoked when CustomerDetailTrialBal.RunModal() is called. The test should fail with the error message "Test Error from Request Page Handler" from the handler procedure.
4. Actual behavior
The RequestPageHandler is not executed at all. Instead, the test continues past the RunModal() call and fails with the error "Unreachable!" from the test procedure itself.
The same test works correctly when run through the Test Runner Framework in the Business Central web client - the RequestPageHandler executes as expected.
5. Versions:
- AL Language: 18.0.2293710
- Visual Studio Code: 1.115.0
- Business Central: Version: DE Business Central 28.0 (Platform 28.0.48678.0 + Application 28.0.46665.48767)
- Operating System:
Final Checklist
Please remember to do the following:
1. Describe the bug
When running AL tests directly from Visual Studio Code RequestPageHandler procedures are not being executed. However, the same tests run correctly and the RequestPageHandler executes as expected when using the Test Runner Framework in the Business Central client.
2. To Reproduce
Steps to reproduce the behavior:
Minimal code snippet demonstrating the issue:
3. Expected behavior
When running the test from VS Code, the RequestPageHandler should be invoked when
CustomerDetailTrialBal.RunModal()is called. The test should fail with the error message "Test Error from Request Page Handler" from the handler procedure.4. Actual behavior
The RequestPageHandler is not executed at all. Instead, the test continues past the
RunModal()call and fails with the error "Unreachable!" from the test procedure itself.The same test works correctly when run through the Test Runner Framework in the Business Central web client - the RequestPageHandler executes as expected.
5. Versions:
Final Checklist
Please remember to do the following: