自动化框架相关代码
文章平均质量分 75
月之舞夜
这个作者很懒,什么都没留下…
展开
-
java正则表达式
public class CommonUtil { int[] num; //在source中查找start和end中间的字符串 public static String findMatchString(String source, String start, String end) { Pattern p = Pattern.compile(start + "(.*)" + end);原创 2017-04-07 16:35:22 · 233 阅读 · 0 评论 -
解决httpclient 4.5 https请求跳过证书验证
public class SslUtil { public static CloseableHttpClient SslHttpClientBuild() { Registry socketFactoryRegistry = RegistryBuilder.create().register("http", PlainConnectionSocketFactory.INSTANCE).r原创 2017-07-21 16:04:38 · 11793 阅读 · 2 评论 -
selenium连接浏览器 Chrome IE Firefox java
public class WebDriverUtil { private static Logger logger = Logger.getLogger(TestTemplate.class); protected static final int CHROME_DRIVER = 1; protected static final int FIREFOX_DRIVER = 2; prote原创 2017-07-18 18:21:30 · 456 阅读 · 0 评论 -
java连接ssh服务
public class Shell { private static Logger logger = Logger.getLogger(Shell.class); private String ip;//远程主机的IP地址 private String username;//远程主机的用户名 private String password;//远程主机的密码 private int p原创 2017-07-20 19:23:34 · 1614 阅读 · 0 评论 -
HttpClientUtil
public class HttpClientUtil { private static Logger logger= Logger.getLogger(HttpClientUtil.class); private CloseableHttpClient httpClient; private void init(){ httpClient= HttpCl原创 2017-07-05 17:27:30 · 378 阅读 · 0 评论 -
CommonUtils
public class CommonUtil { private static Logger logger=Logger.getLogger(CommonUtil.class); /** * 使用正则表达式获取数字 * @param start * @param end * @param source 匹配的源字符串 * @return */ public stat原创 2017-07-21 16:06:11 · 702 阅读 · 0 评论 -
HttpClientUtil2
package com.sun.utils; import com.sun.model.http.HttpRequest; import com.sun.model.http.HttpResponse; public HttpResponse doGet(HttpRequest httpRequest){ HttpGet httpGet=new HttpGet(http原创 2017-07-05 17:28:07 · 293 阅读 · 0 评论 -
读取excel2
/** * 是否有下一行 */ @Override public boolean hasNext() { if (this.rowNum == 0 || this.curRowNo >= this.rowNum) { book.close(); return false; } if (this.singleline > 0 && this.curRowNo > this.sing转载 2017-03-15 12:58:49 · 207 阅读 · 0 评论 -
读取excel
public ExcelProviderByEnv(Object aimob, String aimmathod, String envParameter) { // 读取文件 try { String excelNameString = aimob.getClass().toString().contains("java.lang.String") ? aimob.toString转载 2017-03-15 12:56:19 · 236 阅读 · 0 评论 -
读取excel 头
public class ExcelProviderByEnv implements Iterator { private final static Logger LOG4J_LOGGER = Logger.getLogger(ExcelProviderByEnv.class); private Workbook book = null; private Sheet shee转载 2017-03-15 12:57:45 · 591 阅读 · 0 评论 -
json转换为中文
public static String UnicodeDecode(String msg) { String str=null; try { str = new String(msg.getBytes("utf-8"), "utf-8"); } catch (Exception e) { e.printStackTrace(); } return str;原创 2017-02-27 14:02:06 · 3758 阅读 · 0 评论 -
testng+spring整合
package com.sun.base; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; @ContextConfiguration("classpath*原创 2017-03-31 18:02:43 · 937 阅读 · 0 评论 -
ReporterInfo
package com.sun.utils; import org.testng.Assert; public class ReporterInfo { public static void log(boolean condition){ Assert.assertTrue(condition); } public static void log(String message,b原创 2017-07-18 15:22:38 · 241 阅读 · 0 评论