{"id":110,"date":"2016-10-25T13:14:59","date_gmt":"2016-10-25T13:14:59","guid":{"rendered":"http:\/\/loadfocus.com\/blog\/tech\/?p=110"},"modified":"2019-08-11T18:35:56","modified_gmt":"2019-08-11T18:35:56","slug":"how-to-use-the-overview-home-and-back-buttons-in-appium-for-android","status":"publish","type":"post","link":"https:\/\/loadfocus.com\/blog\/tech\/2016\/10\/how-to-use-the-overview-home-and-back-buttons-in-appium-for-android","title":{"rendered":"How to use the Overview, Home and Back buttons in Appium for Android"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">minute read<\/span><\/span><p class=\"lead\">Using the Overview, Home and Back native buttons is pretty straight forward using WebDriver and Appium. Below there are the code examples for all the 3 buttons:<\/p>\n<p>&nbsp;<\/p>\n<h3>How to click the Back Button on Android with Selenium WebDriver and Appium<\/h3>\n<pre class=\"lang-java\"><code class=\"lang-java\">\npublic void clickBackButton(){\n((AndroidDriver)driver).pressKeyCode(AndroidKeyCode.BACK);\n}\n<\/code><\/pre>\n<h3>How to click the Overview Button on Android with Selenium WebDriver and Appium<\/h3>\n<h3>See more details<\/h3>\n<p><script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<!-- Square --><br \/>\n<ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-8151016364557535\" data-ad-slot=\"3756710829\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins><br \/>\n<script><br \/>\n     (adsbygoogle = window.adsbygoogle || []).push({});<br \/>\n<\/script><br \/>\n           \r\n            <div class=\"onp-locker-call\"  data-lock-id=\"onpLock181291\">\r\n                <p><\/p>\n<pre class=\"lang-java\"><code class=\"lang-java\">\npublic void clickOverviewButton(){\n((AndroidDriver&lt;WebElement&gt;)driver).pressKeyCode(AndroidKeyCode.KEYCODE_APP_SWITCH);\n}\n<\/code><\/pre>\n<h3>How to click the Home Button on Android with Selenium WebDriver and Appium<\/h3>\n<pre class=\"lang-java\"><code class=\"lang-java\">\npublic void clickHomeButton(){\n((AndroidDriver&lt;WebElement&gt;)driver).pressKeyCode(AndroidKeyCode.HOME);\n}\n<\/code><\/pre>\n<p>&nbsp;\n<\/p>\r\n            <\/div>\r\n         \r\n\r\n        <br \/>\n<a href=\"https:\/\/loadfocus.com\">LoadFocus.com<\/a> is a cloud testing platform:<\/p>\n<ul>\n<li><a href=\"https:\/\/loadfocus.com\/load-testing\">Cloud Load Testing Service<\/a><\/li>\n<li><a href=\"https:\/\/loadfocus.com\/website-speed-testing\">Website Speed Testing Service<\/a><\/li>\n<li><a href=\"https:\/\/loadfocus.com\/automated-website-testing\">Automated Website Testing Service<\/a><\/li>\n<li><a href=\"https:\/\/loadfocus.com\/mobile-emulation\">Mobile Emulation Service<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">minute read<\/span><\/span>Using the Overview, Home and Back native buttons is pretty straight forward using WebDriver and Appium. Below there are the code examples for all the 3 buttons: &nbsp; How to click the Back Button on Android with Selenium WebDriver and Appium public void clickBackButton(){ ((AndroidDriver)driver).pressKeyCode(AndroidKeyCode.BACK); } How to click the Overview Button on Android with&#8230;  <a href=\"https:\/\/loadfocus.com\/blog\/tech\/2016\/10\/how-to-use-the-overview-home-and-back-buttons-in-appium-for-android\" class=\"more-link\" title=\"Read How to use the Overview, Home and Back buttons in Appium for Android\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[20,19],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/posts\/110"}],"collection":[{"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":7,"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":340,"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/posts\/110\/revisions\/340"}],"wp:attachment":[{"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/tech\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}