Hey there,
I'm trying to figure out how to Import Dates from a CSV file into Testcomplete. I got a huge Problem when the Date has a starting \"0\" because I think Testcomplete is importing the Date as a Number.
I'm from Germany and I must use the following Date Format in the tested program. (DD.MM.YYYY)
For example:
CSV-File Imported
01.01.2020 1012020
12.01.2020 12012020
’01.01.2020’ ’01.01.2020’
I need:
01.01.2020 01.01.2020
or 01012020
I already tried the Schema.ini file but it's not working for me.
I hope you can help me.
Greetings
Hey there,
I'm trying to figure out how to Import Dates from a CSV file into Testcomplete. I got a huge Problem when the Date has a starting \"0\" because I think Testcomplete is importing the Date as a Number.
I'm from Germany and I must use the following Date Format in the tested program. (DD.MM.YYYY)
For example:
CSV-File Imported
01.01.2020 1012020
12.01.2020 12012020
’01.01.2020’ ’01.01.2020’
I need:
01.01.2020 01.01.2020
or 01012020
I already tried the Schema.ini file but it's not working for me.
I hope you can help me.
Greetings
This should help:
\nhttps://support.smartbear.com/testcomplete/docs/reference/program-objects/aqconvert/strtodate.html
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"120","kudosSumWeight":1,"postTime":"2020-07-23T07:46:09.408-07:00","lastPublishTime":"2020-07-23T07:46:09.408-07:00","metrics":{"__typename":"MessageMetrics","views":2200},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:204983/message:205049","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjQuMTF8Mi4xfG98M3wxNDowLDM5OjF8MQ","node":{"__ref":"ForumReplyMessage:message:205159"}},{"__typename":"MessageEdge","cursor":"MjQuMTF8Mi4xfG98M3wxNDowLDM5OjF8Mg","node":{"__ref":"ForumReplyMessage:message:205245"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:205159":{"__typename":"ModerationData","id":"moderation_data:205159","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:205159":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:75488"},"id":"message:205159","revisionNum":1,"uid":205159,"depth":2,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumReplyMessage:message:205049"},"conversation":{"__ref":"Conversation:conversation:204983"},"subject":"Re: Import Dates with data loop and CSV","moderationData":{"__ref":"ModerationData:moderation_data:205159"},"body":"Thank you for providing guidance Marsha!
\n\n
RKU_AVO was this article helpful?
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"92","kudosSumWeight":0,"repliesCount":0,"postTime":"2020-07-27T04:47:04.280-07:00","lastPublishTime":"2020-07-27T04:47:04.280-07:00","metrics":{"__typename":"MessageMetrics","views":2180},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:204983/message:205159","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:205245":{"__typename":"ModerationData","id":"moderation_data:205245","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:205245":{"__typename":"ForumReplyMessage","uid":205245,"id":"message:205245","revisionNum":1,"author":{"__ref":"User:user:90013"},"readOnly":false,"repliesCount":1,"depth":2,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumReplyMessage:message:205049"},"conversation":{"__ref":"Conversation:conversation:204983"},"subject":"Re: Import Dates with data loop and CSV","moderationData":{"__ref":"ModerationData:moderation_data:205245"},"body":"Hey,
thanks for the respond but this is not working for me because the data is converted while Import.
As you can see in the Field F5 the Dates are converted to numbers.
The normal data is:
01.01.2020
12.01.2020
Thanks
If you already have a string, then you can use aqString methods to pick the string apart and rebuild it in the format you want.
\nhttps://support.smartbear.com/testcomplete/docs/reference/program-objects/aqstring/methods.html
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"203","kudosSumWeight":1,"repliesCount":0,"postTime":"2020-07-28T08:10:40.296-07:00","lastPublishTime":"2020-07-28T08:10:40.296-07:00","metrics":{"__typename":"MessageMetrics","views":2159},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:204983/message:205270","customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:205300":{"__typename":"ModerationData","id":"moderation_data:205300","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"AcceptedSolutionMessage:message:205300":{"__typename":"AcceptedSolutionMessage","author":{"__ref":"User:user:90013"},"id":"message:205300","revisionNum":2,"uid":205300,"depth":1,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumTopicMessage:message:204983"},"conversation":{"__ref":"Conversation:conversation:204983"},"subject":"Re: Import Dates with data loop and CSV","moderationData":{"__ref":"ModerationData:moderation_data:205300"},"body":"I made a small Workaround now and my Problem is done with it.
function Excel_Loop()
{
//Runs the \"EXCEL\" tested application.
TestedApps.EXCEL.Run(1, true);
Project.Variables.csv2207.Reset();
for(; !Project.Variables.csv2207.IsEOF();)
{
csvimporttest = Project.Variables.csv2207.Value(\"F5\");
test123 = String(Project.Variables.csv2207.Value(\"F5\"));
laengecsv = test123.length;
if (laengecsv < 8 {
csvimporttest = \"kleiner 8\" + \" 0\" + Project.Variables.csv2207.Value(\"F5\") + \" \" + laengecsv
}
else {
csvimporttest = \"größer 7\" + \" \" + Project.Variables.csv2207.Value(\"F5\") + \" \" + laengecsv
}
//csvimporttest = Project.Variables.csv2207.Value(\"F5\") + \" \" + laengecsv
//csvimporttest = \"Test123\" + Project.Variables.csv2207.Value(\"F5\")
Aliases.EXCEL.wndXLMAIN.XLDESK.Mappe1.Keys(csvimporttest);
Aliases.EXCEL.wndXLMAIN.XLDESK.EXCEL6.Keys(\"[Enter]\");
Project.Variables.csv2207.Next();
}
}
I imported the data as before but then i watched at the length of the importet value and added a leading 0 when the length is 7.
Thanks for your Replys
/discussions/soapui_os/assertions/255511
🎉 NEW API Hub and Insight Hub are here to simplify workflows and help you deliver quality faster. Learn More