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

Silverlight Focussed Element and Selected Text

2 Answers 72 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Luke Ryan
Top achievements
Rank 1
Luke Ryan asked on 21 Jun 2010, 02:26 AM
Hi,
We are using WebAii for Silverlight Automation testing
In our XAML we have a button that when clicked creates a form with a text box (System.Windows.Controls.TextBox) that is given focus with a default value that is selected.

Given we have found the element (Xaml.Get<ArtOfTest.WebAii.Silverlight.UI.TextBox>("Name=InputTextBox"); 
Is there a way we can test to check that the element
1) Has Focus
2) Has text in it that is selected


Thanks.

2 Answers, 1 is accepted

Sort by
0
Missing User
answered on 23 Jun 2010, 11:12 PM
Hi Luke,

I apologize for the late reply. For WebUI Test Studio, you can use the Sentence Verification Builder on the TextBox with 'Property' -> 'SelectedText'. Please see the 'Creating Advanced Test Verifications' in the QA or Dev quick start guide.

If your using the WebAii Framework, you can use:

string s = (string)b.GetProperty(new ArtOfTest.WebAii.Silverlight.AutomationProperty("SelectedText", typeof(string)));

For determining if a SL control has focus, there is functionality to determine this, but unfortunately it is not currently exposed. I'll log a feature request to have this made available.

Greetings,
Nelson Sin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Luke
Top achievements
Rank 1
answered on 13 May 2015, 03:04 AM

Hi,

I'm also attempting to detect whether or not a Silverlight element has focus. Has this feature ever been exposed in the Silverlight test framework?

Many thanks,
Luke.

Tags
General Discussions
Asked by
Luke Ryan
Top achievements
Rank 1
Answers by
Missing User
Luke
Top achievements
Rank 1
Share this question
or