This is a migrated thread and some comments may be shown as answers.

OpenFileDialog missing class

1 Answer 57 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Danielle
Top achievements
Rank 1
Danielle asked on 25 Nov 2014, 09:44 PM
Hello,

I write tests in Test Studio mostly using the coded steps, but I need to handle Open/Save dialogs in my WPF Application.  I was trying to use Telerik's build in dialog test step "Handle 'OpenFile' dialog" and this appeared to be working, but after typing in the file name and clicking Open, the application seemed to freeze.  I manually aborted the test and decided to try writing this in code instead.  I'd prefer to do this in code so I can define a variable for the filepath.

I noticed that the ArtOfTest.WebAii.Win32.Dialogs namespace does NOT have an OpenFileDialog class listed as an option!  I am running the latest Test Studio, 2014.3.903.0.  I noticed many other Dialog classes seem available such as GenericDialog and FileUploadDialog, but the OpenFileDialog and SaveFileDialog classes are missing.  Any thoughts or suggestions?

Thanks,
Danielle

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 25 Nov 2014, 10:05 PM
Hello Danielle,

What you really want is the OpenFileDialog and the SaveAsDialog classes. Both of these are contained in ArtOfTest.WebAii.dll in the namespace ArtOfTest.WebAii.Win32.Dialogs.

OpenFileDialog openDialog = OpenFileDialog.CreateOpenFileDialog(ActiveApplication, DialogButton.OPEN, "file path here");
 
SaveAsDialog saveDialog = SaveAsDialog.CreateSaveAsDialog(ActiveApplication, DialogButton.SAVE, "file path here");

Don't forget your using statement:

using ArtOfTest.WebAii.Win32.Dialogs;


Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Danielle
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or