diff --git a/src/test/java/com/browserstack/BrowserStackTest.java b/src/test/java/com/browserstack/BrowserStackTest.java index 9e8a1f9..4ec1a5b 100644 --- a/src/test/java/com/browserstack/BrowserStackTest.java +++ b/src/test/java/com/browserstack/BrowserStackTest.java @@ -14,6 +14,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.AfterMethod; +import com.codeborne.selenide.Configuration; import com.codeborne.selenide.WebDriverRunner; import org.yaml.snakeyaml.Yaml; @@ -33,13 +34,13 @@ public BrowserStackTest() { @BeforeMethod(alwaysRun = true) public void setUp() throws Exception { - MutableCapabilities capabilities = new MutableCapabilities(); HashMap bstackOptions = new HashMap<>(); bstackOptions.put("source", "selenide:sample-master:v1.2"); - capabilities.setCapability("bstack:options", bstackOptions); - driver = new RemoteWebDriver(new URL(String.format("https://%s:%s@hub-cloud.browserstack.com/wd/hub", userName, accessKey)), capabilities); - driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); - WebDriverRunner.setWebDriver(driver); + bstackOptions.put("userName", userName); + bstackOptions.put("accessKey", accessKey); + Configuration.timeout = 10000; + Configuration.remote = "https://hub-cloud.browserstack.com/wd/hub"; + Configuration.browserCapabilities.setCapability("bstack:options", bstackOptions); } @AfterMethod(alwaysRun = true)