BrowserWindow 类

表示 vstsEssTest 测试框架中的一个 Web 浏览器窗口。

继承层次结构

System.Object
  Microsoft.VisualStudio.TestTools.UITesting.UITestControl
    Microsoft.VisualStudio.TestTools.UITesting.ApplicationUnderTest
      Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow

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

语法

声明
Public Class BrowserWindow _
    Inherits ApplicationUnderTest
public class BrowserWindow : ApplicationUnderTest
public ref class BrowserWindow : public ApplicationUnderTest
type BrowserWindow =  
    class
        inherit ApplicationUnderTest
    end
public class BrowserWindow extends ApplicationUnderTest

BrowserWindow 类型公开以下成员。

构造函数

  名称 说明
公共方法 BrowserWindow 初始化 BrowserWindow 类的新实例。

页首

属性

  名称 说明
公共属性静态成员 AllowPopups 获取或设置一个值,该值确定 Web 浏览器窗口是否允许弹出窗口。
公共属性 AlwaysOnTop 获取一个值,该值指示应用程序窗口是否始终出现在顶层。 (继承自 ApplicationUnderTest。)
公共属性 BoundingRectangle 获取此控件的边框。 (继承自 UITestControl。)
公共属性 ClassName 获取此控件的类名。 (继承自 UITestControl。)
公共属性 Container 获取或设置此 UITestControl 的容器。 (继承自 UITestControl。)
公共属性 ControlType 获取 UI 控件的类型。 (继承自 UITestControl。)
公共属性静态成员 CurrentBrowser 从已注册浏览器的列表中获取或设置当前浏览器。
公共属性 CurrentDocumentWindow 获取与浏览器关联的当前活动文档窗口
公共属性 Enabled 获取一个值,该值指示是否启用此控件。 (继承自 UITestControl。)
公共属性 Exists 获取一个值,该值指示此控件是否存在于用户界面中。 (继承自 UITestControl。)
公共属性 FilterProperties 获取用于消除控件歧义的属性-值对集合。 (继承自 UITestControl。)
公共属性 FriendlyName 获取该控件在用户接口中的名称。 (继承自 UITestControl。)
公共属性 HasFocus 获取指示此控件当前是否在用户界面中有焦点的值。 (继承自 UITestControl。)
公共属性 HasTitleBar 获取一个值,该值指示应用程序窗口是否具有标题栏。 (继承自 ApplicationUnderTest。)
公共属性 IsTopParent 获取指示此控件是否是顶级元素的值。 (继承自 UITestControl。)
公共属性 Maximized 获取或设置一个值,该值指示应用程序窗口是否处于最大化状态。 (继承自 ApplicationUnderTest。)
公共属性 Minimized 获取或设置一个值,该值指示应用程序窗口是否处于最小化状态。 (继承自 ApplicationUnderTest。)
公共属性 Name 获取此控件的名称。 (继承自 UITestControl。)
公共属性 NativeElement 获取与此控件对应的本机技术元素。 (继承自 UITestControl。)
公共属性 Popup 获取一个值,该值指示应用程序窗口是否为弹出窗口。 (继承自 ApplicationUnderTest。)
公共属性 Process 获取或设置基础 Process 对象。 (继承自 ApplicationUnderTest。)
公共属性 Resizable 获取一个值,该值指示应用程序窗口是否可调整大小。 (继承自 ApplicationUnderTest。)
公共属性 Restored 获取或设置一个值,该值指示应用程序窗口是否处于还原状态。 (继承自 ApplicationUnderTest。)
公共属性 SearchConfigurations 获取或设置搜索配置。 (继承自 UITestControl。)
公共属性 SearchProperties 获取用于标识控件的属性-值对集合。 (继承自 UITestControl。)
受保护的属性 SearchPropertiesSetExplicitly 获取一个值,该值指示用户是否已显式设置搜索属性。 (继承自 ApplicationUnderTest。)
公共属性 ShowInTaskbar 获取一个值,该值指示程序图标是否出现在任务栏中。 (继承自 ApplicationUnderTest。)
公共属性 TechnologyName 获取或设置实现此控件的技术框架。 (继承自 UITestControl。)
公共属性 Title 获取或设置进行测试的应用程序的标题。 (继承自 ApplicationUnderTest。)
公共属性 TopParent 获取此控件的顶级父级。 (继承自 UITestControl。)
公共属性 Transparent 获取一个值,该值指示应用程序窗口是否透明。 (继承自 ApplicationUnderTest。)
公共属性 Uri 获取已加载页的 URI。
公共属性 Version 获取 Web 浏览器的版本。
公共属性 WindowHandle 获取此控件的窗口句柄。 (继承自 UITestControl。)
公共属性 WindowTitles 获取顶层窗口的窗口标题的集合。 (继承自 UITestControl。)

页首

方法

  名称 说明
