Selecting a UI element not on the screen of native android app using Appium, Selenium web driver, Node js, Mocha etc
<p>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. </p>

<p>For example to click on an onscreen element this works:</p>

<pre><code>    it("Select Button Test",function(){
                      return driver
                          .setImplicitWaitTimeout(timeoutWait)
                          .elementByXPath('//android.widget.TextView[@text=\'My Button\']').click();
                });
</code></pre>

<p>Also the full xpath works for onscreen elements - in this case: </p>

<pre><code>    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();
            });
</code></pre>

<p>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...</p>

<p>So how can I access a button that is not on the screen? </p>

<p>I'm sure its some mundane detail.  Thanks!</p>