The AccChecker API
The AccChecker API supports automated testing. After screening an application by using manual testing with the AccChecker GUI, you can write automated tests that incorporate the message and suppression logs created with the GUI tool.
The following code example demonstrates how to use the AccChecker API to test tabbing functionality in the Windows Firewall control panel application.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AccCheck.Logging;
public class TestCases : TestBase
{
public void AccessibilityTestCase()
{
// get our user interface ready for AccChecker
Setup();
// AccChecker's class representing verifications that you can run
AccCheck.Verification.VerificationManager vm = new AccCheck.Verification.VerificationManager();
// create a console logger to get output in the console
ConsoleLogger consoleLogger = new ConsoleLogger();
// add AccChecker's Console Logger
vm.AddLogger(consoleLogger);
// disable all verifications
vm.DisableVerifications(AccCheck.Verification.VerificationFilter.All);
// enable the ones we want to run
vm.EnableRoutine("CheckTabbing");
// run it against the firewall
vm.ExecuteEnabled(_fireWallHwnd);
// check if the verification failed by looking at the logger
if (consoleLogger.ErrorCount > 0)
{
Console.WriteLine("Test failed!");
Console.WriteLine("Error count = " + consoleLogger.ErrorCount);
}
// cleanup our user interface
Cleanup();
}
Related topics
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for