Android smallest UI unit is View. However, in Appium, the unit is called element instead. We find element instead of View.
Before we take any action on the screen, we have to locate the element first.There are various way to findElement from your codes. But some of them don't work well, so I gather here what work as expected for me.
Most of them rely on Ui Automation framework. After that, we take action by using built-in methods of element. For example,
element.click() to click an element or element.getText() to get word from that element.
You should declare a field variable driver. As follows:
protected static AndroidDriver driver;