Sorry for late reply please find my total code
My java version 1.8 ( I am using android studio jdk)
appium version 1.6.5 (appium -v)
i am trying to click using
driver.findElement(By.id("com.appredeem.apptrailers:id/textview5")).click();
but it is not in mobile screen it is only visible once i scroll to bottom
the code
public class AppTrailersTest {
WebDriver driver;
long minute_delay = 60000 ;
AppiumServerJava appiumServerJava;
@Before
public void setUp() throws MalformedURLException {
appiumServerJava = new AppiumServerJava();
// start appium appiumServer
appiumServerJava.startServer();
// Created object of DesiredCapabilities class.
DesiredCapabilities capabilities = new DesiredCapabilities();
// Set android deviceName desired capability. Set your device name.
capabilities.setCapability("deviceName", "LC51GY642544");
// capabilities.setCapability("deviceName", "V20270160320032782");
// Set BROWSER_NAME desired capability. It's Android in our case here.
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android");
// Set android VERSION desired capability. Set your mobile device's OS version.
capabilities.setCapability(CapabilityType.VERSION, "4.4.2");
// Set android platformName desired capability. It's Android in our case here.
capabilities.setCapability("platformName", "Android");
// this willnot delet app data and app registration details
capabilities.setCapability("noReset", "true");
// set timeout to 5minutes
capabilities.setCapability("newCommandTimeout", 300);
// Set android appPackage desired capability. It is
// com.android.calculator2 for calculator application.
// Set your application's appPackage if you are using any other app.
// capabilities.setCapability("appPackage", "com.google.android.calculator");
capabilities.setCapability("appPackage", "com.appredeem.apptrailers");
// Set android appActivity desired capability. It is
// com.android.calculator2.Calculator for calculator application.
// Set your application's appPackage if you are using any other app.
// capabilities.setCapability("appActivity", "com.google.android.calculator.Calculator");
capabilities.setCapability("appActivity", "com.appredeem.apptrailers.AppTrailers");
// Created object of RemoteWebDriver will all set capabilities.
// Set appium server address and port number in URL string.
// It will launch calculator app in android device.
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(150, TimeUnit.SECONDS);
}
@Test
public void testFirstCalculator() {
driver.findElement(By.id("com.appredeem.apptrailers:id/textview5")).click();
driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS);
}
@After
public void End() {
// driver.manage().timeouts().wait(300,TimeUnit.SECONDS);
// driver.quit();
try {
Thread.sleep(minute_delay * 5);
}catch(Exception e) {
e.printStackTrace();
}
driver.quit();
appiumServerJava.stopServer();
}
}