{"id":655,"date":"2011-11-12T18:20:46","date_gmt":"2011-11-12T12:50:46","guid":{"rendered":"http:\/\/www.automationrepository.com\/?p=655"},"modified":"2011-11-19T22:36:22","modified_gmt":"2011-11-19T17:06:22","slug":"block-keyboard-and-mouse-inputs-while-running-qtp-scripts","status":"publish","type":"post","link":"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/","title":{"rendered":"How To Block Keyboard and Mouse Inputs while Running QTP Scripts"},"content":{"rendered":"<div style=\"font-family: Verdana; text-align: justify;\">\n<p>When you are running your Test Scripts, sometimes an accidental button press on your keyboard or mouse may interrupt your run session. To prevent this, QTP 11 provides a method that prevents keyboard and mouse input events from reaching applications.<!--more--><\/p>\n<p><strong>SystemUtil.BlockInput method:<\/strong> This method prevents keyboard and mouse input events from reaching applications and thus interrupting your run session. After you use this method, the keyword and mouse events are blocked till one of the following things occur &#8211;<\/p>\n<p>1. SystemUtil.UnBlockInput method is used.<br \/>\n2. The run session ends or is paused due to run error, breakpoint etc.<br \/>\n3. Ctrl + Alt + Del combination is pressed on the keyboard.<br \/>\n4. A critical system error occurs.<\/p>\n<p><strong>SystemUtil.UnBlockInput method:<\/strong> This method re-enables keyboard and mouse input events after a BlockInput statement was used to block them.<\/p>\n<p><strong>Example:<\/strong> The below example shows how keyboard and mouse events can be blocked\/unblocked.<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n'Block Keyboard &amp; Mouse Inputs\r\nSystemUtil.BlockInput\r\n'Code\r\nBrowser(&quot;brBrowser&quot;).Page(&quot;pgPage&quot;).WebEdit(&quot;txtSearch&quot;).Set &quot;Text&quot;\r\nBrowser(&quot;brBrowser&quot;).Page(&quot;pgPage&quot;).WebButton(&quot;btnSearch&quot;).Click\r\n'Unblock Keyboard &amp; Mouse Inputs\r\nSystemUtil.UnBlockInput\r\n<\/pre>\n<\/div>\n<div style=\"font-family: Verdana,sans-serif; border: 1px solid #C8B560; padding: 3mm; background: #FFF8C6; text-align: center;\">\n<p>If you liked this article, you can join our blog to get free email updates directly in your inbox.<\/p>\n<form style=\"text-align: center;\" action=\"http:\/\/feedburner.google.com\/fb\/a\/mailverify\" method=\"post\" onsubmit=\"window.open('http:\/\/feedburner.google.com\/fb\/a\/mailverify?uri=automationrepository\/feeds', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true\" target=\"popupwindow\"><input style=\"width: 160px; height: 20px;\" onfocus=\"if (this.value == 'Enter Your Email Address') {this.value = '';}\" onblur=\"if (this.value == '') {this.value = 'Enter Your Email Address';}\" type=\"text\" value=\"Enter Your Email Address\" \/> <input type=\"hidden\" name=\"uri\" value=\"automationrepository\/feeds\" \/> <input type=\"hidden\" name=\"loc\" value=\"en_US\" \/> <input type=\"submit\" value=\"Join Us\" \/><\/p>\n<p style=\"text-align: justify;\">\n<\/form>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>When you are running your Test Scripts, sometimes an accidental button press on your keyboard or mouse may interrupt your run session. To prevent this, QTP 11 provides a method that prevents keyboard and mouse input events from reaching applications.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[17],"class_list":["post-655","post","type-post","status-publish","format-standard","hentry","category-general","tag-qtp-11"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Block Keyboard and Mouse Inputs while Running QTP Scripts - XX<\/title>\n<meta name=\"description\" content=\"Use SystemUtil.BlockInput method to block Keyword and Mouse Inputs while running QTP Scripts. Use SystemUtil.UnBlockInput to re-enable keyboard and mouse input events.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anish Pillai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/\",\"url\":\"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/\",\"name\":\"How To Block Keyboard and Mouse Inputs while Running QTP Scripts - XX\",\"isPartOf\":{\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#website\"},\"datePublished\":\"2011-11-12T12:50:46+00:00\",\"dateModified\":\"2011-11-19T17:06:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/7a35710e1ce89e5fb481be88fcd6cd20\"},\"description\":\"Use SystemUtil.BlockInput method to block Keyword and Mouse Inputs while running QTP Scripts. Use SystemUtil.UnBlockInput to re-enable keyboard and mouse input events.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.automationrepository.com\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Block Keyboard and Mouse Inputs while Running QTP Scripts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#website\",\"url\":\"https:\/\/www.automationrepository.com\/wordpress\/\",\"name\":\"XX\",\"description\":\"\\r\\nasas\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.automationrepository.com\/wordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/7a35710e1ce89e5fb481be88fcd6cd20\",\"name\":\"Anish Pillai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8aa984de2295c3c4078fa48f6ba5d91e7c849b1a27a11dca24c6f11dd673ba14?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8aa984de2295c3c4078fa48f6ba5d91e7c849b1a27a11dca24c6f11dd673ba14?s=96&d=mm&r=g\",\"caption\":\"Anish Pillai\"},\"description\":\"Find more about Anish Pillai on Google+\",\"sameAs\":[\"http:\/\/www.automationrepository.com\"],\"url\":\"https:\/\/www.automationrepository.com\/wordpress\/author\/anish\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Block Keyboard and Mouse Inputs while Running QTP Scripts - XX","description":"Use SystemUtil.BlockInput method to block Keyword and Mouse Inputs while running QTP Scripts. Use SystemUtil.UnBlockInput to re-enable keyboard and mouse input events.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/","twitter_misc":{"Written by":"Anish Pillai","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/","url":"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/","name":"How To Block Keyboard and Mouse Inputs while Running QTP Scripts - XX","isPartOf":{"@id":"https:\/\/www.automationrepository.com\/wordpress\/#website"},"datePublished":"2011-11-12T12:50:46+00:00","dateModified":"2011-11-19T17:06:22+00:00","author":{"@id":"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/7a35710e1ce89e5fb481be88fcd6cd20"},"description":"Use SystemUtil.BlockInput method to block Keyword and Mouse Inputs while running QTP Scripts. Use SystemUtil.UnBlockInput to re-enable keyboard and mouse input events.","breadcrumb":{"@id":"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.automationrepository.com\/wordpress\/2011\/11\/block-keyboard-and-mouse-inputs-while-running-qtp-scripts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.automationrepository.com\/wordpress\/"},{"@type":"ListItem","position":2,"name":"How To Block Keyboard and Mouse Inputs while Running QTP Scripts"}]},{"@type":"WebSite","@id":"https:\/\/www.automationrepository.com\/wordpress\/#website","url":"https:\/\/www.automationrepository.com\/wordpress\/","name":"XX","description":"\r\nasas","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.automationrepository.com\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/7a35710e1ce89e5fb481be88fcd6cd20","name":"Anish Pillai","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8aa984de2295c3c4078fa48f6ba5d91e7c849b1a27a11dca24c6f11dd673ba14?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8aa984de2295c3c4078fa48f6ba5d91e7c849b1a27a11dca24c6f11dd673ba14?s=96&d=mm&r=g","caption":"Anish Pillai"},"description":"Find more about Anish Pillai on Google+","sameAs":["http:\/\/www.automationrepository.com"],"url":"https:\/\/www.automationrepository.com\/wordpress\/author\/anish\/"}]}},"_links":{"self":[{"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/posts\/655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/comments?post=655"}],"version-history":[{"count":20,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/posts\/655\/revisions"}],"predecessor-version":[{"id":744,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/posts\/655\/revisions\/744"}],"wp:attachment":[{"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/media?parent=655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/categories?post=655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/tags?post=655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}