2017-11-19 28 views
-1

여러 입력 (매개 변수화)으로 테스트를 실행하는 경우 타임 스탬프가있는 파일을 생성하려고합니다.writetofile 속성을 사용할 때 UFT에서 파일 이름에 타임 스탬프를 추가하는 방법

파일 이름에 타임 스탬프를 추가하는 방법을 제안하십시오. 예 : C:\xxx\xxxx\xxx\Responses\xxx.xlsx이 경로에 고유 한 파일을 만들기 위해 타임 스탬프를 추가해야합니다.

+0

당신이 당신의 코드를 게시 할 수 있을까요? 우리가 한 일을 보여주십시오. –

답변

0

쉬운 옵션 :

Dim sTimeStamp, sPath 
sPath = "C:\Path\To\My\Folder\myFile.xlsx" 

' Get current time and date value and strip out the separators 
sTimeStamp = Replace(Replace(Replace(Now, " ", "_"), "/", ""), ":", "") 

'insert timestamp into file name 
sPath = Replace(sPath, ".xlsx", "_" & sTimeStamp & ".xlsx") 

Debug.Write sPath ' output is C:\Path\To\My\Folder\myFile_20112017_015827.xlsx