I'm getting blank page while using page.PagePicture method. Kindly help.
Function TakeFullScreenshot(page)\nDim screenshot\nscreenshot = Project.Variables.REPORTPATH&\"\\\\\" & aqConvert.DateTimeToFormatStr(aqDateTime.Now(), \"%m%d%Y_%H%M%S\") & \".jpg\"\n\npage.PagePicture().SaveToFile screenshot\n\nTakeFullScreenshot = screenshot\nEnd Function","body@stringLength":"374","rawBody":"
I'm getting blank page while using page.PagePicture method. Kindly help.
Function TakeFullScreenshot(page)\nDim screenshot\nscreenshot = Project.Variables.REPORTPATH&\"\\\\\" & aqConvert.DateTimeToFormatStr(aqDateTime.Now(), \"%m%d%Y_%H%M%S\") & \".jpg\"\n\npage.PagePicture().SaveToFile screenshot\n\nTakeFullScreenshot = screenshot\nEnd Function","author":{"__ref":"User:user:85589"},"isEscalated":null,"postTime":"2019-11-20T22:30:24.676-08:00","solution":false,"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"kudosSumWeight":0,"repliesCount":3,"images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:193923_2"},"latestVersion":null,"metrics":{"__typename":"MessageMetrics","views":1251},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}}},"Revision:revision:193952_2":{"__typename":"Revision","id":"revision:193952_2","lastEditTime":"2019-11-21T06:22:04.146-08:00"},"QueryVariables:ReplyList:message:193952:2":{"__typename":"QueryVariables","id":"ReplyList:message:193952:2","value":{"id":"message:193952","first":10,"sorts":{"kudosSumWeight":{"direction":"DESC","order":0},"postTime":{"direction":"ASC","order":1}},"repliesFirst":3,"repliesFirstDepthThree":1,"repliesSorts":{"kudosSumWeight":{"direction":"DESC","order":0},"postTime":{"direction":"ASC","order":1}},"useAvatar":true,"useAuthorLogin":true,"useAuthorRank":true,"useBody":true,"useKudosCount":true,"useTimeToRead":false,"useMedia":false,"useReadOnlyIcon":false,"useRepliesCount":true,"useSearchSnippet":false,"useAcceptedSolutionButton":true,"useSolvedBadge":false,"useAttachments":false,"attachmentsFirst":5,"useTags":false,"useNodeAncestors":false,"useUserHoverCard":false,"useNodeHoverCard":false,"useModerationStatus":true,"usePreviewSubjectModal":false,"useMessageStatus":true}},"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1741125846000":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserAvatar-1741125846000","value":{"altText":"{login}'s avatar","altTextGeneric":"User's avatar"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1741125846000":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/ranks/UserRankLabel-1741125846000","value":{"altTitle":"Icon for {rankName} rank"},"localOverride":false},"CachedAsset:text:en_US-components/messages/AcceptedSolutionButton-1741125846000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/AcceptedSolutionButton-1741125846000","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-components/messages/ThreadedReplyList-1741125846000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/ThreadedReplyList-1741125846000","value":{"title":"{count, plural, one{# Reply} other{# Replies}}","title@board:BLOG":"{count, plural, one{# Comment} other{# Comments}}","title@board:TKB":"{count, plural, one{# Comment} other{# Comments}}","title@board:IDEA":"{count, plural, one{# Comment} other{# Comments}}","title@board:OCCASION":"{count, plural, one{# Comment} other{# Comments}}","noRepliesTitle":"No Replies","noRepliesTitle@board:BLOG":"No Comments","noRepliesTitle@board:TKB":"No Comments","noRepliesTitle@board:IDEA":"No Comments","noRepliesTitle@board:OCCASION":"No Comments","noRepliesDescription":"Be the first to reply","noRepliesDescription@board:BLOG":"Be the first to comment","noRepliesDescription@board:TKB":"Be the first to comment","noRepliesDescription@board:IDEA":"Be the first to comment","noRepliesDescription@board:OCCASION":"Be the first to comment","messageReadOnlyAlert:BLOG":"Comments have been turned off for this post","messageReadOnlyAlert:TKB":"Comments have been turned off for this article","messageReadOnlyAlert:IDEA":"Comments have been turned off for this idea","messageReadOnlyAlert:FORUM":"Replies have been turned off for this discussion","messageReadOnlyAlert:OCCASION":"Comments have been turned off for this event"},"localOverride":false},"Revision:revision:193923_2":{"__typename":"Revision","id":"revision:193923_2","lastEditTime":"2019-11-20T22:31:32.508-08:00"},"AssociatedImage:{\"url\":\"https://community.smartbear.com/t5/s/nwkab66374/images/cmstMjktSG1CVVBR\"}":{"__typename":"AssociatedImage","url":"https://community.smartbear.com/t5/s/nwkab66374/images/cmstMjktSG1CVVBR","height":64,"width":64,"mimeType":"image/png"},"Rank:rank:29":{"__typename":"Rank","id":"rank:29","position":0,"name":"Alumni","color":"949494","icon":{"__ref":"AssociatedImage:{\"url\":\"https://community.smartbear.com/t5/s/nwkab66374/images/cmstMjktSG1CVVBR\"}"},"rankStyle":"OUTLINE"},"Revision:revision:58457_1":{"__typename":"Revision","id":"revision:58457_1","lastEditTime":"2012-07-29T18:22:05.000-07:00"},"ModerationData:moderation_data:193979":{"__typename":"ModerationData","id":"moderation_data:193979","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:193979":{"__typename":"ForumReplyMessage","uid":193979,"id":"message:193979","revisionNum":1,"author":{"__ref":"User:user:85589"},"readOnly":false,"repliesCount":1,"depth":4,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumReplyMessage:message:193952"},"conversation":{"__ref":"Conversation:conversation:58436"},"subject":"Re: capturing entire page","moderationData":{"__ref":"ModerationData:moderation_data:193979"},"body":"
Hi Alex,
Yes, The page was fully loaded. It is a new customer registration form (CRM) where I've filled up all the values and before submitting the form, want to capture the entire page screenshot.
Dim uMobile, CustomerPanel\n Set uMobile = Aliases.browser.pageUmobile3\n\n v1 = GetIDType(getDicValue(\"IdType\"))\n\n Log.Message(v1)\n Call uMobile.Panel(1).TextNode(v1).WaitProperty(\"VisibleOnScreen\", True, 2000)\n Call uMobile.Panel(1).TextNode(v1).Click()\n...\n...\n<code to fill the new customer registration form>\n...\n...\n...\n 'Click on ok button\n Call uMobile.Panel(23).Panel(1).Panel(0).Panel(0).Panel(2).Panel(0).Button(1).Click()\n Delay 1000\n set nxtbtn = customerForm.Form(1).Panel(1).Panel(0).Panel(0).Panel(0).Panel(0).Button(1)\n \n' Take screenshot of the full form before submitting \n screenshotPath = ExtentManager.TakeFullScreenshot(uMobile)\n Call ExtentManager.passTestWithScreenshot(Project.Variables.CURRENTTCID , Project.Variables.CURRENTTCDESC, screenshotPath)\n\n\n'Click \"Next\" button on the customer registration form\n Status = SafeClick(nxtbtn, 500, \"Next button not found in the e registration form\")\n If Not Status Then\n NewRegistration_Dealer = Status\n Exit Function\n End If\n \n 'click on Next\n Call customerForm.Form(1).Panel(1).Panel(0).Panel(0).Panel(0).Panel(0).Button(1).Click()","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"208","kudosSumWeight":0,"postTime":"2019-11-21T18:09:50.464-08:00","lastPublishTime":"2019-11-21T18:09:50.464-08:00","metrics":{"__typename":"MessageMetrics","views":1209},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:58436/message:193979","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjUuMnwyLjF8b3wzfDE0OjAsMzk6MXwx","node":{"__ref":"ForumReplyMessage:message:193996"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"editFrozen":false,"body@stringLength":"1429","rawBody":"
Hi Alex,
Yes, The page was fully loaded. It is a new customer registration form (CRM) where I've filled up all the values and before submitting the form, want to capture the entire page screenshot.
Dim uMobile, CustomerPanel\n Set uMobile = Aliases.browser.pageUmobile3\n\n v1 = GetIDType(getDicValue(\"IdType\"))\n\n Log.Message(v1)\n Call uMobile.Panel(1).TextNode(v1).WaitProperty(\"VisibleOnScreen\", True, 2000)\n Call uMobile.Panel(1).TextNode(v1).Click()\n...\n...\n<code to fill the new customer registration form>\n...\n...\n...\n 'Click on ok button\n Call uMobile.Panel(23).Panel(1).Panel(0).Panel(0).Panel(2).Panel(0).Button(1).Click()\n Delay 1000\n set nxtbtn = customerForm.Form(1).Panel(1).Panel(0).Panel(0).Panel(0).Panel(0).Button(1)\n \n' Take screenshot of the full form before submitting \n screenshotPath = ExtentManager.TakeFullScreenshot(uMobile)\n Call ExtentManager.passTestWithScreenshot(Project.Variables.CURRENTTCID , Project.Variables.CURRENTTCDESC, screenshotPath)\n\n\n'Click \"Next\" button on the customer registration form\n Status = SafeClick(nxtbtn, 500, \"Next button not found in the e registration form\")\n If Not Status Then\n NewRegistration_Dealer = Status\n Exit Function\n End If\n \n 'click on Next\n Call customerForm.Form(1).Panel(1).Panel(0).Panel(0).Panel(0).Panel(0).Button(1).Click()","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:193979_1"},"latestVersion":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}}},"ModerationData:moderation_data:193996":{"__typename":"ModerationData","id":"moderation_data:193996","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:193996":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:21756"},"id":"message:193996","revisionNum":3,"uid":193996,"depth":5,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumReplyMessage:message:193979"},"conversation":{"__ref":"Conversation:conversation:58436"},"subject":"Re: capturing entire page","moderationData":{"__ref":"ModerationData:moderation_data:193996"},"body":"
Hi,
\n\n
Well... While I see Delay(1000) after OK button click and really hope that the page was loaded and rendered within this second, I would recommend this:
\n-- Add <page>.Wait() call after the click. This will wait for the page source to be received from the server. Note, that this will not wait for the objects obtained via additional requests sent from page script code. If you need to wait for such objects this must be coded explicitly. I.e.: add this line after the call to .Click() - uMobile.Wait()
\n-- In order to ensure that page has been rendered by the time the TakeFullScreenshot() function is called, add this line before the call to TakeFullScreenshot(): Call Log.Picture(uMobile.Picture()) (or Log.Picture(uMobile.Parent.Picture()) ) - this should log the visible part of the page, so you will be able to verify that page displays some content.
\n\n
P.S. Some improvements in the .PagePicture() method were implemented in the recently released TC 14.30 - you may consider to update.
\n","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"214","kudosSumWeight":0,"repliesCount":0,"postTime":"2019-11-22T04:44:04.215-08:00","lastPublishTime":"2019-11-22T04:47:44.800-08:00","metrics":{"__typename":"MessageMetrics","views":1204},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:58436/message:193996","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}},"readOnly":false,"editFrozen":false,"body@stringLength":"1083","rawBody":"
Hi,
\n\n
Well... While I see Delay(1000) after OK button click and really hope that the page was loaded and rendered within this second, I would recommend this:
\n-- Add <page>.Wait() call after the click. This will wait for the page source to be received from the server. Note, that this will not wait for the objects obtained via additional requests sent from page script code. If you need to wait for such objects this must be coded explicitly. I.e.: add this line after the call to .Click() - uMobile.Wait()
\n-- In order to ensure that page has been rendered by the time the TakeFullScreenshot() function is called, add this line before the call to TakeFullScreenshot(): Call Log.Picture(uMobile.Picture()) (or Log.Picture(uMobile.Parent.Picture()) ) - this should log the visible part of the page, so you will be able to verify that page displays some content.
\n\n
P.S. Some improvements in the .PagePicture() method were implemented in the recently released TC 14.30 - you may consider to update.
\n","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:193996_3"},"latestVersion":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}}},"Revision:revision:193996_3":{"__typename":"Revision","id":"revision:193996_3","lastEditTime":"2019-11-22T04:47:44.800-08:00"},"Revision:revision:193979_1":{"__typename":"Revision","id":"revision:193979_1","lastEditTime":"2019-11-21T18:09:50.464-08:00"}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"testcomplete-questions","messageSubject":"capturing-entire-page","messageId":"58436","replyId":"193952"},"buildId":"k2ra3WbQxEm0ebgjo41Oz","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","openTelemetryClientEnabled":false,"openTelemetryConfigName":"smartbear","openTelemetryServiceVersion":"25.2.0","openTelemetryUniverse":"prod","openTelemetryCollector":"http://localhost:4318","openTelemetryRouteChangeAllowedTime":"5000","apolloDevToolsEnabled":false,"inboxMuteWipFeatureEnabled":false},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["./components/seo/QAPageSchema/QAPageSchema.tsx","./components/community/Navbar/NavbarWidget.tsx","./components/community/Breadcrumb/BreadcrumbWidget.tsx","./components/messages/TopicWithThreadedReplyListWidget/TopicWithThreadedReplyListWidget.tsx","./components/messages/MessageListForNodeByRecentActivityWidget/MessageListForNodeByRecentActivityWidget.tsx","./components/messages/RelatedContentWidget/RelatedContentWidget.tsx","./components/customComponent/CustomComponent/CustomComponent.tsx","./components/messages/MessageView/MessageViewStandard/MessageViewStandard.tsx","../shared/client/components/common/List/UnstyledList/UnstyledList.tsx","./components/messages/MessageView/MessageView.tsx","./components/messages/MessageView/MessageViewInline/MessageViewInline.tsx","../shared/client/components/common/Pager/PagerLoadMore/PagerLoadMore.tsx","./components/customComponent/CustomComponentContent/TemplateContent.tsx"],"appGip":true,"scriptLoader":[]}