Hi Guys ,
Following is my appium spec for Android
Java-client 5.0.4
Appium 1.7.2
Maven
Im unable to scroll to the particular element and click on it, want to use generic way of getting the device size and dimension and scroll and not by cordinates have tried below url solutions but not working for me,please can anyone help me out its kinda urgent
For some reason i changed it it was able to scroll but not click on the element but now i am unable to scroll and click,please help
@FindBy(id=“com.licious:id/nav_view”)
public WebElement scrolltoAccount;
public void verticalScroll()
{
while(sidemenuobjects.scrolltoAccount.findElements(By.id("//android.widget.CheckedTextView[@text=‘My Account’]")).size()==0);
{
Dimension dimensions = getDriver().manage().window().getSize();
Double screenHeightStart = dimensions.getHeight() * 0.5;
int scrollStart = screenHeightStart.intValue();
Double screenHeightEnd = dimensions.getHeight() * 0.2;
int scrollEnd = screenHeightEnd.intValue();
new TouchAction(getDriver()).press(0, scrollStart).waitAction()
.moveTo(0, scrollEnd).release().perform();
}
if(getDriver().findElements(By.id("//android.widget.CheckedTextView[@text='My Account']")).size()>0)
{
getDriver().findElement(By.id("//android.widget.CheckedTextView[@text='My Account']")).click();
}
}
Please help with exact code to handle this situation,thanks again
if i have to horizontol scroll it how would i doit
created
Apr '18
last reply
Apr '18
- 6
replies
- 702
views
- 2
users
- 6
links