Simulating the ENTER key press

367 views
Skip to first unread message

circa.1741

unread,
Feb 4, 2014, 5:52:08 PM2/4/14
to co...@googlegroups.com
How do I press the ENTER key in Coypu?

Thanks

Adrian Longley

unread,
Feb 5, 2014, 3:26:59 AM2/5/14
to co...@googlegroups.com
You can use the constants in here:

    OpenQA.Selenium.Keys

Such as Keys.ENTER or Keys.RETURN. If you want RETURN you can just use "\n" in your string if you prefer.

You can pass these to FillIn as part of the value string:

    browserSession.FillIn("textarea").With("First line\nSecond line");

Or if the field is complete already and you just want to press enter in there without clearing the field you can use the SendKeys method:

    browserSession.FindField("pre-filled").SendKeys(Keys.RETURN);






On Tue, Feb 4, 2014 at 10:52 PM, circa.1741 <circa...@gmail.com> wrote:
How do I press the ENTER key in Coypu?

Thanks

--
You received this message because you are subscribed to the Google Groups "Coypu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coypu+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages