Saturday, 19 April 2014

Handling Windows Dialogs Using Selenium Part4

This section describes some of the important API methods and their usage.


//The initial method to interact with a main window
public WindowElement getWindowElement(String windowName)
                     throws WindowsHandlerException


//To Check whether a particular window is present
public boolean isWindowPresent(String windowName) 


//To see whether an element is displayed on screen (Visible on screen)
public boolean isDisplayed(WindowElement element) 


//To determine whether an element is enabled to interact
public boolean isEnabled(WindowElement element)
                     throws WindowsHandlerException 


//To check whether an element is found
public boolean isNull(WindowElement element) 


//Retrieve Text Box Content
public String getTextBoxValue(WindowElement element)


//Get text of an Element
public String getText(WindowElement element)


//Search for Installed browser Version, Pass the Browser Enum as parameter
public String getInstalledBrowserVersion(Browser browser)
                     throws WindowsHandlerException 


//Start/Run/Open an application
public boolean openApplication(String appPath) 


//Close Process safely as a user would close it.
//Identify the process by id or multiple process by same name
//If the process cannot be closed in a natural way - kill the process
public void closeProcessesByName(String name, boolean forceKill)
public void closeProcessesByID(int pid, boolean forceKill)



//Search an element by following methods
public WindowElement findElementByAccessKey(WindowElement parentElement,
                     String accessKey) throws WindowsHandlerException


public WindowElement findElementByClassNameAndLocalizedControlType(
                     WindowElement parentElement, String className,
                     String localizedControlTypeName) throws WindowsHandlerException

public WindowElement findElementByAutomationID(WindowElement parentElement,
                     String automationID) throws WindowsHandlerException 

public WindowElement findElementByNameAndLocalizedControlType(
                     WindowElement parentElement, String name,
                     String localizedControlTypeName) throws WindowsHandlerException 

public WindowElement findElementByClassName(WindowElement parentElement,
                     String className) throws WindowsHandlerException

public WindowElement findElementByNameAndClassName(
                     WindowElement parentElement, String name, String className)
                     throws WindowsHandlerException


public WindowElement findElementByLocalizedControlType(
                     WindowElement parentElement, String localizedControlTypeName)
                     throws WindowsHandlerException

public WindowElement findElementByName(WindowElement parentElement,
                     String name) throws WindowsHandlerException 





Find Multiple Elements by
public List<WindowElement> findElementsByLocalizedControlType(
                     WindowElement parentElement, String localizedControlTypeName) 


To Be Contd..