🖋️
QualityMate
  • QualityMate
  • Getting Started
    • Introduction
    • Why QualityMate
    • Architecture
    • Supported Web Browsers
    • Glossary
  • Components
    • UI Player
      • Basic Concepts
      • UiPlayer
      • MSTest Integration
      • Samples
        • QualityMate Sample Desktop
        • QualityMate Sample Web
        • QualityMate MSTest Integration Sample Desktop
        • QualityMate MSTest Integration Sample Web
        • QualityMate Integration with Test Frameworks
        • Web Authentication Sample
      • QualityMate Project Template
    • UI Recorder
      • Basic Concepts
      • Setting Up the Recorder
      • Validating an Element
      • Generating QualityMate Solution
  • Tools
    • File Comparators
    • Image Processor
    • Project Merger
    • Test Case Generator
      • Filters
      • Rename Recorded Controls
  • Basic Concepts
    • Page Object
      • Work Guide
    • Controls
      • Control Types
        • Generic Types
        • Desktop types
        • Web Types
        • WebMap types
          • Kendo PowerBuilder
          • Kendo WinForms
          • Kendo Silverlight
      • Interactions
        • SendKeys
        • Validate
    • Selectors
      • Selectors in Code
      • Default Selector
      • Shared Selector
      • Selectors Category
        • CSS Selector
        • XPath Selector
        • Image Selector
        • Frame Selector
      • Identifying Selector
        • Identify for Windows Desktop
        • Identify for Web
  • How to Guides
    • Setting Up the Configuration
      • Parameters
      • Context
      • Loading External Data
    • Awaiting for the Application
      • Busy Loaders
      • Retries
    • Defining Controls
      • Extending Controls
      • Control Slice
      • Control Collection
    • Logging on Tests
      • QualityMate Reports
      • Logging
  • Help
    • Best Practices
      • Environment
      • Tests
      • Page Objects
      • Validations
      • Interactions
      • Image Comparisons
    • Known Issues
    • Continuous Integration
      • Agents Session
    • Upgrading QualityMate
      • From version 7 to version 8
      • Previous Versions
      • How to switch from TestFeature to UiTest
    • VS Test
      • Command Line
      • Generate Reports
  • API
    • Control Interfaces
      • IButton
      • ICheckBox
      • IComboBox
      • IControl
      • IControlSlice
      • IDateTimePicker
      • IElement
      • IGrid
      • IGroupBox
      • ILabel
      • IListBox
      • IMenu
      • INumericUpDown
      • IPageObject
      • IProgressBar
      • IRadioButton
      • IRadioButtonGroup
      • ISplitButton
      • IStatusStrip
      • ITab
      • ITextBox
      • IToggleButton
      • IToolBar
      • ITreeView
    • Behavior
      • ICheckableControl
      • IList
      • ITextControl
    • Enums
      • ClickType
      • KeyModifiers
      • MouseButton
  • Changelog
    • Changelog
      • Version 8
      • Version 7
      • Version 6
      • Version 5
      • Version 4
      • Version 3
Powered by GitBook
On this page
  • Find the Recorder Model file and open it with any text editor
  • Recorder Model
  • Find the Component to rename
  • Component
  • Fill the UserDefinedProperty
  • UserDefinedProperty

Was this helpful?

  1. Tools
  2. Test Case Generator

Rename Recorded Controls

How to rename the controls that will be generated for the Test Case Generator

PreviousFiltersNextPage Object

Last updated 3 years ago

Was this helpful?

Please edit only the elements described in this article; other changes might negatively affect the model.

Find the Recorder Model file and open it with any text editor

Recorder Model

  • The Recorder Model is the one that stores the UI Tree and the Recordings.

  • The Model can be found on the Project directory in the Raw folder with the name model.json

  • Once you open the model file, we will be only working on the ComponentTree area (the UI Tree).

    {
      "$type": "UiRecorder.Model.Model, UiRecorder.Model",
      "imageAssertionCount": 0,
      "imageComponentCount": 0,
      "ComponentTree": { },
      "Suite": { }
    }

Find the Component to rename

Component

  • The Component is a representation of the UI element recorded, and is only inside the ComponentTree.

  • Once you find the component to edit its name, type and selectors, it will look like these

    {
      "$id": "2",
      "$type": "UiRecorder.Model.Component, UiRecorder.Model",
      "ControlDescriptor": 
      {
          "$type": "UiRecorder.Contracts.Models.RecorderControlDescriptor, UiRecorder.Contracts",
          "Id": "Form1",
          "Name": "FlaUI WinForms Test App",
          "Class": "WindowsForms10.Window.8.app.0.2bf8098_r9_ad1",
          "Type": "Window",
          "IsPassword": false,
          "CanReceiveText": false,
          "Properties": 
          {
              "$type": "System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.String, mscorlib]], mscorlib",
              "FrameworkType": "WinForm",
              "Index": "-1"
          },
          "Value": null
      },
      "UserDefinedProperty": 
      {
          "$type": "UiRecorder.Contracts.Models.UserDefinedProperty, UiRecorder.Contracts",
          "Name": "MyApplication",
          "Type": null,
          "Selectors": 
          [
              {
                  "Technology": "Web",
                  "Value": "body"
              },
              {
                  "Technology": "KendoWinForms",
                  "Value": "wm-app"
              }
          ]
      }
    }

This structure could change over time. But will always be inside ComponentTree

Fill the UserDefinedProperty

UserDefinedProperty

  • The UserDefinedProperties is a structure that every Component has.

  • It will store desired properties of the actual component for the generated solution.

    • Name ➔ string

    • Type ➔ string

    • Selectors ➔ List

    "UserDefinedProperty": {
        "$type": "UiRecorder.Contracts.Models.UserDefinedProperty, UiRecorder.Contracts",
        "Name": null,
        "Type": null,
        "Selectors": null
      },

Name and Type

  • To change the Name and Type just change the null for what you want inside of double quotes (").

  • "UserDefinedProperty": {
        "$type": "UiRecorder.Contracts.Models.UserDefinedProperty, UiRecorder.Contracts",
        "Name": "MyNameForElement",
        "Type": "IButton",
        "Selectors": null
      },

Selectors

  • The selectors are a List of Selector which has Technology and Value (only CSS selector is supported in the TestCasesGenerator).

  • If we want to add a selector for the component, first add square brackets ([,]) to Selectors

    "UserDefinedProperty": {
        "$type": "UiRecorder.Contracts.Models.UserDefinedProperty, UiRecorder.Contracts",
        "Name": "MyNameForElement",
        "Type": "IButton",
        "Selectors": []
      },
  • Now we can add Selectors inside the list with curly brackets ({,}). Also, both Technology and Value inside double quotes (").

  • If you want more than one just add a comma (,).

    "UserDefinedProperty": {
      "$type": "UiRecorder.Contracts.Models.UserDefinedProperty, UiRecorder.Contracts",
      "Name": "MyNameForElement",
      "Type": "IButton",
      "Selectors": [
              {
                  "Technology": "Web",
                  "Value": "body"
              },
              {
                  "Technology": "KendoWinForms",
                  "Value": "wm-app"
              }
          ]
      },

If you are in the Recorder UI, these changes will be affected after loading the model.

If you don't know the Type which is a just leave the null, the TestCasesGeneration will fill.

QualityMate Interface