Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key.ESCAPE is not working in karate UI script #1228

Closed
SalilGupta12 opened this issue Jul 27, 2020 · 5 comments
Closed

Key.ESCAPE is not working in karate UI script #1228

SalilGupta12 opened this issue Jul 27, 2020 · 5 comments
Labels

Comments

@SalilGupta12
Copy link

SalilGupta12 commented Jul 27, 2020

As per our discussion over this slackoverflow thread
I am unable to close the geo-location pop up using the escape key.

Issue:
On this website https://www.cure.fit/care/skinhair, on clicking the escape key the geo location pop up goes away and page is rendered perfectly fine.

I am trying to use the escape key to get rid of geo-location pop up.

Code link:
https://github.com/SalilGupta12/karate/blob/master/examples/ui-test/src/test/java/ui/escape.feature

Feature: Skincare Treatments

  Background:
    * configure driver = { type: 'chrome', showDriverLog: true }

  Scenario: Go to care.fit website and buy Skincare Treatments

    Given driver 'https://www.cure.fit/care/skinhair'
    * screenshot()
    * input('body', Key.TAB)
    * input('body', Key.ESCAPE)
@ptrthomas
Copy link
Member

@SalilGupta12 this has nothing to do with karate, see this: https://stackoverflow.com/q/34721359

I did try * configure driver = { type: 'chrome', addOptions: ['--disable-geolocation'] } - but it doesn't seem to work and I don't know why. see if this discussion gives you any tips: #1134 (comment)

@SalilGupta12
Copy link
Author

SalilGupta12 commented Jul 27, 2020

Thanks @ptrthomas, I saw that Key.TAB was working fine, so thought of giving Key.ESCAPE a try but somehow that doesn't work in this case.

@ptrthomas
Copy link
Member

for my future reference, I am told --incognito can help for this case

@iamkavinash
Copy link

@ptrthomas is there any way to add --incognito to docker karate-chrome?

@ptrthomas
Copy link
Member

@iamkavinash it will need a change to the docker container: https://github.com/intuit/karate/blob/master/karate-docker/karate-chrome/supervisord.conf

perhaps you can contribute an enhancement - which is to allow the user to pass an environment variable to add options. also it may be easy for you to create a custom image etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants