MATLAB App Testing - Confirmation dialog boxes
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Michaela Konstantinou
il 9 Set 2021
Risposto: Houman Rastegarfar
il 10 Lug 2025
How can I handle confirmation dialog boxes when testing an app with gestures?
Ideally, I would like to choose 'OK' or 'Cancel' based on some variables' values.
I know there is not a straight-forward way to do it but is there any option so that they get disabled or something??
2 Commenti
Thomas Fournier
il 10 Set 2021
you can create them, and chosse if they are visible or not, editable or note.
app.Button1.Visible='off'
app.Button2.Editable='off'
Risposta accettata
Andy Campbell
il 13 Set 2021
Until this functionality is included in the App Testing Framework, if you can adjust the architecture of the source code you can leverage a similar strategy as that outlined here and use a mock for the confirmation dialog.
Does that help you get going?
Thanks,
Andy
2 Commenti
Più risposte (3)
Sean de Wolski
il 10 Set 2021
You can dismiss and alert but not a confirmation dialog yet. Capability for alerts added in 21a.
https://www.mathworks.com/help/releases/R2021a/matlab/ref/matlab.uitest.testcase.dismissalertdialog.html
3 Commenti
Sean de Wolski
il 13 Set 2021
I don't know of any hacky way. I added your vote to the enhancement request for this.
Houman Rastegarfar
il 10 Lug 2025
Starting in R2024b, you can use the chooseDialog and dismissDialog methods to programmatically interact with confirmation dialog boxes. For an example, see Select Option in Nonblocking Dialog Box.
0 Commenti
Cris LaPierre
il 10 Set 2021
It sounds like you want to programmatically close a confirmation diaglog box. If so, see this answer.
0 Commenti
Vedere anche
Categorie
Scopri di più su Test Apps in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!