diff --git a/src/main/java/io/appium/java_client/AppiumDriver.java b/src/main/java/io/appium/java_client/AppiumDriver.java index abfdf126f..6d57cadd2 100644 --- a/src/main/java/io/appium/java_client/AppiumDriver.java +++ b/src/main/java/io/appium/java_client/AppiumDriver.java @@ -58,7 +58,6 @@ public class AppiumDriver extends RemoteWebDriver implements ComparesImages, ExecutesDriverScript, LogsEvents, - CanSetElementValue, HasBrowserCheck, HasSettings { diff --git a/src/main/java/io/appium/java_client/CanSetElementValue.java b/src/main/java/io/appium/java_client/CanSetElementValue.java deleted file mode 100644 index 45a7916b3..000000000 --- a/src/main/java/io/appium/java_client/CanSetElementValue.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * See the NOTICE file distributed with this work for additional - * information regarding copyright ownership. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.appium.java_client; - -import com.google.common.collect.ImmutableMap; -import org.openqa.selenium.remote.RemoteWebElement; - -public interface CanSetElementValue extends ExecutesMethod { - /** - * Set a value to an element. - * - * @param webElement Web element instance. - * @param value Value to set. - */ - default void setElementValue(RemoteWebElement webElement, String value) { - this.execute(MobileCommand.SET_VALUE, ImmutableMap.of( - "id", webElement.getId(), - "value", value - )); - } -} diff --git a/src/test/java/io/appium/java_client/android/AndroidElementTest.java b/src/test/java/io/appium/java_client/android/AndroidElementTest.java index 9effaadbd..911dd8150 100644 --- a/src/test/java/io/appium/java_client/android/AndroidElementTest.java +++ b/src/test/java/io/appium/java_client/android/AndroidElementTest.java @@ -85,7 +85,7 @@ public class AndroidElementTest extends BaseAndroidTest { driver.startActivity(activity); WebElement editElement = driver .findElement(AppiumBy.androidUIAutomator("resourceId(\"io.appium.android.apis:id/edit\")")); - driver.setElementValue((RemoteWebElement) editElement, value); + editElement.sendKeys(value); assertEquals(value, editElement.getText()); } } diff --git a/src/test/java/io/appium/java_client/ios/IOSElementTest.java b/src/test/java/io/appium/java_client/ios/IOSElementTest.java index 1004dc1a0..ca57c4cb4 100644 --- a/src/test/java/io/appium/java_client/ios/IOSElementTest.java +++ b/src/test/java/io/appium/java_client/ios/IOSElementTest.java @@ -10,7 +10,6 @@ import org.junit.Test; import org.junit.runners.MethodSorters; import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.RemoteWebElement; import org.openqa.selenium.support.ui.WebDriverWait; import io.appium.java_client.AppiumBy; @@ -33,7 +32,7 @@ public void setValueTest() { WebElement slider = wait.until( driver1 -> driver1.findElement(AppiumBy.className("XCUIElementTypeSlider"))); - driver.setElementValue((RemoteWebElement) slider, "0%"); + slider.sendKeys("0%"); assertEquals("0%", slider.getAttribute("value")); } } diff --git a/src/test/java/io/appium/java_client/pagefactory_tests/XCUITModeTest.java b/src/test/java/io/appium/java_client/pagefactory_tests/XCUITModeTest.java index aa72d203e..b56f67859 100644 --- a/src/test/java/io/appium/java_client/pagefactory_tests/XCUITModeTest.java +++ b/src/test/java/io/appium/java_client/pagefactory_tests/XCUITModeTest.java @@ -36,7 +36,6 @@ import org.junit.Test; import org.junit.runners.MethodSorters; import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.RemoteWebElement; import org.openqa.selenium.support.PageFactory; import java.util.List; @@ -141,8 +140,8 @@ public class XCUITModeTest extends AppIOSTest { } @Test public void setValueTest() { - driver.setElementValue((RemoteWebElement) textField1, "2"); - driver.setElementValue((RemoteWebElement) textField2, "4"); + textField1.sendKeys("2"); + textField2.sendKeys("4"); driver.hideKeyboard(); computeButton.click(); assertEquals("6", answer.getText());