Locating Elements in Wpf Window fails

2 posts, 0 answers
  1. Stephan
    Stephan avatar
    4 posts
    Member since:
    Sep 2015

    Posted 29 Sep 2015 Link to this post

    Hey Chummers,

     I f***ing love this Framework!!

    However, it seems that I am way to stupid to use it. :-D Hope you can help me out!

    I am trying to click on a button, but always get a NotFoundException. So I wrote a small test containing the following code:

    01.var app = myManager.ActiveApplication.MainWindow;
    03.app.Find.Strategy = FindStrategy.AlwaysWaitForElementsVisible;
    04.IList<FrameworkElement> buttonList = app.Find.AllByType("Button");
    06.foreach (var element in buttonList)
    08.    Debug.WriteLine(element.Name);

    The output is


     So it seems my code is only able to address the buttons in the Window-frame so far and I have no idea what do do...

     Any suggestions?

    Greetings Stephan

  2. Ivaylo
    Ivaylo avatar
    749 posts

    Posted 02 Oct 2015 Link to this post

    Hello Stephan,

    I am glad to hear you like the framework :)

    Regarding the problem you are experiencing I can see that some buttons are found. Are those all buttons that are supposed to be found? If yes, as far as I can understand the click step is not performing, since you've missed to provide the original test and the failure details.

    So in order to proceed any further please elaborate a bit on your scenario.

    Also the best way to proceed is to provide me with your application and the test you are trying to execute so I can take a look. If you're not able to provide the entire application a stripped down version that reproduces the behavior will also do the trick.

    Looking forward to hearing from you.

    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top