arr = Sys.Process(\"<ProcessName>\").FindAllChildren(\"WndClass\", \"SysListView32\", 50)
if len(arr) > 0:
for i in range (0, len(arr)):
if True == arr[i].Focused:
arr[i].ClickR()
Log.Message(\"Context Menu Opened Successfully!\")
break
else:
Log.Error(\"No List Objects were found.\")
ebarbera I would still like to hear from you if there is any better approach for this issue.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"203","kudosSumWeight":0,"postTime":"2021-11-23T07:00:19.756-08:00","lastPublishTime":"2021-11-23T07:32:04.722-08:00","metrics":{"__typename":"MessageMetrics","views":989},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:226000/message:226050","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":true,"endCursor":"MjUuMnwyLjF8b3wxfDE0OjAsMzk6MXwx","hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjUuMnwyLjF8b3wxfDE0OjAsMzk6MXwx","node":{"__ref":"ForumReplyMessage:message:226845"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"editFrozen":false,"body@stringLength":"1039","rawBody":"For anyone who is struggling with the same problem, I wrote a python script (which is just a workaround and not the desired way of opening the context menu on lists) which seems to be working for me.
def open_context_menu():
arr = Sys.Process(\"<ProcessName>\").FindAllChildren(\"WndClass\", \"SysListView32\", 50)
if len(arr) > 0:
for i in range (0, len(arr)):
if True == arr[i].Focused:
arr[i].ClickR()
Log.Message(\"Context Menu Opened Successfully!\")
break
else:
Log.Error(\"No List Objects were found.\")
The issue could be that there is more than one SysListView32 control. It could be on the same Form or maybe in memory and not visible. This could explain why you are seeing inconsistent results and why looping an array of list view controls seems to work.
A couple of things you could try.
1. Narrow you search by specifying parameters that are unique to the control. For example, make sure it is visible. Or if it has a unique index you could specify that.
Listview = Sys.Process(\"<ProcessName>\").FindChild(new Array(\"WndClass\",\"Visible\", \"Index\") , new Array(\"SysListView32\", true, 1), 50)
2. Get a parent object closer to the desired SystemListView32 object.
Parent = Sys.Process(\"<ProcessName>\").FindChild(new Array(\"WndClass\",\"Visible\") , new Array(\"#32770\", true), 50)
ListView = Parent.FindChild(new Array(\"WndClass\",\"Visible\", \"Index\") , new Array(\"SysListView32\", true, 1), 50)
I hope this helps.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"208","kudosSumWeight":2,"repliesCount":1,"postTime":"2021-12-07T10:54:33.709-08:00","lastPublishTime":"2021-12-07T10:54:33.709-08:00","metrics":{"__typename":"MessageMetrics","views":858},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:226000/message:226845","customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"readOnly":false,"editFrozen":false,"body@stringLength":"1303","rawBody":"Hi
The issue could be that there is more than one SysListView32 control. It could be on the same Form or maybe in memory and not visible. This could explain why you are seeing inconsistent results and why looping an array of list view controls seems to work.
A couple of things you could try.
1. Narrow you search by specifying parameters that are unique to the control. For example, make sure it is visible. Or if it has a unique index you could specify that.
Listview = Sys.Process(\"<ProcessName>\").FindChild(new Array(\"WndClass\",\"Visible\", \"Index\") , new Array(\"SysListView32\", true, 1), 50)
2. Get a parent object closer to the desired SystemListView32 object.
Parent = Sys.Process(\"<ProcessName>\").FindChild(new Array(\"WndClass\",\"Visible\") , new Array(\"#32770\", true), 50)
ListView = Parent.FindChild(new Array(\"WndClass\",\"Visible\", \"Index\") , new Array(\"SysListView32\", true, 1), 50)
I hope this helps.
","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:226845_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":[]}}}},"CachedAsset:text:en_US-components/tags/TagView/TagViewChip-1741125846000":{"__typename":"CachedAsset","id":"text:en_US-components/tags/TagView/TagViewChip-1741125846000","value":{"tagLabelName":"Tag name {tagName}"},"localOverride":false},"Revision:revision:226050_3":{"__typename":"Revision","id":"revision:226050_3","lastEditTime":"2021-11-23T07:32:04.722-08:00"},"Revision:revision:226008_1":{"__typename":"Revision","id":"revision:226008_1","lastEditTime":"2021-11-22T12:55:09.971-08:00"},"Revision:revision:226845_1":{"__typename":"Revision","id":"revision:226845_1","lastEditTime":"2021-12-07T10:54:33.709-08:00"}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"testcomplete-questions","messageSubject":"right-click-on-rcp-list-view","messageId":"226000","replyId":"226003"},"buildId":"q_bLpq2mflH0BeZigxpj6","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","../shared/client/components/common/List/UnwrappedList/UnwrappedList.tsx","./components/tags/TagView/TagView.tsx","./components/tags/TagView/TagViewChip/TagViewChip.tsx"],"appGip":true,"scriptLoader":[]}