TestResults.io
  • What is TestResults.io
  • System Architecture
  • Regulated Markets
    • Health Care Industry
    • Financial Services Industry
  • What's new?
    • Update Instruction
      • Update of the Designer extension in Visual Studio
      • Update the Execution Engine
      • Update the Base- and Environment Models
    • Migration to new project file
  • Designer
    • Overview
    • First Steps
    • Installation
    • TestResults.io solution
    • The development environment
      • Tool Window Overview
        • Test Environments
          • Steps to configure a SUT VM
          • How to access files on the system under test
        • Remote Viewer
          • Control Mode
          • Capture Mode
          • Screen Editor
          • Capture Single Image
        • Screen Explorer
        • Test Case Designer
        • Image Explorer
        • API Testing
        • TestResults.io options
          • Engines
          • Servers
    • Test Cases
      • Adding Test Cases
      • Test Case structure
      • Simple Test Case (Example)
      • Executing your Test Case
      • Generating Test Containers
      • Publishing Test Cases
      • Execution Variables
    • Software Models
      • Adding SW Models
      • Referencing the Model in the Test Case
      • Generating Test Containers
      • Publishing SW Models
      • Screens and Screen Elements
        • Tables
        • Visual Sense
        • Custom Screen Elements
    • Installers
      • Adding Installers
      • Generating Test Containers
      • Publishing Installers
    • Automation Framework Reference
      • Attributes
      • Enumerations
      • Filters
        • IImageFilter Interface
        • Select
        • Resize
      • GlobalEngineParameters
      • ImageDetectionParameters
      • ImageReference
      • Interfaces
        • ITester Interface
          • ITester Methods
          • ITester Properties
        • ITestee Interface
          • ITestee Methods
        • IConnections Interface
          • IConnections Methods
          • IConnections Properties
        • IDebug Interface
        • IEngineResult
        • IHelpers Interface
        • IImageHelper Interface
          • IImageHelper Methods
        • IKeyboard Interface
          • IKeyboard Methods
        • IMouse Interface
          • IMouse Methods
          • IMouse Properties
        • IReport Interface
          • IReport Methods
        • ISUTConnection Interface
      • OcrEngineParameters
        • Best practise
        • IronOcrEngineParameters
        • LEADOcrEngineParameters
        • OcrEngineRelatedCharacters
        • OcrPreprocessingParameters
      • ResultRectangle
      • SutNotReadyException
      • TestStepAbortedException
    • FAQ
      • Two-factor authentication (2FA) and One Time Passwords (OTP)
      • Receive and verify Emails
      • Using Excel as test data source
      • Verify PDF Content
  • Portal
    • Overview
    • First Steps
    • User's Guide
      • Login
      • Projects
      • Dashboard
      • Test Cases
      • Software & Environments
      • Test Sets
      • Job Queue
      • Management
      • Notifications Summary
    • Automation Engineer's Guide
      • Test Automation Workflow
      • Automating a test case
      • Enabling Software & Environments
    • REST API Reference
      • Authentication
      • Projects
      • Test Sets
      • Test Cases
      • Test Plans
      • Test Reports
      • Files
      • Software
      • Environments
      • Untitled
      • Executions
      • Favorites
      • Statistics
      • User Management
      • Customer Management
      • Notifications
      • Configurations
      • Invoicing
  • Models
    • Overview
    • Base Model
      • BaseScreen
        • BaseScreen Properties
        • BaseScreen Methods
      • OnScreenElement
        • OnScreenElement Methods
        • OnScreenElement Properties
      • Primitives
        • Button
          • Button Methods
          • Button Properties
        • Checkbox
          • Checkbox Methods
        • ContextMenu
          • ContextMenu Methods
          • ContextMenu Properties
        • Dropdown
          • Dropdown Methods
          • Dropdown Properties
        • DropdownMenu
          • DropdownMenu Methods
          • DropdownMenu Properties
        • GenericScroller
          • GenericScroller Methods
          • GenericScroller Properties
        • HorizontalScroller
        • IconButton
          • IconButton Properties
        • Label
        • LabelWithButton
          • LabelWithButton Properties
        • LabelWithCheckbox
          • LabelWithCheckbox Properties
        • LabelWithValue
          • LabelWithValue Methods
          • LabelWithValue Properties
        • PwTextBox
          • PwTextBox Methods
        • TextBox
          • TextBox Methods
          • TextBox Properties
        • Tables and lists
          • Column
            • Column Methods
            • Column Properties
          • ItemList
            • ItemList Methods
            • ItemList Properties
          • Row
            • Row Methods
            • Row Properties
          • TableBase
            • TableBase Methods
            • TableBase Properties
        • LabelWithElementBase
          • LabelWithElementBase Properties
      • Enumerations
      • Extensions
        • EngineResultExtensions Methods
        • EnumExtensions Methods
        • ReportExtensions Methods
        • StringExtensions Methods
        • TesterConnectionExtensions Methods
        • TesterDebugExtensions Methods
        • TesterHelperExtensions Methods
        • TesterMouseExtensions Methods
        • TesterOnScreenElementExtensions
        • TesterSelectExtensions Methods
      • Helper Classes
        • BaseModelHelpers
          • BaseModelHelpers Methods
          • BaseModelHelpers Properties
        • Attributes for Designer
        • ListHelpers
      • Exceptions
        • ElementNotFoundException
        • InteractionFailedException
        • ScreenNotFoundException
      • Interfaces
        • IAppBasics Interface
          • IAppBasics Methods
          • IAppBasics Properties
        • IBrowser
        • ICommandLineWindow
        • IScroller Interface
          • IScroller Methods
          • IScroller Properties
        • ISutLocale Interface
          • ISutLocale Methods
          • ISutLocale Properties
        • ISystemHelpers
        • ISystemInteractions
        • IWindow
    • Environment Model
      • Windows
        • Screens
          • CmdWindow
            • CmdWindow Methods
            • CmdWindow Properties
          • FileDialog
            • FileDialog Methods
            • FileDialog Properties
          • FileExplorer
            • FileExplorer Properties
          • RunWindow
            • RunWindow Methods
            • RunWindow Properties
          • Window
            • Window Methods
            • Window Properties
        • SutLocale
          • SutLocale Methods
          • SutLocale Properties
        • SystemHelpers
          • SystemHelpers Methods
          • SystemHelpers Properties
        • SystemInteractions
        • WebBrowser
          • Browser
            • Browser Methods
            • Browser Properties
          • BrowserScroller
            • BrowserScroller Methods
            • BrowserScroller Properties
          • AuthenticationDialog
            • AuthenticationDialog Methods
            • AuthenticationDialog Properties
          • DownloadDialog
            • DownloadDialog Methods
            • DownloadDialog Properties
        • EnvironmentModel Enumerations
        • Interfaces
          • IWebAppBasics
            • IWebAppBasics Property
