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.

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
Since:
2021-04-10
  • Method Summary

    Modifier and Type
    Method
    Description
    org.openqa.selenium.WebDriver
     
  • Method Details

    • serve

      org.openqa.selenium.WebDriver serve()