Package com.github.ngoanh2n.wdc
Interface WebDriverService
public interface WebDriverService
Interface for using to serve current your WebDriver to WebDriverChecker.
Therefore, you don't need to pass WebDriver to the argument of static APIs.
Therefore, you don't need to pass WebDriver to the argument of static APIs.
- When not using SPI WebDriverService:
WebDriverChecker.isChrome(driver)
- When applying SPI WebDriverService:
WebDriverChecker.isChrome()
How to build the service provider:
- 1. Create a class that implements SPI WebDriverService
package com.company.project.impl; import org.openqa.selenium.WebDriver; import com.github.ngoanh2n.wdc.WebDriverService; public class MyWebDriverService implements WebDriverService { public WebDriver serve() { WebDriver driver = MyStaticDriver.getDriver(); return driver; } }
- 2. Create a provider configuration file:
- Location:
resources/META-INF/services
- Name:
com.github.ngoanh2n.wdc.WebDriverService
- Content:
com.company.project.impl.MyWebDriverService
- Location:
- Since:
- 2021-04-10
-
Method Summary
-
Method Details
-
serve
org.openqa.selenium.WebDriver serve()
-