|
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
10
|
10
|
import org.springframework.stereotype.Component;
|
11
|
11
|
|
12
|
12
|
import java.io.File;
|
|
13
|
+import java.util.concurrent.TimeUnit;
|
13
|
14
|
|
14
|
15
|
@Component
|
15
|
16
|
public class ScreenShotUtil {
|
|
@@ -37,7 +38,8 @@ public class ScreenShotUtil {
|
37
|
38
|
|
38
|
39
|
//访问网址
|
39
|
40
|
webDriver.get(url);
|
40
|
|
- Thread.sleep(config.getWait());
|
|
41
|
+// Thread.sleep(config.getWait());
|
|
42
|
+ webDriver.manage().timeouts().implicitlyWait(config.getWait(), TimeUnit.MILLISECONDS);
|
41
|
43
|
|
42
|
44
|
//截取全屏
|
43
|
45
|
File f = ((TakesScreenshot)webDriver).getScreenshotAs(OutputType.FILE);
|