Skip to content

Commit

Permalink
Updated to Selenium 2.35
Browse files Browse the repository at this point in the history
  • Loading branch information
Ardesco committed Oct 5, 2013
1 parent e58dd73 commit f7d3369
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 25 deletions.
32 changes: 16 additions & 16 deletions RepositoryMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@
<root>
<windows>
<driver id="internetexplorer">
<version id="2.31.0">
<version id="2.35.3">
<bitrate sixtyfourbit="true">
<filelocation>https://selenium.googlecode.com/files/IEDriverServer_x64_2.31.0.zip</filelocation>
<hash>1125b9df018fc8ab90f16bd6e7e17a55a4d8e35f</hash>
<filelocation>https://selenium.googlecode.com/files/IEDriverServer_x64_2.35.3.zip</filelocation>
<hash>55bbd8f9034753a1cd2ca019b64692df835b56fb</hash>
<hashtype>sha1</hashtype>
</bitrate>
<bitrate thirtytwobit="true">
<filelocation>https://selenium.googlecode.com/files/IEDriverServer_Win32_2.31.0.zip</filelocation>
<hash>dc0da83a90dab23032bf7468be7c480e2f2776bb</hash>
<filelocation>https://selenium.googlecode.com/files/IEDriverServer_Win32_2.35.3.zip</filelocation>
<hash>38b48b706267cfb5d4c5694c64481d9deeff7076</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
</driver>
<driver id="googlechrome">
<version id="26">
<version id="2.4">
<bitrate thirtytwobit="true" sixtyfourbit="true">
<filelocation>http://chromedriver.googlecode.com/files/chromedriver_win_26.0.1383.0.zip</filelocation>
<hash>a75d5d197e66ec9eb21f146163050ccec92fcb60</hash>
<filelocation>http://chromedriver.storage.googleapis.com/2.4/chromedriver_win32.zip</filelocation>
<hash>79a1eb1320e25b3666adeab87dac5173216e9956</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
</driver>
</windows>
<linux>
<driver id="googlechrome">
<version id="26">
<version id="2.4">
<bitrate sixtyfourbit="true">
<filelocation>http://chromedriver.googlecode.com/files/chromedriver_linux64_26.0.1383.0.zip</filelocation>
<hash>715c7124427e52f4ae056dc71e6dd9c15802c462</hash>
<filelocation>http://chromedriver.storage.googleapis.com/2.4/chromedriver_linux64.zip</filelocation>
<hash>0bb42841124ee10ef83599c26f95843bb9ceb029</hash>
<hashtype>sha1</hashtype>
</bitrate>
<bitrate thirtytwobit="true">
<filelocation>http://chromedriver.googlecode.com/files/chromedriver_linux32_26.0.1383.0.zip</filelocation>
<hash>061bb440039e2a21a816c3d10c3dce3e8543a08a</hash>
<filelocation>http://chromedriver.storage.googleapis.com/2.4/chromedriver_linux32.zip</filelocation>
<hash>7b5336993c794b4ad40363290c5516eedaf80e07</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
</driver>
</linux>
<osx>
<driver id="googlechrome">
<version id="26">
<version id="2.4">
<bitrate thirtytwobit="true" sixtyfourbit="true">
<filelocation>http://chromedriver.googlecode.com/files/chromedriver_mac_26.0.1383.0.zip</filelocation>
<hash>5aec8bccdb601a5cc0a03ba5bfe32b4ac39399a1</hash>
<filelocation>http://chromedriver.storage.googleapis.com/2.4/chromedriver_mac32.zip</filelocation>
<hash>b78a808c083fe17215069c9d0ff0e6b6455d8964</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
Expand Down
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.30.0</version>
<version>2.35.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -72,8 +72,14 @@
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.0.1</version>
<version>1.0.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testng</groupId>
Expand Down
20 changes: 13 additions & 7 deletions src/test/java/com/lazerycode/selenium/SeleniumBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -53,6 +54,11 @@ public static void tearDown() {
}
}

@AfterMethod
public static void clearCookies() {
getDriver().manage().deleteAllCookies();
}

protected static WebDriver getDriver() {
return driverForThread.get();
}
Expand All @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f7d3369

Please sign in to comment.