5

I tried using Find element by id but it is not inserting required data. Then I used Find element by xpath //android.widget.ScrollView[0]/android.widget.RelativeLayout[0]/android.widget.TextView[0]/ndroid.widget.TextView[1]/android.widget.EditText[2]")).sendKeys("Check@localmail.com");

but still it is not working.enter image description here

Kaivalya
  • 121
  • 1
  • 2
  • 8

5 Answers5

13

Please use this Xpath , I hope this solves your problem:

By.xpath("//android.widget.EditText[@text='Email ID']")
Abhishek Swain
  • 1,054
  • 8
  • 28
  • would you be kind enough to help me understand to get to a solution for this http://stackoverflow.com/questions/39484982/access-toggle-button-in-android-settings-using-appium-whlie-client-is-written-in – Pankaj Nimgade Sep 14 '16 at 07:52
4

A better way of doing this is as follows -

driver.findElement(By.xpath("//EditText[contains(@text,'Edit ID')]"));
user2220762
  • 565
  • 4
  • 16
0

u can do it in another way ,u know that there are 5 textfields , hence write the code as below.

driver.findelements(By.tagname("textfield")).get(0).sendkeys("abc@gmail.com"));

this means that you are trying to pass the abc@gmail.com value in the first text field "get(0)".

Vignesh
  • 165
  • 4
  • 15
  • and i guess you need to update your appium version to the latest one or try using uiautomator to inspect elements. – Vignesh May 23 '14 at 08:11
  • I tried but it is giving me invalid locator. Moreover I have 1.0.0.3 (orion) version and uiautomator shows "id" but when I use it in code, system(appium) does not insert email id. – Kaivalya May 23 '14 at 10:21
0

Find xpath of mobile app using contains

driver.findElement(By.xpath("//android.widget.TextView[contains(@text, 'Call')]")).isDisplayed())
Pang
  • 9,564
  • 146
  • 81
  • 122
Sarika
  • 1
0

By using the available properties - index and class name, you can try with the below xpath

//android.widget.EditText[@index='2']
alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46
Lishani
  • 41
  • 3