Table of Contents
You are writing automation test scripts for multiple browsers such as:
- Chrome, Safari.. on PC
- Safari & native application on iOS
- Chrome & native application on Android
And somewhere, you have to check type of browser or platform to navigate your scripts.
Use WebDriverChecker
to make it more convenient!
- Browser: Chrome, Firefox, Edge, Opera, Safari, IE
- Platform: MacOS, Linux, Windows, iOS, Android
- State: Alive, Local, Remote, Web, Native, Docker, Virtual Device, Cloud
- Selenium: 4.24.0
- Selenide: 7.4.3
- JUnit5: 5.11.0
- TestNG: 7.10.2
It automatically provides the current WebDriver
instance to com.github.ngoanh2n.wdc.WebDriverChecker
.
You don't need to pass the WebDriver
instance to the argument of checker methods.
With extension | Without extension |
---|---|
WebDriverChecker.isChrome() |
WebDriverChecker.isChrome(driver) |
When using Selenide
directly.
When using JUnit Jupiter
as a testing framework.
When using TestNG
as a testing framework.
Add to build.gradle
.
implementation("com.github.ngoanh2n:webdriverchecker:2.9.0")
Add to pom.xml
.
<dependency>
<groupId>com.github.ngoanh2n</groupId>
<artifactId>webdriverchecker</artifactId>
<version>2.9.0</version>
</dependency>
- Browser
WebDriverChecker.isChrome(driver)
WebDriverChecker.isSafari(driver)
WebDriverChecker.isFirefox(driver)
WebDriverChecker.isEdge(driver)
WebDriverChecker.isOpera(driver)
WebDriverChecker.isIE(driver)
WebDriverChecker.isLegacyEdge(driver)
WebDriverChecker.isLegacyFirefox(driver)
- Platform
WebDriverChecker.isLinux(driver)
WebDriverChecker.isMacOS(driver)
WebDriverChecker.isWindows(driver)
WebDriverChecker.isPC(driver)
WebDriverChecker.isIOS(driver)
WebDriverChecker.isAndroid(driver)
WebDriverChecker.isMobile(driver)
- State
WebDriverChecker.isAlive(driver)
WebDriverChecker.isLocal(driver)
WebDriverChecker.isRemote(driver)
WebDriverChecker.isDocker(driver)
WebDriverChecker.isBrowser(driver)
WebDriverChecker.isNative(driver)
- Cloud
WebDriverChecker.isLambdaTest(driver)
WebDriverChecker.isBrowserStack(driver)
WebDriverChecker.isSauceLabs(driver)
WebDriverChecker.isTestingBot(driver)
- Combination
WebDriverChecker.isLocalServer(driver)
WebDriverChecker.isRemoteServer(driver)
WebDriverChecker.isPCBrowser(driver)
WebDriverChecker.isPCNative(driver)
WebDriverChecker.isMacOSNative(driver)
WebDriverChecker.isWindowsNative(driver)
WebDriverChecker.isIOSBrowser(driver)
WebDriverChecker.isIOSNative(driver)
WebDriverChecker.isIOSVirtual(driver)
WebDriverChecker.isAndroidBrowser(driver)
WebDriverChecker.isAndroidNative(driver)
WebDriverChecker.isAndroidVirtual(driver)
WebDriverChecker.isMobileBrowser(driver)
WebDriverChecker.isMobileNative(driver)
WebDriverChecker.isMobileVirtual(driver)