简体   繁体   English

空手道 UI 自动化 - 如何关闭位置津贴 window (Chrome)

[英]Karate-UI Automation - How to close Location allowance window (Chrome)

I am using Karate-UI Automation Software.我正在使用 Karate-UI 自动化软件。 I run my test scenario under Chrome browser.我在 Chrome 浏览器下运行我的测试场景。 When I go to page where map is displayed (eg Mapbox) user is asked about Location allowance (screenshot) with buttons Allow and Deny.当我 go 到显示 map 的页面(例如 Mapbox)时,系统会使用允许和拒绝按钮询问用户位置许可(屏幕截图)。 Is there some easy trick to confirm/deny/close dialog in scenario step?在场景步骤中是否有一些简单的技巧来确认/拒绝/关闭对话框? - in feature file. - 在功能文件中。

location allowance位置津贴

Thank you for your advice.感谢您的意见。

Is this the Chrome dialog that does not impact the flow of the test but just stays there and is somewhat irritating ?这是不影响测试流程但只是停留在那里并且有点刺激的 Chrome 对话框吗? I'm sorry I haven't found a way to suppress that.对不起,我还没有找到抑制它的方法。 Would be great if someone can find a way, I have tried all the flags here, but none of them worked: https://peter.sh/experiments/chromium-command-line-switches/如果有人能找到方法就太好了,我在这里尝试了所有标志,但没有一个有效: https : //peter.sh/experiments/chromium-command-line-switches/

We are experimenting with Karate-Robot to be able to handle some of these use-cases, but this is still experimental.我们正在尝试使用Karate-Robot来处理其中一些用例,但这仍然是实验性的。 We need people to try and contribute fixes, if you use this - take 0.9.6.RC1 because 0.9.5 has some issues.我们需要人们尝试并提供修复,如果你使用它 - 使用 0.9.6.RC1,因为 0.9.5 有一些问题。

Finally if you are facing a problem with plain HTML, please follow this process so that we can try and figure a solution or enhance the Karate syntax if needed: https://github.com/intuit/karate/tree/develop/examples/ui-test最后,如果您遇到纯 HTML 的问题,请按照以下流程操作,以便我们可以尝试找出解决方案或在需要时增强空手道语法: https : //github.com/intuit/karate/tree/develop/examples/用户界面测试

It works perfectly if you use chromedriver.如果您使用 chromedriver,它会完美运行。 Refer below code snippet which currently I am using.请参考下面我目前正在使用的代码片段。

Background: 
* def session = { capabilities: { alwaysMatch: { browserName: 'chrome', 'goog:chromeOptions': { args: [ '--disable-geolocation', '--test-type' ] } } } }
* configure driver = { type: 'chromedriver', port: 9515, executable: '<Path to chromedriver>', webDriverSession: '#(session)'}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM