send keys like TAB PageDown etc.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

send keys like TAB PageDown etc.

Illusion0Reality
I searched but did not see any thing relevant.
I saw that Selenium.Focus is only the available option to scroll to a particular element.

Is there any method, with webdriver, to send  keys like TAB PageDown etc,  please let me know.
Reply | Threaded
Open this post in threaded view
|

Re: send keys like TAB PageDown etc.

softwaretestingforum
Administrator
You could use sendKeys  method to send specific key strokes like -

driver.findElement("locator").sendKeys(Keys.Enter)

I used Enter, you could use any other key.
See this for more on Keys - http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/Keys.html
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: send keys like TAB PageDown etc.

Illusion0Reality
Thanks Tarun!
This is what I have been looking for.