I’ve more or less completed a Selenium Webdriver course so I have all elements to run the selenium tests on web. I’ve now decided to start an appium course.
I’ve downloaded set up appium.
I’ve downloaded and set up maven
I’ve downloaded and set up selenium 2.53.1
I’ve dowloaded and set up all the other items.
The only thing I have left to do is add the Appium jar (java -client 2.1.0)
I’ve downloaded it and its in my downloads folder.
Its seem to be just 1 jar do I just to the jar to the lib folder for selenium 2.53.1?
Or should I, in my selenium folder, leave it as a stand alone jar (because I have Selenium Java 2.53.1 as a separate jar from my Libs folder which I add when I add as an external jar when I create a new project)
Is there anything else I need to do?
If so, what would that be.
I suspect its just adding the jar to the lib folder and then go about setting up my desired capabilities.
The Appium Java client library is meant to be linked with your tests (that is, your tests will need the Appium jar in their classpath when your tests run). The Selenium process that you start with the Selenium standalone jar will not need to know about Appium in order for Appium to run together with Selenium.
The only setup that I’m familiar with that involves Appium and Selenium working together is if the Selenium standalone is executed in Selenium Grid Hub mode, while Appium is started as a Grid Node client. Fortunately, all the communication between Appium and Selenium here is based on HTTP and a REST API, so there is no need to deal with Java classpaths to get this setup working.
The other way to run Appium is to run it as a standalone client. In this setup, you will not need Selenium’s jars, since Appium implements the same HTTP REST APIs as the Selenium standalone server.
I’ve just read the getting started guide. I was very confused by it.
So the appium jar cacn work by themselves they don’t need to work the with selenium jars in order to do testing. So they don’t need to place in the Lib folder in selenium. Is that right?
The Appium Java client jar is not Appium itself. As it’s name suggests, it is simply a convenience library for your Java code to interact with an Appium server. The Java client is unable to perform any device automation on its own.
The Appium server is the main component in the automation setup. The server is a Node.js application. All Appium client libraries (Ruby, Python, Java, Javascript, etc.) talk to this server to set up and manage automation sessions because the server is the main component that sends out automation commands to the devices.
Note that the Selenium standalone library does not appear anywhere in this structure for a basic setup. You do not need the Selenium standalone jar to automate on devices.
I recommend reading about the following topics to help clear up some confusion related to writing automation tests in Java:
HTTP and REST - The Selenium automation API is built to be a REST API, which is why Appium can completely replace Selenium when it comes to device automation (it’s also why Appium can be registered as a Selenium Grid node when you’re setting up a distributed automation network)
The following stuff is not strictly Appium-related information.
If you write your tests in Java, you need to place the Appium Java client library in the classpath of your tests. For standard Eclipse Java projects, the classpath usually includes the project’s lib/ directory, but classpaths for various projects are customized in various ways. The classpath is simply a list of places for typical class loaders running within a Java Virtual Machine (the JVM) to look for .class files and Java libraries (packaged as .jar files).
In the Java world, there are thousands upon thousands of libraries for different tasks. Many of these libraries will depend on each other, so if you choose to use one particular library, you will likely have to download another library - this other library is called a dependency. Dependencies can have their own dependencies, so you can end up having a so-called dependency chain. This is a nightmare to manage manually, so most Java programmers would recommend you to use Maven or Gradle as your project’s build tools to manage these dependencies. Ant (with the Ivy extension) is also able to manage these dependencies, but Ant is pure configuration while Maven and Gradle offer “convention over configuration” defaults. Note that the Appium Java client itself has its own dependency chain, so it’s not practical to simply download the Appium jar and plop it right inside your classpath.