如何与无法通过google-chrome-devtools中的css/xpath检查的元素进行交互 [英] How to interact with elements those cannot be inspected through css/xpath within google-chrome-devtools
问题描述
我经常遇到无法右键单击以检查其xpath或CSS的元素.
I often encounter elements which I cannot right click to inspect their xpath or css.
我想问一下还有哪些其他方式可以点击这些元素?
I want to ask what other ways exist to click on those elements ?
推荐答案
There are a lot of elements/controls which can't be located within the HTML DOM i.e. you can't right click on the element to inspect their xpath through google-chrome-devtools
. The three mostly encountered such elements/controls are as follows:
- 警告 :警报是通过 JavaScript 创建的,您无法在 DOM树.您可以在为什么切换到通过硒警报不稳定吗?
- 通知(密码记住/地理位置/麦克风/摄像头):
- Alert: Alerts are created through JavaScript and you can't find them within the DOM Tree. You can find a detailed discussion in Why switching to alert through selenium is not stable?
- Notifications (PasswordRemember/GeoLocation/Microphone/Camera):
在 DOM树中无法跟踪这些通知.在这里,您可以在
These notifications can't be tracked within the DOM Tree. Here you will find a relevant discussion on How to allow or deny notification geo-location microphone camera pop up
- 确定要退出此页面吗?弹出窗口:
- Are you sure you want to leave this page? popup:
该消息也不能位于 DOM树中.在这里您可以找到有关
This message as well can't be located within the DOM Tree. Here you will find a detailed discussion on How to handle below Internet Explorer popup "Are you sure you want to leave this page?" through Selenium
这篇关于如何与无法通过google-chrome-devtools中的css/xpath检查的元素进行交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!