-
Notifications
You must be signed in to change notification settings - Fork 0
/
basics.java
30 lines (21 loc) · 1015 Bytes
/
basics.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.net.MalformedURLException;
import java.util.concurrent.TimeUnit;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
public class basics extends base{
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
AndroidDriver<AndroidElement> driver=Capabilities();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
/*
*Xpath syntax
//tagName[@attribute='value']
*/
driver.findElementByXPath("//android.widget.TextView[@text='Preference']").click();
driver.findElementByXPath("//android.widget.TextView[@text='3. Preference dependencies']").click();
driver.findElementById("android:id/checkbox").click();
driver.findElementByXPath("(//android.widget.RelativeLayout)[2]").click();
driver.findElementByClassName("android.widget.EditText").sendKeys("hello");
driver.findElementsByClassName("android.widget.Button").get(1).click();
}
}