WPF test do not Handle Save Dialog

6 posts, 0 answers
  1. Ludovic
    Ludovic avatar
    3 posts
    Member since:
    Jun 2017

    Posted 30 Jun Link to this post

    Hello

    I'm creating some test and i have to test the "Save as/Save" feature of my program, a simple text Editor for some training with TestStudio.

    I can use successfully OpenFile Dialog to open a File or Save an existing file with test Studio but when i'm not using it i can save and use the save Dialogin my program.

    But when i'm recording, the Save as Dialog create a "Handle generic dialog" step and when i'm executing the test,nothing happens, i'ts not creating a new file as expected.

    And when i changed this step by a "Save Dialog" ,and i try to use it like an "OpenFile" dialog and it doesn't worked. It's like the test is unable to access the Dialog window.

    This is the log

    : Overall Result: Fail
    ------------------------------------------------------------
    '30/06/2017 10:34:23' - Executing test: 'TestWord', path: 'TestWord.tstest.'
    '30/06/2017 10:34:23' - Using .Net Runtime version: '4.0.30319.42000' for test execution. Build version is '2017.2.530.0'.
    '30/06/2017 10:34:23' - Starting execution....
    ------------------------------------------------------------
    ------------------------------------------------------------
    '30/06/2017 10:34:29' - Using 'C:\Users\Everdyn\Documents\Stage Ludovic\WPF\EntrainementOuverture\EntrainementOuverture\bin\Debug\EntrainementOuverture.exe' application.
    '30/06/2017 10:34:31' - 'Pass' : 1. LeftClick on Item0Textboxview
    '30/06/2017 10:34:36' - 'Pass' : 2. Type 'Test d'écriture et de sauvegarde' into TxtEditorTextbox
    '30/06/2017 10:34:37' - 'Pass' : 3. Desktop command: LeftClick on Item2Textblock
    '30/06/2017 10:34:38' - 'Pass' : 4. Desktop command: LeftClick on Item4Textblock
    '30/06/2017 10:34:38' - LOG: Unexpected dialog encountered. Taking no action.
    '30/06/2017 10:34:48' - 'Fail' : 5. Handle 'SaveFile' dialog.
    ------------------------------------------------------------
    Failure Information: 
    ~~~~~~~~~~~~~~~
    Timed out waiting '10000' msec. for any dialog to be handled '1'
    InnerException:
    System.TimeoutException: Timed out waiting '10000' msec. for any dialog to be handled '1'
       à ArtOfTest.WebAii.Win32.Dialogs.BaseDialog.WaitUntilAnyHandled(IEnumerable`1 dialogs, Int32 handleCount, Int64 timeoutMilliseconds, Boolean resetHandleCount)
       à ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.DialogHandlerDescriptor.Execute(Browser browser)
       à ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.DialogHandlerDescriptor.Execute(IAutomationHost browser)
       à ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)
    ------------------------------------------------------------
    '30/06/2017 10:34:48' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
    ------------------------------------------------------------
    '30/06/2017 10:34:48' - Overall Result: Fail
    '30/06/2017 10:34:48' - Duration: [0 min: 19 sec: 258 msec]
    ------------------------------------------------------------
    '30/06/2017 10:34:51' - Test completed!

    Can you help me? Do you need more information?

    Thanks you

    PS:I'm sorry if you have any problem for understand or if my grammar is awful, i'm french and explain my problem in English is not easy .

  2. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    224 posts

    Posted 04 Jul Link to this post

    Hi Ludovic,

    Thank you for the log information provided.

    Is it possible to provide a sample application and a test script that reproduce the problem to investigate it further?

    What are the handle dialog steps properties? If introduce an execution delay after step 4 does it makes a difference in the test execution?

    Kind Regards,
    Nikolay Petrov
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  3. Ludovic
    Ludovic avatar
    3 posts
    Member since:
    Jun 2017

    Posted 05 Jul in reply to Nikolay Petrov Link to this post

    Thanks for helping me.

    I'm sorry but introduce an execution delay after step 4 makes no difference .

    I add my little program and the test scrip as attach files.

    Thanks you!

  4. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    224 posts

    Posted 06 Jul Link to this post

    Hello Ludovic,

    Thank you for the resources to reproduce the problem provided.

    I modified the project since there war an image missing. Then recompile it. The test script has to be adjusted not to search for a code behind file. Then I execute the test with no exception when save dialog open and been handled. 

    Please provide further details on how to reproduce this problem. Which is the operating system you are recording and execution on? Could you reproduce this problem on another machine?

    Kind Regards,
    Nikolay Petrov
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  5. Ludovic
    Ludovic avatar
    3 posts
    Member since:
    Jun 2017

    Posted 18 Jul in reply to Nikolay Petrov Link to this post

    i have this problem with an other computer too , I'm using window 10.

    What do you mean with "The test script has to be adjusted not to search for a code behind file" and about this "image missing".

    Can you bring me back the program with  hightligthting the modification?

     

  6. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    224 posts

    Posted 21 Jul Link to this post

    Hello Ludovic,

    I think that the problem in this case is in the handle dialog step properties. I attached a screenshot on the properties I used to make this step to pass.

    I hope this would work on your side as well.

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