Discussion:
how to press Esc(Escape) key in selenium using webdriver.
Sudhansu Sekhar panda
2013-04-24 06:42:59 UTC
Permalink
Hi Kamal,

Please try with the below code.

Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);

Thanks,
Sudhansu
http://www.mindfiresolutions.com/
Hi all,
Can anyone tell me how to press Esc key in selenium using webdriver.
I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.
It would be very needful if i get reply..
Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/66hd1HQO318J.
For more options, visit https://groups.google.com/groups/opt_out.
Mani
2014-03-11 13:08:55 UTC
Permalink
Hi Kamal,

Facing the same problem. Iam using WebDriver. Can u pls tell how your
problem got resolved?

Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);
the above code is also not working on this.

Thanks,
Mani.
Hi all,
Can anyone tell me how to press Esc key in selenium using webdriver.
I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.
It would be very needful if i get reply..
Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/93a77bb9-e16e-4f75-bc96-00f7322f1a1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Susovan Dutta
2014-03-11 18:45:18 UTC
Permalink
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE).build.perform;
Post by Sudhansu Sekhar panda
Hi Kamal,
Facing the same problem. Iam using WebDriver. Can u pls tell how your
problem got resolved?
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);
the above code is also not working on this.
Thanks,
Mani.
Hi all,
Can anyone tell me how to press Esc key in selenium using webdriver.
I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.
It would be very needful if i get reply..
Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/92d65916-69ed-43e5-893c-98b625087da2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Shadaab
2014-03-12 04:44:08 UTC
Permalink
If you are using Java you can go with Robot Library.

Robot r = new Robot();
r.keyPress(KeyEvent.VK_ESCAPE);
r.keyRelease(KeyEvent.VK_ESCAPE);

Rgds
Shadaab
Post by Sudhansu Sekhar panda
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE).build.perform;
Post by Sudhansu Sekhar panda
Hi Kamal,
Facing the same problem. Iam using WebDriver. Can u pls tell how your
problem got resolved?
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);
the above code is also not working on this.
Thanks,
Mani.
Hi all,
Can anyone tell me how to press Esc key in selenium using webdriver.
I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.
It would be very needful if i get reply..
Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/92d65916-69ed-43e5-893c-98b625087da2%40googlegroups.com<https://groups.google.com/d/msgid/selenium-users/92d65916-69ed-43e5-893c-98b625087da2%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAN-bRy6%2BWTU3esqrzEj%3DzGpSwDqu%3Dxftw2OYW%3DJ796mPW5mzEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Ripon Al Wasim
2014-03-12 06:51:14 UTC
Permalink
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE).build().perform();
Post by Shadaab
If you are using Java you can go with Robot Library.
Robot r = new Robot();
r.keyPress(KeyEvent.VK_ESCAPE);
r.keyRelease(KeyEvent.VK_ESCAPE);
Rgds
Shadaab
Post by Sudhansu Sekhar panda
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE).build.perform;
Post by Sudhansu Sekhar panda
Hi Kamal,
Facing the same problem. Iam using WebDriver. Can u pls tell how your
problem got resolved?
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);
the above code is also not working on this.
Thanks,
Mani.
Hi all,
Can anyone tell me how to press Esc key in selenium using webdriver.
I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.
It would be very needful if i get reply..
Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/92d65916-69ed-43e5-893c-98b625087da2%40googlegroups.com<https://groups.google.com/d/msgid/selenium-users/92d65916-69ed-43e5-893c-98b625087da2%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/CAN-bRy6%2BWTU3esqrzEj%3DzGpSwDqu%3Dxftw2OYW%3DJ796mPW5mzEg%40mail.gmail.com<https://groups.google.com/d/msgid/selenium-users/CAN-bRy6%2BWTU3esqrzEj%3DzGpSwDqu%3Dxftw2OYW%3DJ796mPW5mzEg%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CADrmqWXjmbW-yrNJsHjaeASfBoUCA%3Da7tmD-SaLsri03SdOSyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Sarla Kumari
2017-05-22 09:51:21 UTC
Permalink
It worked for me. Thanks
Post by Sudhansu Sekhar panda
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE).build().perform();
Post by Shadaab
If you are using Java you can go with Robot Library.
Robot r = new Robot();
r.keyPress(KeyEvent.VK_ESCAPE);
r.keyRelease(KeyEvent.VK_ESCAPE);
Rgds
Shadaab
Post by Sudhansu Sekhar panda
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE).build.perform;
Post by Sudhansu Sekhar panda
Hi Kamal,
Facing the same problem. Iam using WebDriver. Can u pls tell how your
problem got resolved?
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);
the above code is also not working on this.
Thanks,
Mani.
Hi all,
Can anyone tell me how to press Esc key in selenium using webdriver.
I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.
It would be very needful if i get reply..
Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google
Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send
<javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/92d65916-69ed-43e5-893c-98b625087da2%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/92d65916-69ed-43e5-893c-98b625087da2%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/CAN-bRy6%2BWTU3esqrzEj%3DzGpSwDqu%3Dxftw2OYW%3DJ796mPW5mzEg%40mail.gmail.com
<https://groups.google.com/d/msgid/selenium-users/CAN-bRy6%2BWTU3esqrzEj%3DzGpSwDqu%3Dxftw2OYW%3DJ796mPW5mzEg%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a7040d4f-31fd-4b30-8a72-72fd4f6e5322%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Denis Platonov
2016-04-08 23:56:40 UTC
Permalink
It won't work if you're using RemoteDriver (i.e. Sauce labs or Selenium
Grid)
Post by Shadaab
If you are using Java you can go with Robot Library.
Robot r = new Robot();
r.keyPress(KeyEvent.VK_ESCAPE);
r.keyRelease(KeyEvent.VK_ESCAPE);
Rgds
Shadaab
Post by Sudhansu Sekhar panda
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE).build.perform;
Post by Sudhansu Sekhar panda
Hi Kamal,
Facing the same problem. Iam using WebDriver. Can u pls tell how your
problem got resolved?
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);
the above code is also not working on this.
Thanks,
Mani.
Hi all,
Can anyone tell me how to press Esc key in selenium using webdriver.
I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.
It would be very needful if i get reply..
Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/92d65916-69ed-43e5-893c-98b625087da2%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/92d65916-69ed-43e5-893c-98b625087da2%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c1433758-70fa-4239-8b94-235d7a1b8c3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
G S
2018-07-10 13:48:16 UTC
Permalink
Thanks Susovan, that worked for me. :-)
Post by Sudhansu Sekhar panda
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE).build.perform;
Post by Sudhansu Sekhar panda
Hi Kamal,
Facing the same problem. Iam using WebDriver. Can u pls tell how your
problem got resolved?
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);
the above code is also not working on this.
Thanks,
Mani.
Hi all,
Can anyone tell me how to press Esc key in selenium using webdriver.
I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.
It would be very needful if i get reply..
Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/b9ae0a43-8c85-4630-bb4f-0a984809beb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
DongXiang
2014-03-13 09:34:46 UTC
Permalink
you can use robot to perform clicking "ESC" button. It will actually click "ESC" like manually do it.

