function issuance() { var registrarCode = Project.Variables.code.Value("codeRegister"); var url = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Issuance\\issuance.sti"; var zip = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Issuance\\issuance.zip"; var account = Project.Variables.getAccount1.Value("sid1"); var securityCode = Project.Variables.code.Value("instrumenLocalCode"); var certif2 = Project.Variables.certificate.Value("certif2"); var certif3 = Project.Variables.certificate.Value("certif3"); var certif4 = Project.Variables.certificate.Value("certif4"); var certif5 = Project.Variables.certificate.Value("certif5"); var certif6 = Project.Variables.certificate.Value("certif6"); var certif7 = Project.Variables.certificate.Value("certif7"); var certif8 = Project.Variables.certificate.Value("certif8"); var certif9 = Project.Variables.certificate.Value("certif9"); var certif10 = Project.Variables.certificate.Value("certif10"); var certif11 = Project.Variables.certificate.Value("certif11"); var today = new Date(); var dd = String(today.getDate()).padStart(2, '0'); var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! var yyyy = today.getFullYear(); today = yyyy + mm + dd; var template = '\n'+ '\n'+ ''+certif2+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '20\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif2+'\n'+ '11-30\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '\n'+ ''+certif3+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '30\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif3+'\n'+ '31-60\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '\n'+ ''+certif4+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '40\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif4+'\n'+ '61-100\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '\n'+ ''+certif5+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '50\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif5+'\n'+ '101-150\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '\n'+ ''+certif6+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '60\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif6+'\n'+ '151-210\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '\n'+ ''+certif7+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '70\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif7+'\n'+ '211-280\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '\n'+ ''+certif8+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '80\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif8+'\n'+ '281-360\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '\n'+ ''+certif9+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '90\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif9+'\n'+ '361-450\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '\n'+ ''+certif10+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '100\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif10+'\n'+ '451-550\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '\n'+ ''+certif11+'\n'+ ''+registrarCode+'\n'+ ''+account+'\n'+ 'LOCAL\n'+ ''+securityCode+'\n'+ '110\n'+ ''+today+'\n'+ 'ISSUANCE\n'+ ''+certif11+'\n'+ '551-660\n'+ 'B\n'+ 'ISSU\n'+ '9X000\n'+ '\n'+ '' ; if (aqFile.Create(url) == 0) { aqFile.WriteToTextFile(url, template, aqFile.ctUTF8); Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis."); } else { aqFile.Delete(url); aqFile.Delete(zip); if (aqFile.Create(url) == 0) { aqFile.WriteToTextFile(url, template, aqFile.ctUTF8); Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis."); } } }