parent
ce9a6b53b7
commit
4776b5c90d
|
@ -4,9 +4,11 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.openqa.selenium.JavascriptExecutor;
|
||||
import org.openqa.selenium.OutputType;
|
||||
import org.openqa.selenium.TakesScreenshot;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.remote.Augmenter;
|
||||
|
||||
import luckyclient.publicclass.LogUtil;
|
||||
|
@ -48,4 +50,17 @@ public class BaseWebDrive {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 在自动化过程中加入点击显示效果
|
||||
* @param driver
|
||||
* @param element
|
||||
* @author Seagull
|
||||
* @date 2019年9月6日
|
||||
*/
|
||||
public static void highLightElement(WebDriver driver, WebElement element){
|
||||
JavascriptExecutor js = (JavascriptExecutor) driver;
|
||||
/*调用js将传入参数的页面元素对象的背景颜色和边框颜色分别设定为黄色和红色*/
|
||||
js.executeScript("arguments[0].setAttribute('style', arguments[1]);", element, "background: yellow; border:2px solid red;");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -140,6 +140,9 @@ public class WebCaseExecution extends TestCaseExecution {
|
|||
return "步骤执行失败:定位的元素不存在!";
|
||||
}
|
||||
|
||||
//点亮即将操作的元素
|
||||
BaseWebDrive.highLightElement(wd, we);
|
||||
|
||||
if (operation.contains("select")) {
|
||||
result = EncapsulateOperation.selectOperation(we, operation, operationValue);
|
||||
} else if (operation.contains("get")) {
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package luckyclient.dblog;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import luckyclient.publicclass.DbOperation;
|
||||
import luckyclient.publicclass.SysConfig;
|
||||
|
||||
/**
|
||||
* =================================================================
|
||||
* 这是一个受限制的自由软件!您不能在任何未经允许的前提下对程序代码进行修改和用于商业用途;也不允许对程序代码修改后以任何形式任何目的的再发布。
|
||||
|
@ -17,35 +12,10 @@ import luckyclient.publicclass.SysConfig;
|
|||
*
|
||||
*/
|
||||
public class DbLink {
|
||||
|
||||
/**
|
||||
* =================================================================
|
||||
* 这是一个受限制的自由软件!您不能在任何未经允许的前提下对程序代码进行修改和用于商业用途;也不允许对程序代码修改后以任何形式任何目的的再发布。
|
||||
* 此测试框架主要采用testlink做分层框架,负责数据驱动以及用例管理部分,有任何疑问欢迎联系作者讨论。
|
||||
* QQ:24163551 seagull1985
|
||||
* =================================================================
|
||||
* @ClassName: DbLogLink
|
||||
* @Description: 定义数据日志数据库链接地址
|
||||
* @author: seagull
|
||||
* @date 2015年4月20日 上午9:29:40
|
||||
*
|
||||
*/
|
||||
public static DbOperation dbLogLink(){
|
||||
Properties properties = SysConfig.getConfiguration();
|
||||
String urlBase = "jdbc:mysql://"+properties.getProperty("mysql.db.ip")+":"+properties.getProperty("mysql.db.port")
|
||||
+"/"+properties.getProperty("mysql.db.dbname")+"?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false";
|
||||
String userNameBase = properties.getProperty("mysql.db.username");
|
||||
String passwordBase = properties.getProperty("mysql.db.userpwd");
|
||||
return new DbOperation(urlBase, userNameBase, passwordBase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务执行类型: 0 任务调度模式 1 控制台模式
|
||||
*/
|
||||
public static int exetype;
|
||||
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
public static int exetype;
|
||||
|
||||
}
|
||||
|
|
|
@ -1406,16 +1406,13 @@ public class HttpClientHelper {
|
|||
if(1==responsecode){
|
||||
resultBuffer.append("RESPONSE_CODE:【"+con.getResponseCode()+"】 ");
|
||||
}
|
||||
if(null!=con.getHeaderField("Content-Length")){
|
||||
int contentLength = Integer.parseInt(con.getHeaderField("Content-Length"));
|
||||
if (contentLength > 0||"chunked".equals(con.getHeaderField("Transfer-Encoding"))) {
|
||||
br = new BufferedReader(new InputStreamReader(con.getInputStream(), charset));
|
||||
String temp;
|
||||
while ((temp = br.readLine()) != null) {
|
||||
resultBuffer.append(temp);
|
||||
}
|
||||
if (null != con.getHeaderField("Content-Length") || null != con.getHeaderField("Transfer-Encoding")) {
|
||||
br = new BufferedReader(new InputStreamReader(con.getInputStream(), charset));
|
||||
String temp;
|
||||
while ((temp = br.readLine()) != null) {
|
||||
resultBuffer.append(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.APP.error("使用HttpURLConnection发送delete请求出现异常,请检查!", e);
|
||||
throw new RuntimeException(e);
|
||||
|
|
Loading…
Reference in New Issue