OBFile = aqString.Concat(DDT.CurrentDriver.Value[0], DDT.CurrentDriver.Value[1])
Baseline = DDT.CurrentDriver.Value[2]
AllowableDiff = StrToInt(DDT.CurrentDriver.Value[3])
# Perform file comparison for each entry in the Excel file
if (Files.Baseline.Check(OBFile, AllowableDiff) == False):
Log.Warning(\"For BaselineFileName\" + \": \" + aqConvert.VarToStr(DDT.CurrentDriver.Value[2]) + \"the file HashCompare is beyond acceptable threshold - Please review OB file and compare against baseline file in SmartBear Repository.\", pmHighest)# highest priority
else:
Log.Message(aqConvert.VarToStr(DDT.CurrentDriver.Value[2]) + \"file was verified and is either identical or within acceptable threshold - No further actoin is needed.\")
It fails with error on the \"if (Files.Baseline.Check(OBFile, AllowableDiff) == False):\" line :
Python runtime error.
AttributeError
the object does not support this property or method
I just need a way to pass in the File Object names - I am storing these names in the DDT.ExcelDriver as well since there are so many and they need to correspond with the Files I am comparing against. Just need a way to represent this as an Object in the script. Any ideas?
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"218","kudosSumWeight":0,"postTime":"2017-11-08T13:15:01.172-08:00","lastPublishTime":"2017-11-08T13:15:01.172-08:00","metrics":{"__typename":"MessageMetrics","views":2784},"visibilityScope":"PUBLIC","placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjUuNHwyLjF8b3wxfDE0OjAsMzk6MXwx","node":{"__ref":"ForumReplyMessage:message:153213"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:153213":{"__typename":"ModerationData","id":"moderation_data:153213","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:153213":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:66982"},"id":"message:153213","entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:152785/message:153213","revisionNum":2,"uid":153213,"depth":3,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumReplyMessage:message:153196"},"conversation":{"__ref":"Conversation:conversation:152785"},"subject":"Re: most efficient way to code file comparison checkpoints in large quantities","moderationData":{"__ref":"ModerationData:moderation_data:153213"},"body":"Files.Baseline.Check()
\n\n
Files provides an interface ONLY to the objects created in Stores/Files, however you are trying to get access to the Baseline, which actually is a DDT object.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"205","kudosSumWeight":0,"repliesCount":1,"postTime":"2017-11-09T01:35:26.623-08:00","lastPublishTime":"2017-11-09T01:35:46.384-08:00","metrics":{"__typename":"MessageMetrics","views":2785},"visibilityScope":"PUBLIC","placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"readOnly":false},"QueryVariables:MessageSolutions":{"__typename":"QueryVariables","id":"MessageSolutions","value":{"first":10,"constraints":{"topicId":{"eq":"message:152785"},"solution":{"eq":true}},"sorts":{"postTime":{"direction":"ASC"}},"useAvatar":true,"useAuthorLogin":true,"useAuthorRank":false,"useBody":true,"useKudosCount":false,"useTimeToRead":false,"useMedia":true,"useRepliesCount":false,"useSearchSnippet":false,"useAcceptedSolutionButton":true,"useSolvedBadge":false,"useAttachments":true,"useTags":false,"useUserHoverCard":false,"useNodeHoverCard":false,"usePreviewSubjectModal":false,"useMessageStatus":false}},"CachedAsset:text:en_US-components/messages/EscalatedMessageBanner-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/EscalatedMessageBanner-1749759380271","value":{"escalationMessage":"Escalated to Salesforce by {username} on {date}","viewDetails":"View Details","modalTitle":"Case Details","escalatedBy":"Escalated by: ","escalatedOn":"Escalated on: ","caseNumber":"Case Number: ","status":"Status: ","lastUpdateDate":"Last Update: ","automaticEscalation":"automatic escalation","anonymous":"Anonymous"},"localOverride":false},"CachedAsset:text:en_US-components/users/UserLink-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/users/UserLink-1749759380271","value":{"authorName":"View Profile: {author}","anonymous":"Anonymous"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/users/UserRank-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserRank-1749759380271","value":{"rankName":"{rankName}","userRank":"Author rank {rankName}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageTime-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageTime-1749759380271","value":{"postTime":"Published: {time}","lastPublishTime":"Last Update: {time}","conversation.lastPostingActivityTime":"Last posting activity time: {time}","conversation.lastPostTime":"Last post time: {time}","moderationData.rejectTime":"Rejected time: {time}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageSolvedBadge-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageSolvedBadge-1749759380271","value":{"solved":"Solved"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageSubject-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageSubject-1749759380271","value":{"noSubject":"(no subject)"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageBody-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageBody-1749759380271","value":{"showMessageBody":"Show More","mentionsErrorTitle":"{mentionsType, select, board {Board} user {User} message {Message} other {}} No Longer Available","mentionsErrorMessage":"The {mentionsType} you are trying to view has been removed from the community.","videoProcessing":"Video is being processed. Please try again in a few minutes.","bannerTitle":"Video provider requires cookies to play the video. Accept to continue or {url} it directly on the provider's site.","buttonTitle":"Accept","urlText":"watch"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageCustomFields-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageCustomFields-1749759380271","value":{"CustomField.default.label":"Value of {name}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageReplyButton-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageReplyButton-1749759380271","value":{"repliesCount":"{count}","title":"Reply","title@board:BLOG@message:root":"Comment","title@board:TKB@message:root":"Comment","title@board:IDEA@message:root":"Comment","title@board:OCCASION@message:root":"Comment"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageSolutionList-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageSolutionList-1749759380271","value":{"emptyDescription":"No has been message solutions yet"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageListMenu-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageListMenu-1749759380271","value":{"postTimeAsc":"Oldest","postTimeDesc":"Newest","kudosSumWeightAsc":"Least Liked","kudosSumWeightDesc":"Most Liked","sortTitle":"Sort By","sortedBy.item":" { itemName, select, postTimeAsc {Oldest} postTimeDesc {Newest} kudosSumWeightAsc {Least Liked} kudosSumWeightDesc {Most Liked} other {}}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/AcceptedSolutionButton-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/AcceptedSolutionButton-1749759380271","value":{"accept":"Mark as Solution","accepted":"Marked as Solution","errorHeader":"Error!","errorAdd":"There was an error marking as solution.","errorRemove":"There was an error unmarking as solution.","solved":"Solved","topicAlreadySolvedErrorTitle":"Solution Already Exists","topicAlreadySolvedErrorDesc":"Refresh the browser to view the existing solution"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/common/Pager/PagerLoadMore-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/common/Pager/PagerLoadMore-1749759380271","value":{"loadMore":"Show More"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageView/MessageViewInline-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageView/MessageViewInline-1749759380271","value":{"bylineAuthor":"{bylineAuthor}","bylineBoard":"{bylineBoard}","anonymous":"Anonymous","place":"Place {bylineBoard}","gotoParent":"Go to parent {name}"},"localOverride":false},"User:user:45447":{"__typename":"User","id":"user:45447","uid":45447,"login":"tristaanogre","biography":null,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2009-11-30T22:07:57.000-08:00"},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://community.smartbear.com/t5/s/nwkab66374/images/dS00NTQ0Ny0zMzU5aTMyNEQ2NzhFNzA1Mjc2RUI"},"entityType":"USER","eventPath":"community:nwkab66374/user:45447"},"ModerationData:moderation_data:153234":{"__typename":"ModerationData","id":"moderation_data:153234","status":"APPROVED","rejectReason":null},"AcceptedSolutionMessage:message:153234":{"__typename":"AcceptedSolutionMessage","author":{"__ref":"User:user:45447"},"id":"message:153234","entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:152785/message:153234","revisionNum":1,"uid":153234,"depth":4,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumReplyMessage:message:153213"},"conversation":{"__ref":"Conversation:conversation:152785"},"subject":"Re: most efficient way to code file comparison checkpoints in large quantities","moderationData":{"__ref":"ModerationData:moderation_data:153234"},"body":"I don't know Python well so forgive me if my syntax is incorrect.
\n\n
If I understand correctly, Baseline, as it comes from the DDT driver, is a text string that represents the name of the file in the Files store of TestComplete. So, you want to compare that file to what is being created as OBFile, right?
\n\n
If that's the case, then your comparison should look like this:
# Creates a driver\nDriver = DDT.ExcelDriver(\"C:\\\\SmartBear-DDTDrivers\\\\BulkCustody.xlsx\", \"Sheet1\")\n\nOBFile = aqString.Concat(DDT.CurrentDriver.Value[0], DDT.CurrentDriver.Value[1])\nBaseline = DDT.CurrentDriver.Value[2]\nAllowableDiff = StrToInt(DDT.CurrentDriver.Value[3])\n\n# Perform file comparison for each entry in the Excel file\nif (Files.Items(Baseline).Check(OBFile, AllowableDiff) == False):\n Log.Warning(\"For BaselineFileName\" + \": \" + aqConvert.VarToStr(DDT.CurrentDriver.Value[2]) + \"the file HashCompare is beyond acceptable threshold - Please review OB file and compare against baseline file in SmartBear Repository.\", pmHighest)# highest priority\nelse:\n Log.Message(aqConvert.VarToStr(DDT.CurrentDriver.Value[2]) + \"file was verified and is either identical or within acceptable threshold - No further actoin is needed.\")\n
The Files.Items method returns the File object with the indicated name. You can then call the \"Check\" method of that item as you are doing.
","body@stripHtml({\"removeProcessingText\":true,\"removeSpoilerMarkup\":true,\"removeTocMarkup\":true,\"truncateLength\":200})@stringLength":"213","postTime":"2017-11-09T05:59:53.981-08:00","lastPublishTime":"2017-11-09T05:59:53.981-08:00","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"attachments":{"__typename":"AttachmentConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"solution":true,"metrics":{"__typename":"MessageMetrics","views":2774},"placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"videos":{"__typename":"VideoConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"isEscalated":null,"customFields":[]},"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserAvatar-1749759380271","value":{"altText":"{login}'s avatar","altTextGeneric":"User's avatar"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/ranks/UserRankLabel-1749759380271","value":{"altTitle":"Icon for {rankName} rank"},"localOverride":false},"CachedAsset:text:en_US-components/common/ExternalLinkWarningModal-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/common/ExternalLinkWarningModal-1749759380271","value":{"title":"Leaving the Community","description":"You're about to leave this site and navigate to an external domain. Are you sure you want to continue?","action.submit":"Continue","action.cancel":"Go Back"},"localOverride":false}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"testcomplete-questions","messageSubject":"most-efficient-way-to-code-file-comparison-checkpoints-in-large-quantities","messageId":"152785"},"buildId":"3XH0qYWYCnEYycuN5W4S8","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","surveysEnabled":true,"openTelemetry":{"clientEnabled":false,"configName":"smartbear","serviceVersion":"25.4.0","universe":"prod","collector":"http://localhost:4318","logLevel":"error","routeChangeAllowedTime":"5000","headers":"","enableDiagnostic":"false","maxAttributeValueLength":"4095"},"apolloDevToolsEnabled":false,"quiltLazyLoadThreshold":"3"},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["components_seo_QAPageSchema","components_community_Navbar_NavbarWidget","components_community_Breadcrumb_BreadcrumbWidget","components_messages_TopicWithThreadedReplyListWidget","components_messages_MessageListForNodeByRecentActivityWidget","components_messages_RelatedContentWidget","components_customComponent_CustomComponent","components_messages_MessageView_MessageViewStandard","components_messages_ThreadedReplyList","components_messages_EscalatedMessageBanner","shared_client_components_common_List_UnstyledList","components_messages_MessageView","shared_client_components_common_Pager_PagerLoadMore","components_messages_MessageView_MessageViewInline","components_customComponent_CustomComponentContent_TemplateContent"],"appGip":true,"scriptLoader":[]}