PlaybackSettings.DelayBetweenActions 属性

获取或设置操作之间的延迟(以毫秒为单位)。

命名空间:  Microsoft.VisualStudio.TestTools.UITesting
程序集:  Microsoft.VisualStudio.TestTools.UITesting(在 Microsoft.VisualStudio.TestTools.UITesting.dll 中)

语法

声明
Public Property DelayBetweenActions As Integer
public int DelayBetweenActions { get; set; }
public:
property int DelayBetweenActions {
    int get ();
    void set (int value);
}
member DelayBetweenActions : int with get, set
function get DelayBetweenActions () : int
function set DelayBetweenActions (value : int)

属性值

类型:System.Int32
操作之间的延迟(以毫秒为单位)。

示例

public void ModifiedSimpleAppTest()
        {
            #region Variable Declarations
            WpfButton uIStartButton = this.UIMainWindowWindow.UIStartButton;
            WpfCheckBox uICheckBoxCheckBox = this.UIMainWindowWindow.UICheckBoxCheckBox;
            WpfButton uICloseButton = this.UIMainWindowWindow.UIMainWindowTitleBar.UICloseButton;
            #endregion

            // Launch '%VisualStudioDir%\Projects\AddTwoNumbers\AddTwoNumbers\bin\Debug\AddTwoNumbers.exe'
            ApplicationUnderTest uIMainWindowWindow = ApplicationUnderTest.Launch(this.SimpleAppTestParams.UIMainWindowWindowExePath, this.SimpleAppTestParams.UIMainWindowWindowAlternateExePath);

            // Set delay between actions to 1 second. Add this code before any mouse, keyboard and SetProperty actions.
            Playback.PlaybackSettings.DelayBetweenActions = 1000;

            // Click 'Start' button
            Mouse.Click(uIStartButton, new Point(27, 10));

            uICheckBoxCheckBox.WaitForControlEnabled();
            
            // Select 'CheckBox' check box
            uICheckBoxCheckBox.Checked = this.SimpleAppTestParams.UICheckBoxCheckBoxChecked;

            // Click 'Close' button
            Mouse.Click(uICloseButton, new Point(15, 10));
        }

.NET Framework 安全性

请参见

参考

PlaybackSettings 类

Microsoft.VisualStudio.TestTools.UITesting 命名空间