编写liteamall的编辑品牌商的用例,在进行数据清理时,加上删除操作就会报handshake failed; returned -1, SSL error code 1, net_error -101

如果不加数据清理的步骤,代码可以正常运行,附上po建模之前的原始代码,请老师帮忙看一下

    def test_modify_brand_company(self):
        # =======造数据======
        self.driver.find_element(By.XPATH, "//*[text()='商场管理']").click()
        self.driver.find_element(By.XPATH, "//*[text()='品牌制造商']").click()
        self.driver.find_element(By.XPATH, "//*[text()='添加']").click()
        self.driver.find_element(By.XPATH, "//form[@class='el-form el-form--label-left']/div[1]//input").send_keys(
            "haon商品测试modify")
        self.driver.find_element(By.CSS_SELECTOR, "[for='simpleDesc']+.el-form-item__content>div>input").send_keys(
            "haon宝宝最可爱modify")
        self.driver.find_element(By.XPATH, "//input[@name='file']").send_keys(
            "D:/projects/webdemo/test_litemall/pictures/haon.jpg")
        self.driver.find_element(By.CSS_SELECTOR, "[for='floorPrice']+.el-form-item__content>div>input").send_keys(
            "1000")
        self.driver.find_element(By.XPATH, "//*[text()='确定']").click()
        res1 = self.driver.find_elements(By.XPATH, "//*[text()='haon宝宝最可爱modify']")
        # 断言品牌新增后是否成功找到,如果找到,证明新增成功
        # 判断是否为空列表即可判断是否新增成功,如果不是空列表代表新增成功
        assert res1 != []
        # =====完成编辑操作=====
        #======使用显示等待优化
        # ele = WebDriverWait(self.driver,10).until(expected_conditions.element_to_be_clickable((By.XPATH, "//*[text()='haon商品测试modify']/../..//*[text()='编辑']")))
        # ele.click()
        #======显示等待优化方案2:自定义显示等待条件

        def click_exception(by,element,max_attempts=5):
            def _inner(driver):
                #多次点击按钮
                actul_attemps =0 #实际点击次数
                while actul_attemps < max_attempts:
                    #继续点击
                    actul_attemps += 1
                    try:
                        # 如果点击过程报错,则直接执行except逻辑并且继续循环
                        # 如果没有报错,则直接retrun 结束循环
                        driver.find_element(by,element).click()
                        return True
                    except Exception:
                        print("在点击动作时报错")
                #当实际点击次数大于最大点击次数时,结束循环并抛出异常
                raise Exception(f"超过了最大点击次数:{max_attempts}次")
            return _inner

        WebDriverWait(self.driver, 10).until(click_exception(By.XPATH, "//*[text()='haon商品测试modify']/../..//*[text()='编辑']"))
        # self.driver.find_element(By.XPATH, "//*[text()='haon商品测试modify']/../..//*[text()='编辑']").click()
        self.driver.find_element(By.XPATH, "//form[@class='el-form el-form--label-left']/div[1]//input").clear()
        self.driver.find_element(By.XPATH, "//form[@class='el-form el-form--label-left']/div[1]//input").send_keys(
            "haon商品测试修改后")
        self.driver.find_element(By.XPATH, "//*[text()='确定']").click()
        res = self.driver.find_elements(By.XPATH, "//*[text()='haon商品测试修改后']")
        logger.info(f"获取到的实际结果为{res}")
        WebDriverWait(self.driver, 10).until(click_exception(By.XPATH, "//*[text()='haon商品测试修改后']/../..//*[text()='删除']",7))
        assert res != []


用例运行到最后会一直卡在这个页面,然后报如下错误