How to handle with "Enter" key?

192 views
Skip to first unread message

Sudhansu Sekhar panda

unread,
Jan 3, 2013, 1:18:23 AM1/3/13
to seleniu...@googlegroups.com
Hi All,

Can anyone please help me in the below scenario?

Scenario: There is a username field and a password field . The scenario is to hit on "Enter" key through selenium webdriver using java after providing values to the username and password fields. I am trying with the below code which is working fine for IE9 and Chrome but not working fine for Firefox browser for a particular applicatio(not for all the applications).

Code: Select all
 
driver.findElement(By.xpath(OR.getProperty("input_Login_password"))).sendKeys(Keys.ENTER);


But this code is not working for FF browser for xyz.com application but is applicable to all the applications

Is there any alternative way to handle with the Enter key for Firefox browser?

Please reply here if anyone having any solution for the above scenario.

Thanks
Sudhansu

Shaba K

unread,
Jan 3, 2013, 3:37:28 PM1/3/13
to seleniu...@googlegroups.com
Keyboard kb = ((RemoteWebDriver) driver).getKeyboard();
kb.pressKey(Keys.RETURN);


Cheers,
S

Sudhansu

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/jw8bICE9LN4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

tulsi.tester

unread,
Jan 4, 2013, 3:36:49 AM1/4/13
to seleniu...@googlegroups.com
Hi Sudhansu,

Can you try with sendKeys("\uE007")

Sudhansu Sekhar panda

unread,
Jan 4, 2013, 7:28:02 AM1/4/13
to seleniu...@googlegroups.com
Thanks a lot Shaba
The code that has given you is working fine.:)

Amit Sahoo

unread,
Jan 15, 2014, 9:30:06 AM1/15/14
to seleniu...@googlegroups.com
thnks Shaba.. this code run fine..
Reply all
Reply to author
Forward
0 new messages