Using these 2 statements in my java main function I can’t able to detect the EditText or the Button,
I know it can be done using the "By.name " at the place of “By.id” but I want to detect the views using those id value. I this case I visit the Inspector Window, but I found there, the “resource id” is missing.
I think this might be the case, that’s why the “By.id” notation in my script can’t detect the EditText and Button. I have attached the screen shot here.
what should I write in “+ your_text_variable +” ?
I’m not willing to use the “hint” or “text” property of any Android view. Because it will not work in any action bar icon.
In that case I can use driver.findElement(By.name(“User Full Name”));
But try to understand my problem, I can use only this text or hint in any EditText field or Button? what should I do if there is no any Text or Hint like Action Bar icons. example given below:
what should I write to identify this setting button ? here is no any text or hint.
Individual element of EditText will be identified by it’s “index” value or “content-desc” value. Prefered to set “content-desc” value because it’s unique identity will be in out hand. we can set this view property as title in app’s xml file. example:
android:title=“Settings”
For Button identification:
driver.findElement(By.xpath(“//android.widget.Button[@index=‘1’]”)).click();
You can use “content-desc” too at the place of index.
Here the 2nd line choose the option of index 1 of the list of drop-down values. index started from value 0. I choose the 2nd value of the list in this example.
I am trying with driver.findElement(By.xpath("//android.view.View[@bounds=’[0,72][1080,222]’]")).click();
but it is not working and I upload a screen shot. Could you please suggest me regarding the issue ?