首页 > 其他分享 >playwright启动后报错net::ERR_CERT_COMMON_NAME_INVALID 解决方法

playwright启动后报错net::ERR_CERT_COMMON_NAME_INVALID 解决方法

时间:2024-08-13 16:31:34浏览次数:9  
标签:errors NAME ignore playwright 报错 https page

运行playwright测试用例报错:

1、如果是在跑测试的时候报错,在创建上下文时设置ignore_https_errors=True就可以了,如:

from idlelib import browser
from playwright.sync_api import Playwright

def getPage(playwright: Playwright):
    chromium = playwright.chromium  
    browser = chromium.launch(headless=False)
    page = browser.new_page(ignore_https_errors=True)     # 解决报错问题
    return page

def test_has_title(playwright: Playwright):
    page = getPage(playwright)
    page.goto("https://www.test.com")
    expect(page).to_have_title(re.compile("XXXX"))
    # other actions...
    browser.close()

2、如果是在录制脚本的时候报错,那就是在playwright codegen命令后添加–ignore-https-errors参数即可,如:

 playwright codegen --ignore-https-errors https://www.test.com/

 

标签:errors,NAME,ignore,playwright,报错,https,page
From: https://www.cnblogs.com/liyuanhong/p/18357202

相关文章

  • flannel容器启动失败,日志报错“Failed to find any valid interface to use: failed t
    现状k8s部署,flannel容器起不来,不断重启,查看日志报错"Failedtofindanyvalidinterfacetouse:failedtogetdefaultinterface:Unabletofinddefaultroute"排查过程根据报错提示,可能是网卡名称奇怪导致,或者没有默认路由查看默认路由很显然是有默认路由的查......
  • KVM修改网络产生报错
    事件描述:用户尝试使用virsh命令启动名为default的虚拟网络,但遇到了错误。错误信息表明default网络无法启动,因为没有.service文件提供org.fedoraproject.FirewallD1这个名称。报错过程及结果:首先编辑了default网络的XML配置文件:[root@localhost~]#virshnet-......
  • axios报错Module not found: Error: Package path ./lib/helpers/buildURL is not exp
    node12使用axios报错:Modulenotfound:Error:Packagepath./lib/helpers/buildURLisnotexportedfrompackageimportbuildURLfrom"axios/lib/helpers/buildURL";import{merge}from"axios/lib/utils";一、原因:对于importaxiosfrom‘./lib/......
  • 【nohup】【Linux】多个nohup同时跑报错
    多个nohup同时跑报错在使用Linux系统进行多任务处理时,nohup命令是一个非常有用的工具,它可以让命令在后台运行,即使终端关闭也不会影响到程序的执行,当尝试同时运行多个nohup命令时,可能会遇到一些错误,以下是对可能出现的问题的分析和解决方案。 需要了解nohup的工作原理。nohu......
  • Odoo search、name_search、search_count、search_read、read_group
    主要包括以下几个方法及主要用途:search():搜索视图中调用search_count():视图中计算记录数时调用name_search():many2one字段搜索时调用search_read():many2one点开搜索更多时调用read_group():搜索视图分组时调用search()search方法中包含有几个子方法 根据domian取查......
  • gorm插入报错Error 1292 (22007): Incorrect datetime value: ‘0000-00-00‘ for col
    在MySQL中,'0000-00-0000:00:00'不是一个合法的DATETIME值。从MySQL5.7.5开始,默认情况下不允许插入零日期或零时间值到DATETIME或TIMESTAMP列,除非明确允许。在gorm中,如果没有为DATETIME类型的字段提供具体的时间值,MySQL就会尝试插入默认值'0000-00-0000:00:00',从而导致这个错......
  • 【ZYNQ MPSoC开发】PL使用自定义IP后Vitis编译报错的解决方法
    问题发现:    在使用Alinx的AXU3EG开发板学习自定义IP时,发现PWM控制呼吸灯频率实验中,由于在PL端使用了自定义IP,Vitis编译PS端程序时会报错。问题所在:    这个问题并不是一个bug,而是官方希望使用者自行为自定义IP编写驱动和Makefile。虽然灵活性增加了,但同......
  • 报错解决
    报错解决文件错误建立文件时建错了,文件格式错误,粘贴完文件后报一堆错此时重新建立项目。项目启动失败./gradlewbuild在idea终端输入时报错Exceptioninthread"main"java.lang.RuntimeException:Timeoutof120000reachedwaitingforexclusiveaccesstofile:文......
  • 报错:2024-08-12T18:39:35.313+08:00 ERROR 29668 --- [demo2] [ main] o.s.
    org.springframework.beans.factory.BeanDefinitionStoreException:Failedtoparseconfigurationclass[com.example.demo.DemoApplication]atorg.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:179)~[spring-con......
  • 系统报错影响美观?gdiplus.dll修复教程,拯救小鸟壁纸加载
    系统报错,特别是gdiplus.dll文件丢失,确实会影响小鸟壁纸等软件的正常加载,进而影响桌面美观。为了解决这个问题,以下是一个详细的gdiplus.dll修复教程,旨在帮助您拯救小鸟壁纸的加载问题:一、了解gdiplus.dll文件gdiplus.dll是Windows系统中用于图形用户界面(GUI)渲染的重要组件,......