Skip to content

Commit

Permalink
Fixing use of deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Feb 2, 2018
1 parent 4969102 commit a5c88d3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions java/client/test/org/openqa/selenium/UploadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import static org.openqa.selenium.testing.Driver.CHROME;
import static org.openqa.selenium.testing.Driver.HTMLUNIT;
import static org.openqa.selenium.testing.Driver.IE;
import static org.openqa.selenium.testing.Driver.MARIONETTE;
import static org.openqa.selenium.testing.Driver.SAFARI;
import static org.openqa.selenium.testing.TestUtilities.catchThrowable;

Expand Down Expand Up @@ -63,7 +62,7 @@ public void setUp() throws Exception {

@SwitchToTopAfterTest
@Test
public void testFileUploading() throws Exception {
public void testFileUploading() {
assumeFalse(
"This test as written assumes a file on local disk is accessible to the browser. "
+ "That is not true for browsers on mobile platforms.",
Expand All @@ -85,7 +84,7 @@ public void testFileUploading() throws Exception {
@Test
@Ignore(IE)
@Ignore(SAFARI)
public void testCleanFileInput() throws Exception {
public void testCleanFileInput() {
driver.get(pages.uploadPage);
WebElement element = driver.findElement(By.id("upload"));
element.sendKeys(testFile.getAbsolutePath());
Expand All @@ -106,7 +105,7 @@ public void testClickFileInput() {
}

@Test
public void testUploadingWithHiddenFileInput() throws Exception {
public void testUploadingWithHiddenFileInput() {
driver.get(appServer.whereIs("upload_invisible.html"));
driver.findElement(By.id("upload")).sendKeys(testFile.getAbsolutePath());
driver.findElement(By.id("go")).click();
Expand All @@ -125,7 +124,7 @@ public void testUploadingWithHiddenFileInput() throws Exception {
private File createTmpFile(String content) throws IOException {
File f = File.createTempFile("webdriver", "tmp");
f.deleteOnExit();
Files.write(content, f, StandardCharsets.UTF_8);
Files.asCharSink(f, StandardCharsets.UTF_8).write(content);
return f;
}

Expand Down

0 comments on commit a5c88d3

Please sign in to comment.