如何验证 xpath是否正确

定位网页,F12,进入控制台,输入验证xpath

$x('xpath')

如果定位元素为空

如果表达式输入错误,比如英文的单引号'',写成了中文的单引号'' ,会报错

Uncaught SyntaxError: Invalid or unexpected token

相关推荐
2601_962295332 天前
如何python实现网页的自动化
python·selenium·beautifulsoup·requests·网页自动化
程序员小远2 天前
自动化测试用例编写实例详解
自动化测试·软件测试·python·selenium·测试工具·职场和发展·测试用例
2601_962298273 天前
Python与Selenium结合的Web自动化测试全流程实践教程
自动化测试·python·selenium·web测试·pageobjectmodel
2601_962298273 天前
【自动化测试】基于Selenium + Python的web自动化框架
自动化测试·python·selenium·测试用例·web框架
2601_962295584 天前
python+selenium实现自动化测试
自动化测试·python·selenium·学习心得·web端测试
B2_Proxy5 天前
Selenium配置代理IP的完整指南:从启动参数到认证扩展
selenium·测试工具
weixin_440730505 天前
Playwright介绍、特点、小例子还有与传统selenium的区别
selenium·测试工具·playwright
2601_962387827 天前
web自动化测试实战教程【selenium/unittest/pytest】【共193课
selenium·pytest·devops·web自动化测试·unittest
2601_962297257 天前
Python、Pytest、Allure、Selenium和Jenkins实现自动化测试集成实例
python·selenium·jenkins·pytest·allure