🖋️
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
  • Sending special keys
  • Key Combinations
  • SendKeys vs. Text

Was this helpful?

  1. Basic Concepts
  2. Controls
  3. Interactions

SendKeys

The SendKeys method allows the user to send keystrokes and combinations to a Control or Page Object.

Sending special keys

You can send some special keys to controls using the Keys class.

The Keys class contains the following special keys categories:

  • Function Keys.

  • Navigation Keys.

  • System Keys.

  • Numeric Keys

  • Editing keys.

  • Lock keys.

  • Modifier Keys

The following is an example of the use of the Keys class:

    MyPageObject.MyControl.SendKeys(Keys.ENTER);

Key Combinations

The SendKeys method can be used to simulate hotkeys and accelerator keys on a control.

How to use

You have to enclose them in brackets ([]), one or more modifier keys such as ctrl, alt or shift with at least one character or special key. For example:

    MyPageObject.MyControl.SendKeys("[" + Keys.CTRL + "a]");
  • To escape braces and brackets, you need to write them twice, for example: "[[".

  • Any key or special key enclosed on the brackets will have the specified modifiers active.

SendKeys vs. Text

PreviousInteractionsNextValidate

Last updated 2 years ago

Was this helpful?

Some controls have which can be used instead of SendKeys. There is one major difference between these two methods: SendKeys will press each key from the string passed onto it as if performed by a human. On the other hand,Text is only concerned with replacing the text on the control by any means necessary. In practice this means that SendKeys is guaranteed to raise browser or OS key-press events, whereas Text is not.

the settable Text property