Skip to content

Commit 313fe15

Browse files
author
ssmmhh99
committed
webdriver 연동 및 누적오류 알람 기능 추가
1 parent a876818 commit 313fe15

16 files changed

+2326
-193
lines changed

guitar/bin/GUITAR.au3

Lines changed: 200 additions & 42 deletions
Large diffs are not rendered by default.

guitar/bin/GUITARErrorReport.au3

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
#include ".\_include_nhn\_util.au3"
2+
#include <date.au3>
3+
#Include <Array.au3>
4+
5+
6+
;global $_sErrorSumarryFile = "D:\_Autoit\guitar\report\errorsummary2.txt"
7+
;global $sScriptName = "26_샘플서비스_SUS_IE_REAL"
8+
;local $a =_getErrorSumarry($sScriptName, "2,6")
9+
;local $b, $c
10+
;$c= _getErrorSumarryInfo("서버aa", $a,False,"http://", $b)
11+
;debug($c, $b)
12+
;deleteSuccessListFormErrorSumarry($sScriptName)
13+
14+
; 타입별로 메세지를 생성함
15+
func _getErrorSumarryInfo($sServerName, $aErrorInfo, $sDashBoardReport, byref $sEmailContents)
16+
17+
local $sRet
18+
19+
$sEmailContents = ""
20+
local $iCount = ubound($aErrorInfo) -1
21+
22+
if $iCount <= 0 then return ""
23+
24+
$sRet = "[GUITAR] 누적오류, " & $aErrorInfo[1][1]
25+
if $iCount > 1 then $sRet = $sRet & "" & $iCount-1 & ""
26+
$sRet = $sRet & " (@" & $sServerName & ")"
27+
28+
$sEmailContents = ""
29+
$sEmailContents = $sEmailContents & "서버 : " & $sServerName & @crlf
30+
$sEmailContents = $sEmailContents & "실행 스크립트 : " & $aErrorInfo[1][1] & @crlf
31+
$sEmailContents = $sEmailContents & "리포트 : " & $sDashBoardReport & @crlf
32+
$sEmailContents = $sEmailContents & @crlf
33+
$sEmailContents = $sEmailContents & "" & $iCount & "" & @crlf
34+
35+
for $i = 1 to ubound($aErrorInfo) -1
36+
$sEmailContents = $sEmailContents & "누적 " & $aErrorInfo[$i][0] & "회 (" & $aErrorInfo[$i][3] & @tab & $aErrorInfo[$i][4] & @tab & $aErrorInfo[$i][5] & ")" & @crlf
37+
next
38+
39+
return $sRet
40+
41+
endfunc
42+
43+
44+
; 특정 횟수 이상 오류가 발생된 경우 배열로 리턴하도록 함
45+
Func _getErrorSumarry($sCount, $sScriptName, $sTestTime)
46+
47+
; 26_샘플서비스_SUS_IE_REAL1,2014/07/17 17:34:15,샘플서비스_SUS_010,샘플SUS_TC002,8
48+
49+
local $aFile
50+
local $aNewList [1][10]
51+
local $aRetList
52+
local $i
53+
local $aLine
54+
local $iSearchIndex
55+
local $bFound
56+
local $aCount
57+
58+
59+
$aCount = StringSplit($sCount,",")
60+
$aRetList = $aNewList
61+
62+
_FileReadToArray ($_sErrorSumarryFile, $aFile,0)
63+
$aFile = _ArrayUnique($aFile,1)
64+
65+
for $i=0 to ubound($aFile) -1
66+
67+
$aLine = StringSplit($aFile[$i],",")
68+
$bFound = False
69+
70+
for $j= 1 to ubound($aNewList) -1
71+
; 실행된 스크립트 기준으로
72+
; 기존에 있을 경우 Count 만 추가
73+
74+
if $sScriptName = $aLine[1] then
75+
if $aLine[1] = $aNewList[$j][1] and $aLine[3] = $aNewList[$j][3] and $aLine[4] = $aNewList[$j][4] and $aLine[5] = $aNewList[$j][5] then
76+
$bFound = True
77+
$aNewList[$j][0] = $aNewList[$j][0] + 1
78+
if $sTestTime = $aLine[2] then $aNewList[$j][2] = $sTestTime
79+
exitloop
80+
endif
81+
endif
82+
next
83+
84+
; 신규 추가
85+
if $bFound = False then
86+
87+
$iSearchIndex = ubound($aNewList)
88+
redim $aNewList[$iSearchIndex + 1][ubound($aNewList,2)]
89+
90+
for $j=1 to ubound($aLine) -1
91+
$aNewList[$iSearchIndex][0] = 1
92+
$aNewList[$iSearchIndex][$j] = $aLine[$j]
93+
next
94+
95+
endif
96+
97+
next
98+
99+
100+
for $i=1 to ubound($aNewList) -1
101+
102+
for $j=1 to ubound($aCount) -1
103+
104+
if $aNewList[$i][0] = Number($aCount [$j]) and ($sTestTime = $aNewList[$i][2])then
105+
106+
$iSearchIndex = ubound($aRetList)
107+
redim $aRetList[$iSearchIndex + 1][ubound($aRetList,2)]
108+
109+
for $j=0 to ubound($aRetList,2) -1
110+
$aRetList[$iSearchIndex][$j] = $aNewList[$i][$j]
111+
next
112+
113+
endif
114+
next
115+
116+
next
117+
118+
119+
return $aRetList
120+
121+
EndFunc
122+
123+
124+
; 메인스크립트 명을 기준으로 해당 스크립트 로그 내용을 모두 삭제함
125+
func deleteSuccessListFormErrorSumarry($sScriptName)
126+
127+
local $aFile
128+
local $i
129+
130+
_FileReadToArray ($_sErrorSumarryFile, $aFile,0)
131+
132+
for $i=0 to ubound($aFile) -1
133+
134+
if StringInStr($aFile[$i], $sScriptName & ",") = 1 then
135+
$aFile[$i] = ""
136+
endif
137+
138+
next
139+
140+
$aFile = _ArrayUnique($aFile,1)
141+
;_msg($aFile)
142+
_FileWriteFromArray($_sErrorSumarryFile, $aFile,1)
143+
144+
endfunc

