Created
July 7, 2022 16:46
-
-
Save eliasnogueira/29795c9dc89f7f7e8b9b9861d87b32d0 to your computer and use it in GitHub Desktop.
Code snippet of the DriverFactory class showing only the createRemoteInstance method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private RemoteWebDriver createRemoteInstance(MutableCapabilities capability) { | |
| RemoteWebDriver remoteWebDriver = null; | |
| try { | |
| String gridURL = String.format("http://%s:%s", configuration().gridUrl(), configuration().gridPort()); | |
| remoteWebDriver = new RemoteWebDriver(new URL(gridURL), capability); | |
| } catch (java.net.MalformedURLException e) { | |
| logger.log(Level.SEVERE, "Grid URL is invalid or Grid is not available"); | |
| logger.log(Level.SEVERE, String.format("Browser: %s", capability.getBrowserName()), e); | |
| } catch (IllegalArgumentException e) { | |
| logger.log(Level.SEVERE, String.format("Browser %s is not valid or recognized", capability.getBrowserName()), e); | |
| } | |
| return remoteWebDriver; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment