diff --git a/RepositoryMap.xml b/RepositoryMap.xml index da2b9203..01993883 100644 --- a/RepositoryMap.xml +++ b/RepositoryMap.xml @@ -2,24 +2,24 @@ - + - https://selenium.googlecode.com/files/IEDriverServer_x64_2.31.0.zip - 1125b9df018fc8ab90f16bd6e7e17a55a4d8e35f + https://selenium.googlecode.com/files/IEDriverServer_x64_2.35.3.zip + 55bbd8f9034753a1cd2ca019b64692df835b56fb sha1 - https://selenium.googlecode.com/files/IEDriverServer_Win32_2.31.0.zip - dc0da83a90dab23032bf7468be7c480e2f2776bb + https://selenium.googlecode.com/files/IEDriverServer_Win32_2.35.3.zip + 38b48b706267cfb5d4c5694c64481d9deeff7076 sha1 - + - http://chromedriver.googlecode.com/files/chromedriver_win_26.0.1383.0.zip - a75d5d197e66ec9eb21f146163050ccec92fcb60 + http://chromedriver.storage.googleapis.com/2.4/chromedriver_win32.zip + 79a1eb1320e25b3666adeab87dac5173216e9956 sha1 @@ -27,15 +27,15 @@ - + - http://chromedriver.googlecode.com/files/chromedriver_linux64_26.0.1383.0.zip - 715c7124427e52f4ae056dc71e6dd9c15802c462 + http://chromedriver.storage.googleapis.com/2.4/chromedriver_linux64.zip + 0bb42841124ee10ef83599c26f95843bb9ceb029 sha1 - http://chromedriver.googlecode.com/files/chromedriver_linux32_26.0.1383.0.zip - 061bb440039e2a21a816c3d10c3dce3e8543a08a + http://chromedriver.storage.googleapis.com/2.4/chromedriver_linux32.zip + 7b5336993c794b4ad40363290c5516eedaf80e07 sha1 @@ -43,10 +43,10 @@ - + - http://chromedriver.googlecode.com/files/chromedriver_mac_26.0.1383.0.zip - 5aec8bccdb601a5cc0a03ba5bfe32b4ac39399a1 + http://chromedriver.storage.googleapis.com/2.4/chromedriver_mac32.zip + b78a808c083fe17215069c9d0ff0e6b6455d8964 sha1 diff --git a/pom.xml b/pom.xml index ced8d9ff..9b1e2306 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ org.seleniumhq.selenium selenium-server - 2.30.0 + 2.35.0 test @@ -72,8 +72,14 @@ com.github.detro.ghostdriver phantomjsdriver - 1.0.1 + 1.0.4 test + + + org.seleniumhq.selenium + selenium-remote-driver + + org.testng diff --git a/src/test/java/com/lazerycode/selenium/SeleniumBase.java b/src/test/java/com/lazerycode/selenium/SeleniumBase.java index 026e6840..e6cf66a0 100644 --- a/src/test/java/com/lazerycode/selenium/SeleniumBase.java +++ b/src/test/java/com/lazerycode/selenium/SeleniumBase.java @@ -11,6 +11,7 @@ import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.safari.SafariDriver; +import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeSuite; @@ -53,6 +54,11 @@ public static void tearDown() { } } + @AfterMethod + public static void clearCookies() { + getDriver().manage().deleteAllCookies(); + } + protected static WebDriver getDriver() { return driverForThread.get(); } @@ -64,7 +70,7 @@ private static DesiredCapabilities generateDesiredCapabilities(BrowserType capab case IE: capabilities = DesiredCapabilities.internetExplorer(); capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true); - capabilities.setCapability(CapabilityType.ENABLE_PERSISTENT_HOVERING, true); + capabilities.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING, true); capabilities.setCapability("requireWindowFocus", true); break; case SAFARI: @@ -110,19 +116,19 @@ private static WebDriver loadWebDriver() { case CHROME: if (System.getProperties().getProperty("os.arch").toLowerCase().equals("x86_64") || System.getProperties().getProperty("os.arch").toLowerCase().equals("amd64")) { if (System.getProperties().getProperty("os.name").toLowerCase().contains("windows")) { - System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/windows/googlechrome/64bit/26/chromedriver.exe"); + System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/windows/googlechrome/64bit/2.4/chromedriver.exe"); } else if (System.getProperties().getProperty("os.name").toLowerCase().contains("mac")) { - System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/osx/googlechrome/64bit/26/chromedriver"); + System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/osx/googlechrome/64bit/2.4/chromedriver"); } else if (System.getProperties().getProperty("os.name").toLowerCase().contains("linux")) { - System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/linux/googlechrome/64bit/26/chromedriver"); + System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/linux/googlechrome/64bit/2.4/chromedriver"); } } else { if (System.getProperties().getProperty("os.name").toLowerCase().contains("windows")) { - System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/windows/googlechrome/32bit/26/chromedriver.exe"); + System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/windows/googlechrome/32bit/2.4/chromedriver.exe"); } else if (System.getProperties().getProperty("os.name").toLowerCase().contains("mac")) { - System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/osx/googlechrome/32bit/26/chromedriver"); + System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/osx/googlechrome/32bit/2.4/chromedriver"); } else if (System.getProperties().getProperty("os.name").toLowerCase().contains("linux")) { - System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/linux/googlechrome/32bit/26/chromedriver"); + System.setProperty("webdriver.chrome.driver", _prop.getString("binaryRootFolder") + "/linux/googlechrome/32bit/2.4/chromedriver"); } } break; diff --git a/src/test/java/com/lazerycode/selenium/Tests/Selenium2ExampleST.java b/src/test/java/com/lazerycode/selenium/Tests/Selenium2ExampleST.java index 44bb6928..f0c95e6e 100644 --- a/src/test/java/com/lazerycode/selenium/Tests/Selenium2ExampleST.java +++ b/src/test/java/com/lazerycode/selenium/Tests/Selenium2ExampleST.java @@ -29,6 +29,7 @@ public void googleCheeseExample() { WebElement element = driver.findElement(By.name("q")); // Enter something to search for + element.clear(); element.sendKeys("Cheese!"); // Now submit the form. WebDriver will find the form for us from the element @@ -65,6 +66,7 @@ public void googleMilkExample() { WebElement element = driver.findElement(By.name("q")); // Enter something to search for + element.clear(); element.sendKeys("Milk!"); // Now submit the form. WebDriver will find the form for us from the element