Select file for uigetfile function during Test

조회 수: 4 (최근 30일)
Ugaitz
Ugaitz 2023년 11월 14일
답변: atharva 2023년 11월 14일
I have an application that calls uigetfile to read an excel file. The application is created with App Designer.
I want to run tests in this application. How can I select the file programmatically? If possible without using mock.
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2023년 11월 14일
"How can I select the file programmatically?"
What exactly does programmatically mean in this context?

댓글을 달려면 로그인하십시오.

답변 (1개)

atharva
atharva 2023년 11월 14일
Hey Ugaitz,
I understand that you want to programmatically select a file for running tests.
To achieve this, you can create a method in your App Designer class that sets the file path directly, and then use this method during testing.
During testing, you can use this method to set the file path before running your tests.
This approach allows you to set the file path without using mocks. However, keep in mind that it modifies the state of your App Designer object for testing purposes, and you need to ensure that your tests clean up any changes made during the testing process.
I hope this helps!

카테고리

Help CenterFile Exchange에서 Testing Frameworks에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by