diff --git a/guitar/bin/GUITAR.au3 b/guitar/bin/GUITAR.au3
index 4fca63c..0c8baa4 100644
--- a/guitar/bin/GUITAR.au3
+++ b/guitar/bin/GUITAR.au3
@@ -1,7 +1,11 @@
#AutoIt3Wrapper_Icon=GUITAR.ico
-#AutoIt3Wrapper_Res_Fileversion=1.5.3.18
+#AutoIt3Wrapper_Res_Fileversion=1.9.0.18
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p
+
+; /INI:D:\GUITAR_MAP\BIN / /WorkPath:D:\GUITAR_MAP\DATA
+
+
;#RequireAdmin
#include-once
@@ -29,6 +33,7 @@
#include ".\_include_nhn\_ie2.au3"
#include ".\_include_nhn\_statusbar.au3"
+
#include "UIACommon.au3"
#include "UIAFormMain.au3"
#include "UIAOptions.au3"
@@ -43,6 +48,8 @@
#include "GUITARARecord.au3"
#include "GUITARAImageList.au3"
#include "GUITARLanguage.au3"
+#include "GuitarWebdriverXpath.au3"
+#include "GuitarErrorReport.au3"
main()
@@ -486,9 +493,14 @@ func _waitFormMain()
case $_gForm_mnu_delete, $_GMEdit_TargetDelete
_mnu_target_delete()
+ case $_GMEdit_XPathVerify
+ onClickXPathVerify()
+
+
case $_GMEdit_CommandTemplate
onClickSampleLoad()
+
Case $_GMEdit_TestCaseImport
onImportTC()
@@ -559,14 +571,11 @@ func _waitFormMain()
;debug(RecordToScript(_UnHookKeyBoardMouseRecord()))
;endif
-
Case $_GMTool_RunTestCaseExport
ShellExecute(@ScriptDir & "\GUITARExportTC.exe")
-
; 도움말
Case $_GMHelp_Help
-
viewHelp()
Case $_GMHelp_HelpAutoitCommand
@@ -599,8 +608,6 @@ func _exit($iReturn = 0, $bLoadingError = False)
local $iMax = 0
-
-
if $bLoadingError = False then
; 탭중에 저장이 안된것 확인할것
@@ -700,7 +707,7 @@ func _exit($iReturn = 0, $bLoadingError = False)
if $_runAlwaysFontsmoothing = True then setWindowsFontSmoothing(True,False)
-
+;
if IsHWnd ($_gForm) = true then
@@ -708,8 +715,6 @@ func _exit($iReturn = 0, $bLoadingError = False)
GUIDelete ( $_gForm )
-
-
MouseBusy (False)
endif
@@ -765,6 +770,11 @@ func runRichScript($bIsRetry, $bAutoSave = False)
local $sReportDateTimeFolder
local $sXMLOutputFile
+ local $aErrorReport
+ local $bCreateErrorSumarry
+ local $sErrorSumarryTitle
+ local $sErrorSumarryContents
+
if $bAutoSave = true and _checkRichTextModified() = True then onClickSave(True)
@@ -832,6 +842,10 @@ func runRichScript($bIsRetry, $bAutoSave = False)
_FileReadToArray($sScriptName,$aRowScript)
+
+
+
+
;if $_runCmdRunning = True then
for $i= 1 to 3
@@ -862,6 +876,9 @@ func runRichScript($bIsRetry, $bAutoSave = False)
_UpdateFolderFileInfo(False)
+
+
+
$_runCommadLintTimeInit = _TimerInit()
$_runCommadLintTimeStart = _Nowcalc()
@@ -869,7 +886,7 @@ func runRichScript($bIsRetry, $bAutoSave = False)
$bResult = False
writeRunLog($_sLogText_PreError & _getLanguageMsg("log_scriptanalysiserror") & " : " & $sErrorMsgAll )
- sleep(1)
+
UpdateRichText($_gEditScript, True, True, $aScript, 0, 0)
makeReportLogFormat("", "", "", "", _GetFileName($sScriptName), 1, 1, _NowCalc(), "F", _getLanguageMsg("log_precheck"),_getLanguageMsg("log_scriptanalysiserror") & " " & $sErrorMsgAll, "")
@@ -885,21 +902,27 @@ func runRichScript($bIsRetry, $bAutoSave = False)
$_runRetryRun = True
$_runWaitTimeOut = getReadINI("environment","DebugTimeOut")
+
_getLastBrowserInfo ()
- ; 최근 수행한 웹드라이버 세션이 있을 경우 수행
- if $_webdriver_connection_host <> "" and $_runWebdriver = False then
- $sNewBrowserCreate = _ProgramQuestionYN(("이전 사용한 웹드라이버 세션을 사용하시겠습니까?" & @crlf & @crlf & $_webdriver_connection_host))
- if $sNewBrowserCreate ="Y" then
- $_runWebdriver = True
- $_runBrowser = ""
- $_hBrowser = ""
- else
- $_runWebdriver = False
- $_webdriver_current_sessionid = ""
- $_webdriver_connection_host = ""
- endif
- endif
+
+ ; 최근 수행한 웹드라이버 세션이 있을 경우 자동으로 셋팅
+
+
+;~ if $_webdriver_connection_host <> "" and $_runWebdriver = False then
+;~ $sNewBrowserCreate = _ProgramQuestionYN(("이전 사용한 웹드라이버 세션을 사용하시겠습니까?" & @crlf & @crlf & $_webdriver_connection_host))
+;~ if $sNewBrowserCreate ="Y" then
+;~ $_runWebdriver = True
+;~ $_runBrowser = ""
+;~ $_hBrowser = ""
+;~ else
+;~ $_runWebdriver = False
+;~ $_webdriver_current_sessionid = ""
+;~ $_webdriver_connection_host = ""
+;~ endif
+;~ endif
+
+
; 프로세스가 존재할 경우 브라우저 이름이 동일한지 확인
if WinExists($_hBrowser) <> 0 then
@@ -909,6 +932,8 @@ func runRichScript($bIsRetry, $bAutoSave = False)
endif
endif
+
+
if ($_runBrowser = "" or WinExists($_hBrowser) = 0) and $_runWebdriver = False Then
$sNewBrowserCreate = _ProgramQuestionYNC(_getLanguageMsg("information_browsersetting"))
@@ -925,13 +950,14 @@ func runRichScript($bIsRetry, $bAutoSave = False)
if $sNewBrowserType <> "" Then
$_runBrowser = $sNewBrowserType
$_hBrowser = $hNewBrowser
- ;Else
- ; $bResult = False
- ; writeRunLog($_sLogText_PreError & _getLanguageMsg("error_browserselectfail"))
- ; exitloop
+ Else
+ $bResult = False
+ writeRunLog($_sLogText_PreError & _getLanguageMsg("error_browserselectfail"))
+ exitloop
endif
endif
+
;msg("선택 브라우저 정보 : " & $_runBrowser & ", Handle:" & $_hBrowser)
_setCurrentBrowserInfo()
@@ -949,6 +975,7 @@ func runRichScript($bIsRetry, $bAutoSave = False)
Else
+
; 전체 새로 실행
if $_runErrorResume = "TEST" then
$_runContinueTest = False
@@ -995,6 +1022,8 @@ func runRichScript($bIsRetry, $bAutoSave = False)
TrayTip($_sProgramName, _getLanguageMsg("report_testrun") & " : " & _GetFileName($sScriptName) & @Crlf & _getLanguageMsg("information_teststop") & " : ESC" & @Crlf & _getLanguageMsg("information_testpause") & " : PAUSE",3,1)
+
+
$sPreloadScript = getReadINI("SCRIPT","PreLoadScript")
$bResult = True
@@ -1118,8 +1147,15 @@ func runRichScript($bIsRetry, $bAutoSave = False)
;debug("임시 리포트 : " & $_sRunningLogFile, $sReportFile )
+ $bCreateErrorSumarry = getIniBoolean(getReadINI("ErrorAccumulate", "Alarm"))
+
+ if $bCreateErrorSumarry then
+ ; 커맨드 모드 거나, 옵션에 의해 누적되도록 설정된 경우에만 On 할것 (수동실행등으로 누적기록될 수 있어 제한하도록 함)
+ if not($_runCmdRunning = True or ($_runCmdRunning = False and getIniBoolean(getReadINI("ErrorAccumulate","CommandlineModeOnly")) = False )) then $bCreateErrorSumarry = False
+ endif
+
writeDebugTimeLog("report 파일 생성 전 ")
- _createHtmlReport($sReportFile , FileRead($_sReportLogFile),_GetFileName($sScriptName) & " " & _getLanguageMsg("report_detail") ,$aTestLogInfo, $sReportPath, _GetFileName($sScriptName), $_aRunReportInfo[$_sResultSkipList], $_aRunReportInfo[$_sResultNorRunList], $_runXMLReport , $sXML, $sDashBoardReport)
+ _createHtmlReport($sTestStartTime, $sReportFile , FileRead($_sReportLogFile),_GetFileName($sScriptName) & " " & _getLanguageMsg("report_detail") ,$aTestLogInfo, $sReportPath, _GetFileName($sScriptName), $_aRunReportInfo[$_sResultSkipList], $_aRunReportInfo[$_sResultNorRunList], $_runXMLReport , $sXML, $sDashBoardReport, $bCreateErrorSumarry)
writeDebugTimeLog("report 파일 생성 후 ")
if $_runXMLReport then
@@ -1177,6 +1213,37 @@ func runRichScript($bIsRetry, $bAutoSave = False)
writeDebugTimeLog("report 저장 전 ")
saveTotalReport($sSummryReportFile, _GetFileName($sScriptName), $sReportDateTimeFolder, $sTestStartTime, $sTestingTime, $bResult, $aRunCountInfo[1], $aRunCountInfo[2], $aRunCountInfo[3], stringreplace(stringreplace($sReportFile, $_runReportPath & "\",""), "\","/" ), $_aRunReportInfo, False)
saveTotalReport($_runReportPath & "\" & _GetFileName(FileGetLongName(_GetPathName($sReportPath))) & "\report.htm", _GetFileName($sScriptName), $sReportDateTimeFolder, $sTestStartTime, $sTestingTime, $bResult, $aRunCountInfo[1], $aRunCountInfo[2], $aRunCountInfo[3], stringreplace(stringreplace($sReportFile, $_runReportPath & "\",""), "\","/" ), $_aRunReportInfo, True)
+
+ ; 누적에러 확인하고 메일 및 SMS 발송
+ if $bCreateErrorSumarry then
+ if $bResult = False then
+ ; 에러 카운트 정보 확인
+ $aErrorReport = _getErrorSumarry(getReadINI("ErrorAccumulate", "Count"), _GetFileName($sScriptName), $sTestStartTime)
+ ; SMS 보내기
+
+ if ubound($aErrorReport) > 1 then
+
+ $sErrorSumarryTitle = _getErrorSumarryInfo($_runComputerName, $aErrorReport,$sDashBoardReport, $sErrorSumarryContents)
+
+ if getIniBoolean(getReadINI("ErrorAccumulate","SMS")) then
+ writeRunLog("테스트결과 누적오류 SMS 발송")
+ sendTestReportSMS(_GetFileName($sScriptName), $bResult, getReadINI("ErrorAccumulate","SMSList"), $sErrorSumarryTitle)
+ endif
+
+
+ if getIniBoolean(getReadINI("ErrorAccumulate","EMAIL")) then
+ sendTestReportEmail(_GetFileName($sScriptName), $bResult ,$sReportFile, $sReportPath, $sDashBoardReport, getReadINI("ErrorAccumulate","EmailList"), $sErrorSumarryTitle, $sErrorSumarryContents)
+ writeRunLog("테스트결과 누적오류 EMAIL 발송")
+ endif
+
+ endif
+ else
+ ; 테스트 성공일 경우 기존 남아 있는 에러 로그
+ deleteSuccessListFormErrorSumarry(_GetFileName($sScriptName))
+
+ endif
+ endif
+
writeDebugTimeLog("report 저장 경로 : " & $_runReportPath & "\" & _GetFileName(FileGetLongName(_GetPathName($sReportPath))) & "\report.htm")
; 스크립트 폴더에 별도로 report.htm 파일 복사
@@ -1195,7 +1262,7 @@ func runRichScript($bIsRetry, $bAutoSave = False)
;SMS 발송
if getIniBoolean(getReadINI("ALARM","SMS")) and ($_runCmdRunning = True or ($_runCmdRunning = False and getIniBoolean(getReadINI("ALARM","CommandlineModeOnly")) = False )) then
writeRunLog(_getLanguageMsg("report_sendsms"))
- if $bResult = False then sendTestReportSMS(_GetFileName($sScriptName), $bResult)
+ if $bResult = False then sendTestReportSMS(_GetFileName($sScriptName), $bResult, getReadINI("ALARM","SMSList"))
endif
;Email 발송
@@ -1203,7 +1270,7 @@ func runRichScript($bIsRetry, $bAutoSave = False)
if getIniBoolean(getReadINI("ALARM","EMAIL")) and ($_runCmdRunning = True or ($_runCmdRunning = False and getIniBoolean(getReadINI("ALARM","CommandlineModeOnly")) = False )) then
writeRunLog(_getLanguageMsg("report_sendemail"))
writeDebugTimeLog("email 발송 전 ")
- if sendTestReportEmail(_GetFileName($sScriptName), $bResult ,$sReportFile, $sReportPath, $sDashBoardReport) = False then
+ if sendTestReportEmail(_GetFileName($sScriptName), $bResult ,$sReportFile, $sReportPath, $sDashBoardReport, getReadINI("ALARM","EmailList")) = False then
writeRunLog($_sLogText_PreError & _getLanguageMsg("error_emailsend"))
endif
writeDebugTimeLog("email 발송 후 ")
@@ -1213,6 +1280,8 @@ func runRichScript($bIsRetry, $bAutoSave = False)
endif
+
+
until True
@@ -1294,25 +1363,28 @@ func deleteSkipListFromNotRunList($sNotRunList, $sSkipList)
endfunc
-func sendTestReportSMS($sScriptName, $bResult)
+func sendTestReportSMS($sScriptName, $bResult, $sSMSList, $sContext = "" )
- local $sList = StringSplit(getReadINI("ALARM","SMSList"),",")
+ local $sList = StringSplit($sSMSList,",")
local $i
+
+ if $sContext = "" then $sContext = "[" & $_sProgramName & "] " & _getLanguageMsg("report_test") & " " & _getLanguageMsg("report_fail") & " (" & $sScriptName & ", " & _NowCalc() & ")"
+
for $i=1 to ubound($sList)-1
$sList[$i] = _Trim(StringReplace($sList[$i],"-",""))
- _SendSMS("[" & $_sProgramName & "] " & _getLanguageMsg("report_test") & " " & _getLanguageMsg("report_fail") & " (" & $sScriptName & ", " & _NowCalc() & ")" , $sList[$i])
+ _SendSMS($sContext , $sList[$i])
next
endfunc
-func sendTestReportEmail($sScriptName, $bResult, $sReportFile, $sReportPath, $sDashBoardReport)
+func sendTestReportEmail($sScriptName, $bResult, $sReportFile, $sReportPath, $sDashBoardReport, $sEmailList, $sExTitle= "", $sExContents = "")
- local $sTitle = "[" & $_sProgramName & "] " & _iif($bResult,_getLanguageMsg("report_pass"),_getLanguageMsg("report_fail")) & ", " & $sScriptName & " (@" & $_runComputerName & ")"
- local $sList = StringReplace(getReadINI("ALARM","EmailList"),",",";")
+ local $sTitle
+ local $sContents
+ local $sList = StringReplace($sEmailList,",",";")
local $sDashboardHost
- local $sContents = FileRead($sReportFile)
local $sNewHost
local $aAttachFile
local $sAttachList
@@ -1323,6 +1395,24 @@ func sendTestReportEmail($sScriptName, $bResult, $sReportFile, $sReportPath, $sD
local $sDetailLink
local $bFullContents = not(getIniBoolean(getReadINI("ALARM","EmailSummary")))
local $bRet
+ local $bErrorSummaryEmail = False
+
+
+
+
+ if $sExTitle = "" then
+ $sTitle = "[" & $_sProgramName & "] " & _iif($bResult,_getLanguageMsg("report_pass"),_getLanguageMsg("report_fail")) & ", " & $sScriptName & " (@" & $_runComputerName & ")"
+ else
+ $bErrorSummaryEmail = True
+ $sTitle = $sExTitle
+ endif
+
+
+ if $sExContents = "" then
+ $sContents = FileRead($sReportFile)
+ else
+ $sContents = $sExContents
+ endif
$sDashboardHost = getReadINI("REPORT", "DashboardHost")
@@ -1341,12 +1431,10 @@ func sendTestReportEmail($sScriptName, $bResult, $sReportFile, $sReportPath, $sD
$sContents = StringReplace($sContents, "src='./" , "src='" & $sNewHost)
$sContents = StringReplace($sContents, "href='./" , "href='" & $sNewHost)
$sContents = StringReplace($sContents, "href='#" , "href='" & $sDashBoardReport & "#")
-
-
$sContents = StringReplace($sContents, "../../" , $sDashboardHost & "/")
;$sContents = StringReplace($sContents, "test01", "
")
- if $bAttachImage then
+ if $bAttachImage and ($bErrorSummaryEmail = False) then
;$sContents = StringReplace($sContents, "" & $sDashBoardReport & ""
@@ -2430,8 +2518,12 @@ func hotkyeResetBrowserHandle()
if not WinActive($_gForm) then return
+ $_runWebdriver = False
$_runBrowser = ""
$_hBrowser = ""
+ $_webdriver_current_sessionid = ""
+ $_webdriver_connection_host = ""
+
_setCurrentBrowserInfo()
@@ -2905,7 +2997,6 @@ func HudsonDateTimeConvert($sDate)
endfunc
-
func _RemoteProgrammError($str)
local $sText = "Error : "
@@ -2982,4 +3073,71 @@ func _ScriptCommentSet()
_GUICtrlRichEdit_Setsel($_gEditScript, $iCharStart, $iCharEnd)
+endfunc
+
+
+
+
+func onClickXPathVerify()
+
+ local $sScriptTarget
+ local $aImageFile
+ local $x, $y
+ local $bResult
+ local $bFileNotFoundError
+ local $aShotXpathList
+ local $sElementID
+ local $i
+ local $sResultText
+
+ local $sClip
+ local $sReturnXpath
+
+
+ ClearLoglist()
+
+ $sClip = _Trim(String(ClipGet()))
+
+ $_runErrorMsg = ""
+ writeRunLog ($_sLogText_Info & "Xpath 재검증 시작 : " & $sClip )
+
+ if stringleft($sClip, 2) <> "//" and stringleft($sClip, 5) <> "/html" then
+ writeRunLog ($_sLogText_Error & "클립보드 문자열이 내용이 Xpath 형태가 아닙니다." )
+ return
+ endif
+
+ $sScriptTarget = "{xpath:" & $sClip & "}"
+ $sReturnXpath = $sScriptTarget
+
+ setTestHotKey(True)
+ $_bScriptStopping = False
+ $bResult = getRunCommnadImageAndSearchTarget ($sScriptTarget, $aImageFile, $x , $y, True, 5, $bFileNotFoundError)
+ setTestHotKey(False)
+
+ if $bResult then
+
+ $sElementID = $x
+ $bResult = _WD_XpathGetShotPathlist($sElementID, $aShotXpathList)
+ if $bResult then
+ writeRunLog ($_sLogText_Info & "사용 가능한 Xpath 확인 : " & ubound($aShotXpathList)-1 & "개" )
+ for $i=1 to ubound($aShotXpathList)-1
+ writeRunLog ($_sLogText_Info & '"{xpath:' & $aShotXpathList [$i] & '}"')
+ next
+
+ $sReturnXpath = '"{xpath:' & $aShotXpathList[1] & '}"'
+ Else
+ writeRunLog ($_sLogText_Error & "추가로 사용가능한 Xpath를 찾을 수 없습니다.")
+ endif
+ ClipPut($sReturnXpath & " ")
+ _GUICtrlRichEdit_Paste($_gEditScript )
+ ClipPut($sClip)
+ else
+ writeRunLog ($_sLogText_Error & "대상을 찾을 수 없습니다.")
+ writeRunLog ($_sLogText_Error & $_runErrorMsg)
+ endif
+
+ writeRunLog ($_sLogText_Info & "Xpath 재검증 종료" )
+
+ setStatusText ("")
+
endfunc
\ No newline at end of file
diff --git a/guitar/bin/GUITARErrorReport.au3 b/guitar/bin/GUITARErrorReport.au3
new file mode 100644
index 0000000..50c2f32
--- /dev/null
+++ b/guitar/bin/GUITARErrorReport.au3
@@ -0,0 +1,144 @@
+#include ".\_include_nhn\_util.au3"
+#include
+#Include
+
+
+;global $_sErrorSumarryFile = "D:\_Autoit\guitar\report\errorsummary2.txt"
+;global $sScriptName = "26_ü_SUS_IE_REAL"
+;local $a =_getErrorSumarry($sScriptName, "2,6")
+;local $b, $c
+;$c= _getErrorSumarryInfo("aa", $a,False,"http://", $b)
+;debug($c, $b)
+;deleteSuccessListFormErrorSumarry($sScriptName)
+
+; ŸԺ
+func _getErrorSumarryInfo($sServerName, $aErrorInfo, $sDashBoardReport, byref $sEmailContents)
+
+ local $sRet
+
+ $sEmailContents = ""
+ local $iCount = ubound($aErrorInfo) -1
+
+ if $iCount <= 0 then return ""
+
+ $sRet = "[GUITAR] , " & $aErrorInfo[1][1]
+ if $iCount > 1 then $sRet = $sRet & " " & $iCount-1 & ""
+ $sRet = $sRet & " (@" & $sServerName & ")"
+
+ $sEmailContents = ""
+ $sEmailContents = $sEmailContents & " : " & $sServerName & @crlf
+ $sEmailContents = $sEmailContents & " ũƮ : " & $aErrorInfo[1][1] & @crlf
+ $sEmailContents = $sEmailContents & "Ʈ : " & $sDashBoardReport & @crlf
+ $sEmailContents = $sEmailContents & @crlf
+ $sEmailContents = $sEmailContents & " " & $iCount & "" & @crlf
+
+ for $i = 1 to ubound($aErrorInfo) -1
+ $sEmailContents = $sEmailContents & " " & $aErrorInfo[$i][0] & "ȸ (" & $aErrorInfo[$i][3] & @tab & $aErrorInfo[$i][4] & @tab & $aErrorInfo[$i][5] & ")" & @crlf
+ next
+
+ return $sRet
+
+endfunc
+
+
+; Ư Ƚ ̻ 迭 ϵ
+Func _getErrorSumarry($sCount, $sScriptName, $sTestTime)
+
+ ; 26_ü_SUS_IE_REAL1,2014/07/17 17:34:15,ü_SUS_010,SUS_TC002,8
+
+ local $aFile
+ local $aNewList [1][10]
+ local $aRetList
+ local $i
+ local $aLine
+ local $iSearchIndex
+ local $bFound
+ local $aCount
+
+
+ $aCount = StringSplit($sCount,",")
+ $aRetList = $aNewList
+
+ _FileReadToArray ($_sErrorSumarryFile, $aFile,0)
+ $aFile = _ArrayUnique($aFile,1)
+
+ for $i=0 to ubound($aFile) -1
+
+ $aLine = StringSplit($aFile[$i],",")
+ $bFound = False
+
+ for $j= 1 to ubound($aNewList) -1
+ ; ũƮ
+ ; Count ߰
+
+ if $sScriptName = $aLine[1] then
+ 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
+ $bFound = True
+ $aNewList[$j][0] = $aNewList[$j][0] + 1
+ if $sTestTime = $aLine[2] then $aNewList[$j][2] = $sTestTime
+ exitloop
+ endif
+ endif
+ next
+
+ ; ű ߰
+ if $bFound = False then
+
+ $iSearchIndex = ubound($aNewList)
+ redim $aNewList[$iSearchIndex + 1][ubound($aNewList,2)]
+
+ for $j=1 to ubound($aLine) -1
+ $aNewList[$iSearchIndex][0] = 1
+ $aNewList[$iSearchIndex][$j] = $aLine[$j]
+ next
+
+ endif
+
+ next
+
+
+ for $i=1 to ubound($aNewList) -1
+
+ for $j=1 to ubound($aCount) -1
+
+ if $aNewList[$i][0] = Number($aCount [$j]) and ($sTestTime = $aNewList[$i][2])then
+
+ $iSearchIndex = ubound($aRetList)
+ redim $aRetList[$iSearchIndex + 1][ubound($aRetList,2)]
+
+ for $j=0 to ubound($aRetList,2) -1
+ $aRetList[$iSearchIndex][$j] = $aNewList[$i][$j]
+ next
+
+ endif
+ next
+
+ next
+
+
+ return $aRetList
+
+EndFunc
+
+
+; νũƮ ش ũƮ α
+func deleteSuccessListFormErrorSumarry($sScriptName)
+
+ local $aFile
+ local $i
+
+ _FileReadToArray ($_sErrorSumarryFile, $aFile,0)
+
+ for $i=0 to ubound($aFile) -1
+
+ if StringInStr($aFile[$i], $sScriptName & ",") = 1 then
+ $aFile[$i] = ""
+ endif
+
+ next
+
+ $aFile = _ArrayUnique($aFile,1)
+ ;_msg($aFile)
+ _FileWriteFromArray($_sErrorSumarryFile, $aFile,1)
+
+endfunc
\ No newline at end of file
diff --git a/guitar/bin/GUITARIEObject.au3 b/guitar/bin/GUITARIEObject.au3
index 6d11325..4f439a7 100644
--- a/guitar/bin/GUITARIEObject.au3
+++ b/guitar/bin/GUITARIEObject.au3
@@ -110,10 +110,13 @@ endfunc
func IEObjectGetAllInnerHtml($oIE)
+
local $aObject, $oItem, $sInnerHtml
+
$aObject = IEObjectSearchFromObject($oIE, "body::", False)
- ;msg($aObject)
+
+
for $i=1 to ubound($aObject) -1
$oItem = $aObject[$i][1]
@@ -121,6 +124,7 @@ func IEObjectGetAllInnerHtml($oIE)
;msg($oItem.outertext)
next
+
;debug($sInnerHtml)
return $sInnerHtml
@@ -205,10 +209,15 @@ func IEObjectSearchFromObject($oIE, $sCondition, $bCountCheck)
local $oFrame
local $aCondition[1][5]
- local $oMyError = ObjEvent("AutoIt.Error","UIAIE_NavigateError")
+ local $oMyError
+
+
+
+ ; 2014-04-26 ã Ҷ AUTOIT Ǵ ־
+
+ ;$oMyError = ObjEvent("AutoIt.Error","UIAIE_NavigateError")
- ;debug("ã : " & $sCondition)
$sSplitTemp = StringSplit($sCondition, $sGroupSplt)
@@ -403,19 +412,19 @@ func IEOjectAttribCheck($Object, $sAttrib, $sSplitChar)
;debug($sAttribValue)
else
- ;_debug($sTagAttribName)
+ ;debug($sTagAttribName)
$sAttribValue = Execute("$Object." & $sTagAttribName)
if @error <> 0 then
$sAttribValue = Execute("$Object.attributes." & $sTagAttribName & ".value()")
- ;_debug("1 :" & $sAttribValue)
+ ;debug("1 :" & $sAttribValue)
;$sAttribValue = Execute("$Object.attributes." & $sTagAttribName & ".nodevalue()")
- ;_debug("2 :" & $sAttribValue)
+ ;debug("2 :" & $sAttribValue)
;for $i=0 to $Object.attributes.length -1
; if $Object.attributes($i).specified then
diff --git a/guitar/bin/GuitarWebdriver.au3 b/guitar/bin/GuitarWebdriver.au3
new file mode 100644
index 0000000..7860b84
--- /dev/null
+++ b/guitar/bin/GuitarWebdriver.au3
@@ -0,0 +1,482 @@
+#include-once
+#include ".\_include_nhn\_util.au3"
+#include ".\_include_nhn\_webdriver.au3"
+
+global $_WebdriverSearchTypeInfo [6][3]
+global $_WebdriverSubFramePath = ""
+global $_WebdriverMobileLastDragX = ""
+global $_WebdriverMobileLastDragY = ""
+
+$_WebdriverSearchTypeInfo[1][1]= "class"
+$_WebdriverSearchTypeInfo[1][2]= "class name"
+
+$_WebdriverSearchTypeInfo[2][1]= "css"
+$_WebdriverSearchTypeInfo[2][2]= "css selector"
+
+$_WebdriverSearchTypeInfo[3][1]= "id"
+$_WebdriverSearchTypeInfo[3][2]= "id"
+
+$_WebdriverSearchTypeInfo[4][1]= "name"
+$_WebdriverSearchTypeInfo[4][2]= "name"
+
+$_WebdriverSearchTypeInfo[5][1]= "xpath"
+$_WebdriverSearchTypeInfo[5][2]= "xpath"
+
+
+;local $a, $b
+;local $x=" {css , 123 456 } "
+;debug(getWebdriverParamTypeAndValue ($x, $a, $b))
+;debug($a, $b)
+
+
+; webdriver Ȯ
+func isWebdriverParam ($sStr)
+
+ $sStr = _Trim($sStr)
+
+ return _iif( stringLeft($sStr,1)= "{" and StringRight($sStr,1)= "}", True,False)
+
+endfunc
+
+func getWebdriverParam ($sStr)
+
+ return _Trim(stringmid($sStr,2,stringlen($sStr)-2))
+
+endfunc
+
+
+; webdriver ˻ Ÿ,
+func getWebdriverParamTypeAndValue ($sStr, byref $sSearchType, byref $sSearchValue)
+
+ local $i
+ local $bSuccess = False
+ local $sSearchTypeKey
+ local $sSearchTypeIndex
+ local $iSplitPos
+
+ $sStr = _Trim($sStr)
+ $sSearchType = ""
+ $sSearchValue = ""
+
+ if isWebdriverParam ($sStr) then
+ $sStr = stringmid($sStr,2,stringlen($sStr)-2)
+ $iSplitPos = StringInStr($sStr,":")
+
+ if $iSplitPos > 0 then
+
+ $bSuccess = True
+
+ $sSearchTypeKey = StringLower(_Trim(Stringleft ($sStr, $iSplitPos -1)))
+ $sSearchTypeIndex = _ArraySearch($_WebdriverSearchTypeInfo,$sSearchTypeKey,0,0,0,0,1,1)
+
+
+ $sSearchValue = StringStripWS(Stringmid ($sStr, $iSplitPos + 1, stringlen($sStr) - $iSplitPos + 1), $STR_STRIPLEADING)
+
+ if $sSearchTypeIndex > 0 Then
+ $sSearchType = $_WebdriverSearchTypeInfo[$sSearchTypeIndex][2]
+ Else
+ $sSearchType = $sSearchTypeKey
+ endif
+ endif
+
+ endif
+
+ return $bSuccess
+
+endfunc
+
+
+; Ķ Ŀؼ ڿ \
+
+;local $a, $b, $c
+;debug(setWebdriverConnectionInfo("{host=172.165.22.22:1711,xxxx=c:\sss,yyty=111}",$a, $b))
+;debug($a)
+;debug($b)
+
+func getWebdriverConnectionInfo($sParam, byref $sHost, byref $aParamInfo)
+
+ local $bSuccess = True
+ local $sConnectionInfo = ""
+ local $aDumyParamInfo[1][3]
+ local $aMainParamInfo
+ local $aSubParamInfo
+
+ $aParamInfo = $aDumyParamInfo
+
+ if isWebdriverParam($sParam) then
+
+ $sParam = _Trim(stringmid($sParam,2,stringlen($sParam)-2))
+ $aMainParamInfo = StringSplit($sParam,",",1)
+
+ redim $aParamInfo[ubound($aMainParamInfo,1) -1][3]
+
+ for $i=1 to ubound ($aMainParamInfo) -1
+
+ $aSubParamInfo = StringSplit($aMainParamInfo[$i],"=",1)
+ ; xxx=yyy ° ƴ ٷ
+
+ if ubound($aSubParamInfo) <> 3 then
+ $bSuccess =False
+ exitloop
+ endif
+
+ ; ù° "host" Ǿ .
+ if $i=1 then
+ if _Trim($aSubParamInfo[1]) = "host" Then
+ $sHost = _Trim($aSubParamInfo[2])
+ Else
+ $bSuccess =False
+ exitloop
+ endif
+ else
+ $aParamInfo [$i-1][1] = _Trim($aSubParamInfo[1])
+
+ $aParamInfo [$i-1][2] = _Trim($aSubParamInfo[2])
+
+ ; T/F ش ڷ
+ if StringLower($aParamInfo [$i-1][2]) = "true" then $aParamInfo [$i-1][2] = True
+ if StringLower($aParamInfo [$i-1][2]) = "false" then $aParamInfo [$i-1][2] = False
+
+ endif
+
+ next
+
+ endif
+
+ return $bSuccess
+
+endfunc
+
+
+func _WD_getBrowserType()
+
+ local $sbrowserType
+
+ Switch StringLower(_Trim(_WD_getBrowserName()))
+ case "chrome","firefox","internet explorer","ie","safari"
+ $sbrowserType = "WEB"
+ EndSwitch
+
+ return $sbrowserType
+
+endfunc
+
+
+func _WD_getBrowserName()
+
+ local $i, $j
+ local $aSessions
+ local $aSession
+ local $acapabilities
+ local $iSessionIndex = -1
+ local $icapabilitiesIndex = -1
+ local $sbrowserName
+ local $sRet = ""
+ local $sSessionID
+
+ $sSessionID = $_webdriver_current_sessionid
+
+ if _WD_get_sessions ($sRet) then
+ ;_jdebug($sRet)
+ $aSessions = _jsonquery($sRet, "value")
+ ;$aSessions = $sRet
+
+ ;debug($aSessions)
+
+ for $i=0 to ubound($aSessions) -1
+
+ $aSession = $aSessions[$i]
+ ;debug($aSession)
+
+ for $j=0 to ubound($aSession) -1
+ ;debug($aSession[$j][0],$aSession[$j][1] ,$sSessionID)
+ if $aSession[$j][0] = "id" and $aSession[$j][1] = $sSessionID then
+ $iSessionIndex = $i
+ endif
+ if $aSession[$j][0] = "capabilities" then $icapabilitiesIndex = $j
+ next
+
+ if $iSessionIndex > -1 then
+ ;_msg("Ծ")
+ $acapabilities = $aSession[$icapabilitiesIndex][1]
+
+ for $j=0 to ubound($acapabilities) -1
+
+ if $acapabilities[$j][0] = "browserName" then
+
+ $sbrowserName = $acapabilities[$j][1]
+ exitloop
+ endif
+ next
+ endif
+
+ next
+
+ endif
+
+ return $sbrowserName
+
+endfunc
+
+func _WD_MoveAndAction($sElementID, $sActionCommand, $Button = 0, $iOffsetX=0, $iOffsetY=0)
+
+ local $bSuccess = False
+ local $sRet = ""
+ local $ElementX, $ElementY, $x, $y
+ local $x, $y
+ local $i
+ local $iClickCount = 1
+ local $sMobileCommand
+ local $sBodyID
+
+ $bSuccess = False
+
+ ;$iOffsetX = String($iOffsetX)
+ ;$iOffsetY = String($iOffsetY)
+
+
+ if _WD_isTestPlatformWEB() then
+ ;
+
+ Switch $sActionCommand
+
+ case "/moveto", "/click", "/buttondown", "/buttonup", "/doubleclick"
+
+
+ if $sElementID <> "" then
+ ; TAG · ãƼ Ŭ
+ ; ÷ 쿡 ̵ Ŭϵ
+ $bSuccess = _getWebdriverParam("POST", "/moveto", $sRet, 'element', $sElementID,"xoffset",$iOffsetX,"yoffset", $iOffsety)
+
+ else
+ ; ̹ Ÿ ãƼ Ŭ
+ $sBodyID = _WD_find_element_by("xpath", "//body")
+ $bSuccess = _getWebdriverParam("POST", "/moveto" , $sRet, "element",$sBodyID, "xoffset", $iOffsetX, "yoffset" , $iOffsety)
+ endif
+
+ if $bSuccess and $sActionCommand <> "/moveto" then
+ if $sElementID <> "" then $_webdriver_last_elementid = $sElementID
+ sleep(1)
+ ;msg($sActionCommand)
+ $bSuccess = _getWebdriverParam("POST", $sActionCommand, $sRet, 'button', $Button)
+ endif
+
+ case Else
+ $_webdriver_last_errormsg = "Webdriver ʴ Դϴ." & $sActionCommand
+ $bSuccess = False
+
+ EndSwitch
+
+ else
+
+ $_webdriver_last_elementid = $sElementID
+
+ $bSuccess = _WD_get_element_location($sElementID, $ElementX, $ElementY)
+
+ $x = $ElementX + $iOffsetX
+ $y = $ElementY + $iOffsetY
+
+ Switch $sActionCommand
+
+
+ ; "/longClick" ̵
+ case "/click", "/doubleclick"
+
+ if $sActionCommand = "/doubleclick" then $iClickCount = 2
+
+ ;$bSuccess = _getWebdriverParam("POST", "/touch/tap" , $sRet, "element", $sElementID, "touchCount", _iif($sActionCommand="/click","1","2"))
+ ;$bSuccess =_WD_execute_script ("mobile: tap", $sRet, "element", $sElementID, "touchCount", _iif($sActionCommand="/click","1","2"))
+ ;$bSuccess = _getWebdriverParam("POST", "/execute" , $sRet, "script", "mobile: tap", "args", _JSONEncode(_JSONArray(_JSONObject("touchCount","2"))))
+ ;$bSuccess = requestWebdriver("POST","session/" & $_webdriver_current_sessionid & "/execute", _JSONEncode(_JSONObject("script", "mobile: tap","args",_JSONArray(_JSONObject("touchCount","2", "element",$sElementID)))), $sRet)
+ ;$bSuccess = requestWebdriver("POST","session/" & $_webdriver_current_sessionid & "/touch/tap", _JSONEncode(_JSONObject("element",number($sElementID) )), $sRet)
+ ;$bSuccess = requestWebdriver("POST","session/" & $_webdriver_current_sessionid & "/touch/cliock", _JSONEncode(_JSONObject("element",$sElementID )), $sRet)
+
+
+ ; Appium
+ ;for $i=1 to $iClickCount
+ ; $bSuccess = requestWebdriver("POST","session/" & $_webdriver_current_sessionid & "/execute", _JSONEncode(_JSONObject("script", "mobile: tap" ,"args",_JSONArray(_JSONObject("x",$x , "y",$y ,"touchCount","1")))), $sRet)
+ ;next
+
+ ;Not yet implemented
+ ;$bSuccess = requestWebdriver("POST","session/" & $_webdriver_current_sessionid & "/touch/down", _JSONEncode(_JSONObject("x",$x,"y",$y )), $sRet)
+
+ ;Not yet implemented
+ ;$bSuccess = requestWebdriver("POST","session/" & $_webdriver_current_sessionid & "/buttondown", _JSONEncode(_JSONObject("x",$x,"y",$y )), $sRet)
+
+ ; Webdriver ⺻
+ $bSuccess = _getWebdriverParam("POST", "/element/" & $sElementID & $sActionCommand, $sRet)
+
+ case "/buttondown"
+ $_WebdriverMobileLastDragX = $x
+ $_WebdriverMobileLastDragY = $y
+ $bSuccess = True
+
+ case "/buttonup"
+ $bSuccess = requestWebdriver("POST","session/" & $_webdriver_current_sessionid & "/execute", _JSONEncode(_JSONObject("script", "mobile: swipe","args",_JSONArray(_JSONObject("startX",$_WebdriverMobileLastDragX , "startY",$_WebdriverMobileLastDragY, "endX",$x , "endY",$y, "duration","1.8" )))), $sRet)
+ $_WebdriverMobileLastDragX = ""
+ $_WebdriverMobileLastDragY = ""
+
+ case Else
+ $_webdriver_last_errormsg = "Webdriver(Mobile) ʴ Դϴ." & $sActionCommand
+ EndSwitch
+
+ endif
+
+ return $bSuccess
+
+EndFunc
+
+
+
+func _WD_get_windowhandles()
+
+ local $sRet
+ local $aWindowHandles [1]
+
+ if _getWebdriverParam("GET", "/window_handles" , $sRet) then
+ $aWindowHandles = (_jsonquery($sRet, "value"))
+ endif
+
+ return $aWindowHandles
+
+endfunc
+
+
+func _WD_find_element_with_highlight_by($sUsing, $sSearchTarget, $bhighlight, $iDelay)
+
+ local $sRet
+ local $sID
+ local $i
+ local $aCurrentFrames
+
+ $iDelay = Number($iDelay)
+
+ if _WD_isTestPlatformWEB() = True then
+ ;debug ("ġ : " & $_WebdriverSubFramePath)
+ ; ӿ ġ ̵
+ if $_WebdriverSubFramePath <> "" then _WD_focus_frame($_JSONNull)
+ endif
+
+ $sID = _WD_find_element_by($sUsing, $sSearchTarget)
+
+ ; ȭ鿡 ˻.
+ if $sID = "" and _WD_isTestPlatformWEB() = True Then
+
+ ; ü о
+ do
+ until _WD_get_allframes($aCurrentFrames)
+
+ for $i=2 to ubound($aCurrentFrames) -1
+ if _WD_go_frame($aCurrentFrames[$i][1]) = True then
+ $_WebdriverSubFramePath = $aCurrentFrames[$i][1]
+ $sID = _WD_find_element_by($sUsing, $sSearchTarget)
+ if $sID <> "" then
+ ExitLoop
+ endif
+ endif
+ next
+
+ endif
+
+ if $sID <> "" then $_webdriver_last_elementid = $sID
+
+ ; ÷ ϰ쿡
+ if $bhighlight and $sID <> "" and _WD_isTestPlatformWEB() = True and ($iDelay > 0) then
+ _WD_execute_script ("arguments[0].setAttribute('style', 'color: yellow; border: 2px solid red;')",$sRet, _JSONObject("ELEMENT",$sID))
+ sleep($iDelay)
+ _WD_execute_script ("arguments[0].setAttribute('style', '')",$sRet, _JSONObject("ELEMENT",$sID))
+ sleep($iDelay)
+ endif
+
+ return $sID
+
+endfunc
+
+
+func _WD_get_allframes(byref $aAllFrames)
+ ; 2 迭 о
+
+ local $i, $j
+ local $aTemp[2][3]
+ local $bAllSearch = True
+ local $iAllFramesUbound
+ local $iAllFrameNewIndex
+ local $aFrames
+ local $aTemp
+
+ ; Խ
+ if IsArray($aAllFrames) = False then
+ $aAllFrames = $aTemp
+ $aAllFrames[1][1] = "X"
+ endif
+
+ $iAllFramesUbound = ubound($aAllFrames,1)
+ ;debug(" : " & $iAllFramesUbound)
+ for $i=1 to $iAllFramesUbound - 1
+ ; 湮 湮Ͽ ű frame ߰
+ if $aAllFrames[$i][2] = "" then
+ $bAllSearch = False
+ $aAllFrames[$i][2] = "S"
+ if _WD_go_frame($aAllFrames[$i][1]) then
+ $aFrames = _WD_find_elements_by("tag name", "iframe")
+ ;debug("ű߰ : " & ubound($aFrames,1))
+ if ubound($aFrames,1) > 0 then
+ ;_msg("ű߰21 : " & ubound($aFrames,1))
+ redim $aAllFrames[$iAllFramesUbound + ubound($aFrames,1)][3]
+ ;debug (ubound($aAllFrames,1))
+ ;msg($aFrames)
+ ;msg("ű߰22 : " & ubound($aFrames,1))
+ ;msg($aFrames)
+ for $j=1 to ubound($aFrames,1)
+ ;debug("ű߰3: " & ubound($aFrames,1))
+ ;debug(":" & ubound($aFrames,1) -1)
+ $iAllFrameNewIndex = ($iAllFramesUbound -1) + $j
+ $aTemp = $aFrames[$j-1]
+ ;_msg($aTemp)
+ ;debug ("߰:" & $iAllFrameNewIndex)
+ $aAllFrames [$iAllFrameNewIndex][1] = $aAllFrames[$i][1] & "-" & $aTemp[1][1]
+ next
+ endif
+ endif
+ endif
+ next
+
+ return $bAllSearch
+
+endfunc
+
+
+func _WD_go_frame($sFrameID)
+
+ ; "0-11-22" ڿ мϿ ش ̵
+ local $aID = StringSplit($sFrameID,"-")
+ local $i
+ local $bSuccess
+
+ ;debug("̵: " & $sFrameID)
+
+ for $i=1 to ubound($aID,1)-1
+
+ if $i=1 then
+ $bSuccess = _WD_focus_frame($_JSONNull)
+ else
+ $bSuccess = _WD_focus_frame(_JSONObject("ELEMENT",$aID[$i]))
+ endif
+
+ if $bSuccess = False then ExitLoop
+ next
+
+ return $bSuccess
+
+endfunc
+
+
+func _WD_isTestPlatformWEB()
+
+ if $_webdriver_testplatform = "" then $_webdriver_testplatform = _WD_getBrowserType()
+
+ ;_msg($_webdriver_testplatform)
+
+ return _iif($_webdriver_testplatform = "WEB",True, False)
+
+endfunc
diff --git a/guitar/bin/GuitarWebdriverXpath.au3 b/guitar/bin/GuitarWebdriverXpath.au3
new file mode 100644
index 0000000..9c195ea
--- /dev/null
+++ b/guitar/bin/GuitarWebdriverXpath.au3
@@ -0,0 +1,308 @@
+#include-once
+#include ".\_include_nhn\_webdriver.au3"
+#include "GuitarWebdriver.au3"
+
+
+Local Enum $_EWXP_TYPE = 1, $_EWXP_VALUE
+
+local $x
+
+func _WD_XpathGetShotPathlist($sElementID, byref $aShotXpathList)
+
+ local $i
+ local $aParentElementAttribute = _WD_XpathGetSearchTemplate ()
+ local $aMainElementAttribute = _WD_XpathGetSearchTemplate ()
+ local $aParentElementAttribute
+ local $aMainElementXpathList
+ local $aParentElementXpathList [1]
+ local $aMainElementXpathDeleteList [1]
+ local $aParentElementXpathDeleteList
+ local $sParentElementID
+ local $sParentElementTagName
+
+ local $sInfoMessage
+ local $bSuccess = False
+
+ $aShotXpathList = $aMainElementXpathDeleteList
+
+ if $sElementID = "" then
+
+ $sInfoMessage = " Xpath شϴ ã ϴ."
+
+ return $sInfoMessage
+ endif
+
+ _WD_XpathGetElementAttribute($sElementID, $aMainElementAttribute, 0)
+ _debug(" element " & $sElementID)
+ _debug($aMainElementAttribute)
+
+
+ ; Ӽ ⺻ xptah
+ $aMainElementXpathList = _WD_XpathMakeString($aMainElementAttribute, 0, $aMainElementXpathDeleteList)
+ _WD_XpathVerification($aMainElementXpathList, $aMainElementXpathDeleteList, $sElementID)
+
+
+ ; ܵ Ӽ ã ʴ
+ ;if ubound($aMainElementXpathList) = 1 then
+ ;_msg(" ã")
+ ; TAG ⺻ ߰
+ if ubound($aMainElementXpathDeleteList) = 1 then _ArrayAdd($aMainElementXpathDeleteList, "//" & $aMainElementAttribute[1][$_EWXP_VALUE])
+
+ ; ִ 10 ȸ θ
+ $sParentElementID = $sElementID
+
+ for $i=1 to 3
+
+ $sParentElementID = _WD_find_element_from ($sParentElementID, "xpath","..")
+
+ if $sParentElementID <> "" then
+
+ $aParentElementAttribute = _WD_XpathGetSearchTemplate ()
+
+ _WD_XpathGetElementAttribute($sParentElementID, $aParentElementAttribute, $i)
+
+ if $i=1 then $sParentElementTagName = $aParentElementAttribute[1][$_EWXP_VALUE]
+
+ ;_debug("θ ˻ : " & $sParentElementID)
+ ;_debug($aParentElementAttribute)
+
+ $aParentElementXpathList = _WD_XpathMakeString($aParentElementAttribute, $i, $aMainElementXpathDeleteList)
+
+ ;_msg("" & $sParentElementID)
+ ;_msg($aParentElementXpathList)
+ _WD_XpathVerification($aParentElementXpathList, $aParentElementXpathDeleteList, $sElementID)
+
+ ;_msg($aParentElementXpathList)
+
+ if ubound($aParentElementXpathList) <> 1 then
+ for $j=1 to ubound($aParentElementXpathList)-1
+ _ArrayAdd($aMainElementXpathList, $aParentElementXpathList[$j])
+ next
+ exitloop
+ endif
+
+ endif
+
+ next
+
+ ;endif
+
+
+ $aShotXpathList = $aMainElementXpathList
+
+
+ ; ũ Ʈ
+ if ubound($aShotXpathList) > 1 then
+ for $i=1 to ubound($aShotXpathList) -2
+ for $j=2 to ubound($aShotXpathList) -1
+ if stringlen($aShotXpathList[$i]) > stringlen($aShotXpathList[$j]) then _Swap($aShotXpathList[$i], $aShotXpathList[$j])
+ next
+ next
+ endif
+
+
+ if ubound($aShotXpathList) > 1 then $bSuccess = True
+
+ return $bSuccess
+
+ ;msg($aMainElementXpathList)
+ ;_debug($aMainElementXpathList)
+ ;_msg($aMainElementXpathDeleteList)
+
+endfunc
+
+
+func _WD_XpathParentVerification($sParentElementTagName, $aXpathDeleteList, $sElementID)
+
+ local $aElements
+ local $i
+ local $aCountElements
+ local $aXpathAddList [1]
+ local $aIDReturn
+ local $sTestXpath
+
+ for $i=1 to ubound($aXpathDeleteList) -1
+ $sTestXpath = "//" & $sParentElementTagName & StringTrimLeft($aXpathDeleteList[$i],1)
+ _debug($sTestXpath)
+ $aElements = _WD_find_elements_by("xpath", $sTestXpath)
+ _debug(" ã : -- " & ubound($aElements))
+
+ ; 10 ̸̳ ã
+ if ubound($aElements) > 0 and ubound($aElements) < 20 then
+
+ for $j=1 to ubound($aElements) -1
+ $sTestXpath ="//" & $sParentElementTagName & "[" & $j & "]" & StringTrimLeft($aXpathDeleteList[$i],0)
+ $aCountElements = _WD_find_elements_by("xpath", $sTestXpath)
+ _debug($sTestXpath & " " & ubound($aCountElements))
+ if ubound($aCountElements) = 1 then
+ ; о ID 쿡 ߰
+ $aIDReturn = $aCountElements[0]
+ $aIDReturn = $aIDReturn[1][1]
+ _debug(" ã ID " & $aIDReturn)
+ if $aIDReturn = $sElementID then _ArrayAdd($aXpathAddList, $sTestXpath)
+ else
+ if ubound($aCountElements) > 0 then
+ $aIDReturn = $aCountElements[0]
+ _debug ($aIDReturn)
+ endif
+ endif
+ next
+ endif
+ next
+
+ return $aXpathAddList
+
+endfunc
+
+func _WD_XpathVerification(byref $aXpathList, byref $aXpathDeleteList, $sElementID)
+
+ local $aNewXpathList
+ local $aXpathAddList
+ local $aElements
+ local $sTemp[1]
+ local $sTemp[1]
+ local $aIDReturn
+
+ $aXpathDeleteList = $sTemp
+ $aXpathAddList = $sTemp
+
+ for $i=1 to ubound($aXpathList) - 1
+ $aElements = _WD_find_elements_by("xpath", $aXpathList[$i])
+
+ _debug(" ã : " & $aXpathList[$i] & " -- " & ubound($aElements))
+ if ubound($aElements) = 1 then
+ ; о ID 쿡 ߰
+ $aIDReturn = $aElements[0]
+ $aIDReturn = $aIDReturn[1][1]
+
+ if $aIDReturn = $sElementID then _ArrayAdd($aXpathAddList, $aXpathList[$i])
+
+ else
+ _ArrayAdd($aXpathDeleteList, $aXpathList[$i])
+ endif
+ next
+
+ $aXpathList = $aXpathAddList
+
+ return $aXpathList
+
+endfunc
+
+
+func _WD_XpathMakeString($aElementAttribute, $iParentLevel, $aMainElementXpathDeleteList)
+ ; 1
+
+ local $i, $j
+ local $sNewXpath
+ local $aXPath[1]
+ local $aParentXPath[1]
+ local $aCopy = $aXPath
+
+
+
+ for $i=2 to ubound($aElementAttribute) -1
+
+ if $aElementAttribute[$i][$_EWXP_VALUE] <> "" then
+ $sNewXpath = ""
+
+ switch $aElementAttribute[$i][$_EWXP_TYPE]
+
+ case "text"
+ ; θ TEXT (ʹ text ˻ )
+ $sNewXpath = _WD_XpathMakeTextString ( $aElementAttribute[1][$_EWXP_VALUE], $aElementAttribute[$i][$_EWXP_VALUE])
+ case else
+ $sNewXpath = "//" & $aElementAttribute[1][$_EWXP_VALUE] & "[@" & $aElementAttribute[$i][$_EWXP_TYPE] & "='" & $aElementAttribute[$i][$_EWXP_VALUE] & "']"
+
+ EndSwitch
+
+ if $sNewXpath <> "" then _ArrayAdd($aXPath, $sNewXpath)
+
+ endif
+
+ next
+
+ if $iParentLevel <> 0 then
+
+ ; θ ߰ ȰͰ Ͽ List
+ for $i=1 to ubound($aMainElementXpathDeleteList)-1
+ for $j=1 to ubound($aXPath)-1
+ $sNewXpath = $aXPath[$j] & StringTrimLeft($aMainElementXpathDeleteList[$i],_iif($iParentLevel=1,1,0))
+ _ArrayAdd($aParentXPath, $sNewXpath)
+ next
+ next
+
+ $aXpath = $aParentXPath
+
+ endif
+
+ return $aXpath
+
+endfunc
+
+
+func _WD_XpathMakeTextString ($aTagName, $sText)
+
+ local $sXpathTextString
+ local $iMaxTextLen = 10
+
+ if stringlen($sText) > $iMaxTextLen then
+ $sText = Stringleft($sText, $iMaxTextLen)
+ $sXpathTextString = "//" & $aTagName & "[contains(.,'" & $sText & "')]"
+ else
+ $sXpathTextString = "//" & $aTagName & "[.='" & $sText & "']"
+ endif
+
+ return $sXpathTextString
+
+endfunc
+
+
+func _WD_XpathGetElementAttribute($sElementID, byref $aElementAttribute, $iParentLevel)
+
+ local $i
+ local $sVaule
+
+ ;_msg(_WD_get_element_tagname($sElementID))
+ $aElementAttribute[1][$_EWXP_VALUE] = _WD_get_element_tagname($sElementID)
+
+ for $i=2 to ubound($aElementAttribute) -1
+ if $aElementAttribute[$i][1] <> "" then
+ ; θ ̻ text
+ if not ($iParentLevel > 0 and $aElementAttribute[$i][$_EWXP_TYPE] = "text") then
+ if _WD_get_element_attribute($sElementID, $aElementAttribute[$i][1], $sVaule) then $aElementAttribute[$i][2] = $sVaule
+ endif
+ endif
+ next
+
+endfunc
+
+func _WD_XpathGetSearchTemplate ()
+
+ local $i=0
+ local $aPriority [100][3]
+
+ $i+=1
+ $aPriority[$i][$_EWXP_TYPE] = "tag"
+ $i+=1
+ $aPriority[$i][$_EWXP_TYPE] = "class"
+ $i+=1
+ $aPriority[$i][$_EWXP_TYPE] = "id"
+ $i+=1
+ $aPriority[$i][$_EWXP_TYPE] = "name"
+ $i+=1
+ $aPriority[$i][$_EWXP_TYPE] = "title"
+ $i+=1
+ $aPriority[$i][$_EWXP_TYPE] = "alt"
+ $i+=1
+ $aPriority[$i][$_EWXP_TYPE] = "text"
+ $i+=1
+ $aPriority[$i][$_EWXP_TYPE] = "innertext"
+ $i+=1
+ $aPriority[$i][$_EWXP_TYPE] = "value"
+
+ redim $aPriority [$i][3]
+
+ return $aPriority
+
+endfunc
+
diff --git a/guitar/bin/UIAAbout.au3 b/guitar/bin/UIAAbout.au3
index 4a2ef2a..f8824f0 100644
--- a/guitar/bin/UIAAbout.au3
+++ b/guitar/bin/UIAAbout.au3
@@ -51,7 +51,7 @@ func openAboutWindow()
ExitLoop
Case $msg[1] = $formAbout And $msg[0] = $lbHomepage
- ShellExecute("http://devcode.nhncorp.com/projects/guitar")
+ ShellExecute("http://dev.naver.com/projects/guitar")
EndSelect
WEnd
diff --git a/guitar/bin/UIAAnalysis.au3 b/guitar/bin/UIAAnalysis.au3
index 3f04b28..430912d 100644
--- a/guitar/bin/UIAAnalysis.au3
+++ b/guitar/bin/UIAAnalysis.au3
@@ -72,6 +72,13 @@ Global Const $_sCommandJSRun = "JSRun"
Global Const $_sCommandJSInsert = "JSInsert"
Global Const $_sCommandWDSessionCreate = "WDSessionCreate"
Global Const $_sCommandWDSessionDelete = "WDSessionDelete"
+Global Const $_sCommandWDAcceptAlert = "WDAcceptAlert"
+Global Const $_sCommandWDDismissAlert = "WDDismissAlert"
+
+Global Const $_sCommandWDNavigateBack = "WDNavigateBack"
+Global Const $_sCommandWDNavigateForward = "WDNavigateForward"
+Global Const $_sCommandWDNavigateRefresh = "WDNavigateRefresh"
+
Global Const $_sScriptFileExt = ".txt"
@@ -197,6 +204,7 @@ func _setCommonVar()
$_sRunningLogFile = $_runReportPath & "\" & "running.log"
$_sReportLogFile = $_runReportPath & "\" & "running_report.log"
+ $_sErrorSumarryFile = $_runReportPath & "\" & "errorsummary.txt"
SetKeyDelay()
@@ -301,6 +309,12 @@ func getCommandText()
addCommandList($iCommandCount, $_sCommandWDSessionCreate , $aCommandList, _getLanguageMsg("Command_WDSessionCreate"))
addCommandList($iCommandCount, $_sCommandWDSessionDelete , $aCommandList, _getLanguageMsg("Command_WDSessionDelete"))
+ addCommandList($iCommandCount, $_sCommandWDAcceptAlert , $aCommandList, _getLanguageMsg("Command_WDAcceptAlert"))
+ addCommandList($iCommandCount, $_sCommandWDDismissAlert , $aCommandList, _getLanguageMsg("Command_WDDismissAlert"))
+
+ addCommandList($iCommandCount, $_sCommandWDNavigateBack , $aCommandList, _getLanguageMsg("Command_WDNavigateBack"))
+ addCommandList($iCommandCount, $_sCommandWDNavigateForward , $aCommandList, _getLanguageMsg("Command_WDNavigateForward"))
+ addCommandList($iCommandCount, $_sCommandWDNavigateRefresh , $aCommandList, _getLanguageMsg("Command_WDNavigateRefresh"))
redim $aCommandList[$iCommandCount + 1][$_iCommandEnd]
@@ -1487,7 +1501,7 @@ func checkSimpleCommand($sCommand)
Switch $sCommand
- case $_sCommandSuccess, $_sCommandFail, $_sCommandCapture, $_sCommandBrowserEnd, $_sCommandMouseHide, $_sCommandMouseWheelUp , $_sCommandMouseWheelDown, $_sCommandComma, $_sCommandGoHome, $_sCommandBlockStart, $_sCommandBlockEnd, $_sCommandFullScreenWork, $_sCommandWDSessionDelete
+ case $_sCommandSuccess, $_sCommandFail, $_sCommandCapture, $_sCommandBrowserEnd, $_sCommandMouseHide, $_sCommandMouseWheelUp , $_sCommandMouseWheelDown, $_sCommandComma, $_sCommandGoHome, $_sCommandBlockStart, $_sCommandBlockEnd, $_sCommandFullScreenWork, $_sCommandWDSessionDelete, $_sCommandWDAcceptAlert, $_sCommandWDDismissAlert, $_sCommandWDNavigateBack, $_sCommandWDNavigateForward, $_sCommandWDNavigateRefresh
$bResult = True
@@ -1660,3 +1674,8 @@ func _UpdateFolderFileInfo($bForceUpdate)
endif
endfunc
+
+
+
+
+
diff --git a/guitar/bin/UIACommon.au3 b/guitar/bin/UIACommon.au3
index 4b41333..af93935 100644
--- a/guitar/bin/UIACommon.au3
+++ b/guitar/bin/UIACommon.au3
@@ -146,6 +146,7 @@ Global $_aRunScriptPathList[1]
Global $_sDebugLogFile
Global $_sRunningLogFile
Global $_sReportLogFile
+Global $_sErrorSumarryFile
Global $_sUserINIFile
diff --git a/guitar/bin/UIAHtml.au3 b/guitar/bin/UIAHtml.au3
index 91c2ae4..6f4f9b5 100644
--- a/guitar/bin/UIAHtml.au3
+++ b/guitar/bin/UIAHtml.au3
@@ -21,8 +21,6 @@ Global $_aTSTitle[$_iTSEnd] =["", "TestCaseName", "ID","
;test()
-
-
;_createHtmlReport("c:\1.htm" , FileRead("D:\_Autoit\JT\running.log"),"Ʈ : " & "111" , "", "" )
func test()
@@ -353,7 +351,7 @@ Func _INetGetMHT( $url, $file )
EndFunc
-Func _createHtmlReport($sHtmlFile, $sLog, $sTitle, $aNewAddInfo, $sCurrentPaht, $sScriptName, $sTestSkipID, $sTestNotRunID, $bXMLCreate, byref $sXML, $sDashBoardReport)
+Func _createHtmlReport($sTestingTime, $sHtmlFile, $sLog, $sTitle, $aNewAddInfo, $sCurrentPath, $sScriptName, $sTestSkipID, $sTestNotRunID, $bXMLCreate, byref $sXML, $sDashBoardReport, $bCreateErrorSumarry)
local $sHtml
local $aAddInfo[1]
@@ -413,17 +411,17 @@ Func _createHtmlReport($sHtmlFile, $sLog, $sTitle, $aNewAddInfo, $sCurrentPaht,
endif
- $aFailLog = _getTestResultLog($sLog, $sCurrentPaht, True, "" )
+ $aFailLog = _getTestResultLog($sLog, $sCurrentPath, True, "" )
addHtml ($sHtml,"")
if ubound($aFailLog) <> 1 then
addHtml ($sHtml,"" & "Ʈ α () :" & "
")
- addHtml ($sHtml,_createAllResultTable($aFailLog, $sTestSkipID, $sTestNotRunID, False, $sXML, $sDashBoardReport))
+ addHtml ($sHtml,_createAllResultTable($sScriptName, $sTestingTime, $aFailLog, $sTestSkipID, $sTestNotRunID, False, $sXML, $sDashBoardReport, $bCreateErrorSumarry))
endif
addHtml ($sHtml,"")
addHtml ($sHtml,"" & "Ʈ α (ü):" & "
")
- addHtml ($sHtml,_createAllResultTable(_getTestResultLog($sLog, $sCurrentPaht, False, $sTestSkipID), $sTestSkipID, $sTestNotRunID, $bXMLCreate, $sXML, $sDashBoardReport))
+ addHtml ($sHtml,_createAllResultTable($sScriptName, $sTestingTime, _getTestResultLog($sLog, $sCurrentPath, False, $sTestSkipID), $sTestSkipID, $sTestNotRunID, $bXMLCreate, $sXML, $sDashBoardReport, False))
addHtml ($sHtml,"