0

I want to input username. I have tried to find element as below using UIatomator but it throwing error.

 Input Text     xpath("//android.widget.EditText[@resourse-id='name']")    test

I have attached screenshot for reference please help..please suggest

2 Answers2

1

You are using the wrong syntax for xpath. The syntax is:

Input Text    xpath=//android.widget.EditText[@resource-id='name']

The format is described in the Selenium2Library documentation, under the section "Locating or Specifying Elements"

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • This are the output after correcting syntax Starting test: Test.TC1 20170512 21:38:26.196 : INFO : Typing text 'test' into text field 'xpath=//android.widget.EditText[@resource-id='name']' 20170512 21:38:28.864 : INFO : 20170512 21:38:28.866 : FAIL : ValueError: Element locator 'xpath=//android.widget.EditText[@resource-id='name']' did not match any elements. Ending test: Test.TC1 – Shivaji Ghadge May 12 '17 at 17:14
0

Try like this:

xpath = "//*[@resource-id='name']/android.widget.EditText"

I believe it solves your problem.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77