<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to unit test ALV based GUI components in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948041#M1966193</link>
    <description>&lt;P&gt;Hi Community,&lt;/P&gt;
  &lt;P&gt;i want to add unit tests to my GUI components (most ALV based) but i do not have any clue how to.&lt;/P&gt;
  &lt;P&gt;Basic structure of all classes which are responsible for (ALV) GUI handling&lt;/P&gt;
  &lt;P&gt;* generate ALV (public) -&amp;gt; Build ALV and display&lt;BR /&gt;* refresh ALV (protected / event) -&amp;gt; refresh ALV if surrounding GUI component notifies via event&lt;BR /&gt;* handle_click (private) -&amp;gt; handle component specific events like button clicks etc.&lt;/P&gt;
  &lt;P&gt;Are there any suggestion to unit test such objects. Code to cover is &lt;STRONG&gt;mostly&lt;/STRONG&gt; within private methods for component specific events.&lt;/P&gt;
  &lt;P&gt;Thx Sebastian&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2019 22:04:54 GMT</pubDate>
    <dc:creator>former_member512562</dc:creator>
    <dc:date>2019-07-11T22:04:54Z</dc:date>
    <item>
      <title>How to unit test ALV based GUI components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948041#M1966193</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;
  &lt;P&gt;i want to add unit tests to my GUI components (most ALV based) but i do not have any clue how to.&lt;/P&gt;
  &lt;P&gt;Basic structure of all classes which are responsible for (ALV) GUI handling&lt;/P&gt;
  &lt;P&gt;* generate ALV (public) -&amp;gt; Build ALV and display&lt;BR /&gt;* refresh ALV (protected / event) -&amp;gt; refresh ALV if surrounding GUI component notifies via event&lt;BR /&gt;* handle_click (private) -&amp;gt; handle component specific events like button clicks etc.&lt;/P&gt;
  &lt;P&gt;Are there any suggestion to unit test such objects. Code to cover is &lt;STRONG&gt;mostly&lt;/STRONG&gt; within private methods for component specific events.&lt;/P&gt;
  &lt;P&gt;Thx Sebastian&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 22:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948041#M1966193</guid>
      <dc:creator>former_member512562</dc:creator>
      <dc:date>2019-07-11T22:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to unit test ALV based GUI components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948042#M1966194</link>
      <description>&lt;P&gt;Hi Sebastian,&lt;/P&gt;&lt;P&gt;for UI testing i would go for eCATT.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 07:14:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948042#M1966194</guid>
      <dc:creator>RobertVit</dc:creator>
      <dc:date>2019-07-12T07:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to unit test ALV based GUI components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948043#M1966195</link>
      <description>&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;i do not want to test the UI. Goal is to have the code behind covered by unit tests.&lt;/P&gt;&lt;P&gt;Are there any other approaches?&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 08:22:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948043#M1966195</guid>
      <dc:creator>former_member512562</dc:creator>
      <dc:date>2019-07-12T08:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to unit test ALV based GUI components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948044#M1966196</link>
      <description>&lt;P&gt;In my opinion you only have to test the content of the table and the behaviour of the events.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;test the methods, in which the content is created&lt;/LI&gt;&lt;LI&gt;extract the event methods (click) into separate methods and test only them&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 16 Jul 2019 13:12:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948044#M1966196</guid>
      <dc:creator>UweFetzer_se38</dc:creator>
      <dc:date>2019-07-16T13:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to unit test ALV based GUI components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948045#M1966197</link>
      <description>&lt;P&gt;Hi Uwe,&lt;/P&gt;&lt;P&gt;that's clear but how to testdouble a necessary gui container which is required for code under test.&lt;BR /&gt;I didn't find a way to mock any object based on CL_GUI_CONTAINER (or inherited)&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 08:45:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948045#M1966197</guid>
      <dc:creator>former_member512562</dc:creator>
      <dc:date>2019-07-17T08:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to unit test ALV based GUI components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948046#M1966198</link>
      <description>&lt;P&gt;&lt;EM&gt;I didn't find a way to mock any object based on CL_GUI_CONTAINER (or inherited)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Been there &amp;amp; tried that without any success. But then again, why do you want to mock the control framework? &lt;/P&gt;&lt;P&gt;I agree with &lt;SPAN class="mention-scrubbed"&gt;se38&lt;/SPAN&gt; on this one, i would test the contents of the output table &amp;amp; the event handling logic (if any). &lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 09:05:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948046#M1966198</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2019-07-17T09:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to unit test ALV based GUI components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948047#M1966199</link>
      <description>&lt;P&gt;To clarify: maybe your design does not allow unit tests. All the logic should be placed in its own class which you can test. The UI just calls these tested methods.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 13:31:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948047#M1966199</guid>
      <dc:creator>UweFetzer_se38</dc:creator>
      <dc:date>2019-07-17T13:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to unit test ALV based GUI components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948048#M1966200</link>
      <description>&lt;P&gt;Create an interface with all the methods that you'll be using in the CL_GUI class. Implement it with pass through calls to the actual CL_GUI class. Create a local test double implementing the interface.&lt;/P&gt;&lt;P&gt;Inject a reference to the local test double.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 14:47:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-unit-test-alv-based-gui-components/m-p/11948048#M1966200</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-07-17T14:47:42Z</dc:date>
    </item>
  </channel>
</rss>

