-2

Here is xpath of create account button:

//android.view.ViewGroup[@content-desc="ScreenLogin"]/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[5]/android.widget.TextView

And I want to set action that click on create account button.

frianH
  • 7,295
  • 6
  • 20
  • 45
sid
  • 1
  • This happen in react-native application – sid Oct 22 '19 at 10:40
  • The question is not clear . Please state what you have done , the screen shot of xml what is your main objective as "click on create account button" is not clear. The guidelines are in https://stackoverflow.com/help/how-to-ask – john Oct 22 '19 at 12:38

1 Answers1

0
androidDriver.findElementByXPath("//android.view.ViewGroup[@content-desc="ScreenLogin"]/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[5]").click();

Note: you can't click() on TextView widget element, you will get an exception by appium. I believe you could shorten this xpath removing unnecessary tree elements.

Vault23
  • 743
  • 1
  • 5
  • 19