selenium 对当前已经打开的窗口进行调试

要求selenium版本4.11.2

使用cmd进入chrome浏览器的路径执行如下命令,创建一个端口为9522的窗口

复制代码
chrome.exe --remote-debugging-port=9522 --user-data-dir="D:\selenium\AutomationProfile"

代码里面创建实例,调用driver即可

复制代码
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_experimental_option("debuggerAddress","127.0.0.1:9527")
driver = webdriver.Chrome(options=options)
相关推荐
我送炭你添花5 小时前
Pelco KBD300A 模拟器:04+1.Python 打包详解:历史、发展与多种方式对比
python·测试工具·运维开发
chuntian_tester7 小时前
Qwen通义千问大模型
测试工具·aigc
少云清8 小时前
【接口测试】3_Postman _Postman断言
测试工具·postman
我一定会有钱9 小时前
pytest基础
python·测试工具·测试用例·pytest
西游音月9 小时前
(6)pytest+Selenium自动化测试-测试用例编写
selenium·测试用例·pytest
Wpa.wk11 小时前
自动化测试 - 文件上传 和 弹窗处理
开发语言·javascript·自动化测试·经验分享·爬虫·python·selenium
少云清11 小时前
【接口测试】4_Postman _全局变量和环境变量
测试工具·postman
卓码软件测评12 小时前
CMA/CNAS软件测评机构:【Gatling数据库性能关联测试JDBC连接和SQL执行时间监控】
数据库·sql·测试工具·性能优化·测试用例
mike041214 小时前
Eclipse+maven+selenium自动化测试用例入门
selenium·eclipse·maven
2501_924064111 天前
2025年接口错误自动分析工具对比与性能测试平台选型指南
测试工具·性能优化·数据可视化