My code runs in other ID but not in Eclipse [message #1855777] |
Wed, 02 November 2022 15:48 |
test estt Messages: 1 Registered: November 2022 |
Junior Member |
|
|
Hello, good morning
Im working with Eclipse to automate some ios app test cases, my actual test is to learn to do a swipe
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();
}
}
Someone can help me to understand where is the problem and why in appium studio works and in Eclipse no?
[Updated on: Wed, 02 November 2022 16:35] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.08441 seconds