Problem with OpenFileDialog handling

4 posts, 0 answers
  1. Oleksii
    Oleksii avatar
    3 posts
    Member since:
    Jan 2016

    Posted 10 Apr Link to this post

    I have next code to handle OpenFileDialog in WPF app tests:

    var dialog = OpenFileDialog.CreateOpenFileDialog(Manager.ActiveApplication, DialogButton.OPEN, pathToImportFile, "Open");
    Manager.DialogMonitor.AddDialog(dialog);
    Manager.DialogMonitor.Start();
    importStep1.Find.ByType("RadButton").User.Click();
    dialog.WaitUntilHandled(10000);

     

    But sometimes my test doesn't work correctly. The dialog box remains open (with correct title - "Open"), but I have next erroe:

    Message: System.TimeoutException : Timed out waiting '10000' msec. for any dialog to be handled '1'

     

    This happens in half of the cases when the same test is run, without any changes.

  2. Ivaylo
    Admin
    Ivaylo avatar
    774 posts

    Posted 13 Apr Link to this post

    Hello Oleksiy,

    Usually such sporadic behavior is related to a timing issue. Did you try increasing the timeout of WaitUntilHandled to 15000 or 20000?

    Please try increasing the timeout and if the problem reoccur let us know.

    Regards,
    Ivaylo
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  3. Oleksii
    Oleksii avatar
    3 posts
    Member since:
    Jan 2016

    Posted 13 Apr in reply to Ivaylo Link to this post

    Timeout increasing doesn't help. Problem that dialog is opened in few seconds, but dialog monitor can't detect it.
  4. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    902 posts

    Posted 18 Apr Link to this post

    Hi Oleksii,

    Thank you for getting back to us. 

    Please let me know if there is any chance the active user session is lost in the cases when the dialog is not recognized? 

    Since the issue is intermittent it is very hard to find out what might be causing it. Therefore it will be very helpful if you are able to find out anything specific that appears in the faulty executions. 

    Thank you in advance for your cooperation and understanding! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top