Not able to verify wpf window is loaded

4 posts, 0 answers
  1. rashmi
    rashmi avatar
    11 posts
    Member since:
    Feb 2016

    Posted 25 Apr Link to this post

    Hi team,

    We are doing POC for one of our wpf application.

    Can you please give me the method or properties  which verify wpf window is loaded or not and should return true /false.

     

    Thank you,

  2. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    81 posts

    Posted 26 Apr Link to this post

    Hello Rashmi,

    The method you may use is WaitForWindow(). You have to create coded step using following line to verify if the next window is loaded:

    Assert.IsNotNull(ActiveApplication.WaitForWindow("your next window name"));

    You can read more about it on our public API Reference here.

    Regards,
    Nikolay Petrov
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. rashmi
    rashmi avatar
    11 posts
    Member since:
    Feb 2016

    Posted 27 Apr in reply to Nikolay Petrov Link to this post

    Hi Nikolay,

    Thanks for a reply.

    In the above statement, assert basically stops the current test case execution if window is not loaded,

    But I wanted to try something if window is not loaded wait for 2 more sec and then continue till window is loaded.

    Thank you,

  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 29 Apr Link to this post

    Hi Rashmi,

    Then use this code:

    ActiveApplication.WaitForWindow("yourWindowsCaption", 30000);

    In this case Test Studio will wait 30 sec for the window. If it appears during this time it will continue with the test.

    Hope that helps.

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