Skip to main content

WinDriverVirtualUserScript Reference

WinDriverVirtualUserScript Summary of Methods

Window Methods
MethodDescription
------
FindTopWindow/

FindTopAutomationWindow
Return a top level window matching the supplied selection criteria.
FindTopWindows/

FindTopAutomationWindows
Return a list of of top level windows matching the supplied selection criteria.
FindControlReturn a control matching the supplied criteria
FindControlsReturn a list of controls matching the supplied criteria
GetWindowTextReturn the control text. Can be used on items such as a window title
SetForegroundWindowSet a window into the foreground and activate the window
ShowWindowShow, maximise, minimise or otherwise change a windows state.
Window Control and AutomationControl Methods
MethodDescription
------
ClickButtonClick a windows button Control
GetComboBoxItemsReturns a list of the items in a windows combo box Control.
SelectComboBoxItemSelects a specified item (value or index number) in a Combo box Control
GetListBoxItemsReturns a list of items in a list box Control
SelectListBoxItemSelects a specified item (value or index number) in a list box Control
GetEditTextReturn the text in an edit Control
SetEditTextSet the text in an edit Control
SetCursorPosBottomRHSSet the cursor position relative to the bottom right corner of window
SetCursorPosTopLHSSet the cursor position relative to the top left hand corner of the window
LeftClickLeft click in the centre of the given window
DoubleLeftClickDouble left click at the current cursor position
LeftClickBelowRHSLeft click below bottom right of window
LeftClickLHSLeft click top left hand side of window
LeftClickRHSLeft click top right hand side of window
RightClickRight click centre of window
Mouse Methods
MethodDescription
------
DoubleLeftClickDouble click the left mouse button.
DoubleMiddleClickDouble click the middle mouse.
DoubleRightClickDouble click the right mouse.
LeftClickClick the left mouse button.
MiddleClickClick the middle mouse button.
RightClickClick the right mouse button.
ClickPauseSet the default pause time in milliseconds following each click action.
DoubleClickPauseSet the default pause time in milliseconds following each double click action.
Menu Controls Methods
MethodDescription
------
GetTopMenuReturn the menu handle of the window's main, top level menu.
ActivateMenuItemActivate a windows menu item

Controls derived from SysTreeView32 and SysListView32 are supported using the following methods on 32-bit runtime.

ListView
MethodDescription
------
GetListItemCountReturn the number of items in the List
GetListItemLocationReturn the location coordinates of the item with the given index number
GetListItemTextReturn the test of the item for the given index and column
GetListItemPointFromNameReturn the location of the item with the given name and column
EnsureVisibleListItemScroll the list view to ensure the item given by an index number is visible
SelectListItemSet the item given by the index number to the selected state
TreeView
MethodDescription
------
GetTreeViewItemCountReturn the number of visible items in the Tree
GetTreeItemLocationReturn the location coordinates of the item with the given name
GetTreeItemRectangeReturn the rectangle enclosing the item
ExpandTreeItemReturn the location of the item
EnsureVisibleTreeItemScroll the list view to ensure the item is visible
SelectTreeItemSet the item to the selected state
GetTreeItemTextGet the text of the item for the given index number

Metadata

using Facilita.Fc.Runtime;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Automation;

