diff --git a/jdi-light-core/src/main/java/com/epam/jdi/light/driver/get/DriverData.java b/jdi-light-core/src/main/java/com/epam/jdi/light/driver/get/DriverData.java index 23e3194027..3a33739496 100644 --- a/jdi-light-core/src/main/java/com/epam/jdi/light/driver/get/DriverData.java +++ b/jdi-light-core/src/main/java/com/epam/jdi/light/driver/get/DriverData.java @@ -10,6 +10,8 @@ import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.ie.InternetExplorerOptions; import org.openqa.selenium.safari.SafariOptions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.util.ArrayList; @@ -39,6 +41,8 @@ * Email: roman.iovlev.jdi@gmail.com; Skype: roman.iovlev */ public class DriverData { + private static final Logger log = LoggerFactory.getLogger(DriverData.class); + public static String getDriverFolder() { return isNotBlank(DRIVER.path) && !DRIVER.path.equalsIgnoreCase("default") ? DRIVER.path : mergePath(COMMON.testPath, "resources", "drivers"); @@ -102,7 +106,13 @@ public static MutableCapabilities getCapabilities( setupErrors.clear(); } try { - DRIVER.capabilities.common.forEach((property, value) -> setupCapability(caps, property, value)); + DRIVER.capabilities.common.forEach((property, value) -> { + if (property != null && value != null) { + setupCapability(caps, property, value); + } else { + logger.error("Property is not valid %s %", property, value); + } + }); } catch (Throwable ex) { logger.info("Failed to set COMMON_CAPABILITIES Capabilities for Driver: " + safeException(ex)); } @@ -110,7 +120,7 @@ public static MutableCapabilities getCapabilities( } public static void setupCapability(MutableCapabilities cap, String property, String value) { - if (!property.equals(ARGUMENTS_PROPERTY)) { + if (!ARGUMENTS_PROPERTY.equals(property)) { if (property.toLowerCase().contains("version")) { cap.setCapability(property, value); } else {