Reputation: 72
When I try to use text in XPath, I am getting the error
org.openqa.selenium.InvalidSelectorException: Argument was an invalid selector (e.g. XPath/CSS). (WARNING: The server did not provide any stacktrace information)"
This is the code that i am trying to find an element
driver.findElement(By.xpath("//android.widget.EditText[@text=‘Enter recipient. Editing.’]")).sendKeys("8659741253");
Upvotes: 1
Views: 873
Reputation: 193348
To send the text 8659741253
to the WebElement
you can use the following line of code :
driver.findElement(By.xpath("//android.widget.EditText[contains(normalize-space(),'Enter recipient. Editing.')]")).sendKeys("8659741253");
Upvotes: 2
Reputation: 2267
Problem is with the text editor. " ‘ " character is not the expected single quote . So use the normal " ' ". Hope this will work.
Upvotes: 3