\n
If use code :
\nObject.PopupMenu.Click( \"Select Machine...\" );
\nit works. But what is problem with above code ?
\n\n
This is much better code anyway. Your other version is using index numbers. Not good. If they add a new menu item, the index numbers change, and your test is broken. Always better to use as static an identifier as possible for doing things like this. Of course, they could also update the text for it, but it's a much lower probability breaker than an index.
\n\n
And baxatob could well be right. There may be hidden options. Who knows. Not us without access to the object and it's properties ....
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"213","kudosSumWeight":2,"repliesCount":0,"postTime":"2017-01-12T04:20:53.376-08:00","lastPublishTime":"2017-01-12T04:21:21.266-08:00","metrics":{"__typename":"MessageMetrics","views":2624},"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":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"AssociatedImage:{\"url\":\"https://community.smartbear.com/t5/s/nwkab66374/images/cmstMzEtZ3JyeWo3\"}":{"__typename":"AssociatedImage","url":"https://community.smartbear.com/t5/s/nwkab66374/images/cmstMzEtZ3JyeWo3","height":20,"width":20,"mimeType":"image/png"},"Rank:rank:31":{"__typename":"Rank","id":"rank:31","position":6,"name":"Champion Level 1","color":"00537C","icon":{"__ref":"AssociatedImage:{\"url\":\"https://community.smartbear.com/t5/s/nwkab66374/images/cmstMzEtZ3JyeWo3\"}"},"rankStyle":"OUTLINE"},"User:user:21756":{"__typename":"User","id":"user:21756","uid":21756,"login":"AlexKaras","biography":null,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2013-07-19T01:15:21.000-07:00"},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://community.smartbear.com/t5/s/nwkab66374/images/dS0yMTc1Ni00aTg4NzJBNDUwNjM4MzlDQkE"},"rank":{"__ref":"Rank:rank:31"},"entityType":"USER","eventPath":"community:nwkab66374/user:21756"},"ModerationData:moderation_data:134355":{"__typename":"ModerationData","id":"moderation_data:134355","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"AcceptedSolutionMessage:message:134355":{"__typename":"AcceptedSolutionMessage","uid":134355,"id":"message:134355","entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:134279/message:134355","revisionNum":1,"author":{"__ref":"User:user:21756"},"readOnly":false,"repliesCount":1,"depth":1,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumTopicMessage:message:134279"},"conversation":{"__ref":"Conversation:conversation:134279"},"subject":"Re: Problem with selection in popup menu","moderationData":{"__ref":"ModerationData:moderation_data:134355"},"body":"Hi,
\n\n
As others already wrote,
\nObject.PopupMenu.Click( \"Select Machine...\" );
\nis much better than
\nObject.PopupMenu.Click(\"[1]\");
\n\n
The reason why the latter did not work for you is because menu item with index 1 is a separator displayed as a grayed line between Edit Definition and Select Machine menu items.
\nYou should use index value of 2 if you like to select Select Machine menu item by index.
\n\n
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"213","kudosSumWeight":2,"postTime":"2017-01-12T13:37:05.137-08:00","lastPublishTime":"2017-01-12T13:37:05.137-08:00","solution":true,"metrics":{"__typename":"MessageMetrics","views":2623},"visibilityScope":"PUBLIC","placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"isEscalated":null,"replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjUuNHwyLjF8b3wzfDE0OjAsMzk6MXwx","node":{"__ref":"ForumReplyMessage:message:134371"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"body@stripHtml({\"removeProcessingText\":true,\"removeSpoilerMarkup\":true,\"removeTocMarkup\":true,\"truncateLength\":200})@stringLength":"213","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"videos":{"__typename":"VideoConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:134371":{"__typename":"ModerationData","id":"moderation_data:134371","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:134371":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:72460"},"id":"message:134371","entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:134279/message:134371","revisionNum":1,"uid":134371,"depth":2,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"AcceptedSolutionMessage:message:134355"},"conversation":{"__ref":"Conversation:conversation:134279"},"subject":"Re: Problem with selection in popup menu","moderationData":{"__ref":"ModerationData:moderation_data:134371"},"body":"
Thanks this worked :)
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"23","kudosSumWeight":1,"repliesCount":0,"postTime":"2017-01-13T02:31:28.413-08:00","lastPublishTime":"2017-01-13T02:31:28.413-08:00","metrics":{"__typename":"MessageMetrics","views":2596},"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":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"User:user:72549":{"__typename":"User","id":"user:72549","uid":72549,"login":"shankar_r","biography":null,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2016-10-21T02:32:03.268-07:00"},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://community.smartbear.com/t5/s/nwkab66374/images/dS03MjU0OS00Mjg0aTkyMUU0Rjk5MEI0QzY5QTk"},"rank":{"__ref":"Rank:rank:26"},"entityType":"USER","eventPath":"community:nwkab66374/user:72549"},"ModerationData:moderation_data:134283":{"__typename":"ModerationData","id":"moderation_data:134283","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:134283":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:72549"},"id":"message:134283","entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:134279/message:134283","revisionNum":1,"uid":134283,"depth":1,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumTopicMessage:message:134279"},"conversation":{"__ref":"Conversation:conversation:134279"},"subject":"Re: Problem with selection in popup menu","moderationData":{"__ref":"ModerationData:moderation_data:134283"},"body":"What is your AUT technology?. I used to work with JSwing application and it works fine for me.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"96","kudosSumWeight":0,"repliesCount":0,"postTime":"2017-01-12T03:48:28.131-08:00","lastPublishTime":"2017-01-12T03:48:28.131-08:00","metrics":{"__typename":"MessageMetrics","views":2633},"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":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"QueryVariables:MessageSolutions":{"__typename":"QueryVariables","id":"MessageSolutions","value":{"first":10,"constraints":{"topicId":{"eq":"message:134279"},"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},"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},"CachedAsset:text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1749759380271","value":{"errorTitle":"Failed!","previewFile":"Preview File","downloadFile":"Download File {name}","removeFile":"Remove File {name}","errorBadExtension":"This file does not have a valid extension. \"{extensions}\" are the valid extensions.","errorFileEmpty":"This file is empty or does not exist.","errorTooLarge":"The maximum file size is: {maxFileSize}.","errorTooMany":"Too many attachments. The maximum number of attachments per message is: {maxAttachmentCount, number, integer}.","errorDuplicate":"This file is already attached."},"localOverride":false}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"testcomplete-questions","messageSubject":"problem-with-selection-in-popup-menu","messageId":"134279"},"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","shared_client_components_common_List_UnwrappedList","components_attachments_AttachmentView","components_attachments_AttachmentView_AttachmentViewChip"],"appGip":true,"scriptLoader":[]}