guitar/bin/GUITARIEObject.au3

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,21 @@ endfunc
110110

111111
func IEObjectGetAllInnerHtml($oIE)
112112

113+
113114
local $aObject, $oItem, $sInnerHtml
114115

116+
115117
$aObject = IEObjectSearchFromObject($oIE, "body::", False)
116-
;msg($aObject)
118+
119+
117120
for $i=1 to ubound($aObject) -1
118121

119122
$oItem = $aObject[$i][1]
120123
$sInnerHtml &= $oItem.outertext
121124
;msg($oItem.outertext)
122125
next
123126

127+
124128
;debug($sInnerHtml)
125129
return $sInnerHtml
126130

@@ -205,10 +209,15 @@ func IEObjectSearchFromObject($oIE, $sCondition, $bCountCheck)
205209
local $oFrame
206210
local $aCondition[1][5]
207211

208-
local $oMyError = ObjEvent("AutoIt.Error","UIAIE_NavigateError")
212+
local $oMyError
213+
214+
215+
216+
; 2014-04-26 수애 샘플 예제 찾기 할때 이유 없이 AUTOIT이 종료되는 문제가 있어 해제
217+
218+
;$oMyError = ObjEvent("AutoIt.Error","UIAIE_NavigateError")
209219

210220

211-
;debug("찾는조건 : " & $sCondition)
212221

213222
$sSplitTemp = StringSplit($sCondition, $sGroupSplt)
214223

@@ -403,19 +412,19 @@ func IEOjectAttribCheck($Object, $sAttrib, $sSplitChar)
403412
;debug($sAttribValue)
404413
else
405414

406-
;_debug($sTagAttribName)
415+
;debug($sTagAttribName)
407416

408417
$sAttribValue = Execute("$Object." & $sTagAttribName)
409418

410419
if @error <> 0 then
411420

412421
$sAttribValue = Execute("$Object.attributes." & $sTagAttribName & ".value()")
413-
;_debug("1 :" & $sAttribValue)
422+
;debug("1 :" & $sAttribValue)
414423

415424

416425

417426
;$sAttribValue = Execute("$Object.attributes." & $sTagAttribName & ".nodevalue()")
418-
;_debug("2 :" & $sAttribValue)
427+
;debug("2 :" & $sAttribValue)
419428

420429
;for $i=0 to $Object.attributes.length -1
421430
; if $Object.attributes($i).specified then

0 commit comments

Comments
 (0)