Package com.axway.ats.uiengine
Class UiDriver
- java.lang.Object
-
- com.axway.ats.uiengine.UiDriver
-
- Direct Known Subclasses:
AbstractHtmlDriver,AbstractRMIDriver,MobileDriver,RobotDriver,SwingDriver
public abstract class UiDriver extends Object
Abstraction of a UI driver
-
-
Constructor Summary
Constructors Constructor Description UiDriver()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ChromeDrivergetChromeDriver(String url)Get instance of driver working with Chrome browserstatic ChromeDrivergetChromeDriver(String url, String remoteSeleniumURL)Get instance of driver working with Chrome browserstatic UiDrivergetCustomDriver(String driverClassName, Class<?>[] parameterTypes, Object[] constructorArguments)This method allows you to load your own driver implementation which you can use as any other UI Engine driverstatic EdgeDrivergetEdgeDriver(String url)static EdgeDrivergetEdgeDriver(String url, String remoteSeleniumURL)Get instance of driver working with Edge browserstatic FirefoxDrivergetFirefoxDriver(String url)static FirefoxDrivergetFirefoxDriver(String url, String browserPath)Get instance of driver working with Firefox browserstatic FirefoxDrivergetFirefoxDriver(String url, String browserPath, String remoteSeleniumURL)Get instance of driver working with Firefox browserstatic HiddenBrowserDrivergetHiddenBrowserDriver(String url)static HiddenBrowserDrivergetHiddenBrowserDriver(String url, com.gargoylesoftware.htmlunit.BrowserVersion browserVersion)Get instance of driver working with HiddenBrowser (headless browser)static InternetExplorerDrivergetInternetExplorerDriver(String url)Get instance of driver working with Internet Explorer browserstatic InternetExplorerDrivergetInternetExplorerDriver(String url, String remoteSeleniumURL)static MobileDrivergetMobileDriver(String deviceName, String platformVersion, String udid, String host)Driver for working with mobile applicationsstatic MobileDrivergetMobileDriver(String deviceName, String platformVersion, String udid, String host, int port)Driver for working with mobile applicationsstatic PhantomJsDrivergetPhantomJSDriver(String url, String browserPath)Deprecated.static RobotDrivergetRobotDriver()static SafariDrivergetSafariDriver(String url)Get instance of driver working with Safari browserstatic SafariDrivergetSafariDriver(String url, String remoteSeleniumURL)static SwingDrivergetSwingDriver(Class<?> mainClassOfTestedApplication)Get instance of driver working with Swing UI applicationstatic SwingDrivergetSwingDriver(Class<?> mainClassOfTestedApplication, String windowTitle)static SwingDrivergetSwingDriver(String windowTitle)static SwingDrivergetSwingDriver(String jnlpLocation, boolean cacheEnabled)Driver for working with JNLP applicationsabstract voidstart()start the driverabstract voidstop()stop the driver
-
-
-
Method Detail
-
start
public abstract void start()
start the driver
-
stop
public abstract void stop()
stop the driver
-
getFirefoxDriver
public static FirefoxDriver getFirefoxDriver(String url)
- Parameters:
url- the URL to open- Returns:
- new FirefoxDriver instance
-
getFirefoxDriver
public static FirefoxDriver getFirefoxDriver(String url, String browserPath)
Get instance of driver working with Firefox browser- Parameters:
url- the URL to openbrowserPath- the path to the browser starting file or the remote Selenium hub URL (eg. http://10.11.12.13:4444/wd/hub/)- Returns:
- new FirefoxDriver instance
-
getFirefoxDriver
public static FirefoxDriver getFirefoxDriver(String url, String browserPath, String remoteSeleniumURL)
Get instance of driver working with Firefox browser- Parameters:
url- the target application URLbrowserPath- the browser start pathremoteSeleniumURL- the remote Selenium hub URL (eg. http://10.11.12.13:4444/wd/hub/)- Returns:
- new FirefoxDriver instance
-
getInternetExplorerDriver
public static InternetExplorerDriver getInternetExplorerDriver(String url)
Get instance of driver working with Internet Explorer browser- Parameters:
url- the URL to open- Returns:
- new InternetExplorerDriver instance
-
getEdgeDriver
public static EdgeDriver getEdgeDriver(String url, String remoteSeleniumURL)
Get instance of driver working with Edge browser- Parameters:
url- the URL to openremoteSeleniumURL- the remote selenium hub URL (eg. http://10.11.12.13:4444/wd/hub/)- Returns:
- new EdgeDriver instance
-
getEdgeDriver
public static EdgeDriver getEdgeDriver(String url)
- Parameters:
url- the URL to open- Returns:
- new EdgeDriver instance
-
getInternetExplorerDriver
public static InternetExplorerDriver getInternetExplorerDriver(String url, String remoteSeleniumURL)
- Parameters:
url- the URL to openremoteSeleniumURL- the remote selenium hub URL (eg. http://10.11.12.13:4444/wd/hub/)- Returns:
- new InternetExplorerDriver instance
-
getChromeDriver
public static ChromeDriver getChromeDriver(String url)
Get instance of driver working with Chrome browser- Parameters:
url- the URL to open- Returns:
- new ChromeDriver instance
-
getChromeDriver
public static ChromeDriver getChromeDriver(String url, String remoteSeleniumURL)
Get instance of driver working with Chrome browser- Parameters:
url- the URL to openremoteSeleniumURL- the remote Selenium hub URL (eg. http://10.11.12.13:4444/wd/hub/)- Returns:
- new ChromeDriver instance
-
getSafariDriver
public static SafariDriver getSafariDriver(String url)
Get instance of driver working with Safari browser- Parameters:
url- the URL to open- Returns:
- new SafariDriver instance
-
getSafariDriver
public static SafariDriver getSafariDriver(String url, String remoteSeleniumURL)
- Parameters:
url- the URL to openremoteSeleniumURL- the remote Selenium hub URL (eg. http://10.11.12.13:4444/wd/hub/)- Returns:
- new SafariDriver instance
-
getHiddenBrowserDriver
public static HiddenBrowserDriver getHiddenBrowserDriver(String url)
- Parameters:
url- the URL to open- Returns:
- new HiddenBrowserDriver instance
-
getHiddenBrowserDriver
public static HiddenBrowserDriver getHiddenBrowserDriver(String url, com.gargoylesoftware.htmlunit.BrowserVersion browserVersion)
Get instance of driver working with HiddenBrowser (headless browser)- Parameters:
url- the URL to openbrowserVersion- aBrowserVersionto emulate- Returns:
- new HiddenBrowserDriver instance
-
getPhantomJSDriver
@Deprecated public static PhantomJsDriver getPhantomJSDriver(String url, String browserPath)
Deprecated.- Parameters:
url- the URL to openbrowserPath- the browser absolute path- Returns:
- new PhantomJSDriver instance
-
getRobotDriver
public static RobotDriver getRobotDriver()
- Returns:
- new RobotDriver instance
-
getSwingDriver
public static SwingDriver getSwingDriver(Class<?> mainClassOfTestedApplication)
Get instance of driver working with Swing UI application- Parameters:
mainClassOfTestedApplication- the class containing the "main" method- Returns:
- new SwingDriver instance
-
getSwingDriver
public static SwingDriver getSwingDriver(Class<?> mainClassOfTestedApplication, String windowTitle)
- Parameters:
mainClassOfTestedApplication- the class containing the "main" methodwindowTitle- the window title- Returns:
- new SwingDriver instance
-
getSwingDriver
public static SwingDriver getSwingDriver(String windowTitle)
- Parameters:
windowTitle- the window title- Returns:
- new SwingDriver instance
-
getSwingDriver
public static SwingDriver getSwingDriver(String jnlpLocation, boolean cacheEnabled)
Driver for working with JNLP applications- Parameters:
jnlpLocation- JNLP location. It can be local JNLP file path or a remote urlcacheEnabled- whether the JNLP is cached or not- Returns:
- new SwingDriver instance
-
getMobileDriver
public static MobileDriver getMobileDriver(String deviceName, String platformVersion, String udid, String host)
Driver for working with mobile applications- Parameters:
deviceName- the kind of mobile device or emulator to use. You can use one ofMobileDriverdriver type constants.
For example: MobileDriver.DEVICE_ANDROID_EMULATOR, MobileDriver.DEVICE_IPHONE_SIMULATOR or iPhone Retina 4-inch, Galaxy S4, ...
On iOS, this should be one of the valid devices returned by instruments with instruments -s devices.platformVersion- mobile OS version. For example: 8.1, 4.4 ... For Android it could be skipped (null)udid- unique device identifier of the connected physical device or null for emulator/simulator usagehost- the host address of the Appium server. null may be passed if you want to work with localhost emulator- Returns:
- new MobileDriver instance
-
getMobileDriver
public static MobileDriver getMobileDriver(String deviceName, String platformVersion, String udid, String host, int port)
Driver for working with mobile applications- Parameters:
deviceName- the kind of mobile device or emulator to use. You can use one ofMobileDriverdriver type constants.
For example: MobileDriver.DEVICE_ANDROID_EMULATOR, MobileDriver.DEVICE_IPHONE_SIMULATOR or iPhone Retina 4-inch, Galaxy S4, ...
On iOS, this should be one of the valid devices returned by instruments with instruments -s devices.platformVersion- mobile OS version. For example: 11.4, 8.1 ... For Android it could be skipped (null)udid- unique device identifier of the connected physical device or null for emulator/simulator usagehost- the host address of the Appium server. null may be passed if you want to work with localhost emulatorport- the port number of the Appium server- Returns:
- new MobileDriver instance
-
getCustomDriver
public static UiDriver getCustomDriver(String driverClassName, Class<?>[] parameterTypes, Object[] constructorArguments) throws Exception
This method allows you to load your own driver implementation which you can use as any other UI Engine driver- Parameters:
driverClassName- the full class name of the custom driver classparameterTypes- the parameters that the constructor requiresconstructorArguments- the arguments, which will be passed to the constructor- Returns:
- new UiDriver instance
- Throws:
Exception
-
-