如何处理没有任何元素的浏览器通知弹出窗口? [英] How to handle browser notification popup which is without any elements?
本文介绍了如何处理没有任何元素的浏览器通知弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何根据图像按确定
按钮。
我可以切换到这个窗口。但它没有加载,直到我点击确定,所以没有任何元素。
警报句柄也没有帮助。
Autoit也无法检测到此弹出消息。
禁用通知也无法提供帮助。
有什么想法吗?
添加两个screeshots。
How to press the OK
button as per the image.
I can switch to this window. but it is not loaded till i click ok, so there is no any elements.
Alert handle does't helped too.
Autoit cannot detect this pop up message too.
disable-notifications cant help too.
Any ideas?
Two screeshots is added.
Firefox快照:
Firefox snapshot:
Chrome快照:
p.companieGenreal.sActivities().click();
driver.switchTo().defaultContent();
String parent = driver.getWindowHandle();
p.companieGenreal.sAddNew().click();
p.companieGenreal.sAddJobOrder().click();
p.companieGenreal.sContract().click();
swithToChildWindow(parent);
driver.switchTo().alert().accept();
推荐答案
要将其视为提醒,请尝试以下方法:
To treat it as an alert try this:
Alert a = driver.switchTo().alert();
a.confirm();
如果可以使用Escape键关闭它,请像这样发送Escape keypress(或 ENTER 如果在按Enter键时关闭):
If it can be closed with Escape key, send Escape keypress like this (or ENTER if it closes when Enter is hit):
Actions action = new Actions(driver);
action.sendKeys(Keys.ESCAPE);
这篇关于如何处理没有任何元素的浏览器通知弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文