2
votes

I have a textfield in my application , it gets enabled when i click on it. I am able to do click using CSS but i am unable to enter text when it got highlighted.

I tried using xpath to idenfify the dynamicly but webdriver is throwing an error

"Unable to locate element: {"method":"xpath","selector":"//input[@class='x-form-field x-form-text']"}![enter image description here][1]

showed the difference before n after clicking on the field in thescreen shot.

Please help in how to dynamically identify and enter the text in that field

2
have u solved it out? - gumuruh

2 Answers

1
votes

try the following:

 String cssSelector = "[class='x-form-field x-form-text']"
//but verify found css selector in firepath, firebug addon in ffox to make sure selenium //locate web element for input properly.
 driver.findElement(By.cssSelector(cssSelector)).clear();
 driver.findElement(By.cssSelector(cssSelector)).sendKeys("blablabla");

Hope this works for you

0
votes

Try this code:

String cssSelector = ".x-form-field x-form-text"
driver.findElement(By.cssSelector(cssSelector)).clear();
driver.findElement(By.cssSelector(cssSelector)).sendKeys("blablabla");

Let me know is the above scripting is working or not.