com.codeborne.selenide.appium.commands.AppiumSetValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selenide-appium Show documentation
Show all versions of selenide-appium Show documentation
Selenide adaptor for Appium framework
package com.codeborne.selenide.appium.commands;
import com.codeborne.selenide.commands.SetValue;
import com.codeborne.selenide.impl.WebElementSource;
import org.openqa.selenium.WebElement;
import static com.codeborne.selenide.appium.AppiumDriverUnwrapper.isMobile;
import static com.google.common.base.MoreObjects.firstNonNull;
import static java.util.Objects.requireNonNull;
public class AppiumSetValue extends SetValue {
AppiumSetValue() {
super(new AppiumClear());
}
@Override
protected void execute(WebElementSource locator, Object[] args) {
if (isMobile(locator.driver())) {
WebElement element = locator.findAndAssertElementIsInteractable();
CharSequence text = firstNonNull((CharSequence) requireNonNull(args)[0], "");
element.clear();
element.sendKeys(text);
}
else {
super.execute(locator, args);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy