Como deslizar horizontalmente depois de localizar um elemento usando o Appium em um aplicativo Android?

Eu usei o seguinte código, mas não está funcionando:

int startX = driver.findElement(By.xpath("//*[@class='android.widget.FrameLayout' and @index='1']")).getLocation.getX();
int startY = driver.findElement(By.xpath("//*[@class='android.widget.FrameLayout' and @index='1']")).getLocation.getY();

e o erro que recebo é:

getLocation cannot be resolved or is not a field

questionAnswers(2)

yourAnswerToTheQuestion