Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » My code runs in other ID but not in Eclipse
My code runs in other ID but not in Eclipse [message #1855777] Wed, 02 November 2022 15:48 Go to next message
test estt is currently offline test esttFriend
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

Re: My code runs in other ID but not in Eclipse [message #1855782 is a reply to message #1855777] Thu, 03 November 2022 06:54 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33224
Registered: July 2009
Senior Member
You provide little information about what you've done and what's failing. What have you done to set up the project's build path so that the libraries can be found? What does "work well" versus not "work well" mean exactly?

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Issue with org.eclipse.jetty.security.jaspi/9.4.46.v20220331
Next Topic:Marketplace installed but not available
Goto Forum:
  


Current Time: Sun Oct 06 16:59:40 GMT 2024

Powered by FUDForum. Page generated in 0.07924 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top