public class UIAutomation extends Object
| Modifier and Type | Field and Description |
|---|---|
protected IUIAutomation |
automation |
| Modifier | Constructor and Description |
|---|---|
protected |
UIAutomation()
Constructor for UIAutomation library
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAutomationEventHandler(IUIAutomationElement sender,
int eventId,
TreeScope treeScope,
EventHandler eventHandler)
Adds an event handler for the given event.
|
AutomationApplication |
attach(Process process)
Attaches to the application process
|
void |
captureScreen(String filename)
Captures the screen.
|
IUIAutomationCondition |
CreateAndCondition(IUIAutomationCondition condition0,
IUIAutomationCondition condition1)
Creates the raw and condition
|
CacheRequest |
createCacheRequest()
Create a cache request
|
IUIAutomationCacheRequest |
CreateCacheRequest() |
IUIAutomationCondition |
CreateFalseCondition()
Creates a false Condition
|
IUIAutomationCondition |
CreateOrCondition(IUIAutomationCondition condition0,
IUIAutomationCondition condition1)
Getst the raw condition
|
IUIAutomationCondition |
CreatePropertyCondition(int property,
Object value)
Creates a property condition
|
IUIAutomationCondition |
CreateTrueCondition()
Creates a true Condition
|
AutomationApplication |
findProcess(String... command)
Finds the given process
|
AutomationWindow |
getDesktopWindow(String title)
Gets the desktop window associated with the title
|
List<AutomationWindow> |
getDesktopWindows()
Gets the list of desktop windows
|
static UIAutomation |
getInstance()
Gets the instance
|
AutomationApplication |
launch(String... command)
Launches the application
|
AutomationApplication |
launchOrAttach(String... command)
Attaches or launches the application
|
boolean |
supportsAutomation2()
Does this automation object support IUIAutomation2
i.e.
|
boolean |
supportsAutomation3()
Does this automation object support IUIAutomation3
i.e.
|
protected IUIAutomation automation
public static final UIAutomation getInstance()
public CacheRequest createCacheRequest()
public AutomationApplication launch(String... command) throws IOException
command - The command to be calledIOException - Cannot start application?public AutomationApplication attach(Process process)
process - Process to attach topublic AutomationApplication findProcess(String... command) throws Exception
command - Command to look forException - If findProcessEntry throws an exception.public AutomationApplication launchOrAttach(String... command) throws Exception
command - Command to be startedException - Unable to find processpublic AutomationWindow getDesktopWindow(String title) throws ElementNotFoundException
title - Title to search forElementNotFoundException - Element is not foundpublic List<AutomationWindow> getDesktopWindows()
public boolean supportsAutomation2()
public boolean supportsAutomation3()
public void captureScreen(String filename) throws AWTException, IOException
filename - The filenameAWTException - Robot exceptionIOException - IO Exceptionpublic void addAutomationEventHandler(IUIAutomationElement sender, int eventId, TreeScope treeScope, EventHandler eventHandler)
sender - The sendereventId - The event idtreeScope - The treescopeeventHandler - The EventHandler to addpublic IUIAutomationCondition CreateAndCondition(IUIAutomationCondition condition0, IUIAutomationCondition condition1)
condition0 - First conditioncondition1 - Second conditionpublic IUIAutomationCondition CreateFalseCondition()
public IUIAutomationCondition CreateTrueCondition()
public IUIAutomationCondition CreateOrCondition(IUIAutomationCondition condition0, IUIAutomationCondition condition1)
public IUIAutomationCondition CreatePropertyCondition(int property, Object value)
property - The property to checkvalue - The value of the propertypublic IUIAutomationCacheRequest CreateCacheRequest()
Copyright © 2016. All rights reserved.