Powered by GitBook
On this page
  • ClearScreen
  • EnterText
  • MakeReadyForNewCommand
  • RunCommand
  • VerifyText
  • WaitForCmdToComplete

Was this helpful?

  1. Models
  2. Environment Model
  3. Windows
  4. Screens
  5. CmdWindow

CmdWindow Methods

ClearScreen

Clears the current console session by running the "cls" command.

Syntax:

public void ClearScreen()

EnterText

Enters the specified text in the console and verifies the input.

Syntax:

public void EnterText(
	string textToEnter
)

Parameters:

Parameter

Description

textToEnter

MakeReadyForNewCommand

Makes sure the console is ready for a new command. Clears existing input text that is not run yet and aborts a running command with Ctrl+C if necessary.

Syntax:

public bool MakeReadyForNewCommand(
	bool throwException = true
)

Parameters:

Parameter

Description

[throwException]

Return Value:

True if console is ready for a new command, false or exception otherwise.

Exceptions:

Exception

Condition

Command window was not ready for a new command

RunCommand

Example to run you own command from a test case:

    var cmd = App.SystemHelpers.OpenCommandLineWindow();
    cmd.RunCommand("my command");
    cmd.WaitForCmdToComplete();    // not required if my command doesn't log

Syntax:

public void RunCommand(
	string command,
	int timeoutInSeconds = 60
)

Parameters:

Parameter

Description

command

[timeoutInSeconds]

Exceptions:

Exception

Condition

Command did not complete within timeoutInSeconds.

VerifyText

Verifies the expected text appears in the output of the last command. Allows to pass in different variants of the text in order to allow for different localisations.

Syntax:

public bool VerifyText(
	params string[] expectedTextWithVariants,
	out string lastCmd
)

Parameters:

Parameter

Description

expectedTextWithVariants

[lastCmd]

Return Value:

Returns true if one of the text variants appears in the output of the last command or the command itself.

WaitForCmdToComplete

Waits for a command to complete by waiting until the console is ready for a new command. Note: an input request is not considered a completed command and will mostly likely timeout the method.

Syntax:

public bool WaitForCmdToComplete(
	int timeout = 60,
	bool throwException = true
)

Parameters:

Parameter

Description

[timeout]

[throwException]

Return Value:

True if command is completed within the specified timeout, false or exception otherwise.

Exceptions:

Exception

Condition

Command did not complete within timeoutInSeconds and throwException is true.

PreviousCmdWindowNextCmdWindow Properties

Last updated 2 years ago

Was this helpful?

Type: The text to enter.

Type: If set to true throws an exception if console is not ready for a new command, otherwise returns false.

Enters the provided command and runs it by pressing enter. Returns as soon as the first output of the command is received (on the next line) or the command completes. If your command logs output to the console you probably want to follow RunCommand with

Type: The command that shall be entered and run.

Type: The timeout in seconds until the first output must be received.

Type: [ ] The text to verify in the console. Can be multiple strings that are e.g. different localisations, which are all accepted. Array must not be empty.

Type: Returns the full output of the last command, to enable further checks without the need to get the text again.

Type: The timeout in which the command must be completed.

Type: If set to true an exception is thrown if command is not completed after the timeout, otherwise returns false.

WaitForCmdToComplete
String
Boolean
TestStepAbortedException
String
Int32
TestStepAbortedException
String
String
String
Int32
TestStepAbortedException