如何与无法通过google-chrome-devtools中的css/xpath检查的元素进行交互 [英] How to interact with elements those cannot be inspected through css/xpath within google-chrome-devtools

查看:156
本文介绍了如何与无法通过google-chrome-devtools中的css/xpath检查的元素进行交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常遇到无法右键单击以检查其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:

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