!!

Welcome to Selenium Webdriver Forum

As a web user you can read and search through forum content. Once you have registered and signed you can post topics, post replies, set up watch lists, modify forum settings, and use private messaging.

Author Topic: sendKeys  (Read 2701 times)

Ir@

  • Web User
sendKeys
« on: March 28, 2012, 05:10:33 PM »
Hi Guys
 I have a question.
 
To test the software I have to fill a normal input field and than
 press Enter to confirm the input.
 Main.element.sendKeys(" test", Keys.ENTER); doesnt work.
 It fills the input with the " test"  and than comes the "Element
 cannot be interracted with" Exception.
 
Main.element=Main.driver.findElement(By.xpath("//div/blockquote/ul/li/
 table/tbody/tr/td/div/input"));
 Main.element.click();
 Main.element.clear();
 Main.element.sendKeys(" and some", Keys.ENTER);
 
What do I do wrong?
 
Thanks in advance

Simon Stewart

  • Web User
Re: sendKeys
« Reply #1 on: March 28, 2012, 05:10:48 PM »
Hi,
 Try Keys.RETURN, or using the "\n" escape for a newline. If that's
 still not behaving, it would be good to know which OS, browser and
 version your using :)
 
Regards,
 
Simon
 

- Show quoted text -

Ir@

  • Web User
Re: sendKeys
« Reply #2 on: March 28, 2012, 05:10:59 PM »
Thanks Simon, Keys.RETURN works.
 I use Mac OS and Firefox.
 
Have a great day or night :)
 
On 29 Jul., 16:13, Simon Stewart <simon.m.stew...@gmail.com> wrote:
 

- Show quoted text -

Selenium Webdriver

Re: sendKeys
« Reply #2 on: March 28, 2012, 05:10:59 PM »

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
1819 Views
Last post February 21, 2012, 02:08:20 PM
by Ana Stavreva
3 Replies
1525 Views
Last post February 21, 2012, 02:50:45 PM
by Ana Stavreva
1 Replies
1257 Views
Last post March 28, 2012, 04:04:03 PM
by Simon Stewart
3 Replies
1116 Views
Last post April 01, 2012, 09:18:10 PM
by bruce
2 Replies
1508 Views
Last post April 02, 2012, 10:45:27 PM
by Benjamin Hawkes-Lewis
2 Replies
1688 Views
Last post April 04, 2012, 07:43:36 PM
by bp
0 Replies
286 Views
Last post November 20, 2013, 07:51:31 PM
by Logith