I'm testing a native Android app and need to click on a button that is off the bottom of the screen. I've seen tons of examples of this using Java and Javascript but I'm using Node.js and nothing seems to work. I'm pretty new to this stuff and have wasted far too much time on something so simple.
For example to click on an onscreen element this works:
it("Select Button Test",function(){
return driver
.setImplicitWaitTimeout(timeoutWait)
.elementByXPath('//android.widget.TextView[@text=\'My Button\']').click();
});
Also the full xpath works for onscreen elements - in this case:
var myButton ='//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.view.View[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.TableLayout[1]/android.widget.TableRow[10]');
it("Select Button Test",function(){
return driver
.setImplicitWaitTimeout(timeoutWait)
.elementByXPath(myButton).click();
});
I found the full xpath for this button by scrolling to it while the test was running and firing up the screen in appium inspector. I've tried various scroll, touch, and swipe methods from the webdriver docs but nothing is available so apparently I've wandered off the ponderosa...
So how can I access a button that is not on the screen?
I'm sure its some mundane detail. Thanks!