Date: Tue, 11 Mar 2014 06:08:55 -0700
From: vinnu.strawberry-***@public.gmane.org
To: selenium-users-/***@public.gmane.org
CC: kannan.kamal87-***@public.gmane.org
Subject: [selenium-users] Re: how to press Esc(Escape) key in selenium using webdriver.

Hi Kamal,

Facing the same problem. Iam using WebDriver. Can u pls tell how your problem got resolved?

Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);
the above code is also not working on this.

Thanks,
Mani.

On Thursday, February 9, 2012 11:13:21 PM UTC+5:30, kamal wrote:
Hi all,

Can anyone tell me how to press Esc key in selenium using webdriver.

I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.

It would be very needful if i get reply..


Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org

To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/93a77bb9-e16e-4f75-bc96-00f7322f1a1e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/BLU174-W13E357F9203EA1223CD9AF90710%40phx.gbl.
For more options, visit https://groups.google.com/d/optout.
Rejeesh Gopalakrishnan
2014-04-23 16:06:39 UTC
Permalink
It worked exactly.

Thanks,
Rejeesh.
Alert a = driver.switchTo().alert();
a.confirm(); // or dismiss() if you want to hit 'cancel'
May be you are right Luke Inmam.....
But In My case i am getting an
"org.openqa.selenium.UnhandledAlertException: Modal dialog present
This box is containing an "Ok" button . I have to click on this "ok"
button to get back to my parent window.
This pop up goes away only by clicking "ok" button or by pressing "enter"
or "Escape" key from keyboard.
When I try to Right Click on this "ok" no options are displayed to get
its Xpath, CSS, Id etc. So there is not way to get the location of "Ok"
button.
this pop can be gone by clciking "Enter" key or "ESC" from keyboard.
So In element.sendKeys(Keys.ESCAPE)
there is not way to get the Location of Webelement.
Can it done by just clicking the "Esc" key from keyboard
element.sendKeys(Keys.ESCAPE)
Hi all,
Can anyone tell me how to press Esc key in selenium using webdriver.
I have used selenium.Keypressnative("27"), it works fine in selenium 1
but not in webdriver. i am using Webdriverbackedselenium in my code.
But still it is not working.
It would be very needful if i get reply..
Thanks in advance,
Kamal...
--
You received this message because you are subscribed to the Google
Groups "Selenium Users" group.
.
googlegroups.com <javascript:>.
For more options, visit this group at http://groups.google.com/
group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/selenium-users/-/Ec95H3yq34oJ.
.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/4a815a22-ec4d-45a9-afe4-8efbfb0ff352%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...