[Selenium] 在Chrome的开发者工具中验证检查XPath/CSS selectors
Evaluate and validate XPath/CSS selectors in Chrome Developer Tools
Method 1 : From Elements panel
Use the search function inside Elements panel to evaluate XPath/CSS selectors and highlight matching nodes in the DOM.
1.Press F12 to open up Chrome DevTools.
2.Elements panel should be opened by default.
3.Press Ctrl + F to enable DOM searching in the panel.
4.Type in XPath or CSS selectors to evaluate.
5.If there are matched elements, they will be highlighted in DOM. However, if there are matching strings inside DOM, they will be considered as valid results as well. For example, CSS selector header should match everything (inline CSS, scripts etc.) that contains the word header, instead of match only elements.
Method 2 : From Console panel
Execute tokens $x("some_xpath") or $$("css-selectors") in Console panel, which will both evaluate and validate.
1.Press F12 to open up Chrome DevTools.
2.Switch to Console panel.
3.Type in XPath like $x(".//header") to evaluate and validate.
4.Type in CSS selectors like $$("header") to evaluate and validate.
5.Check results returned from console execution
If elements are matched, they will be returned in a list. Otherwise an empty list [ ] is shown.
If the XPath or CSS selector is invalid, an exception will be shown in red text.
[Selenium] 在Chrome的开发者工具中验证检查XPath/CSS selectors的更多相关文章
- chrome谷歌开发者工具(hover时候的css样式怎么在浏览器调试)
很多小伙伴在开发的时候,大多是在用谷歌开发者工具调试代码(快捷键F12 或 Ctrl-Shift-i). 可能会经常遇到需要调试hover样式的时候,一般都是直接改代码,然后在页面上刷新查看效果. 其 ...
- 【译】在 Chrome 开发者工具中调试 node.js
原文链接 : Debugging Node.js in Chrome DevTools 原文作者 : MATT DESLAURIERS 译文出自 : 掘金翻译计划 译文链接 : https://git ...
- 在chrome开发者工具中观察函数调用栈、作用域链与闭包
在chrome开发者工具中观察函数调用栈.作用域链与闭包 在chrome的开发者工具中,通过断点调试,我们能够非常方便的一步一步的观察JavaScript的执行过程,直观感知函数调用栈,作用域链,变量 ...
- 在chrome开发者工具中观察函数调用栈、作用域链、闭包
在chrome的开发者工具中,通过断点调试,我们能够非常方便的一步一步的观察JavaScript的执行过程,直观感知函数调用栈,作用域链,变量对象,闭包,this等关键信息的变化.因此,断点调试对于快 ...
- 在 Chrome 开发者工具中调试 node.js
命令行工具 devtool ,它可以在 Chrome 的开发者工具中运行 Node.js 程序. 下面的记录显示了在一个 HTTP 服务器中设置断点的情况. 该工具基于 Electron 将 Node ...
- 前端基础进阶(六):在chrome开发者工具中观察函数调用栈、作用域链与闭包
在前端开发中,有一个非常重要的技能,叫做断点调试. 在chrome的开发者工具中,通过断点调试,我们能够非常方便的一步一步的观察JavaScript的执行过程,直观感知函数调用栈,作用域链,变量对象, ...
- 使用chrome开发者工具中的network面板测量网站网络性能
前面的话 Chrome 开发者工具是一套内置于Google Chrome中的Web开发和调试工具,可用来对网站进行迭代.调试和分析.使用 Network 面板测量网站网络性能.本文将详细介绍chrom ...
- chrome浏览器开发者工具F12中某网站的sources下的源码如何批量保存?
目录 chrome浏览器 开发者工具F12中某网站的sources下的源码如何批量保存 1. 常用保存Sources源码的两种方法 1.1单个文件 1.2 单个页面 2. 问题 3.解决方案 chro ...
- 谷歌Chrome浏览器开发者工具的基础功能
上一篇我们学习了谷歌Chrome浏览器开发者工具的基础功能,下面介绍的是Chrome开发工具中最有用的面板Sources.Sources面板几乎是最常用到的Chrome功能面板,也是解决一般问题的主要 ...
随机推荐
- 深入分析JavaWeb Item2 -- Tomcat服务器学习和使用
https://segmentfault.com/a/1190000004095363 一.Tomcat服务器端口的配置 Tomcat的所有配置都放在conf文件夹之中,里面的server.xml文件 ...
- marathon 测试
marathon 初步使用 关闭selinux setenforce 0 Marathon之应用篇 先来了解一下 Marathon 是怎么布署decker的 json shell.json { } ...
- IIS7.5 PHP环境HTTP经常500错误处理方法
IIS使用FastCGI方式配置PHP以后,在编写PHP程序时,经常会出现HTTP 500错误 HTTP 500(Internal Server Error):服务器尝试执行请求时遇到了意外情况.研究 ...
- 2.STM32启动文件
一.概念声明 中断向量:由硬件产生的中断标识码,一般用于存放中断服务程序的跳转指令.根据硬件产生的中断号查找中断向量表来确定对应的中断向量.CM3内核有15个异常 和240个中断源. 程序的内 ...
- Python——python读取xml实战,作业6(python programming)
cd_catalog.xml <?xml version="1.0" encoding="ISO-8859-1"?> <!-- Edited ...
- Sqluldr2 libclntsh.so报错处理
Sqluldr2 libclntsh.so报错处理 处理报错 [oracle@oracledg tmp]$ ./sqluldr2linux64.bin ./sqluldr2linux64.bin: e ...
- linux服务nfs与dhcp篇
nfs复习: 1.简介:用于liunx与linux之间的文件传输系统 2.下载nfs-utils和rpcbind 3.打开配置文件/etc/exports——文件名(目录名)共享给予的ip地址(rw) ...
- 200. Spring Boot JNDI:在Tomcat中怎么玩JNDI?
[视频&交流平台] àSpringBoot视频:http://t.cn/R3QepWG à SpringCloud视频:http://t.cn/R3QeRZc à Spring Boot源 ...
- win7+win10系统使用日常经验集锦
请保留此份 Cmd Markdown 的欢迎稿兼使用说明, 当然你也可以使用彩色字体. 或者使用小体字. 或者使用大体字. 如需撰写新稿件,点击顶部工具栏右侧的 新文稿 或者使用快捷键 Ctrl+Al ...
- 【学习】数据处理基础知识(汇总和计算描述统计)【pandas】
pd对象拥有一组常用的数学和统计方法.大部分都属于约简和汇总统计,用于从Series中单个值,如sum 和 mean 或从DF的行或列中提取一个Series. 1. 描述和汇总统计方法 #汇总和计算描 ...