Undefined folder created
It creates an undefined folder only. Inside Undefined we got Manual and inside Manual we got time stamp. The main problem is the first folder Undefined. Could anyone please help me?
function Test()
{
var currentDateAndTime = aqDateTime.Now();
var currentTime = aqDateTime.Time();
var currentDate = aqDateTime.Today();
var projectName = ProjectSuite.Variables.projectName;
var testtype = ProjectSuite.Variables.testtype;
var timestamp = aqDateTime.Now(); //currentDate + currentTime;
if(testtype == "Manual")
{
ProjectSuite.Variables.buildnumber = aqConvert.DateTimeToFormatStr(timestamp, "%m%d%Y_%H%M%S");
}
var folderPath = "E:\\Results\\" + projectName + "\\" + testtype +"\\" + ProjectSuite.Variables.buildnumber + "\\";
//var folderPath = Project.Variables.resultpath;
// Check if the folder already exists
//if (!aqFileSystem.Exists(folderPath)) {
// Create the folder
//if (aqFileSystem.CreateFolder(folderPath)) {
// Log.Message("Folder created successfully: " + folderPath);
// } else {
//Log.Error("Failed to create folder: " + folderPath);
// }
//} else {
// Log.Warning("Folder already exists: " + folderPath);
//}
aqFileSystem.CreateFolder(folderPath);
//folderPath = folderPath + "\\"
Log.SaveResultsAs(folderPath, lsXML, true, 1); // Files are created in the Project1 folder
}
Folder is created without issues,
Ensure you have appropriate permissions to create a folder in your E: drive.