Eclipse + Appium + Selenium

So I’ve been able to learn and create plenty of scripts on Eclipse that run perfectly well on any web browser I need.
I’ve now moved onto mobile automation, since from my research I discovered the tool Appium can interpret the selenium syntax, so I won’t need to learn a new language.
So I wrote my script into Eclipse using selenium, and now I want it to run on Appium. Do I run it as a Junit or a Java Application? And if an application, it asks for a main, and I don’t know what to choose.
I had it working previously, but that was because it chose the method automatically, but for some reason its not anymore.

When I use the Junit option, it says it has no JUnit4 cases to run. I’ve make the folder “use as source folder” and that usually works, but not this time.

If anyone is seasoned with Appium and eclipse working together, i need help.

This is from the pinned post. Hope it helps.


Thank you for responding. I will check out this framework you created, and I’m 100% sure I’ll have questions.


Whenever I use test scripts for Appium, it gives me this problem - please define the main method as:
public static void main(String[] args) - I put in text for the UDID and the other.

package iOSPackage ;

import io.appium.java_client.AppiumDriver;


import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class iOSClass {

private AppiumDriver driver;


public void setUp() throws Exception {  

DesiredCapabilities capabilities = new DesiredCapabilities(); 
    capabilities.setCapability("platformName", "ios");
    capabilities.setCapability("udid", "blag");
    capabilities.setCapability("app", "blah");
    driver = (AppiumDriver) new RemoteWebDriver( new URL( "" ), capabilities );

public void tearDown() throws Exception {  

public void testScriptGoesHere() throws Exception {  

System.out.println("Test Output From Within the test");
System.out.println("Here goes your test script");


You need to run the script as JUnit test not java application. If you are no longer getting prompt to choose the type you can change this from run configuration.