公共方法 Back 使 Web 浏览器返回至上一网页。
公共方法 CaptureImage 捕获 UITestControl 的图像。UITestControl 必须显示在屏幕上。 (继承自 UITestControl。)
公共方法静态成员 ClearCache 清除 Web 浏览器的缓存。
公共方法静态成员 ClearCookies 清除 Web 浏览器的 Cookie。
公共方法 Close 关闭进行测试的应用程序。 (继承自 ApplicationUnderTest。)
公共方法 CopyFrom 创建一个用户界面 (UI) 控件对象,该对象与原始控件引用相同的用户界面元素。 (重写 UITestControl.CopyFrom(UITestControl)。)
公共方法 Dispose() 释放由 ApplicationUnderTest 使用的所有资源。 (继承自 ApplicationUnderTest。)
受保护的方法 Dispose(Boolean) 释放由 BrowserWindow 使用的非托管资源,还可以选择释放托管资源。 (重写 ApplicationUnderTest.Dispose(Boolean)。)
公共方法 DrawHighlight 突出显示控件。 (继承自 UITestControl。)
公共方法 EnsureClickable() 滚动用户界面以确保控件可单击。 (继承自 UITestControl。)
公共方法 EnsureClickable(Point) 将用户界面滚动到特定点,以确保控件可单击。 (继承自 UITestControl。)
公共方法 Equals 确定指定的 UITestControl 是否等于当前的 UITestControl。 (继承自 UITestControl。)
受保护的方法 Finalize ApplicationUnderTest 终结器。 (继承自 ApplicationUnderTest。)
公共方法 Find 在用户界面中查找此应用程序窗口。 (继承自 ApplicationUnderTest。)
公共方法 FindMatchingControls 返回与指定 SearchPropertiesFilterProperties 匹配的所有 UITestControl 的集合。 (继承自 UITestControl。)
公共方法 Forward 使 Web 浏览器前进至历史记录列表中的下一页。
公共方法静态成员 FromProcess 创建对现有进程中正在运行的 Web 浏览器窗口的引用。
公共方法 GetChildren 返回当前 UITestControl 的所有第一级子级的集合。 (继承自 UITestControl。)
公共方法 GetClickablePoint 返回控件上可单击的点。 (继承自 UITestControl。)
公共方法 GetHashCode 返回一个唯一值,表示当前 UITestControl 实例。 (继承自 UITestControl。)
公共方法 GetParent 返回当前 UITestControl 的父级。 (继承自 UITestControl。)
公共方法 GetProperty 获取指定属性的值。 (继承自 UITestControl。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
受保护的方法 GetUITestControlsForSearch 返回将用于搜索的 UITestControl 对象的数组。 (继承自 UITestControl。)
公共方法静态成员 Launch() 启动一个 Web 浏览器窗口并返回该 Web 浏览器窗口对象。
公共方法静态成员 Launch(array<String[]) 使用给定的命令行参数数组启动一个 Web 浏览器窗口并返回该浏览器窗口对象。
公共方法静态成员 Launch(Uri) 使用给定 URI 启动一个 Web 浏览器窗口并返回该 Web 浏览器窗口对象。
公共方法静态成员 Locate 使用窗口标题查找 Web 浏览器窗口并返回对应的浏览器窗口对象。
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 NavigateToHomepage 在 Web 浏览器窗口中打开主页。
公共方法 NavigateToUrl 在 Web 浏览器中打开指定网页。
公共方法 PerformDialogAction(BrowserDialogAction) 搜索带有脚本的 Web 对话框,执行指定的操作。
公共方法 PerformDialogAction(BrowserDialogAction, Object) 使用提供的参数值搜索带有脚本的 Web 对话框,执行指定的操作。
公共方法 Refresh 刷新 Web 浏览器窗口。
公共方法 SetFocus 将键盘焦点设置到 UITestControl。 (继承自 UITestControl。)
公共方法 SetProperty 设置给定属性的值。 (继承自 UITestControl。)
受保护的方法 Shutdown 强制应用程序关闭。 (继承自 ApplicationUnderTest。)
公共方法 StopPageLoad 在 Web 浏览器窗口中停止加载页。
公共方法 ToString 返回表示当前 UITestControl 的字符串。 (继承自 UITestControl。)
公共方法 TryGetClickablePoint 返回 UITestControl 中的可单击点。如果不可单击该控件,则此方法返回 false。 (继承自 UITestControl。)
公共方法 WaitForControlCondition(Predicate<UITestControl>) 阻止当前线程,直到此控件满足指定条件或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlCondition(Predicate<UITestControl>, Int32) 阻止当前线程,直到此控件满足指定条件或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlEnabled() 阻止当前线程,直到启用此控件或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlEnabled(Int32) 阻止当前线程,直到启用此控件或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlExist() 阻止当前线程,直到用户界面中出现此控件,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlExist(Int32) 阻止当前线程,直到用户界面中出现此控件,或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlNotExist() 阻止当前线程,直到用户界面中不再存在此控件,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlNotExist(Int32) 阻止当前线程,直到用户界面中不再存在此控件,或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlPropertyEqual(String, Object) 阻止当前线程,直到此控件的指定属性等于指定值,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlPropertyEqual(String, Object, Int32) 阻止当前线程,直到此控件的指定属性等于指定值,或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlPropertyNotEqual(String, Object) 阻止当前线程,直到此控件的指定属性不等于指定值,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlPropertyNotEqual(String, Object, Int32) 阻止当前线程,直到此控件的指定属性不等于指定值,或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlReady() 阻止当前线程,直到此控件准备好接收受鼠标或键盘输入,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlReady(Int32) 阻止当前线程,直到此控件准备好接收受鼠标或键盘输入,或直到指定超时时间已到。 (继承自 UITestControl。)

页首

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.VisualStudio.TestTools.UITesting 命名空间