WebDriverManagerServer

WebDriverManager can also be used as a server. There are two ways to use it as a server:

  • Directly from the code and Maven
  • Using WebDriverManager as a fat JAR

Let's look at both of these methods:

  1. Directly from the code and Maven: The command to be used is: mvn exec:java -Dexec.args="server <port>". If the second argument is omitted, the default port (4041) will be used: C: Maven mvn exec:java -Dexec.args="server":

  1. Using WebDriverManager as a fat-jar: We can also use WebDriverManager as a fat JAR. For instance: java -jar webdrivermanager-3.0.0-fat.jar chrome.

After executing this command, the following gets printed in the console:

When WebDriverManager gets up and running, HTTP requests can be done to resolve driver binary executables (chromedriver, geckodriver, and so on). For example, suppose that WebDriverManager is running the localhost and in the default port, navigates to the following URLs to get the latest versions of the driver executables:

  • http://localhost:4041/chromedriver: The latest version of chromedriver
  • http://localhost:4041/firefoxdriver: The latest version of geckodriver
  • http://localhost:4041/operadriver: The latest version of operadriver
  • http://localhost:4041/phantomjs: The latest version of phantomjs driver
  • http://localhost:4041/edgedriver: The latest version of MicrosoftWebDriver
  • http://localhost:4041/iedriver: The latest version of IEDriverServer

These requests can be initiated using a normal browser. The driver binary is then automatically downloaded by the browser as an attachment in the HTTP response when the response is sent back.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.126.74