设置请求时的重试规则 import requests from requests.adapters import HTTPAdapter s = requests.Session() a = HTTPAdapter(max_retries=3) b = HTTPAdapter(max_retries=3) #将重试规则挂载到http和https请求 s.mount('http://', a) s.mount('https://', b) 请求Url 上面设置完毕后,通过改Session的请求就可…
TestNg提供了失败重试接口IRetryAnalyzer,需要实现retry方法: package com.shunhe.testngprac.retry; import org.testng.IRetryAnalyzer; import org.testng.ITestResult; /** * 设置testng用例失败重试次数 * Created by shunhe on 2019/2/13. */ public class MyRetryAnalyzer implements IRetr…