function conversion() { 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 Conversion Demat\\conv_to_demat.conv"; var zip = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Conversion Demat\\conv_to_demat.zip"; var account = Project.Variables.getAccount1.Value("sid1"); var securityCode = Project.Variables.code.Value("instrumenLocalCode"); var certif4 = Project.Variables.certificate.Value("certif4"); 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'+ ' '+certif4+'\n'+ ' '+registrarCode+'\n'+ ' '+account+'\n'+ ' LOCAL\n'+ ' '+securityCode+'\n'+ ' 40\n'+ ' '+today+'\n'+ ' DEISSUANCE\n'+ ' '+certif4+'\n'+ ' 61-100\n'+ ' DEMAT\n'+ ' 123456789\n'+ ' '+certif4+'\n'+ ' 61-100\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."); } } }