namespace Facilita.Fc.WinDriver
{
public abstract class WinDriverVirtualUserScript : VirtualUserScript
{
protected WinDriverVirtualUserScript();
public Keyboard Keyboard { get; }
public int MaxSearchDepth { get; set; }
public int MaxWait { get; set; }
public Mouse Mouse { get; }
public int PausePerKeyPress { get; set; }
public int RetryInterval { get; set; }
public WinDriverVirtualUser VU { get; }
public AutomationControl AutomationWindowFromPoint();
public AutomationControl AutomationWindowFromPoint(Point p);
public AutomationControl FindTopAutomationWindow(ControlType controlType);
public AutomationControl FindTopAutomationWindow(MatchCriteria matchCriteria);
public AutomationControl FindTopAutomationWindow(Predicate<AutomationControl> selectionFunction);
public AutomationControl FindTopAutomationWindow(string wantedText);
public AutomationControl FindTopAutomationWindow(MatchCriteria matchCriteria, int maxWait);
public AutomationControl FindTopAutomationWindow(Predicate<AutomationControl> selectionFunction, int maxWait);
public AutomationControl FindTopAutomationWindow(string wantedText, ControlType controlType);
public AutomationControl FindTopAutomationWindow(string wantedText, int maxWait);
public AutomationControl FindTopAutomationWindow(string wantedText, string wantedClass);
public AutomationControl FindTopAutomationWindow(string wantedText, TextMatch textMatch);
public AutomationControl FindTopAutomationWindow(string wantedText, string wantedClass, int maxWait);
public AutomationControl FindTopAutomationWindow(string wantedText, string wantedClass, TextMatch textMatch);
public AutomationControl FindTopAutomationWindow(string wantedText, TextMatch textMatch, ControlType controlType);
public AutomationControl FindTopAutomationWindow(string wantedText, TextMatch textMatch, int maxWait);
public AutomationControl FindTopAutomationWindow(string wantedText, string wantedClass, TextMatch textMatch, int maxWait);
public IList<AutomationControl> FindTopAutomationWindows(ControlType controlType);
public IList<AutomationControl> FindTopAutomationWindows(MatchCriteria matchCriteria);
public IList<AutomationControl> FindTopAutomationWindows(Predicate<AutomationControl> selectionFunction);
public IList<AutomationControl> FindTopAutomationWindows(string wantedText);
public IList<AutomationControl> FindTopAutomationWindows(string wantedText, ControlType controlType);
public IList<AutomationControl> FindTopAutomationWindows(string wantedText, string wantedClass);
public IList<AutomationControl> FindTopAutomationWindows(string wantedText, TextMatch textMatch);
public IList<AutomationControl> FindTopAutomationWindows(string wantedText, string wantedClass, TextMatch textMatch);
public IList<AutomationControl> FindTopAutomationWindows(string wantedText, TextMatch textMatch, ControlType controlType);
public Control FindTopWindow(MatchCriteria matchCriteria);
public Control FindTopWindow(Predicate<IControl> selectionFunction);
public Control FindTopWindow(string wantedText);
public Control FindTopWindow(MatchCriteria matchCriteria, int maxWait);
public Control FindTopWindow(Predicate<IControl> selectionFunction, int maxWait);
public Control FindTopWindow(string wantedText, int maxWait);
public Control FindTopWindow(string wantedText, string wantedClass);
public Control FindTopWindow(string wantedText, TextMatch textMatch);
public Control FindTopWindow(string wantedText, string wantedClass, int maxWait);
public Control FindTopWindow(string wantedText, string wantedClass, TextMatch textMatch);
public Control FindTopWindow(string wantedText, TextMatch textMatch, int maxWait);
public Control FindTopWindow(string wantedText, string wantedClass, TextMatch textMatch, int maxWait);
public AutomationControl FindTopWindowByAutomationId(string automationId);
public IList<Control> FindTopWindows(MatchCriteria matchCriteria);
public IList<Control> FindTopWindows(Predicate<IControl> selectionFunction);
public IList<Control> FindTopWindows(string wantedText);
public IList<Control> FindTopWindows(string wantedText, string wantedClass);
public IList<Control> FindTopWindows(string wantedText, TextMatch textMatch);
public IList<Control> FindTopWindows(string wantedText, string wantedClass, TextMatch textMatch);
public Point GetCursorPos();
public void SaveBitmap(string pathName, Rectangle rectangle);
public void SaveBitmap(string pathName, int x, int y, int width, int height);
public void SendKeys(string text);
public Rectangle WaitForScreenMatch(Rectangle expectedLocation, string bitmapFile);
public Rectangle WaitForScreenMatch(Rectangle expectedLocation, string bitmapFile, int maxWait, int searchRadius);
public void WaitForTopWindowCount(MatchCriteria matchCriteria, int count);
public void WaitForTopWindowCount(Predicate<IControl> selectionFunction, int count);
public void WaitForTopWindowCount(string wantedText, int count);
public void WaitForTopWindowCount(MatchCriteria matchCriteria, int count, int maxWait);
public void WaitForTopWindowCount(Predicate<IControl> selectionFunction, int count, int maxWait);
public void WaitForTopWindowCount(string wantedText, int count, int maxWait);
public void WaitForTopWindowCount(string wantedText, string wantedClass, int count);
public void WaitForTopWindowCount(string wantedText, TextMatch textMatch, int count);
public void WaitForTopWindowCount(string wantedText, string wantedClass, int count, int maxWait);
public void WaitForTopWindowCount(string wantedText, string wantedClass, TextMatch textMatch, int count);
public void WaitForTopWindowCount(string wantedText, TextMatch textMatch, int count, int maxWait);
public void WaitForTopWindowCount(string wantedText, string wantedClass, TextMatch textMatch, int count, int maxWait);
public void WaitWhileTopWindowCount(MatchCriteria matchCriteria, int count);
public void WaitWhileTopWindowCount(Predicate<IControl> selectionFunction, int count);
public void WaitWhileTopWindowCount(string wantedText, int count);
public void WaitWhileTopWindowCount(MatchCriteria matchCriteria, int count, int maxWait);
public void WaitWhileTopWindowCount(Predicate<IControl> selectionFunction, int count, int maxWait);
public void WaitWhileTopWindowCount(string wantedText, int count, int maxWait);
public void WaitWhileTopWindowCount(string wantedText, string wantedClass, int count);
public void WaitWhileTopWindowCount(string wantedText, TextMatch textMatch, int count);
public void WaitWhileTopWindowCount(string wantedText, string wantedClass, int count, int maxWait);
public void WaitWhileTopWindowCount(string wantedText, string wantedClass, TextMatch textMatch, int count);
public void WaitWhileTopWindowCount(string wantedText, TextMatch textMatch, int count, int maxWait);
public void WaitWhileTopWindowCount(string wantedText, string wantedClass, TextMatch textMatch, int count, int maxWait);
public Control WindowFromPoint();
public Control WindowFromPoint(Point p);
}
}