Working on creating automated tests with selenium I expired problem when I try to locate text input by text inside it. I use Xpath and FirePath plugin for checking it's result.
My xpath is:
//input[@context='@name' and contains(@class, 'edit-string') and contains(@value, 'testSection')]
and it returns nothing, while when I remove last condition:
//input[@context='@name' and contains(@class, 'edit-string')]
i found required div.
As I undestand the problem is in that fact that value attribute doesn't contains typed text. Firebug console proves this theory(jQuery library present on the page):
>>>> $("input.edit-string")[0].getAttribute("value")
null
>>>> $("input.edit-string")[0].value
"testSection"
>>>> $("input.edit-string")[0].getAttribute("context")
"@name"
Any ideas how can I use typed text in xpath expression?
inputelement by text. What is your Selenium version (also, Selenium RC or Selenium 2?) and Firefox version? Could you post a whole code for us to see whether there is a problem in something else or not? Did you try Implicit/Explicit wait? - Petr Janeček(JavascriptExecutor)driver.executeScript('thetest()')- Petr Janeček