Vijay,
Every test object that corresponds to a window or control contains the Click method that simulates a mouse click at object-specific coordinates. Test objects that correspond to specific control types (buttons, list views, list boxes, etc.) contain specific methods for simulating mouse clicks on an appropriate object (like ClickButton, ClickItem, etc.).
You can record a test with your application and look at the recorded test commands to see how TestComplete simulates mouse clicks. See also Simulating Mouse Actions and Simulating User Actions in TestComplete help.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"203","kudosSumWeight":0,"repliesCount":0,"postTime":"2011-11-24T23:05:08.000-08:00","lastPublishTime":"2011-11-24T23:05:08.000-08:00","metrics":{"__typename":"MessageMetrics","views":3624},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:52453/message:52458","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:52462":{"__typename":"ModerationData","id":"moderation_data:52462","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:52462":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:48912"},"id":"message:52462","revisionNum":1,"uid":52462,"depth":1,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumTopicMessage:message:52453"},"conversation":{"__ref":"Conversation:conversation:52453"},"subject":"Re: simulate pressing a mouse button","moderationData":{"__ref":"ModerationData:moderation_data:52462"},"body":"Hello,Vijay,
I see. The MouseDown method is available only for the Desktop object. As you said, this method works with screen coordinates. You need to convert window coordinates to screen coordinates before calling this method. For the conversion, use the WindowToScreen method of your window object.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"203","kudosSumWeight":0,"postTime":"2011-11-27T22:58:06.000-08:00","lastPublishTime":"2011-11-27T22:58:06.000-08:00","metrics":{"__typename":"MessageMetrics","views":3616},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:52453/message:52467","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjQuMTF8Mi4xfG98M3wxNDowLDM5OjF8MQ","node":{"__ref":"ForumReplyMessage:message:169581"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:169581":{"__typename":"ModerationData","id":"moderation_data:169581","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"Rank:rank:6":{"__typename":"Rank","id":"rank:6","position":12,"name":"Esteemed Contributor","color":"333333","icon":null,"rankStyle":"TEXT"},"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","confirmEmailStatus":null,"registrationAccessLevel":null,"ssoRegistrationFields":[]},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://community.smartbear.com/t5/s/nwkab66374/images/dS00NTQ0Ny0zMzU5aTMyNEQ2NzhFNzA1Mjc2RUI"},"rank":{"__ref":"Rank:rank:6"},"messagesCount":8186,"kudosGivenCount":2563,"kudosReceivedCount":4578,"kudosWeight":1,"ssoId":null,"followersCount":null,"solutionsCount":1102,"entityType":"USER","eventPath":"community:nwkab66374/user:45447"},"ForumReplyMessage:message:169581":{"__typename":"ForumReplyMessage","uid":169581,"id":"message:169581","revisionNum":1,"author":{"__ref":"User:user:80469"},"readOnly":false,"repliesCount":3,"depth":2,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumReplyMessage:message:52467"},"conversation":{"__ref":"Conversation:conversation:52453"},"subject":"Re: simulate pressing a mouse button","moderationData":{"__ref":"ModerationData:moderation_data:169581"},"body":"Hello, AlexxeyK\nI'm new about TC. And I have the same requirement, and I try to write a PressMouse sub in a script, but I get a error when I try. As picture shown below. How should I correct it?\nThanks!","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"203","kudosSumWeight":0,"postTime":"2018-08-12T18:43:47.576-07:00","lastPublishTime":"2018-08-12T18:43:47.576-07:00","metrics":{"__typename":"MessageMetrics","views":2775},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:52453/message:169581","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjQuMTF8Mi4xfG98MXwxNDowLDM5OjF8MQ","node":{"__ref":"ForumReplyMessage:message:169620"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[{"__typename":"AttachmentEdge","cursor":"MjQuMTF8Mi4xfG98NXxfTlZffDE","node":{"__ref":"Attachment:{\"id\":\"attachment:message169581AttachmentNumber1\",\"url\":\"https://community.smartbear.com/t5/s/nwkab66374/attachments/nwkab66374/testcomplete-questions/91587/1/(%25EIF9%7D4P~5%5BP5LF3)BYW0J.png\"}"}}],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:169620":{"__typename":"ModerationData","id":"moderation_data:169620","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:169620":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:45447"},"id":"message:169620","revisionNum":1,"uid":169620,"depth":3,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:testcomplete-questions"},"parent":{"__ref":"ForumReplyMessage:message:169581"},"conversation":{"__ref":"Conversation:conversation:52453"},"subject":"Re: simulate pressing a mouse button","moderationData":{"__ref":"ModerationData:moderation_data:169620"},"body":"
...
Set pointObj = MyWindowObject.WindowToScreen(10, 10) ' Convert coordinates
Call Sys.Desktop.MouseDown(VK_LBUTTON, pointObj.X, pointObj.Y) ' Call the MouseDown method
...
First of all... this thread is 7 years old... Might be better to have posted your own question since there is no guarentee, after 7 years, that the original people are still around.
That said... Since you're using the Desktop object MouseDown method, you have the wrong number of parameters. See https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/desktop/mousedown-method-desktop-object.html
\n
Remove the ms parameter and you should be good.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"208","kudosSumWeight":1,"repliesCount":2,"postTime":"2018-08-13T05:32:55.820-07:00","lastPublishTime":"2018-08-13T05:32:55.820-07:00","metrics":{"__typename":"MessageMetrics","views":2757},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:TestComplete_forum/community:nwkab66374board:testcomplete-questions/message:52453/message:169620","customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"CachedAsset:text:en_US-components/messages/EscalatedMessageBanner-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/EscalatedMessageBanner-1720711077000","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-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/users/UserLink-1720711077000","value":{"authorName":"View Profile: {author}","anonymous":"Anonymous"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/users/UserRank-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserRank-1720711077000","value":{"rankName":"{rankName}","userRank":"Author rank {rankName}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageTime-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageTime-1720711077000","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/MessageSubject-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageSubject-1720711077000","value":{"noSubject":"(no subject)"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageBody-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageBody-1720711077000","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-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageCustomFields-1720711077000","value":{"CustomField.default.label":"Value of {name}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageReplyButton-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageReplyButton-1720711077000","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/AcceptedSolutionButton-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/AcceptedSolutionButton-1720711077000","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"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/common/Pager/PagerLoadMore-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/common/Pager/PagerLoadMore-1720711077000","value":{"loadMore":"Show More"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageView/MessageViewInline-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageView/MessageViewInline-1720711077000","value":{"bylineAuthor":"{bylineAuthor}","bylineBoard":"{bylineBoard}","anonymous":"Anonymous","place":"Place {bylineBoard}","gotoParent":"Go to parent {name}"},"localOverride":false},"Attachment:{\"id\":\"attachment:message169581AttachmentNumber1\",\"url\":\"https://community.smartbear.com/t5/s/nwkab66374/attachments/nwkab66374/testcomplete-questions/91587/1/(%25EIF9%7D4P~5%5BP5LF3)BYW0J.png\"}":{"__typename":"Attachment","id":"attachment:message169581AttachmentNumber1","filename":"(%EIF9}4P~5[P5LF3)BYW0J.png","filesize":22382,"contentType":"image/png","url":"https://community.smartbear.com/t5/s/nwkab66374/attachments/nwkab66374/testcomplete-questions/91587/1/(%25EIF9%7D4P~5%5BP5LF3)BYW0J.png"},"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserAvatar-1720711077000","value":{"altText":"{login}'s avatar","altTextGeneric":"User's avatar"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/ranks/UserRankLabel-1720711077000","value":{"altTitle":"Icon for {rankName} rank"},"localOverride":false},"CachedAsset:text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1720711077000","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},"CachedAsset:text:en_US-shared/client/components/nodes/NodeIcon-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/nodes/NodeIcon-1720711077000","value":{"contentType":"Content Type {style, select, FORUM {Forum} BLOG {Blog} TKB {Knowledge Base} IDEA {Ideas} OCCASION {Events} other {}} icon"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageSolvedBadge-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageSolvedBadge-1720711077000","value":{"solved":"Solved"},"localOverride":false}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"testcomplete-questions","messageSubject":"simulate-pressing-a-mouse-button","messageId":"52453"},"buildId":"_FASV5DDw52YaqfBDLqsB","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","openTelemetryClientEnabled":false,"openTelemetryConfigName":"smartbear","openTelemetryServiceVersion":"24.11.0","openTelemetryUniverse":"prod","openTelemetryCollector":"http://localhost:4318","openTelemetryRouteChangeAllowedTime":"5000","apolloDevToolsEnabled":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/RelatedContentWidget/RelatedContentWidget.tsx","./components/messages/MessageListForNodeByRecentActivityWidget/MessageListForNodeByRecentActivityWidget.tsx","./components/customComponent/CustomComponent/CustomComponent.tsx","./components/messages/MessageView/MessageViewStandard/MessageViewStandard.tsx","./components/messages/ThreadedReplyList/ThreadedReplyList.tsx","../shared/client/components/common/List/UnstyledList/UnstyledList.tsx","./components/messages/MessageView/MessageView.tsx","../shared/client/components/common/Pager/PagerLoadMore/PagerLoadMore.tsx","./components/messages/MessageView/MessageViewInline/MessageViewInline.tsx","../shared/client/components/common/List/ListGroup/ListGroup.tsx","../shared/client/components/common/List/UnwrappedList/UnwrappedList.tsx","./components/attachments/AttachmentView/AttachmentView.tsx","./components/attachments/AttachmentView/AttachmentViewChip/AttachmentViewChip.tsx"],"appGip":true,"scriptLoader":[]}🎉 NEW API Hub and Insight Hub are here to simplify workflows and help you deliver quality faster. Learn More