Locator Attributes For Windows Presentation Foundation (WPF ...
Có thể bạn quan tâm
When a locator is constructed, the attribute type is automatically assigned based on the technology domain that your application uses. The attribute type and value determines how the locator identifies objects within your tests.
Silk Test Classic supports the following locator attributes for WPF controls:
- automationId
- caption
- className
- name
Dynamic Object Recognition
To identify components within WPF scripts, you can specify the automationId, caption, className, or name. The name that is given to an element in the application is used as the automationId attribute for the locator if available. As a result, most objects can be uniquely identified using only this attribute. For example, a locator with an automationId might look like: //WPFButton[@automationId='okButton']".
If you define an automationId and any other attribute, only the automationId is used during replay. If there is no automationId defined, the name is used to resolve the component. If neither a name nor an automationId are defined, the caption value is used. If no caption is defined, the className is used. We recommend using the automationId because it is the most useful property.
| Attribute Type | Description | Example |
|---|---|---|
| automationId | An ID that was provided by the developer of the test application. | //WPFButton[@automationId='okButton']" |
| name | The name of a control. The Visual Studio designer automatically assigns a name to every control that is created with the designer. The application developer uses this name to identify the control in the application code. | //WPFButton[@name='okButton']" |
| caption | The text that the control displays. When testing a localized application in multiple languages, use the automationId or name attribute instead of the caption. | //WPFButton[@automationId='Ok']" |
| className | The simple .NET class name (without namespace) of the WPF control. Using the class name attribute can help to identify a custom control that is derived from a standard WPF control that Silk Test Classic recognizes. | //WPFButton[@className='MyCustomButton']" |
During recording, Silk Test Classic creates a locator for a WPF control by using the automationId, name, caption, or className attributes in the order that they are listed in the preceding table. For example, if a control has a automationId and a name, Silk Test Classic uses the automationId when creating the locator.
The following example shows how an application developer can define a name and an automationId for a WPF button in the XAML code of the application: <Button Name="okButton" AutomationProperties.AutomationId="okButton" Click="okButton_Click">Ok</Button> Parent topic: WPF Applications Related conceptsDynamic Object Recognition Related tasksDefining which Custom Locator Attributes to Use for RecognitionTừ khóa » Thu Wpf
-
Hit Testing In The Visual Layer - WPF .NET Framework - Microsoft Docs
-
Windows Presentation Foundation (WPF) Test - GitHub
-
Configure WPF Test | Progress Test Studio - Documentation - Telerik
-
Unit Test WPF Bindings - Stack Overflow
-
Must Read For WPF Developers: WPF Control Test Bench
-
Mail Merge In Rich Text Editor | WPF Controls
-
Testing WPF Applications | TestComplete Documentation
-
Requirements For Testing WPF Applications - SmartBear Support
-
How To Create Mail Messages Using WPF RichTextBox ... - Syncfusion
-
Test Automation For Micro Focus WPF 21.1 - Infragistics
-
Uses Of Package tional.test.ft.erfaces.WPF - IBM
-
Online WPF Test To Assess And Hire WPF Developer - IMocha
-
About Infragistics WPF Test Automation For Micro Focus UFT
-
Protected: Test WPF - OptinMonster