I am trying to create a app Test Class with app test framework.
I wrote below code,
classdef TestModelVerificationApp < matlab.uitest.TestCase
methods (TestMethodSetup)
function launchApp(testCase)
testCase.App = ModelVerificationApp;
testCase.addTeardown(@delete,testCase.App);
function test_bttn_select(testCase)
testCase.press(testCase.App.Button_Run)
testCase.verifyEqual(testCase.App.ListBox_SelectedModels.Items,'test item')
function unimplementedTest(testCase)
testCase.verifyFail("Unimplemented test");
for test below app. Below is a beginning part of the app, 'ModelVerificationApp'
classdef ModelVerificationApp < matlab.apps.AppBase
properties (Access = public)
ModelAdvisorAppUIFigure matlab.ui.Figure
ModelAdvisorPanel matlab.ui.container.Panel
Button_Run matlab.ui.control.Button
And, when I try to test this, I got below error message.
================================================================================
Error occurred in ModelVerificationApp/test_bttn_select and it did not run to completion.
'MATLAB:class:InvalidHandle'
Invalid or deleted object.
Error in TestModelVerificationApp/test_bttn_select (line 24)
testCase.press(testCase.App.Button_Run)
================================================================================
Anyone can tell me why?
Thanks.