{"id":11362,"date":"2016-06-13T10:24:00","date_gmt":"2016-06-13T10:24:00","guid":{"rendered":"https:\/\/viewmyprojects.com\/winwirewp\/?p=11362"},"modified":"2025-01-28T11:34:52","modified_gmt":"2025-01-28T11:34:52","slug":"why-coded-ui-is-a-smart-choice-in-test-automation","status":"publish","type":"post","link":"https:\/\/viewmyprojects.com\/winwirewp\/blog\/why-coded-ui-is-a-smart-choice-in-test-automation\/","title":{"rendered":"Why Coded UI is a Smart Choice in Test Automation?"},"content":{"rendered":"\n<p>Coded UI Test (CUIT) is a relatively new automation tool supported by high-level programming languages such as C# and Visual Basic .NET.<\/p>\n\n\n\n<p><strong>Find out why Coded UI is a Smart Choice in Test Automation<\/strong><\/p>\n\n\n\n<p class=\"blog-detail-list\">\u2022 Software testers and Developers can work using the same tools\/language, which enables them to collaborate effectively.<br>\u2022 The Coded UI automation tool supports both web and windows projects, as both C# and VB.NET are known for their robustness.<br>\u2022 The element identification mechanism is a powerful feature in Coded UI.<br>\u2022 Coded UI strongly supports Synchronization. The Playback Engine supports features such as \u2018WaitForReadyLevel\u2019, \u2018WaitForControlExist\u2019 etc., it makes the test execution stop till UI Threads or All Threads are ready.<br>\u2022 Automation tests can be run on remote machines with the help of \u2018Tests Agents\u2019.<br>\u2022 Coded UI supports AJAX controls.<br>\u2022 Descriptive Programming is another impressive feature supported by Coded UI tool, which allows software testers to automate scenarios based on object properties. There\u2019s no need to wait for the user interface to record\/assert scenarios.<br>\u2022 Coded UI allows developing an extensive test suite and performing tests in local environments.<br>\u2022 Using Coded UI with a layered framework, automation teams can develop sophisticated tests.<br>\u2022 Utilizing Log4net.dll, software testers can log the results and capture exceptions in an effective manner<\/p>\n\n\n\n<p class=\"blog-detail-list\"><strong>Software Requirements<\/strong><br>\u2022 Requires Visual Studio Premium 2013 or Visual Studio Ultimate 2013 to create Coded UI Tests.Refer the link https:\/\/msdn.microsoft.com\/en-us\/library\/dd380742.aspx for supported configurations.<\/p>\n\n\n\n<p><strong>Technology Managers on Coded UI<\/strong><\/p>\n\n\n\n<p class=\"blog-detail-list\">\u2022 MSAA \u2013 Microsoft Active Accessibility is a COM-based technology and it\u2019s used to automate WIN Forms application.<br>\u2022 UIA \u2013 User Interface Automation is introduced with .Net Framework.<br>\u2022 Web \u2013 Used to access the DOM in a web browser<\/p>\n\n\n\n<p><strong>How to create Coded UI Test<\/strong><\/p>\n\n\n\n<p class=\"blog-detail-list\">\u2022 Recording Actions<br>\u2022 Programmatically (Data Driven)<\/p>\n\n\n\n<p><strong>Getting Started with Coded UI Automation<\/strong><\/p>\n\n\n\n<p class=\"blog-detail-list\"><strong>Recording Actions<\/strong><br>\u2022 Create a CodedUI Solution<br>\u2022 Recording a Scenario<br>\u2022 To Assert a Scenario<\/p>\n\n\n\n<p class=\"blog-detail-list\"><strong>Create a Coded UI Solution<\/strong><br>\u2022 Open Visual Studio 2013<\/p>\n\n\n\n<p>File -&gt; New -&gt; Project-&gt; Test -&gt; Select Coded UI Test Project<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"177\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-1.webp\" alt=\"\" class=\"wp-image-18831\"\/><\/figure><\/div>\n\n\n<p>\u2018<\/p>\n\n\n\n<p>Click on Ok button and the following screen will display<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"747\" height=\"451\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-1.webp\" alt=\"\" class=\"wp-image-18825\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-1.webp 747w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-1-300x181.webp 300w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/figure><\/div>\n\n\n<p><a href=\"https:\/\/www.winwire.net\/wp-content\/uploads\/2016\/06\/coded-UI-1.png\" target=\"_blank\" rel=\"noopener\">&lt;\/a<\/a><\/p>\n\n\n\n<p>Click on ok button and the following screen will display<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"181\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-2.webp\" alt=\"\" class=\"wp-image-18829\"\/><\/figure>\n\n\n\n<p><strong>Recording a Scenario<\/strong><\/p>\n\n\n\n<p>Open a Sample Web application and launch in the browser (Internet Explorer) as shown below<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"79\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-3.webp\" alt=\"\" class=\"wp-image-18830\"\/><\/figure><\/div>\n\n\n<p>Move the Coded UI Test builder to the sample web application opened as shown below:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"184\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-4.webp\" alt=\"\" class=\"wp-image-18828\"\/><\/figure><\/div>\n\n\n<p>Now Click \u201cStart Recording\u201d on the Coded UI Test Builder as shown below:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"478\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI5.webp\" alt=\"\" class=\"wp-image-18824\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI5.webp 640w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI5-300x224.webp 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure><\/div>\n\n\n<p>Now login to the Sample web application and navigate to one or two pages which you desired and click logout from the application.<\/p>\n\n\n\n<p>Once you are logged out from the Sample web application, Click on \u201cPause Recoding\u201d from the Coded UI Test Builder as shown below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"168\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-6.webp\" alt=\"\" class=\"wp-image-18827\"\/><\/figure><\/div>\n\n\n<p>Click \u201c<strong>Generate Code<\/strong>\u201d (last menu) on the Coded UI builder and the following screen will display. Provide your Method Name for your test case.<br>Click&nbsp;<strong>Add and Generate<\/strong>&nbsp;button and that will generate the test code for the sample Web application.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"869\" height=\"456\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-8.webp\" alt=\"\" class=\"wp-image-18823\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-8.webp 869w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-8-300x157.webp 300w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-8-768x403.webp 768w\" sizes=\"auto, (max-width: 869px) 100vw, 869px\" \/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"579\" height=\"398\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-9.webp\" alt=\"\" class=\"wp-image-18822\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-9.webp 579w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-9-300x206.webp 300w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/figure><\/div>\n\n\n<p>Click \u201c<strong>Close<\/strong>\u201d button from Coded UI test Builder as shown below:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"121\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-7.webp\" alt=\"\" class=\"wp-image-18826\"\/><\/figure><\/div>\n\n\n<p>Open the Sample Coded UI Project and Expand the UIMap.uitest as shown below:<\/p>\n\n\n\n<p><strong>To Assert a Scenario<\/strong><\/p>\n\n\n\n<p class=\"blog-detail-list\">\u2022 Assertion feature is available in Coded UI Test Builder. Normally, checkpoints are called as Assertions in Coded UI, an Assertion can be added based on the property of an element.<br>\u2022 In the \u2018UI Control Map\u2019, we can add, delete or rename controls. Once the assertion is added, we can set the comparison operator and the value to compare.<br>\u2022 We can add an Assertion (checkpoint) by clicking ALT + U or by clicking on the Assertion icon available on the Coded UI Test Builder.<\/p>\n\n\n\n<p><strong>Build the Solution and Run the Tests<\/strong><br>\u2022 After the \u2018Test Methods\u2019 are written, build the solution to view the automated test scenarios under \u2018Test Explorer\u2019.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"168\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2022\/05\/Coded-UI-A-300x168-1.png\" alt=\"\" class=\"wp-image-11373\"\/><\/figure><\/div>\n\n\n<p><strong>How to Run Test Case(s)<\/strong><br>\u2022 Select the required Test case(s) and then right click and select \u2018Run Selected Tests\u2019 as shown below:<\/p>\n\n\n\n<p>Once the test cases are executed the following screen will display with execution results.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"264\" src=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-B-1024x264-1.webp\" alt=\"\" class=\"wp-image-18819\" srcset=\"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-B-1024x264-1.webp 1024w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-B-1024x264-1-300x77.webp 300w, https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/coded-UI-B-1024x264-1-768x198.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p><em>Congratulations! You are ready to work with Coded UI (Recording Actions)! In my next blog, \u201cData Driven approach in Coded UI\u2033 and will demonstrate some basic functionalities.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Coded UI Test (CUIT) is a relatively new automation tool supported by high-level programming languages such as C# and Visual Basic .NET. Find out why Coded UI is a Smart Choice in Test Automation \u2022 Software testers and Developers can work using the same tools\/language, which enables them to collaborate effectively.\u2022 The Coded UI automation&hellip; <a class=\"more-link\" href=\"https:\/\/viewmyprojects.com\/winwirewp\/blog\/why-coded-ui-is-a-smart-choice-in-test-automation\/\">Continue reading <span class=\"screen-reader-text\">Why Coded UI is a Smart Choice in Test Automation?<\/span><\/a><\/p>\n","protected":false},"author":43,"featured_media":16797,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_eb_attr":"","_uag_custom_page_level_css":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-11362","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","entry"],"acf":[],"featured_image_src":"https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Coded-UI.webp","author_info":{"display_name":"Yuvaraj","author_link":"https:\/\/viewmyprojects.com\/winwirewp\/author\/yuvaraj\/"},"views":4371,"uagb_featured_image_src":{"full":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Coded-UI.webp",800,440,false],"thumbnail":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Coded-UI-150x150.webp",150,150,true],"medium":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Coded-UI-300x165.webp",300,165,true],"medium_large":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Coded-UI-768x422.webp",750,412,true],"large":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Coded-UI.webp",750,413,false],"1536x1536":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Coded-UI.webp",800,440,false],"2048x2048":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Coded-UI.webp",800,440,false],"post-thumbnail":["https:\/\/viewmyprojects.com\/winwirewp\/wp-content\/uploads\/2023\/11\/Coded-UI.webp",800,440,false]},"uagb_author_info":{"display_name":"Yuvaraj","author_link":"https:\/\/viewmyprojects.com\/winwirewp\/author\/yuvaraj\/"},"uagb_comment_info":0,"uagb_excerpt":"Coded UI Test (CUIT) is a relatively new automation tool supported by high-level programming languages such as C# and Visual Basic .NET. Find out why Coded UI is a Smart Choice in Test Automation \u2022 Software testers and Developers can work using the same tools\/language, which enables them to collaborate effectively.\u2022 The Coded UI automation&hellip;&hellip;","_links":{"self":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/11362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/comments?post=11362"}],"version-history":[{"count":3,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/11362\/revisions"}],"predecessor-version":[{"id":22558,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/posts\/11362\/revisions\/22558"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/media\/16797"}],"wp:attachment":[{"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/media?parent=11362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/categories?post=11362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/viewmyprojects.com\/winwirewp\/wp-json\/wp\/v2\/tags?post=11362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}