{"id":23403,"date":"2020-04-22T12:20:13","date_gmt":"2020-04-22T12:20:13","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=23403"},"modified":"2021-03-06T10:07:20","modified_gmt":"2021-03-06T10:07:20","slug":"how-to-click-on-ribbon-buttons-easily-using-easyrepro-in-dynamics-365-crm","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2020\/04\/how-to-click-on-ribbon-buttons-easily-using-easyrepro-in-dynamics-365-crm\/","title":{"rendered":"How to click on Ribbon buttons easily using Easyrepro in Dynamics 365 CRM"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p><a href=\"https:\/\/github.com\/microsoft\/EasyRepro\" target=\"_blank\" rel=\"noopener noreferrer\">Easyrepro<\/a> has given us an easy way of UI Automation testing for Dynamics 365 CRM. There are many functions related to Command bar, which makes clicking any button on the Command bar easy.<\/p>\n<p>In this blog, we will share our experience while working with Ribbon buttons.<\/p>\n<p>If you need to click on \u2018New\u2019 button of any entity, use the command given below:<\/p>\n<p><strong>xrmApp.CommandBar.ClickCommand(\u201cNew\u201d);<\/strong><\/p>\n<p>Also, if the button is present in <strong>More Commands (\u2026),<\/strong> the <strong>ClickCommand<\/strong> function searches for OOB buttons in <strong>More Commands<\/strong> and executes the action.<\/p>\n<p>In our case, we were facing difficulty in clicking a custom button that was a split button.<\/p>\n<h2><strong>Scenario<\/strong><\/h2>\n<p>Our button <strong>\u2018<a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/undo-restore-recover-deleted-dynamics-365-crm-records\" target=\"_blank\" rel=\"noopener noreferrer\">Click2Undo<\/a>\u2019<\/strong> is a custom split button, within which a <strong>History<\/strong> button is seen on clicking the down arrow.<\/p>\n<p style=\"padding-left: 80px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-23404\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/04\/Ribbon-buttons.png\" alt=\"How to click on Ribbon buttons easily using Easyrepro in Dynamics 365 CRM\" width=\"307\" height=\"128\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/04\/Ribbon-buttons.png 307w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/04\/Ribbon-buttons-300x125.png 300w\" sizes=\"(max-width: 307px) 100vw, 307px\" \/><\/p>\n<p>However, we observed that it works with the OOB split button (<strong>Connect<\/strong> and <strong>To Another<\/strong>) after typing the following command.<\/p>\n<p><strong>xrmApp.CommandBar.ClickCommand(\u201cConnect\u201d, \u201cTo Another\u201d);<\/strong><\/p>\n<p>The <strong>\u2018Click2Undo\u2019<\/strong> button along with its dropdown button <strong>\u2018History\u2019<\/strong> has 2 different actions to perform. On clicking the <strong>\u2018Click2Undo\u2019<\/strong> button the fields changed are undone and on clicking on <strong>\u2018History\u2019<\/strong> button a grid opens up.<\/p>\n<p>Now the question arises, how do we click the <strong>\u2018History\u2019<\/strong> button through <strong>Easyrepro<\/strong>?<\/p>\n<p>For this, we tried to find out the name of the down arrow. We found out that the name<strong> \u2018Click2Undo More Commands\u2019<\/strong> worked.<\/p>\n<p>How did we find out that this will work? We observed that all the split buttons had the same pattern as <strong>&lt;&lt;button name More Commands&gt;&gt;.<\/strong><\/p>\n<p>So, after inspecting the <strong>Click2undo<\/strong> button we found out that the down arrow has the Arial-label name as <strong>\u2018Click2Undo More Commands\u2019.<\/strong><\/p>\n<p>Using this information, we tried to click the <strong>History<\/strong> button by using the following command:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-23405\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/04\/1Ribbon.png\" alt=\"\" width=\"892\" height=\"54\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/04\/1Ribbon.png 892w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/04\/1Ribbon-300x18.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/04\/1Ribbon-768x46.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/04\/1Ribbon-660x40.png 660w\" sizes=\"(max-width: 892px) 100vw, 892px\" \/><\/p>\n<p>After executing the command, the <strong>History<\/strong> button got clicked and the grid that was supposed to open after the click also opened.<\/p>\n<p>Thus, we found out that this command works!<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>This guide on clicking the Ribbon buttons using <strong>Easyrepro<\/strong> will help those who are new to the features of <strong>Easyrepro<\/strong> or has just started working on the application.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Easyrepro has given us an easy way of UI Automation testing for Dynamics 365 CRM. There are many functions related to Command bar, which makes clicking any button on the Command bar easy. In this blog, we will share our experience while working with Ribbon buttons. If you need to click on \u2018New\u2019 button\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2020\/04\/how-to-click-on-ribbon-buttons-easily-using-easyrepro-in-dynamics-365-crm\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":23406,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,18,2192,49],"tags":[],"class_list":["post-23403","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-easyrepro","category-ribbon-buttons"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/23403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=23403"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/23403\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/23406"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=23403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=23403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=23403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}