package te;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class lanuch {
AppiumDriver d;
@SuppressWarnings("rawtypes")
public void appLaunch() throws MalformedURLException {
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.BROWSER_NAME, "");
cap.setCapability("deviceName", "T5511");
cap.setCapability("platformName", "Android");
cap.setCapability(CapabilityType.VERSION, "6.0.1");
cap.setCapability("platformVersion", "7.1.2");
cap.setCapability("appPackage", "com.smartron.tband");
cap.setCapability("appActivity", "com.smartron.sid.ui.setupflow.SetupFlowWelcomeScreen");
d = new AndroidDriver(new URL("http://127.0.0.1:4710/wd/hub"), cap);
System.out.println("connected");
d.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
d.manage().window().getSize();
}
public void scroll() throws InterruptedException
{
Dimension dimensions = d.manage().window().getSize();
for(int i=1; i>4; i++)
{
Double screenHeightStart = dimensions.getHeight() * 0.5;
int scrollStart = screenHeightStart.intValue();
Double screenHeightEnd = dimensions.getHeight() * 0.2;
int scrollEnd = screenHeightEnd.intValue();
d.swipe(0, scrollStart, 0, scrollEnd, 2000);
}
}
public static void main(String args[]) throws MalformedURLException{
lanuch f=new lanuch();
f.appLaunch();
}
}
all code is correct d.swipe …unable to call the method