org.apache.commons.lang3 的随机数生成
apache org.apache.commons.lang3 的随机数生成工具,方便使用。
String a12 = RandomStringUtils.random(4, "0123456789");//4位随机数
System.out.println("randome:"+a12);
apache org.apache.commons.lang3 的随机数生成工具,方便使用。
String a12 = RandomStringUtils.random(4, "0123456789");//4位随机数
System.out.println("randome:"+a12);
//vue 中setTimeOut用法
var $this = this;
setTimeout(function(){ $this.goEnd() }, 10);
goEnd:function(){
//jquery滚动到某一个div的底部
var mydiv = $("#devHomeDescDiv");
//mydiv.scrollTop(mydiv.prop("scrollHeight")); //work
mydiv.animate({ scrollTop: mydiv.prop("scrollHeight") }, 1000);
}
谷歌浏览器debugger,查看变量值,出现滚动条无法查看到具体的值
I had the same problem and found your post. I went as far as reinstalling Chrome, but to no avail. The solution for me was to change the zoom size of the developer tools window. This can be done using ctrl+/-. I guess I was at a smaller zoom size than was natural, and finding the original 100% zoom fixed this problem for me. 'Hope that helps!
使用快捷键对调试窗口的大小进行缩放即可。
public class JsonUtil {/**
* 将json转化成map
* @param jsonStr
* @return*/public static Map<String, Object>convertJsonStrToMap(String jsonStr){
Map<String, Object> map =JSON.parseObject(
jsonStr,new TypeReference<Map<String, Object>>(){} );returnmap;
}
}
String jsonData = "{id:100,list:[{a:1},{a:2}]";
Map<String, Object> map =JsonUtil.convertJsonStrToMap(jsonData);
System.out.println(map);
Integer id= MapUtils.getInteger(map, "id");
Object list= MapUtils.getObject(map, "list");
List<JSONObject> ll =(List)list;for(JSONObject s : ll) {
String eleVal= s.get("a").toString();
System.out.println(s+"---a的值是:"+eleVal);
}
//直接这样无法给input hidden赋值
// driver.findElement(By.id("image_default")).sendKeys("a1112.jpg");
String val = driver.findElement(By.id("image_default")).getAttribute("value");
JavascriptExecutor jse = (JavascriptExecutor)driver;
//这种方式可用直接给隐藏域赋值
String s1="document.getElementById('image_default').value='a22.jpg'";
jse.executeScript(s1);
如果还不行,jse.executeScript("document.getElementById('fs_img1').setAttribute('type', 'text');"); 先改变元素的类型到text再sendKeys就行了。
driver.findElement(By.id("fs_img1")).sendKeys("a.jpg");