This is a migrated thread and some comments may be shown as answers.

Locating Elements in Wpf Window fails

1 Answer 10 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephan
Top achievements
Rank 1
Stephan asked on 29 Sep 2015, 11:12 AM

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;
02. 
03.app.Find.Strategy = FindStrategy.AlwaysWaitForElementsVisible;
04.IList<FrameworkElement> buttonList = app.Find.AllByType("Button");
05. 
06.foreach (var element in buttonList)
07.{
08.    Debug.WriteLine(element.Name);
09.}

The output is

PART_SysMinimizeButton
PART_SysMaximizeButton
PART_SysRestoreButton
PART_SysCloseButton

 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

1 Answer, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 02 Oct 2015, 07:47 AM
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.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Stephan
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Share this question
or