Skip to content

Commit a5c88d3

Browse files
committed
Fixing use of deprecated method
1 parent 4969102 commit a5c88d3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

java/client/test/org/openqa/selenium/UploadTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import static org.openqa.selenium.testing.Driver.CHROME;
2929
import static org.openqa.selenium.testing.Driver.HTMLUNIT;
3030
import static org.openqa.selenium.testing.Driver.IE;
31-
import static org.openqa.selenium.testing.Driver.MARIONETTE;
3231
import static org.openqa.selenium.testing.Driver.SAFARI;
3332
import static org.openqa.selenium.testing.TestUtilities.catchThrowable;
3433

@@ -63,7 +62,7 @@ public void setUp() throws Exception {
6362

6463
@SwitchToTopAfterTest
6564
@Test
66-
public void testFileUploading() throws Exception {
65+
public void testFileUploading() {
6766
assumeFalse(
6867
"This test as written assumes a file on local disk is accessible to the browser. "
6968
+ "That is not true for browsers on mobile platforms.",
@@ -85,7 +84,7 @@ public void testFileUploading() throws Exception {
8584
@Test
8685
@Ignore(IE)
8786
@Ignore(SAFARI)
88-
public void testCleanFileInput() throws Exception {
87+
public void testCleanFileInput() {
8988
driver.get(pages.uploadPage);
9089
WebElement element = driver.findElement(By.id("upload"));
9190
element.sendKeys(testFile.getAbsolutePath());
@@ -106,7 +105,7 @@ public void testClickFileInput() {
106105
}
107106

108107
@Test
109-
public void testUploadingWithHiddenFileInput() throws Exception {
108+
public void testUploadingWithHiddenFileInput() {
110109
driver.get(appServer.whereIs("upload_invisible.html"));
111110
driver.findElement(By.id("upload")).sendKeys(testFile.getAbsolutePath());
112111
driver.findElement(By.id("go")).click();
@@ -125,7 +124,7 @@ public void testUploadingWithHiddenFileInput() throws Exception {
125124
private File createTmpFile(String content) throws IOException {
126125
File f = File.createTempFile("webdriver", "tmp");
127126
f.deleteOnExit();
128-
Files.write(content, f, StandardCharsets.UTF_8);
127+
Files.asCharSink(f, StandardCharsets.UTF_8).write(content);
129128
return f;
130129
}
131130

0 commit comments

Comments
 (0)