{"id":25529199,"date":"2022-06-19T23:59:13","date_gmt":"2022-06-19T18:29:13","guid":{"rendered":"https:\/\/entri.app\/blog\/?p=25529199"},"modified":"2022-11-19T17:33:32","modified_gmt":"2022-11-19T12:03:32","slug":"java-client-for-appium-a-detailed-study","status":"publish","type":"post","link":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/","title":{"rendered":"Java Client For Appium: A Detailed Study"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e5e09dd4ac3\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e5e09dd4ac3\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#Is_Appium_right_For_You\" >Is Appium right For You?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#Why_Should_You_Choose_a_Pure_Java_Client_Instead_of_an_IDE_plugin\" >Why Should You Choose a Pure Java Client Instead of an IDE plugin?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#Installation_Quick_Start_Prerequisites_and_Setting_up_your_Environment\" >Installation, Quick Start, Prerequisites, and Setting up your Environment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#The_Anatomy_of_the_Client\" >The Anatomy of the Client<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#Connecting_to_your_Device\" >Connecting to your Device<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#Executing_Commands\" >Executing Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#Advanced_Parameters_in_Sessions\" >Advanced Parameters in Sessions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#Debugging_Sessions_on_your_Device\" >Debugging Sessions on your Device<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#Testing_on_Real_Devices_with_Slow_Network_Connection_Speeds_2G3G4G\" >Testing on Real Devices with Slow Network Connection Speeds (2G\/3G\/4G)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#WebDriver_Best_Practices\" >WebDriver Best Practices<\/a><\/li><\/ul><\/nav><\/div>\n<p>Appium, an open-source tool (Apache 2 license) written in Ruby, automates native, mobile web, and hybrid applications on iOS and Android platforms. Appium java-client dependency lets you write automated test cases in Java programming language and execute them against your Appium server in your local environment. In this article, we will learn to set up the Java client with its prerequisites on various <a href=\"https:\/\/entri.app\/blog\/top-10-java-debugging-techniques-and-tricks\/\" target=\"_blank\" rel=\"noopener\">operating systems<\/a> and get started with writing our first simple test case. Read on to find out more about it. <span data-slate-fragment=\"JTVCJTdCJTIydHlwZSUyMiUzQSUyMnBhcmFncmFwaCUyMiUyQyUyMmNoaWxkcmVuJTIyJTNBJTVCJTdCJTIydGV4dCUyMiUzQSUyMkFwcGl1bSUyMHByb3ZpZGVzJTIwYW4lMjBBUEklMjB0byUyMGF1dG9tYXRlJTIweW91ciUyMGFwcCUyMHVzaW5nJTIwU2VsZW5pdW0lMjBXZWJEcml2ZXIuJTIwSXQlRTIlODAlOTlzJTIwbm90JTIwdGhlJTIwb25seSUyMHRvb2wlMjB0aGF0JTIwZG9lcyUyMHRoaXMlMkMlMjBvZiUyMGNvdXJzZSUyMCVFMiU4MCU5MyUyMHRoZXJlJTIwYXJlJTIwYSUyMG51bWJlciUyMG9mJTIwb3RoZXIlMjB0b29scyUyMHlvdSUyMGNhbiUyMHVzZSUyQyUyMHN1Y2glMjBhcyUyMFNlbGVuZHJvaWQlMjBhbmQlMjBvdGhlcnMlMjAod2l0aCUyMG1vYmlsZS1zcGVjaWZpYyUyMG9uZXMlMjBsaWtlJTIwaW9zLWRyaXZlciUyMGFuZCUyMGRyb2lkLWRyaXZlcikuJTIwSG93ZXZlciUyQyUyMEFwcGl1bSUyMGhhcyUyMHNvbWUlMjBwcmV0dHklMjBzaWduaWZpY2FudCUyMGFkdmFudGFnZXMlMjBvdmVyJTIwdGhlc2UlMjBjb21wZXRpdG9ycy4lMjBGb3IlMjBvbmUlMjB0aGluZyUyQyUyMGl0JUUyJTgwJTk5cyUyMGZyZWUlMjBhbmQlMjBvcGVuJTIwc291cmNlJTJDJTIwd2hpY2glMjBtZWFucyUyMGl0JTIwZG9lc24lRTIlODAlOTl0JTIwY29zdCUyMHlvdSUyMGFueXRoaW5nJTIwdG8lMjB1c2UlMjBhbmQlMjB5b3UlMjBjYW4lMjBjdXN0b21pemUlMjBpdCUyMGFzJTIwbXVjaCUyMGFzJTIweW91JTIwbGlrZS4lMjIlN0QlNUQlN0QlNUQ=\">Appium provides an API to automate your app using Selenium WebDriver. It\u2019s not the only tool that does this, of course \u2013 there are a number of other tools you can use, such as Selendroid and others (with mobile-specific ones like ios-driver and droid-driver). However, Appium has some pretty significant advantages over these competitors. For one thing, it\u2019s free and open-source, which means it doesn\u2019t cost you anything to use and you can customize it as much as you like. <\/span><span data-slate-fragment=\"JTVCJTdCJTIydHlwZSUyMiUzQSUyMnBhcmFncmFwaCUyMiUyQyUyMmNoaWxkcmVuJTIyJTNBJTVCJTdCJTIydGV4dCUyMiUzQSUyMkluJTIwdGhpcyUyMGFydGljbGUlMkMlMjBJJUUyJTgwJTk5bGwlMjB3YWxrJTIweW91JTIwdGhyb3VnaCUyMHNldHRpbmclMjB1cCUyMHlvdXIlMjBKYXZhJTIwY2xpZW50JTIwdG8lMjBjb21tdW5pY2F0ZSUyMHdpdGglMjBBcHBpdW0lMjB1c2luZyUyMHRoZSUyMEFwcGl1bSUyMEphdmElMjBDbGllbnQlMkMlMjB3aGljaCUyMGlzJTIwaW5jbHVkZWQlMjBpbiUyMHRoZSUyMEFwcGl1bSUyMGRpc3RyaWJ1dGlvbi4lMjBUaGUlMjBpbnN0YWxsYXRpb24lMjBwcm9jZXNzJTIwd2lsbCUyMGJlJTIwZGV0YWlsZWQlMjBhbmQlMjB0aGVyZSUyMHdpbGwlMjBiZSUyMHNjcmVlbnNob3RzJTIwb2YlMjBlYWNoJTIwc3RlcCUyMHNvJTIwdGhhdCUyMHlvdSUyMGNhbiUyMGVhc2lseSUyMGZvbGxvdyUyMGFsb25nISUyMEJ5JTIwdGhlJTIwZW5kJTIwb2YlMjB0aGlzJTIwYXJ0aWNsZSUyQyUyMHlvdSUyMHNob3VsZCUyMGhhdmUlMjBhbGwlMjB0aGUlMjBuZWNlc3NhcnklMjBzZXR1cCUyMGRldGFpbHMlMjB0byUyMGJlZ2luJTIwd3JpdGluZyUyMHRlc3RzJTIwZm9yJTIweW91ciUyMGFwcGxpY2F0aW9uJTIwaW4lMjBKYXZhJTIwd2l0aCUyMEFwcGl1bSElMjIlN0QlNUQlN0QlNUQ=\">In this article, we\u2019ll walk you through setting up your Java client to communicate with Appium using the Appium java-client dependency, which is included in the Appium distribution. The installation process will be detailed and there will be screenshots of each step so that you can easily follow along! By the end of this article, you should have all the necessary setup details to begin writing tests for your application in Java with appium java-client version!<\/span><\/p>\n<h2><a href=\"https:\/\/entri.sng.link\/Bcofz\/yeoy\/ojyv\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-25520997 size-full\" src=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png\" alt=\"\" width=\"970\" height=\"250\" srcset=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png 970w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-300x77.png 300w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-768x198.png 768w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-750x193.png 750w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/a><\/h2>\n<h2><span class=\"ez-toc-section\" id=\"Is_Appium_right_For_You\"><\/span><strong>Is Appium right For You?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you&#8217;re an Android developer looking to automate your app or set of apps, you&#8217;ll want to get a client (your code) and server (Appium&#8217;s code) running. While setting up is easier than it looks, there are multiple clients and servers in operation. Most of them don&#8217;t work with all devices\u2014and some will be easier for you to use than others. Here&#8217;s how to find out which one fits best. First, decide if you need an IDE-based approach (in other words, something that integrates directly into your development environment), or if you can just grab code from GitHub and run it on its own. Then choose whether to go <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">open source<\/a> or commercial\u2014the former means greater freedom but more DIY, while the latter comes with more support but fewer options for customization. Once you&#8217;ve made those decisions, consider cost and ease of setup as well as availability across platforms and device types. Let&#8217;s look at each option so that you can make a more informed decision when selecting tools that are right for your team&#8217;s needs! Java vs Python vs C#: We have a number of language choices when writing tests. Some developers prefer one over another because they think their language choice is superior, but I\u2019m here to tell you that each has benefits and drawbacks depending on what platform you\u2019re targeting. So let\u2019s take a closer look at these three languages by examining their pros and cons for writing mobile test automation scripts.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">To know more about java programming in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Why_Should_You_Choose_a_Pure_Java_Client_Instead_of_an_IDE_plugin\"><\/span><strong>Why Should You Choose a Pure Java Client Instead of an IDE plugin?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you\u2019re an android developer, there are plenty of IDE plugins available to you. Both IntelliJ and Android Studio have them. But why would you want to use those over a pure java client like Appium-Android? The reasons range from lack of functionality (like having no knowledge about screen size and orientation changes), a whole lot of spaghetti code that is necessary for IDE plugins to function properly, or even some licensing problems with certain plugins (for example, many <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">companies require<\/a> their employees to abide by certain NDAs when using third party software). In fact, most companies can only legally allow their employees to write code using company assets since they are at risk of losing clientele if they ever leaked sensitive information. And as we all know, java is not an asset owned by any one company but rather free to be used by anyone. With that said, it seems clear that writing your own appium java-client version tests in pure java will result in much cleaner code than relying on some plugin for your IDE. So what does it take to get started? Let&#8217;s take a look!<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Enroll in our latest java programming course in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Installation_Quick_Start_Prerequisites_and_Setting_up_your_Environment\"><\/span><strong>Installation, Quick Start, Prerequisites, and Setting up your Environment<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before starting, let\u2019s make sure we have all we need in order to work with our client and run tests with it. In order to do that, you will need Java JDK 1.7 or higher installed on your computer. You also need Maven and Git; if you don\u2019t have them already, you can download them here. The second step is to clone a repository of your client (provided below). Once done, change directory into appium-java-client and run mvn package in order to build our project. If everything went fine until now, you should find java_appium_driver JAR file in target folder. We are ready to start working with our driver! Let\u2019s see how it works. How does it work? Our library consists of three main classes &#8211; AppiumDriver, AndroidDriver and iOSDriver. All these classes extend RemoteWebDriver class from Selenium WebDriver. All three are initialized differently depending on platform type &#8211; iOS Driver uses XCode to launch simulator while<a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\"> Android Driver<\/a> launches emulator by default. These two types differ only in deviceName parameter which specifies a name of an emulator\/simulator instance created by you. And finally our main class called JavaAppiumDriver contains main() method which calls other three classes as well as starts web server where clients can connect to test their applications using our driver library. This means that you don&#8217;t need to install anything else except for Java itself. This is really convenient for those who use Mac OSX and want to avoid installing XCode just because they want to test their application on iPhone\/iPad. So what about testing apps running on real devices? Well, even though you won&#8217;t be able to use native UI components like buttons, sliders etc., but rest of functionality should be there just fine.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_Anatomy_of_the_Client\"><\/span><strong>The Anatomy of the Client<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The client is a small library, hence it requires only a few steps to install and run it. First of all, you have to download it from here. The next step is to unzip that file and extract the jar file contained in lib folder. This will be your appium-client.jar . In order to make sure that everything is setup correctly, you can run any of your unit tests on an android device or emulator via command prompt as shown below. On successful execution, you should see something like appium server started at port 4723. If not then please refer to troubleshooting section at end of post. 3) Create a java class which extends <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">RemoteWebDriver<\/a> and override its methods (e.g., getMobileDevice(), createSession(), etc.) with dummy implementation(s). Now call get() method on remoteWebDriver object passed by TestNG while executing test case methods. This will open up browser window and start executing test cases through Appium Server (port 4723 by default). You may also pass custom parameters while creating session object using createSession() method, for example, desired capabilities for mobile devices such as language preference or whether you want single instance mode enabled or not etc.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Get the latest updates on java programming in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Connecting_to_your_Device\"><\/span><strong>Connecting to your Device<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before you can begin writing tests, you must establish a connection to your device. An unconnected device will show up in your Appium dashboard as offline; it won\u2019t have any sessions listed in its view and no apps installed. You need a client library (or at least tools) for whichever language you want to use to write tests with. On Android, that means either AndroidDriver or UiAutomator2\/Appium; on iOS, it\u2019s XCUITest or Calabash; and so on. The variety of libraries has been an issue for <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">many developers<\/a> attempting to get started with mobile test automation. Luckily, there are now plenty of options available for most platforms. It\u2019s important to note that not all mobile clients support all testing frameworks\u2014for example, Appium supports both Selenium WebDriver and JSONWire Protocol, but AndroidDriver only supports Selenium WebDriver. In some cases, like when using RubyMotion or React Native , you may be able to skip setting up a driver altogether by using app-specific JavaScript APIs directly from your browser. This is generally frowned upon by testers because it makes debugging harder (if something goes wrong in JavaScript code running on a device, how do you debug?); however if you&#8217;re just getting started with automated testing then these solutions may be easier than having to set up and learn yet another toolchain.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">To know more about java programming in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Executing_Commands\"><\/span><strong>Executing Commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The most common way to interact with a test script is through JavaScript\u2019s command function. Using commands allows you to easily run various tests and evaluate their results while doing so. However, certain situations call for your client to perform more complex operations that aren\u2019t simple methods or functions, such as accessing data on a particular web page or writing information to a text file. This makes it necessary for your client to execute code as opposed to just manipulate code like you do in tests. In order to do so, you\u2019ll need two additional files: an xml file and a main class that extends from SeleniumWebDriverClient . Let\u2019s take a look at an example of how each of these are used together&#8230; For detailed steps on setting up your project and creating basic tests, check out Part 1 of our tutorial series on setting up a <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">Java project<\/a> for automation testing using Appium and Selenium WebDriver. That part will walk you through everything you need to get started with app automation using a programming language other than JavaScript (specifically in our case, Java). Once we&#8217;ve gotten some basic concepts down, Part 2 will show us how to set up specific libraries required by both Java and Android app automation tools, along with some good practices for making sure everything works smoothly once we&#8217;re ready to start testing! Our Example Application It&#8217;s not absolutely necessary to have an application handy when learning about automation testing tools\u2014however having one definitely helps!<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Get the latest updates on java programming in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Advanced_Parameters_in_Sessions\"><\/span><strong>Advanced Parameters in Sessions<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>From your command prompt or terminal, you can start your client and pass in parameters to fine-tune your sessions. Let\u2019s create a session that waits 30 seconds after logging in, but then fails. If a session times out, it won\u2019t send any logs to Appium Server &#8211; even if you write them! This is useful for seeing how many failures are on specific tests. By default, all sessions time out after 5 minutes of idleness; we\u2019ll change that here and simulate a real failure scenario by purposely ending our browser <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">before submitting<\/a> our login information. To do so, type these commands into your terminal window: cd \/Users\/YourUserName\/Documents\/workspace_folder_name npm install node appium_session_timeout.js &#8211;parameters=timeOutSeconds=30 &#8211;browser=PhantomJS &#8211;platform=iOS 11 After running these commands, make sure to hit enter twice (or press ^D). You should see something like this appear in your terminal window: ** Timeout settings ** : totalTimeOutSeconds = 15000 currentTimeOutSeconds = 0 setTimeoutThresholdMillis = 5000 To ensure that our command line works properly, let\u2019s add some delays.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Debugging_Sessions_on_your_Device\"><\/span><strong>Debugging Sessions on your Device<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you run into any issues with your app, setting up remote debugging can help you get to the bottom of it. Remote debugging allows you to take control of a user\u2019s device and see exactly what they see. In other words, it puts your Android or iOS device into debug mode\u2014enabling you to step through line by line through an automated testing process. If things aren\u2019t going as planned, remote debugging will likely help you find what went wrong faster than anything else. The trick is that once debug mode is enabled on a device, there\u2019s no getting out of it until someone <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">manually switches<\/a> off remote debugging at both ends. It\u2019s worth noting that if you want to be able to remotely debug your devices in future, then you should set up secure passwords for all users. To do so, go to Settings &gt; Users &amp; accounts &gt; User management &gt; Add new user. Then set a password and make sure Allow new users to log in from unregistered devices is disabled (otherwise anyone could access your account). Once done, make sure all users have their own unique login details\u2014and don&#8217;t forget them! If a user forgets their password then they won&#8217;t be able to use remote debugging again without resetting their device. Remember: You can remotely log in only if you have physical access to the target phone\/tablet while running Appium tests on CI server.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Get the latest updates on java programming in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Testing_on_Real_Devices_with_Slow_Network_Connection_Speeds_2G3G4G\"><\/span><strong>Testing on Real Devices with Slow Network Connection Speeds (2G\/3G\/4G)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In addition to running your tests on real devices, you can also test on emulators. However, you must keep in mind that real devices have varying performance characteristics, even when tested within similar conditions. So, if your app works fine on emulators but not on a real device (even one with a slower connection speed), you need to identify why it doesn\u2019t work for those devices. This is where automating your testing saves time and helps ensure reliable test results. Without writing a single line of code or manually navigating through multiple screens to find bugs, you can easily <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">determine whether<\/a> or not there are any issues specific to a certain device and\/or network type. This way, you can focus on making your app more robust and get higher-quality results from fewer tests. Automated tests help improve test coverage, reduce time spent debugging failures and minimize risk.<br \/>\nIf we see that automated UI testing isn&#8217;t delivering as expected due to differences between emulator and actual device behavior &#8211; how do we debug? How do we make sure our automation solution provides us with meaningful data? At some point every automation engineer has encountered an issue with his\/her Selenium project \u2013 an error message while executing a Selenium script, random failures during automated regression runs or delays while waiting for page load \u2013 all these are indications of unexpected behavior by web browsers under certain circumstances which makes debugging essential in order to troubleshoot them.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">To know more about java programming in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"WebDriver_Best_Practices\"><\/span><strong>WebDriver Best Practices<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Using WebDriver (specifically, Selenium WebDriver) is one of many ways to automate tests. Following a set of best practices will make it easier to use your WebDriver scripts and provide reliable results in less time. In particular, you should keep your code clean and readable by following these rules. Some of these rules relate specifically to Selenium while others are just general programming best practices that can be applied when writing WebDriver scripts as well. Here is a list of tips for using WebDriver properly 1. Use clear names for variables, functions, and classes. 2. Use descriptive names for methods within each class. 3. Keep your code organized by using proper indentation and <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">meaningful comments<\/a> where needed 4. Keep track of all exceptions that occur during testing 5. Minimize duplicate code 6. Avoid if\/else statements whenever possible 7 . Use small steps when running through test cases 8. Avoid creating unnecessary objects 9. Stay away from deprecated methods 10 . Run each test case at least twice before making any changes or assumptions 11. Make sure all tests pass before committing changes 12. Use an IDE like Eclipse or IntelliJ 13. Always run your unit tests after making any changes 14. Write automated unit tests for every new feature you add 15. Write integration tests for every new feature 16. Don&#8217;t write integration tests until you&#8217;ve written unit tests 17. Automate anything that takes more than 20 minutes to do manually 18. Make sure automated tasks don&#8217;t take longer than manual tasks 19. Add another developer to projects early on 20 . Don&#8217;t let other developers add features without writing an automated unit or integration test . If you are interested to learn new coding skills, the Entri app will help you to acquire them very easily. Entri app is following a structural study plan so that the students can learn very easily. If you don&#8217;t have a coding background, it won&#8217;t be any problem. You can download the Entri app from the google play store and enroll in your favorite course.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Get the latest updates on java programming in the Entri app<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Appium, an open-source tool (Apache 2 license) written in Ruby, automates native, mobile web, and hybrid applications on iOS and Android platforms. Appium java-client dependency lets you write automated test cases in Java programming language and execute them against your Appium server in your local environment. In this article, we will learn to set up [&hellip;]<\/p>\n","protected":false},"author":93,"featured_media":25529200,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[802,1864,1882,1883,1881],"tags":[],"class_list":["post-25529199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","category-data-science-ml","category-java-programming","category-react-native","category-web-android-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java Client For Appium: A Detailed Study - Entri Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Client For Appium: A Detailed Study - Entri Blog\" \/>\n<meta property=\"og:description\" content=\"Appium, an open-source tool (Apache 2 license) written in Ruby, automates native, mobile web, and hybrid applications on iOS and Android platforms. Appium java-client dependency lets you write automated test cases in Java programming language and execute them against your Appium server in your local environment. In this article, we will learn to set up [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/\" \/>\n<meta property=\"og:site_name\" content=\"Entri Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/entri.me\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-19T18:29:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-19T12:03:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"820\" \/>\n\t<meta property=\"og:image:height\" content=\"615\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Akhil M G\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@entri_app\" \/>\n<meta name=\"twitter:site\" content=\"@entri_app\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Akhil M G\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/\"},\"author\":{\"name\":\"Akhil M G\",\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/person\/875646423b2cce93c1bd5bc16850fff6\"},\"headline\":\"Java Client For Appium: A Detailed Study\",\"datePublished\":\"2022-06-19T18:29:13+00:00\",\"dateModified\":\"2022-11-19T12:03:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/\"},\"wordCount\":2796,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/entri.app\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png\",\"articleSection\":[\"Articles\",\"Data Science and Machine Learning\",\"Java Programming\",\"React Native\",\"Web and Android Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/\",\"url\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/\",\"name\":\"Java Client For Appium: A Detailed Study - Entri Blog\",\"isPartOf\":{\"@id\":\"https:\/\/entri.app\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png\",\"datePublished\":\"2022-06-19T18:29:13+00:00\",\"dateModified\":\"2022-11-19T12:03:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#primaryimage\",\"url\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png\",\"contentUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png\",\"width\":820,\"height\":615,\"caption\":\"Java Client For Appium: A Detailed Study\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/entri.app\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Entri Skilling\",\"item\":\"https:\/\/entri.app\/blog\/category\/entri-skilling\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Java Programming\",\"item\":\"https:\/\/entri.app\/blog\/category\/entri-skilling\/java-programming\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Java Client For Appium: A Detailed Study\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/entri.app\/blog\/#website\",\"url\":\"https:\/\/entri.app\/blog\/\",\"name\":\"Entri Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/entri.app\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/entri.app\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/entri.app\/blog\/#organization\",\"name\":\"Entri App\",\"url\":\"https:\/\/entri.app\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png\",\"contentUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png\",\"width\":989,\"height\":446,\"caption\":\"Entri App\"},\"image\":{\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/entri.me\/\",\"https:\/\/x.com\/entri_app\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/person\/875646423b2cce93c1bd5bc16850fff6\",\"name\":\"Akhil M G\",\"url\":\"https:\/\/entri.app\/blog\/author\/akhil\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Client For Appium: A Detailed Study - Entri Blog","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:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/","og_locale":"en_US","og_type":"article","og_title":"Java Client For Appium: A Detailed Study - Entri Blog","og_description":"Appium, an open-source tool (Apache 2 license) written in Ruby, automates native, mobile web, and hybrid applications on iOS and Android platforms. Appium java-client dependency lets you write automated test cases in Java programming language and execute them against your Appium server in your local environment. In this article, we will learn to set up [&hellip;]","og_url":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/","og_site_name":"Entri Blog","article_publisher":"https:\/\/www.facebook.com\/entri.me\/","article_published_time":"2022-06-19T18:29:13+00:00","article_modified_time":"2022-11-19T12:03:32+00:00","og_image":[{"width":820,"height":615,"url":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png","type":"image\/png"}],"author":"Akhil M G","twitter_card":"summary_large_image","twitter_creator":"@entri_app","twitter_site":"@entri_app","twitter_misc":{"Written by":"Akhil M G","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#article","isPartOf":{"@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/"},"author":{"name":"Akhil M G","@id":"https:\/\/entri.app\/blog\/#\/schema\/person\/875646423b2cce93c1bd5bc16850fff6"},"headline":"Java Client For Appium: A Detailed Study","datePublished":"2022-06-19T18:29:13+00:00","dateModified":"2022-11-19T12:03:32+00:00","mainEntityOfPage":{"@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/"},"wordCount":2796,"commentCount":0,"publisher":{"@id":"https:\/\/entri.app\/blog\/#organization"},"image":{"@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#primaryimage"},"thumbnailUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png","articleSection":["Articles","Data Science and Machine Learning","Java Programming","React Native","Web and Android Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/","url":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/","name":"Java Client For Appium: A Detailed Study - Entri Blog","isPartOf":{"@id":"https:\/\/entri.app\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#primaryimage"},"image":{"@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#primaryimage"},"thumbnailUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png","datePublished":"2022-06-19T18:29:13+00:00","dateModified":"2022-11-19T12:03:32+00:00","breadcrumb":{"@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#primaryimage","url":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png","contentUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/Untitled-70-1.png","width":820,"height":615,"caption":"Java Client For Appium: A Detailed Study"},{"@type":"BreadcrumbList","@id":"https:\/\/entri.app\/blog\/java-client-for-appium-a-detailed-study\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/entri.app\/blog\/"},{"@type":"ListItem","position":2,"name":"Entri Skilling","item":"https:\/\/entri.app\/blog\/category\/entri-skilling\/"},{"@type":"ListItem","position":3,"name":"Java Programming","item":"https:\/\/entri.app\/blog\/category\/entri-skilling\/java-programming\/"},{"@type":"ListItem","position":4,"name":"Java Client For Appium: A Detailed Study"}]},{"@type":"WebSite","@id":"https:\/\/entri.app\/blog\/#website","url":"https:\/\/entri.app\/blog\/","name":"Entri Blog","description":"","publisher":{"@id":"https:\/\/entri.app\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/entri.app\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/entri.app\/blog\/#organization","name":"Entri App","url":"https:\/\/entri.app\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png","contentUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png","width":989,"height":446,"caption":"Entri App"},"image":{"@id":"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/entri.me\/","https:\/\/x.com\/entri_app"]},{"@type":"Person","@id":"https:\/\/entri.app\/blog\/#\/schema\/person\/875646423b2cce93c1bd5bc16850fff6","name":"Akhil M G","url":"https:\/\/entri.app\/blog\/author\/akhil\/"}]}},"_links":{"self":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts\/25529199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/users\/93"}],"replies":[{"embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/comments?post=25529199"}],"version-history":[{"count":4,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts\/25529199\/revisions"}],"predecessor-version":[{"id":25547443,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts\/25529199\/revisions\/25547443"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/media\/25529200"}],"wp:attachment":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/media?parent=25529199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/categories?post=25529199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/tags?post=25529199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}