File dialogs in QML application
-
I have started using Squish relatively recently. It's hard work to get something working robustly but I think I am getting there with the main part of my QML application. One aspect that is causing difficulty is the file dialogs that we use in a few places.
On Windows, I am using
FileDialog
fromQtQuick.Dialogs 1.3
, which resolves to a system file dialog. I can't get reliable identifiers for buttons and so on (they seem to shift from run to run) and picking files is very fragile. I can't examine the UI as programmatically as I can in the pure QML code and have to resort to coordinate-based picking of files. This is fragile and makes it harder to factor out common script fragments as I have done for other aspects of our GUI. For some reason I don't recall now I couldn't get the dialog to work by typing in the file name in the text box. It has basically been one problem after another for what is really a small part of our workflow.I am wondering if anyone has any tips for dealing with file dialogs under Squish. My current thinking is that there isn't actually a lot of point in testing what is essentially a system dialog that I have no control over, so I am considering having a "running under Squish" mode for my application that will just pop up basic text input dialogs, written in pure QML, in place of any file dialogs. Does this sound like a reasonable approach?
-
As workaround to overcome native file dialog, please refer to the following Knowledge Base article.
https://kb.froglogic.com/squish/qt/howto/automating-native-file-dialogs/