diff --git a/src/main/java/com/xceptance/neodymium/common/browser/BrowserRunnerHelper.java b/src/main/java/com/xceptance/neodymium/common/browser/BrowserRunnerHelper.java index 2d0aef36..731728ab 100644 --- a/src/main/java/com/xceptance/neodymium/common/browser/BrowserRunnerHelper.java +++ b/src/main/java/com/xceptance/neodymium/common/browser/BrowserRunnerHelper.java @@ -241,7 +241,7 @@ else if (Neodymium.configuration().useProxy()) var remoteDebuggingPort = PortProber.findFreePort(); Neodymium.setRemoteDebuggingPort(remoteDebuggingPort); options.addArguments("--remote-debugging-port=" + remoteDebuggingPort); - + if (config.getArguments() != null && config.getArguments().size() > 0) { options.addArguments(config.getArguments()); @@ -361,18 +361,18 @@ else if (edgeBrowsers.contains(browserName)) final String driverInPathPath = new ExecutableFinder().find("msedgedriver"); final EdgeOptions options = new EdgeOptions().merge(capabilities); - + if (config.getArguments() != null && config.getArguments().size() > 0) { options.addArguments(config.getArguments()); } - + EdgeBuilder edgeBuilder = new EdgeBuilder(config.getDriverArguments()); if (StringUtils.isNotBlank(driverInPathPath)) { edgeBuilder.usingDriverExecutable(new File(driverInPathPath)); } - + wDSC.setWebDriver(new EdgeDriver(edgeBuilder.build(), options)); } else if (safariBrowsers.contains(browserName)) @@ -404,7 +404,7 @@ else if (safariBrowsers.contains(browserName)) config.getGridProperties().put("userName", testEnvironmentProperties.getUsername()); config.getGridProperties().put("accessKey", testEnvironmentProperties.getPassword()); final String buildId = StringUtils.isBlank(System.getenv("BUILD_NUMBER")) ? "local run" : System.getenv("BUILD_NUMBER"); - config.getGridProperties().put("sessionName", testClassInstance.getClass().toString()); + config.getGridProperties().put("sessionName", testClassInstance instanceof String ? testClassInstance : testClassInstance.getClass().toString()); config.getGridProperties().put("buildName", "Test Automation"); config.getGridProperties().put("buildIdentifier", buildId); if (testEnvironmentUrl.contains("browserstack")) diff --git a/src/main/java/com/xceptance/neodymium/common/browser/configuration/TestEnvironment.java b/src/main/java/com/xceptance/neodymium/common/browser/configuration/TestEnvironment.java index fb714757..ac12b7b5 100644 --- a/src/main/java/com/xceptance/neodymium/common/browser/configuration/TestEnvironment.java +++ b/src/main/java/com/xceptance/neodymium/common/browser/configuration/TestEnvironment.java @@ -28,7 +28,15 @@ protected TestEnvironment(Properties properties, String baseKey) { url = properties.getProperty(baseKey + ".url"); username = properties.getProperty(baseKey + ".username"); + if (StringUtils.isBlank(username)) + { + username = System.getenv("BROWSERSTACK_USERNAME"); + } password = properties.getProperty(baseKey + ".password"); + if (StringUtils.isBlank(password)) + { + password = System.getenv("BROWSERSTACK_PASSWORD"); + } optionsTag = properties.getProperty(baseKey + ".optionsTag"); useProxy = Boolean.valueOf(properties.getProperty(baseKey + ".proxy")); if (useProxy)