Your Name 4 년 전
부모
커밋
5c5538b9ec
4개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. 1
    0
      debug.log
  2. 7
    0
      pom.xml
  3. 3
    1
      src/main/java/com/shigongli/common/ScreenShotUtil.java
  4. 1
    1
      src/main/java/com/shigongli/controller/TaHouseController.java

+ 1
- 0
debug.log 파일 보기

@@ -0,0 +1 @@
1
+[0104/224528.192:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)

+ 7
- 0
pom.xml 파일 보기

@@ -137,6 +137,13 @@
137 137
 			<artifactId>selenium-java</artifactId>
138 138
 			<version>3.4.0</version>
139 139
 		</dependency>
140
+
141
+		<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
142
+		<dependency>
143
+			<groupId>com.google.guava</groupId>
144
+			<artifactId>guava</artifactId>
145
+			<version>28.2-jre</version>
146
+		</dependency>
140 147
 	</dependencies>
141 148
 
142 149
 	<profiles>

+ 3
- 1
src/main/java/com/shigongli/common/ScreenShotUtil.java 파일 보기

@@ -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);

+ 1
- 1
src/main/java/com/shigongli/controller/TaHouseController.java 파일 보기

@@ -43,7 +43,7 @@ public class TaHouseController extends BaseController {
43 43
 
44 44
     private final Logger logger = LoggerFactory.getLogger(TaHouseController.class);
45 45
 
46
-    @Value("weather-shot.url")
46
+    @Value("${weather-shot.url}")
47 47
     String weatherURL;
48 48
 
49 49
     @Autowired