function uploadIndividual() { var registrarCode = Project.Variables.code.Value("codeRegister"); var issuerCode = Project.Variables.code.Value("issuerCode"); var clientCode = Project.Variables.code.Value("accountclientCodeUpload"); var nameIndividual = Project.Variables.name.Value("investoreIndividualName1"); var ktpIndividual = Project.Variables.npwp.Value("ktpInvestor1"); var passportNumber = Project.Variables.code.Value("passportNumberUpload"); var bod = Project.Variables.createUser.Value("bodUpload"); var url = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Investor Individual\\"; var template = '\n'+ '\n'+ 'CREATION\n'+ 'INDIVIDUAL\n'+ 'DIRECT\n'+ ''+registrarCode+'\n'+ ''+clientCode+'\n'+ ''+issuerCode+'\n'+ '101001\n'+ '\n'+ '\n'+ '\n'+ 'CN\n'+ ''+ktpIndividual+'\n'+ '\n'+ '20251010\n'+ '\n'+ '\n'+ ''+passportNumber+'\n'+ '21200312\n'+ '\n'+ '\n'+ 'JAKARTA\n'+ ''+bod+'\n'+ 'JALAN AUTOMATION\n'+ '\n'+ '\n'+ '999\n'+ '1000\n'+ '\n'+ 'CN\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '1\n'+ '1\n'+ '\n'+ 'AUTOMATION\n'+ '\n'+ '\n'+ '3\n'+ '4\n'+ '\n'+ '\n'+ '2\n'+ '2\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '\n'+ '1\n'+ '\n'+ '1\n'+ 'N\n'+ '\n'+ '' ; if (aqFile.Create(url + 'inv_inda.sdi') == 0) { aqFile.WriteToTextFile(url + 'inv_inda.sdi', template, aqFile.ctUTF8); Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis."); var fileName = "inv_inda.sdi"; Log.SaveResultsAs(fileName, 2); // Specifies the name of the archive var archivePath = url + "inv_indi"; // Packes the resutls if (slPacker.Pack(fileName, url, archivePath)) { var OldPath = url + "inv_indi.Zip"; var NewPath = url + "inv_inda.zip"; // Renames the file aqFileSystem.RenameFile(OldPath, NewPath); Log.Message("Files compressed successfully."); } } else { aqFile.Delete(url + 'inv_inda.sdi'); Log.Message("Delete successfully."); aqFile.Delete(url + 'inv_inda.zip'); Log.Message("Delete successfully."); if (aqFile.Create(url + 'inv_inda.sdi') == 0) { aqFile.WriteToTextFile(url + 'inv_inda.sdi', template, aqFile.ctUTF8); Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis."); var fileName = "inv_inda.sdi"; Log.SaveResultsAs(fileName, 2); // Specifies the name of the archive var archivePath = url + "inv_indi"; // Packes the resutls if (slPacker.Pack(fileName, url, archivePath)) { var OldPath = url + "inv_indi.Zip"; var NewPath = url + "inv_inda.zip"; // Renames the file aqFileSystem.RenameFile(OldPath, NewPath); Log.Message("Files compressed successfully."); } } } }