{"id":196430,"date":"2025-03-21T13:49:42","date_gmt":"2025-03-21T13:49:42","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/knowledge\/?post_type=topic&#038;p=196430"},"modified":"2026-03-18T13:41:05","modified_gmt":"2026-03-18T13:41:05","slug":"leveraging-scade-test-automation-framework-to-streamline-testing-of-arinc-661-widgets","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/leveraging-scade-test-automation-framework-to-streamline-testing-of-arinc-661-widgets\/","title":{"rendered":"Leveraging SCADE Test Automation Framework to streamline testing of ARINC 661 widgets"},"content":{"rendered":"<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2025\/03\/scade-041-banner.jpg\" style=\"max-height: 700px !important\" \/><br \/>\n    <em>Photo credit: Miguel Cuenca @<a href=\"https:\/\/www.pexels.com\/photo\/close-up-of-dashboard-in-airplane-18719092\/\">Pexels<\/a><\/em>\n<\/p>\n<p>The <a href=\"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/arinc-661-the-standard-behind-modern-cockpit-display-systems\/\">ARINC 661<\/a> avionics standard, developed by Aeronautical Radio, Inc., is pivotal in modern Cockpit Display Systems (CDS): it enhances the efficiency, usability, and safety of aircraft cockpit interfaces. Ansys has been an active member in the <a href=\"https:\/\/aviation-ia.sae-itc.com\/subcommittees\/cockpit-display-systems\">ARINC 661 standard definition committee<\/a> since its inception, more than two decades ago.<\/p>\n<p>With the increased sophistication of avionics systems, ARINC 661 has become complex, featuring almost 120 widgets in Supplement 9. Each widget has unique behavior and display, making it time-consuming to test an ARINC 661 Server implementation.<\/p>\n<p>In this blog series, we will explore a streamlined approach for testing the ARINC 661 Widgets using the SCADE Test Automation Framework (TAF) for widgets implemented with Ansys SCADE Solutions for ARINC 661 Compliant Systems.<\/p>\n<p>In this article, we will first discuss the benefits and challenges of automatically testing ARINC 661 Widgets. We will then cover the features of TAF and how it addresses these challenges. Finally, we will guide you through the setup of the environment and share a concise example of testing a widget.<\/p>\n<p>So, let&#8217;s get started on our journey.<\/p>\n<h4  id=\"QUICK-INTRODUCTION-TO-ARINC-661-WIDGETS-AND-THEIR-TEST-AUTOMATION\">Quick Introduction to ARINC 661 Widgets and their test automation<\/h4>\n<p>ARINC 661 is a standard for defining interactive avionics display systems. Its intent is to minimize the effort and cost of improving cockpits as technology evolves (new avionics systems, new features on existing systems, new hardware in the cockpit). Widely adopted across the aerospace industry, it promotes interoperability between avionic systems and simplifies vendor integration. <\/p>\n<p>It is composed of UAs (for the logic), a CDS (server implementing the Widgets defined in the standard), and a safe runtime communication protocol. <\/p>\n<p>If you are not familiar with this standard, we invite you to check our entry-level introduction to ARINC 661 in <a href=\"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/arinc-661-the-standard-behind-modern-cockpit-display-systems\/\">this previous blog post<\/a>.<\/p>\n<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2025\/03\/scade-041-a661-standard.svg\" style=\"max-height: 500px !important\" \/><br \/>\n    <em><\/em>\n<\/p>\n<p>The initial testing activities for a hand-coded CDS project with 94 widgets are <a href=\"https:\/\/ieeexplore.ieee.org\/document\/10311110\">estimated<\/a> to require around 300 person-months, excluding verification activities. With ARINC 661 Supplement 9 specifying 119 widgets and this number continually increasing, the workload for testing future CDS projects will only grow.<\/p>\n<p>The need for automated testing in the development of ARINC 661 Widgets cannot be overstated, as it offers numerous benefits that significantly improve the efficiency and reliability of the testing process. By automating tests, development teams can achieve faster results, which is essential in today&#8217;s fast-paced world.<\/p>\n<p>Automated testing also aligns seamlessly with CI\/CD practices, empowering developers to quickly identify and fix issues early in the project while ensuring that changes do not disrupt the implementation. It also supports Continuous Improvement initiatives by enabling teams to consistently improve test cases and test procedures, maintaining high-quality software while keeping pace with rapid development cycles. Additionally, incorporating automated testing with TDD (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Test-driven_development\">Test Driven Development<\/a>) leads to better design and maintainable implementations.<\/p>\n<p>Automated testing eliminates human error, providing reliable results every time it is run, removing the need for tedious manual scenarios, and freeing up test engineers for other critical tasks in the development process. This boosts morale and energy levels. By enabling reproducibility, automated testing facilitates multi-target testing, ensuring that the CDS system functions consistently across various embedded hardware configurations.<\/p>\n<p>These benefits of automatically testing ARINC 661 widgets make it a crucial component of an efficient development cycle. However, it encounters several challenges in its implementation:<\/p>\n<ul>\n<li><strong>Setting pre-conditions<\/strong>: Before executing tests, the widgets under test must be set to a specific state, which might be difficult using only the ARINC 661 communication protocol.<\/li>\n<li><strong>Simulating user interactions<\/strong>: Testing widgets requires manual user interactions through pointers, keyboards, touch, or gestures, making automated execution challenging.<\/li>\n<li><strong>Checking events and notifications<\/strong>: The events or notifications emitted by widgets must be captured in a non-blocking manner.<\/li>\n<li><strong>Performing graphical comparison<\/strong>: To verify the rendered display of the widgets, testers must have a method for display verification that can be automated (e.g., a screenshot mechanism followed by an image comparison).<\/li>\n<li><strong>Describing test scenarios<\/strong>: Testers must have a language or method that allows them to clearly define test scenarios with support for the points listed above.<\/li>\n<li><strong>Developing a test framework<\/strong>: Ultimately, the testing team must develop a Test Framework that provides a communication channel between the host and the target while effectively addressing all the described challenges.<\/li>\n<\/ul>\n<h4  id=\"AUTOMATING-WIDGETS-TESTING-WITH-SCADE-TEST-AUTOMATION-FRAMEWORK\">Automating Widgets testing with SCADE Test Automation Framework<\/h4>\n<p><a href=\"https:\/\/www.ansys.com\/products\/embedded-software\/solutions-for-arinc-661\">SCADE Solutions for ARINC 661 Compliant Systems<\/a> provides a Test Automation Framework (TAF) that includes control proxy functionality in the ARINC 661 Server and a Python library. This library enables encoding\/decoding of ARINC 661 messages and exposes commands to interact with the control proxy.<\/p>\n<p>The usage of TAF can address the issues mentioned above:<\/p>\n<ul>\n<li><strong>Setting pre-conditions<\/strong>: a set of commands can pilot the server, its services, and its interfaces to bring a given widget to a given state.<\/li>\n<li><strong>Simulating user interactions<\/strong>: a set of commands can simulate pointers, keyboard, touch, and gestures; this even supports scenarios with multiple concurrent pointers, which are hard to test manually.<\/li>\n<li><strong>Checking events and notifications<\/strong>: a command can execute the server step by step and wait for events for a given number of cycles.<\/li>\n<li><strong>Performing graphical comparison<\/strong>: a command enables screenshot capture, and the image is sent back to the Python program for later comparison (for example using the image comparison tool provided in SCADE); additionally, it is possible to know the given state of the server (e.g. which widget has the focus) for simplifying testing strategies.<\/li>\n<li><strong>Describing test scenarios<\/strong>: test scenarios can be written in Python using a series of function calls to TAF commands, enabling the reuse of common scenarios across multiple tests.<\/li>\n<li><strong>Developing a test framework<\/strong>: the TAF allows running an automated Python test script commanding a live ARINC 661 server.<\/li>\n<\/ul>\n<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2025\/03\/scade-041-taf.svg\" style=\"max-height: 600px !important\" \/><br \/>\n    <em>ARINC 661 Server and TAF<\/em>\n<\/p>\n<p>Now, let&#8217;s see how we can set it up and test an ARINC 661 Widget.<\/p>\n<h4  id=\"SETTING-UP-THE-TEST-AUTOMATION-FRAMEWORK\">Setting Up the Test Automation Framework<\/h4>\n<p>After installing Ansys SCADE Solutions for ARINC 661 Compliant Systems, the basic setup of the Test Automation Framework requires setting up your Python environment (requires Python 3.6 or above).<\/p>\n<p>First, add the following values to environment variable <code>PYTHONPATH<\/code> to import the Python modules of the Test Automation Framework and SCADE Python API:<\/p>\n<ul>\n<li><code>%SCADE_INSTALL%\/SCADE A661\/PythonLib<\/code><\/li>\n<li><code>%SCADE_INSTALL%\/SCADE\/APIs\/Python\/lib<\/code><\/li>\n<\/ul>\n<p><code>%SCADE_INSTALL%<\/code> should either be replaced inline (e.g. with a path like <code>C:\/Program Files\/ANSYS Inc\/v251\/SCADE<\/code>) or set as a separate environment variable (i.e. called <code>SCADE_INSTALL<\/code>).<\/p>\n<p><strong>TIP: <\/strong>Alternatively, you can add these values to <code>sys.path<\/code> in your Python code before doing the import of Test Automation Framework, like for example:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span>SCADE_INSTALL_DIR <span style=\"font-weight: bold\">=<\/span> <span style=\"color: #bb8844\">&quot;C:\/Program Files\/ANSYS Inc\/v251\/SCADE&quot;<\/span>\r\n\r\n<span style=\"font-weight: bold\">import<\/span> <span style=\"color: #555555\">sys<\/span>\r\nsys<span style=\"font-weight: bold\">.<\/span>path <span style=\"font-weight: bold\">+=<\/span> [\r\n\u00a0 \u00a0 <span style=\"color: #bb8844\">f&quot;{<\/span>SCADE_INSTALL_DIR<span style=\"color: #bb8844\">}\/SCADE A661\/PythonLib&quot;<\/span>,\r\n\u00a0 \u00a0 <span style=\"color: #bb8844\">f&quot;{<\/span>SCADE_INSTALL_DIR<span style=\"color: #bb8844\">}\/SCADE\/APIs\/Python\/lib&quot;<\/span>,\r\n]\r\n<\/pre>\n<\/div>\n<p>We then need to install the python dependencies listed in <code>%SCADE_INSTALL%\/SCADE A661\/PythonLib\/taf\/requirements.txt<\/code> with either one of the following commands:<\/p>\n<ul>\n<li><code>pip install -r \"%SCADE_INSTALL%\/SCADE A661\/PythonLib\/taf\/requirements.txt\"<\/code><\/li>\n<li><code>pip install colorama pillow<\/code><\/li>\n<\/ul>\n<p>You can refer to the Documentation delivered with the product for more details (also available <a href=\"https:\/\/ansyshelp.ansys.com\/public\/Views\/Secured\/SCADE\/v251\/en\/PDFS\/SCADE%20ARINC%20Help%20Resources\/Guidelines\/Test%20Automation%20Framework\/TestAutomationFramework_ARC-TAF-EPG-25.pdf#G5.1284567\">online<\/a>).<\/p>\n<h4  id=\"BASIC-CONTENT-OF-TEST-AUTOMATION-FRAMEWORK\">Basic content of Test Automation Framework<\/h4>\n<p>The Test Automation Framework is a package consisting of several Python modules, including:<\/p>\n<ul>\n<li><strong>a661test.py<\/strong>: This module contains functionalities for tests, such as simulating user interactions and performing screenshots.<\/li>\n<li><strong>a661libgen_rev9_v1.py<\/strong>: This module contains the A661 Widgets API, describing each widget with its parameters and events. (<em>Note: the numbers in the file name could be different, based on the version of ARINC 661 used<\/em>).<\/li>\n<\/ul>\n<p>Other files provide core functionalities (e.g., the basic class of a Widget) and utility functions (e.g., configuring the logging mechanism, generating Definition Files, or checking events).<\/p>\n<h4  id=\"VERIFICATION-OF-CORRECT-SETUP\">Verification of correct setup<\/h4>\n<p>Before using the Test Automation Framework, let&#8217;s make sure it is properly configured.<\/p>\n<p>To do so, we will need a simple Definition File (DF) that we will be loaded into the ARINC 661 Server to check that no error has been reported.<\/p>\n<p>For the creation of the DF, we will use UA Page Creator to implement a specification with a single ToggleButton widget with ID 1 at position (1000, 1000) and <code>AlternateFlag=A661_TRUE<\/code> to see more clearly if this is pressed or not. We then generate a binary file <strong>UA_1.bin<\/strong>. <\/p>\n<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2025\/03\/scade-041-togglebutton-df.png\" style=\"max-height: 394px !important\" \/><br \/>\n    <em><\/em>\n<\/p>\n<p>Using this binary DF, we write few lines of Python that will look like the following:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span><span style=\"color: #999988;font-style: italic\"># 1. import needed modules<\/span>\r\n\r\n<span style=\"color: #999988;font-style: italic\"># 2. initiate ARINC 661 Standard, Test Framework, and logging mechanism<\/span>\r\n\r\n<span style=\"font-weight: bold\">try<\/span>:\r\n<span style=\"color: #999988;font-style: italic\"># 3. start the server, load the DF binary, and establish a connection between TAF and Server<\/span>\r\n\r\n<span style=\"color: #999988;font-style: italic\"># 4. check that no error has been raised by the Server<\/span>\r\n\r\n<span style=\"color: #999988;font-style: italic\"># 5. Test case usually goes here<\/span>\r\n\r\n<span style=\"font-weight: bold\">except<\/span> TAFCommandError <span style=\"font-weight: bold\">as<\/span> error: \r\n    <span style=\"color: #999988;font-style: italic\"># report error while communicating with the Server<\/span>\r\n<span style=\"font-weight: bold\">except<\/span> <span style=\"color: #990000;font-weight: bold\">AssertionError<\/span> <span style=\"font-weight: bold\">as<\/span> error:\r\n    <span style=\"color: #999988;font-style: italic\"># report error during checks in the test<\/span>\r\n<span style=\"font-weight: bold\">finally<\/span>:\r\n    <span style=\"color: #999988;font-style: italic\"># stop the Server<\/span>\r\n<\/pre>\n<\/div>\n<p>Note that we protect the main part of the test inside a try \/ except \/ finally block so that when an error or a failed check is detected, we stop instantly the test and the server.<\/p>\n<p>For the imports, we need the logging mechanism, the selected ARINC 661 standard, the widget we test (i.e. a ToggleButton), a Test Framework, and the class for errors reported by TAF:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span><span style=\"font-weight: bold\">import<\/span> <span style=\"color: #555555\">logging<\/span>\r\n\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661libgen_rev9_v1<\/span> <span style=\"font-weight: bold\">import<\/span> Standard_rev9_v1, ToggleButton\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661log<\/span> <span style=\"font-weight: bold\">import<\/span> log_console\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661test<\/span> <span style=\"font-weight: bold\">import<\/span> TAFCommandError, TestFramework\r\n<\/pre>\n<\/div>\n<p>We then initiate the ARINC 661 Standard, the Test Framework, and the logging mechanism (to display errors and warnings as well as information message starting by &#8220;CHECK&#8221;):<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span>Standard_rev9_v1()\r\nte <span style=\"font-weight: bold\">=<\/span> TestFramework()\r\n\r\nlogger <span style=\"font-weight: bold\">=<\/span> logging<span style=\"font-weight: bold\">.<\/span>getLogger(<span style=\"color: #bb8844\">&quot;taf&quot;<\/span>)\r\nlog_console(level<span style=\"font-weight: bold\">=<\/span>logging<span style=\"font-weight: bold\">.<\/span>INFO, infofilter<span style=\"font-weight: bold\">=<\/span>[<span style=\"color: #bb8844\">&quot;CHECK&quot;<\/span>])\r\n<\/pre>\n<\/div>\n<p>We will then enter the try \/ except \/ finally block to first start the server, load the DF, and initialize the connection through the Runtime protocol. <\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span>    A661_SERVER_PATH <span style=\"font-weight: bold\">=<\/span> <span style=\"color: #bb8844\">&quot;C:\/Program Files\/ANSYS Inc\/v251\/SCADE\/SCADE A661\/bin\/A661Server.exe&quot;<\/span>\r\n\r\n    te<span style=\"font-weight: bold\">.<\/span>start_server(A661_SERVER_PATH, df_list<span style=\"font-weight: bold\">=<\/span>[<span style=\"color: #bb8844\">&quot;UAPC_Model\/DF\/UA_1.bin&quot;<\/span>], bg_exec<span style=\"font-weight: bold\">=True<\/span>)\r\n    te<span style=\"font-weight: bold\">.<\/span>init_connection()\r\n<\/pre>\n<\/div>\n<p>Also, to map the notifications received by the server to the corresponding widgets, we need to register the content of the DF; to do so, we first use Python to create a DF corresponding to our model (a ToggleButton with ID set to 1) and we can then register this DF to the TAF:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span>    df <span style=\"font-weight: bold\">=<\/span> te<span style=\"font-weight: bold\">.<\/span>create_df([ToggleButton(<span style=\"color: #009999\">1<\/span>)])\r\n    te<span style=\"font-weight: bold\">.<\/span>register_df(df)\r\n<\/pre>\n<\/div>\n<p>Finally, we can check that no error has been raised by first moving one step forward (to let the server enter runtime mode), pulling the notifications, and checking that none of them is a &#8220;A661_NOTIFY_EXCEPTION&#8221;:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span>    te<span style=\"font-weight: bold\">.<\/span>step(<span style=\"color: #009999\">1<\/span>)\r\n    notifs <span style=\"font-weight: bold\">=<\/span> te<span style=\"font-weight: bold\">.<\/span>pull_block(df<span style=\"font-weight: bold\">=<\/span>df)\r\n    exceptions <span style=\"font-weight: bold\">=<\/span> [n <span style=\"font-weight: bold\">for<\/span> n <span style=\"font-weight: bold\">in<\/span> notifs <span style=\"font-weight: bold\">if<\/span> n[<span style=\"color: #bb8844\">&quot;kind&quot;<\/span>] <span style=\"font-weight: bold\">==<\/span> <span style=\"color: #bb8844\">&quot;A661_NOTIFY_EXCEPTION&quot;<\/span>]\r\n    <span style=\"font-weight: bold\">assert<\/span> exceptions <span style=\"font-weight: bold\">==<\/span> [], <span style=\"color: #bb8844\">f&quot;Exceptions raised: {<\/span>exceptions<span style=\"color: #bb8844\">}&quot;<\/span>\r\n<\/pre>\n<\/div>\n<p>If at least one exception has been found, the program will exit with the list of exceptions printed in the console (and the server will be also stopped); otherwise, we can print a small message to say that everything is fine:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span>    logger<span style=\"font-weight: bold\">.<\/span>info(<span style=\"color: #bb8844\">&quot;CHECK OK: ARINC 661 Test Automation Framework is correctly set up.&quot;<\/span>)\r\n<\/pre>\n<\/div>\n<p>The full code for checking that TAF is correctly setup and the Server can be correctly loaded and connected is the following:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span><span style=\"color: #bb8844\">&quot;&quot;&quot;Example of a check of configuration for A661 Test Automation Framework.&quot;&quot;&quot;<\/span>\r\n\r\n<span style=\"color: #999988;font-style: italic\"># 1. -- IMPORT THE REQUIRED MODULES --<\/span>\r\n<span style=\"font-weight: bold\">import<\/span> <span style=\"color: #555555\">logging<\/span>\r\n\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661libgen_rev9_v1<\/span> <span style=\"font-weight: bold\">import<\/span> Standard_rev9_v1, ToggleButton\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661log<\/span> <span style=\"font-weight: bold\">import<\/span> log_console\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661test<\/span> <span style=\"font-weight: bold\">import<\/span> TAFCommandError, TestFramework\r\n\r\n<span style=\"color: #999988;font-style: italic\"># 2. -- INITIALIZATION OF TEST AUTOMATION FRAMEWORK --<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># * Set up which ARINC 661 Standard to use and create a Test Framework<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># * Set up the logging for the test<\/span>\r\nStandard_rev9_v1()\r\nte <span style=\"font-weight: bold\">=<\/span> TestFramework()\r\n\r\nlogger <span style=\"font-weight: bold\">=<\/span> logging<span style=\"font-weight: bold\">.<\/span>getLogger(<span style=\"color: #bb8844\">&quot;taf&quot;<\/span>)\r\nlog_console(level<span style=\"font-weight: bold\">=<\/span>logging<span style=\"font-weight: bold\">.<\/span>INFO, infofilter<span style=\"font-weight: bold\">=<\/span>[<span style=\"color: #bb8844\">&quot;CHECK&quot;<\/span>])\r\n\r\n<span style=\"font-weight: bold\">try<\/span>:\r\n    <span style=\"color: #999988;font-style: italic\"># 3. -- START THE ARINC 661 SERVER (Initialization Phase) --<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * start the server with the DF as binary file<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * set the connection with server<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * register the DF (to decode the events sent by the server)<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># We use the ARINC 661 Server path from the SCADE installation directory<\/span>\r\n    A661_SERVER_PATH <span style=\"font-weight: bold\">=<\/span> <span style=\"color: #bb8844\">&quot;C:\/Program Files\/ANSYS Inc\/v251\/SCADE\/SCADE A661\/bin\/A661Server.exe&quot;<\/span>\r\n\r\n    te<span style=\"font-weight: bold\">.<\/span>start_server(A661_SERVER_PATH, df_list<span style=\"font-weight: bold\">=<\/span>[<span style=\"color: #bb8844\">&quot;UAPC_Model\/DF\/UA_1.bin&quot;<\/span>], bg_exec<span style=\"font-weight: bold\">=True<\/span>)\r\n    te<span style=\"font-weight: bold\">.<\/span>init_connection()\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># We need to create a DF object that contains the widgets to be tested<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># that will be used to map the events sent by the server to Widgets types.<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># ... we could also use `create_df_from_sgfx` function from `taf.a661libutil<\/span>\r\n    df <span style=\"font-weight: bold\">=<\/span> te<span style=\"font-weight: bold\">.<\/span>create_df([ToggleButton(<span style=\"color: #009999\">1<\/span>)])\r\n    te<span style=\"font-weight: bold\">.<\/span>register_df(df)\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># 4. -- CHECKING NO ERROR RAISED --<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>step(<span style=\"color: #009999\">1<\/span>)\r\n    notifs <span style=\"font-weight: bold\">=<\/span> te<span style=\"font-weight: bold\">.<\/span>pull_block(df<span style=\"font-weight: bold\">=<\/span>df)\r\n    exceptions <span style=\"font-weight: bold\">=<\/span> [n <span style=\"font-weight: bold\">for<\/span> n <span style=\"font-weight: bold\">in<\/span> notifs <span style=\"font-weight: bold\">if<\/span> n[<span style=\"color: #bb8844\">&quot;kind&quot;<\/span>] <span style=\"font-weight: bold\">==<\/span> <span style=\"color: #bb8844\">&quot;A661_NOTIFY_EXCEPTION&quot;<\/span>]\r\n    <span style=\"font-weight: bold\">assert<\/span> exceptions <span style=\"font-weight: bold\">==<\/span> [], <span style=\"color: #bb8844\">f&quot;Exceptions raised: {<\/span>exceptions<span style=\"color: #bb8844\">}&quot;<\/span>\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># 5. -- TEST CASE USUALLY GOES HERE --<\/span>\r\n    logger<span style=\"font-weight: bold\">.<\/span>info(<span style=\"color: #bb8844\">&quot;CHECK OK: ARINC 661 Test Automation Framework is correctly set up.&quot;<\/span>)\r\n\r\n<span style=\"font-weight: bold\">except<\/span> TAFCommandError <span style=\"font-weight: bold\">as<\/span> error:  <span style=\"color: #999988;font-style: italic\"># Error during communication with the server<\/span>\r\n    logger<span style=\"font-weight: bold\">.<\/span>error(\r\n        <span style=\"color: #bb8844\">f&quot;Error {<\/span>error<span style=\"font-weight: bold\">.<\/span>error<span style=\"color: #bb8844\">} raised for command {<\/span>error<span style=\"font-weight: bold\">.<\/span>command<span style=\"color: #bb8844\">}: {<\/span>error<span style=\"font-weight: bold\">.<\/span>description<span style=\"color: #bb8844\">}&quot;<\/span>\r\n    )\r\n<span style=\"font-weight: bold\">except<\/span> <span style=\"color: #990000;font-weight: bold\">AssertionError<\/span> <span style=\"font-weight: bold\">as<\/span> error:  <span style=\"color: #999988;font-style: italic\"># Error when performing checks during the test<\/span>\r\n    logger<span style=\"font-weight: bold\">.<\/span>error(error, exc_info<span style=\"font-weight: bold\">=True<\/span>)\r\n\r\n<span style=\"font-weight: bold\">finally<\/span>:\r\nte<span style=\"font-weight: bold\">.<\/span>stop_server()\r\n<\/pre>\n<\/div>\n<h4  id=\"EXAMPLE-OF-A-TEST-CASE-ON-AN-ARINC-661-WIDGET\">Example of a Test Case on an ARINC 661 Widget<\/h4>\n<p>Now that we know that the TAF and the Server have been correctly set up, let&#8217;s look at a small example of using the Test Automation Framework to verify that a button click is correctly handled by our ToggleButton (i.e. the server records an event).<\/p>\n<p>We will also take screenshots to record the graphical rendering.<\/p>\n<p>For our test, we will:<\/p>\n<ul>\n<li>Import <code>Path<\/code> from <code>pathlib<\/code> to specify the path of the screenshots<\/li>\n<li>Import <code>taf.a661testcheck<\/code> as <code>checks<\/code> to use utilities for checking notifications<\/li>\n<\/ul>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span><span style=\"font-weight: bold\">import<\/span> <span style=\"color: #555555\">logging<\/span>\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">pathlib<\/span> <span style=\"font-weight: bold\">import<\/span> Path\r\n\r\n<span style=\"font-weight: bold\">import<\/span> <span style=\"color: #555555\">taf.a661testcheck<\/span> <span style=\"font-weight: bold\">as<\/span> <span style=\"color: #555555\">checks<\/span>\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661libgen_rev9_v1<\/span> <span style=\"font-weight: bold\">import<\/span> Standard_rev9_v1, ToggleButton\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661log<\/span> <span style=\"font-weight: bold\">import<\/span> log_console\r\n<\/pre>\n<\/div>\n<p>We will also modify part #5 (&#8220;TEST CASE USUALLY GOES HERE&#8221;) as follows:<\/p>\n<ul>\n<li>Capture an initial screenshot by using function <code>te.get_screenshot<\/code> with a specification of the width, height, and destination of the screenshot (we need to use a <code>Path<\/code> object)<\/li>\n<li>Click on the button and confirm that the A661 Server sends an event related to the button being pressed: to do so, we need to:\n<ul>\n<li>send a button pressed in a location above the button with <code>te.push_pointer<\/code>, <\/li>\n<li>move the server one cycle forward with <code>te.step<\/code>, <\/li>\n<li>release the button at the same location with <code>te.push_pointer<\/code>,<\/li>\n<li>let the server run until we receive a notification for a maximum of 10 cycles with <code>te.step<\/code>,<\/li>\n<li>check received notifications with <code>te.pull_block<\/code>,<\/li>\n<li>finally, check that we have a <code>A661_EVT_STATE_CHANGE<\/code> notification with value <code>A661_SELECTED<\/code> for widget #1, using utility function <code>checks.check_widget_event<\/code> <\/li>\n<\/ul>\n<\/li>\n<li>Capture another screenshot for comparison with <code>te.get_screenshot<\/code><\/li>\n<\/ul>\n<p>The implementation for this part is as follows:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span>    <span style=\"color: #999988;font-style: italic\"># 5.1 -- SCREENSHOT BEFORE CLICK --<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * take a screenshot before the click<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>get_screenshot(\r\n        width<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">5000<\/span>,\r\n        height<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">3000<\/span>,\r\n        user_unit<span style=\"font-weight: bold\">=True<\/span>,\r\n        resulting_file_path<span style=\"font-weight: bold\">=<\/span>Path(<span style=\"color: #bb8844\">&quot;screenshot_before_click.png&quot;<\/span>),\r\n    )\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># 5.2 -- CLICK ON THE BUTTON (Runtime Phase) --<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * press the a click on the button<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * release the click on the button<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * wait for 10 steps or until the server send a notification<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * check that the button has sent a notification<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>push_pointer(<span style=\"color: #009999\">1100<\/span>, <span style=\"color: #009999\">1100<\/span>, <span style=\"color: #bb8844\">&quot;LEFT&quot;<\/span>, <span style=\"color: #bb8844\">&quot;PRESSED&quot;<\/span>, user_unit<span style=\"font-weight: bold\">=True<\/span>)\r\n    te<span style=\"font-weight: bold\">.<\/span>step(<span style=\"color: #009999\">1<\/span>)\r\n    te<span style=\"font-weight: bold\">.<\/span>push_pointer(<span style=\"font-weight: bold\">-<\/span><span style=\"color: #009999\">1<\/span>, <span style=\"font-weight: bold\">-<\/span><span style=\"color: #009999\">1<\/span>, <span style=\"color: #bb8844\">&quot;LEFT&quot;<\/span>, <span style=\"color: #bb8844\">&quot;RELEASED&quot;<\/span>)  <span style=\"color: #999988;font-style: italic\"># -1,-1 to keep same pointer position<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>step(<span style=\"color: #009999\">10<\/span>, <span style=\"font-weight: bold\">True<\/span>)  <span style=\"color: #999988;font-style: italic\"># wait for 10 steps or until the server send a notification<\/span>\r\n    evt <span style=\"font-weight: bold\">=<\/span> te<span style=\"font-weight: bold\">.<\/span>pull_block()\r\n    check <span style=\"font-weight: bold\">=<\/span> checks<span style=\"font-weight: bold\">.<\/span>check_widget_event(\r\n        notifications<span style=\"font-weight: bold\">=<\/span>evt,\r\n        event<span style=\"font-weight: bold\">=<\/span><span style=\"color: #bb8844\">&quot;A661_EVT_STATE_CHANGE&quot;<\/span>,\r\n        widget_id<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">1<\/span>,\r\n        expected_values<span style=\"font-weight: bold\">=<\/span><span style=\"color: #bb8844\">&quot;A661_SELECTED&quot;<\/span>,\r\n    )\r\n    <span style=\"font-weight: bold\">assert<\/span> check, <span style=\"color: #bb8844\">&quot;Test Failed: Button did not send A661_EVT_STATE_CHANGE&quot;<\/span>\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># 5.3 -- SCREENSHOT AFTER CLICK --<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>get_screenshot(\r\n        width<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">5000<\/span>,\r\n        height<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">3000<\/span>,\r\n        user_unit<span style=\"font-weight: bold\">=True<\/span>,\r\n        resulting_file_path<span style=\"font-weight: bold\">=<\/span>Path(<span style=\"color: #bb8844\">&quot;screenshot_after_click.png&quot;<\/span>),\r\n    )\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># The test is successful<\/span>\r\nlogger<span style=\"font-weight: bold\">.<\/span>info(<span style=\"color: #bb8844\">&quot;CHECK OK: Test Case is PASSED&quot;<\/span>)\r\n<\/pre>\n<\/div>\n<p>The full code for our simple Test Case is the following:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow:auto;width:auto;background:none;border:none;padding:.2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\"><span><\/span><span style=\"color: #bb8844\">&quot;&quot;&quot;Example of a test for a button widget in an ARINC 661 application.&quot;&quot;&quot;<\/span>\r\n\r\n<span style=\"color: #999988;font-style: italic\"># 1. -- IMPORT THE REQUIRED MODULES --<\/span>\r\n<span style=\"font-weight: bold\">import<\/span> <span style=\"color: #555555\">logging<\/span>\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">pathlib<\/span> <span style=\"font-weight: bold\">import<\/span> Path\r\n\r\n<span style=\"font-weight: bold\">import<\/span> <span style=\"color: #555555\">taf.a661testcheck<\/span> <span style=\"font-weight: bold\">as<\/span> <span style=\"color: #555555\">checks<\/span>\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661libgen_rev9_v1<\/span> <span style=\"font-weight: bold\">import<\/span> Standard_rev9_v1, ToggleButton\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661log<\/span> <span style=\"font-weight: bold\">import<\/span> log_console\r\n<span style=\"font-weight: bold\">from<\/span> <span style=\"color: #555555\">taf.a661test<\/span> <span style=\"font-weight: bold\">import<\/span> TAFCommandError, TestFramework\r\n\r\n<span style=\"color: #999988;font-style: italic\"># 2. -- INITIALIZATION OF TEST AUTOMATION FRAMEWORK --<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># * Set up which ARINC 661 Standard to use and create a Test Framework<\/span>\r\n<span style=\"color: #999988;font-style: italic\"># * Set up the logging for the test<\/span>\r\nStandard_rev9_v1()\r\nte <span style=\"font-weight: bold\">=<\/span> TestFramework()\r\n\r\nlogger <span style=\"font-weight: bold\">=<\/span> logging<span style=\"font-weight: bold\">.<\/span>getLogger(<span style=\"color: #bb8844\">&quot;taf&quot;<\/span>)\r\nlog_console(level<span style=\"font-weight: bold\">=<\/span>logging<span style=\"font-weight: bold\">.<\/span>INFO, infofilter<span style=\"font-weight: bold\">=<\/span>[<span style=\"color: #bb8844\">&quot;CHECK&quot;<\/span>])\r\n\r\n<span style=\"font-weight: bold\">try<\/span>:\r\n    <span style=\"color: #999988;font-style: italic\"># 3. -- START THE ARINC 661 SERVER (Initialization Phase) --<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * start the server with the DF as binary file<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * set the connection with server<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * register the DF (to decode the events sent by the server)<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># We use the ARINC 661 Server path from the SCADE installation directory<\/span>\r\n    A661_SERVER_PATH <span style=\"font-weight: bold\">=<\/span> <span style=\"color: #bb8844\">&quot;C:\/Program Files\/ANSYS Inc\/v251\/SCADE\/SCADE A661\/bin\/A661Server.exe&quot;<\/span>\r\n\r\n    te<span style=\"font-weight: bold\">.<\/span>start_server(A661_SERVER_PATH, df_list<span style=\"font-weight: bold\">=<\/span>[<span style=\"color: #bb8844\">&quot;UAPC_Model\/DF\/UA_1.bin&quot;<\/span>], bg_exec<span style=\"font-weight: bold\">=True<\/span>)\r\n    te<span style=\"font-weight: bold\">.<\/span>init_connection()\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># We need to create a DF object that contains the widgets to be tested<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># that will be used to map the events sent by the server to Widgets types.<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># ... we could also use `create_df_from_sgfx` function from `taf.a661libutil<\/span>\r\n    df <span style=\"font-weight: bold\">=<\/span> te<span style=\"font-weight: bold\">.<\/span>create_df([ToggleButton(<span style=\"color: #009999\">1<\/span>)])\r\n    te<span style=\"font-weight: bold\">.<\/span>register_df(df)\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># 4. -- CHECKING NO ERROR RAISED --<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>step(<span style=\"color: #009999\">1<\/span>)\r\n    notifs <span style=\"font-weight: bold\">=<\/span> te<span style=\"font-weight: bold\">.<\/span>pull_block(df<span style=\"font-weight: bold\">=<\/span>df)\r\n    exceptions <span style=\"font-weight: bold\">=<\/span> [n <span style=\"font-weight: bold\">for<\/span> n <span style=\"font-weight: bold\">in<\/span> notifs <span style=\"font-weight: bold\">if<\/span> n[<span style=\"color: #bb8844\">&quot;kind&quot;<\/span>] <span style=\"font-weight: bold\">==<\/span> <span style=\"color: #bb8844\">&quot;A661_NOTIFY_EXCEPTION&quot;<\/span>]\r\n    <span style=\"font-weight: bold\">assert<\/span> exceptions <span style=\"font-weight: bold\">==<\/span> [], <span style=\"color: #bb8844\">f&quot;Exceptions raised: {<\/span>exceptions<span style=\"color: #bb8844\">}&quot;<\/span>\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># 5.1 -- SCREENSHOT BEFORE CLICK --<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * take a screenshot before the click<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>get_screenshot(\r\n        width<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">5000<\/span>,\r\n        height<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">3000<\/span>,\r\n        user_unit<span style=\"font-weight: bold\">=True<\/span>,\r\n        resulting_file_path<span style=\"font-weight: bold\">=<\/span>Path(<span style=\"color: #bb8844\">&quot;screenshot_before_click.png&quot;<\/span>),\r\n    )\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># 5.2 -- CLICK ON THE BUTTON (Runtime Phase) --<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * press the a click on the button<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * release the click on the button<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * wait for 10 steps or until the server send a notification<\/span>\r\n    <span style=\"color: #999988;font-style: italic\"># * check that the button has sent a notification<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>push_pointer(<span style=\"color: #009999\">1100<\/span>, <span style=\"color: #009999\">1100<\/span>, <span style=\"color: #bb8844\">&quot;LEFT&quot;<\/span>, <span style=\"color: #bb8844\">&quot;PRESSED&quot;<\/span>, user_unit<span style=\"font-weight: bold\">=True<\/span>)\r\n    te<span style=\"font-weight: bold\">.<\/span>step(<span style=\"color: #009999\">1<\/span>)\r\n    te<span style=\"font-weight: bold\">.<\/span>push_pointer(<span style=\"font-weight: bold\">-<\/span><span style=\"color: #009999\">1<\/span>, <span style=\"font-weight: bold\">-<\/span><span style=\"color: #009999\">1<\/span>, <span style=\"color: #bb8844\">&quot;LEFT&quot;<\/span>, <span style=\"color: #bb8844\">&quot;RELEASED&quot;<\/span>)  <span style=\"color: #999988;font-style: italic\"># -1,-1 to keep same pointer position<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>step(<span style=\"color: #009999\">10<\/span>, <span style=\"font-weight: bold\">True<\/span>)  <span style=\"color: #999988;font-style: italic\"># wait for 10 steps or until the server send a notification<\/span>\r\n    evt <span style=\"font-weight: bold\">=<\/span> te<span style=\"font-weight: bold\">.<\/span>pull_block()\r\n    check <span style=\"font-weight: bold\">=<\/span> checks<span style=\"font-weight: bold\">.<\/span>check_widget_event(\r\n        notifications<span style=\"font-weight: bold\">=<\/span>evt,\r\n        event<span style=\"font-weight: bold\">=<\/span><span style=\"color: #bb8844\">&quot;A661_EVT_STATE_CHANGE&quot;<\/span>,\r\n        widget_id<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">1<\/span>,\r\n        expected_values<span style=\"font-weight: bold\">=<\/span><span style=\"color: #bb8844\">&quot;A661_SELECTED&quot;<\/span>,\r\n    )\r\n    <span style=\"font-weight: bold\">assert<\/span> check, <span style=\"color: #bb8844\">&quot;Test Failed: Button did not send A661_EVT_STATE_CHANGE&quot;<\/span>\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># 5.3 -- SCREENSHOT AFTER CLICK --<\/span>\r\n    te<span style=\"font-weight: bold\">.<\/span>get_screenshot(\r\n        width<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">5000<\/span>,\r\n        height<span style=\"font-weight: bold\">=<\/span><span style=\"color: #009999\">3000<\/span>,\r\n        user_unit<span style=\"font-weight: bold\">=True<\/span>,\r\n        resulting_file_path<span style=\"font-weight: bold\">=<\/span>Path(<span style=\"color: #bb8844\">&quot;screenshot_after_click.png&quot;<\/span>),\r\n    )\r\n\r\n    <span style=\"color: #999988;font-style: italic\"># The test is successful<\/span>\r\n    logger<span style=\"font-weight: bold\">.<\/span>info(<span style=\"color: #bb8844\">&quot;CHECK OK: Test Case is PASSED&quot;<\/span>)\r\n\r\n<span style=\"font-weight: bold\">except<\/span> TAFCommandError <span style=\"font-weight: bold\">as<\/span> error:  <span style=\"color: #999988;font-style: italic\"># Error during communication with the server<\/span>\r\n    logger<span style=\"font-weight: bold\">.<\/span>error(\r\n        <span style=\"color: #bb8844\">f&quot;Error {<\/span>error<span style=\"font-weight: bold\">.<\/span>error<span style=\"color: #bb8844\">} raised for command {<\/span>error<span style=\"font-weight: bold\">.<\/span>command<span style=\"color: #bb8844\">}: {<\/span>error<span style=\"font-weight: bold\">.<\/span>description<span style=\"color: #bb8844\">}&quot;<\/span>\r\n    )\r\n<span style=\"font-weight: bold\">except<\/span> <span style=\"color: #990000;font-weight: bold\">AssertionError<\/span> <span style=\"font-weight: bold\">as<\/span> error:  <span style=\"color: #999988;font-style: italic\"># Error when performing checks during the test<\/span>\r\n    logger<span style=\"font-weight: bold\">.<\/span>error(error, exc_info<span style=\"font-weight: bold\">=True<\/span>)\r\n\r\n<span style=\"font-weight: bold\">finally<\/span>:\r\n    te<span style=\"font-weight: bold\">.<\/span>stop_server()\r\n<\/pre>\n<\/div>\n<p>Now let&#8217;s have a look at the two screenshots we made respectively before and after the click:<\/p>\n<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2025\/03\/scade-041-screenshot-before.png\" style=\"max-height: 150px !important\" \/><br \/>\n    <em><\/em>\n<\/p>\n<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2025\/03\/scade-041-screenshot-after.png\" style=\"max-height: 150px !important\" \/><br \/>\n    <em><\/em>\n<\/p>\n<p>From this code and its execution, we can notice the key elements of the TAF:<\/p>\n<ul>\n<li><strong>ARINC 661 Server Control<\/strong>: The ARINC 661 Server is exclusively controlled by TAF, disabling user interactivity and executing commands step-by-step.<\/li>\n<li><strong>Command Execution<\/strong>: All server commands are executed by the <code>TestFramework<\/code> class.<\/li>\n<li><strong>Screenshot Mechanism<\/strong>: The TAF provides a convenient way to perform screenshots of the server for automatically testing the graphical rendering of the CDS<\/li>\n<\/ul>\n<h4  id=\"EXPLORE-FURTHER\">Explore Further<\/h4>\n<p>This blog post about the ARINC 661 Test Automation Framework provides an overview of the problems it helps solve, how to configure it, and a brief demonstration of its usage. More blog posts will follow to expand on how to create Test Cases and perform specific checks.<\/p>\n<p>Meanwhile, you can also check the &#8220;SCADE Test Automation Framework Guidelines&#8221; in the Ansys <a href=\"https:\/\/ansyshelp.ansys.com\/public\/account\/secured?returnurl=\/Views\/Secured\/prod_page.html?pn=SCADE&amp;pid=SCADE&amp;lang=en\">online documentation<\/a> for SCADE Products.<\/p>\n<p>If you&#8217;d like to learn more about Ansys SCADE Solutions for ARINC 661 Compliant Systems, we&#8217;d love to hear from you! Get in touch on our <a href=\"https:\/\/www.ansys.com\/products\/embedded-software\/solutions-for-arinc-661\">product page<\/a>.<\/p>\n<h4  id=\"ABOUT-THE-AUTHOR\">About the author<\/h4>\n<table style=\"border: none !important\">\n<tr>\n<td style=\"border: none !important\">\n<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2025\/03\/scade-041-author.png\" style=\"max-height: 150px !important\" \/>\n        <\/td>\n<td style=\"border: none !important\">\n<p>Jean-Fran\u00e7ois Thuong (<a href=\"https:\/\/www.linkedin.com\/in\/jfthuong\/\">LinkedIn<\/a>) is a Software Validation Manager at Ansys. He excels in software development, testing, and team management. His areas of expertise include the SCADE product, with a particular focus on Scade One. He is fluent in French, English and Chinese.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n","protected":false},"template":"","class_list":["post-196430","topic","type-topic","status-publish","hentry","topic-tag-arinc-661","topic-tag-cds","topic-tag-df","topic-tag-scade","topic-tag-standard","topic-tag-taf","topic-tag-test","topic-tag-ua"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_edit_lock":["1773841503:1769"],"_edit_last":["1769"],"_aioseo_title":[null],"_aioseo_description":[null],"_aioseo_keywords":["a:0:{}"],"_aioseo_og_title":[""],"_aioseo_og_description":[""],"_aioseo_og_article_section":[""],"_aioseo_og_article_tags":["a:0:{}"],"_aioseo_twitter_title":[""],"_aioseo_twitter_description":[""],"filter_by_optics_product":["Lumerical"],"_filter_by_optics_product":["field_64fb192ba3121"],"application_name":[""],"_application_name":["field_64a80903c8e15"],"family":[""],"_family":["field_64a809229a857"],"siebel_km_number":[""],"_siebel_km_number":["field_63ecbffce60db"],"salesforce_km_number":[""],"_salesforce_km_number":["field_63ecc018e60dc"],"km_published_date":[""],"_km_published_date":["field_64c77704499dd"],"product_version":[""],"_product_version":["field_64c776cb4fd2e"],"_bbp_forum_id":["27825"],"_bbp_topic_id":["198177"],"_bbp_author_ip":["194.98.52.82"],"_bbp_last_reply_id":["0"],"_bbp_last_active_id":["196431"],"_bbp_last_active_time":["2025-03-21 13:49:42"],"_bbp_reply_count":["0"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["0"],"_btv_view_count":["1710"],"_bbp_likes_count":["4"]},"test":"solution"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/196430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":13,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/196430\/revisions"}],"predecessor-version":[{"id":198177,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/196430\/revisions\/198177"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=196430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}