Hello, good morning
Im trying to use driver.swipe but this line (import io.appium.java_client.SwipeElementDirection;
) in eclipse say : " The import io.appium.java_client.SwipeElementDirection cannot be resolved:"
and in the test code I write: driver.swipe(349, 867, 290, 303, 507); and say: The method swipe(int, int, int, int, int) is undefined for the type IOSDriver
What is happening? when I run the code in appium studio works well, but not in Eclipse
package tests;
//package ;
import io.appium.java_client.remote.IOSMobileCapabilityType;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.ios.IOSElement;
import io.appium.java_client.remote.MobileCapabilityType;
import io.appium.java_client.SwipeElementDirection;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.By;
import org.testng.annotations.*;
import java.net.URL;
import java.net.MalformedURLException;
import java.util.logging.Level;public class Untitled {
private String reportDirectory = âreportsâ;
private String reportFormat = âxmlâ;
private String testName = âUntitledâ;
protected IOSDriver driver = null;DesiredCapabilities dc = new DesiredCapabilities();
@BeforeMethod
public void setUp() throws MalformedURLException {
dc.setCapability(âreportDirectoryâ, reportDirectory);
dc.setCapability(âreportFormatâ, reportFormat);
dc.setCapability(âtestNameâ, testName);
dc.setCapability(MobileCapabilityType.UDID, âE4F6EDC4-E23C-42B3-987D-3DB282CA77C1â);
dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, âcom.test.beta.test.testappsâ);
driver = new IOSDriver<>(new URL(âhttp://localhost:4723/wd/hubâ), dc);
driver.setLogLevel(Level.INFO);
}@Test
public void testUntitled() {
driver.findElement(By.xpath(â//[@text=â3â]â)).click();
driver.findElement(By.xpath(â//[@accessibilityLabel=âcart_startShoppingButtonâ]â)).click();
driver.findElement(By.xpath(â//[@text=âTe llegarĂĄ entre el jueves 3 y el viernes 4 noviembreâ and ./parent::[@text=âshippingMethodCell_CurrentStoreâ]]â)).click();
driver.findElement(By.xpath(â//[@text=âSANT CUGATâ]â)).click();
driver.findElement(By.xpath(â//[@text=âPago con tarjetaâ]â)).click();
driver.findElement(By.xpath(â//[@accessibilityLabel=âpayment_cardNumberFieldâ]â)).sendKeys(â4111111111111111â);
driver.swipe(349, 867, 290, 303, 507);
driver.findElement(By.xpath(â//[@accessibilityLabel=âpayment_cvvFieldâ]â)).sendKeys(â123â);
}@AfterMethod
public void tearDown() {
driver.quit();
}
}