OpenFileDialog missing class

2 posts, 0 answers
  1. Danielle
    Danielle avatar
    2 posts
    Member since:
    Jun 2014

    Posted 25 Nov 2014 Link to this post


    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?

  2. Cody
    Cody avatar
    3354 posts

    Posted 25 Nov 2014 Link to this post

    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;

    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top