Hi All
please help me on this. I am trying to run in Cloud Saucelab for android device.
I have included the Android Jars properly. But getting the below Error.
The type org.openqa.selenium.HasTouchScreen cannot be resolved. It is indirectly referenced from required .class files
If I only use RemoteWeb driver, I dont think it will be enough
below is the code…
package Appium_Demo_SauceLab;
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.UnexpectedAlertBehaviour;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.android.AndroidDriver;
import org.openqa.selenium.html5.;
import org.openqa.selenium.;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
//import io.appium.java_client.android.AndroidDriver;
//import okhttp3.internal.platform.Platform;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.MessageFormat;
public class Sample_Appium_SauceTest {
public static final String USERNAME = "turbotest1984";
public static final String accesskey = "2de971c1-216f-44b0-82c3-ce2e889d760b";
//public static final String URL = "https://" + USERNAME + ":" + ACCESS_KEY + "@ondemand.saucelabs.com:443/wd/hub";
public static final String URL = "http://" + USERNAME + ":" + accesskey + "@ondemand.saucelabs.com:80/wd/hub";
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "Samsung Galaxy S4 Emulator");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("app", "http://saucelabs.com/example_files/ContactManager.apk");
capabilities.setCapability("browserName", "chrome");
capabilities.setCapability("deviceOrientation", "portrait");
capabilities.setCapability("appiumVersion", "1.5.3");
MutableCapabilities sauceCaps = new MutableCapabilities();
sauceCaps.setCapability("username", "turbotest1984");
sauceCaps.setCapability("accessKey", "2de971c1-216f-44b0-82c3-ce2e889d760b");
sauceCaps.setCapability("seleniumVersion", "3.11.0");
sauceCaps.setCapability("name", "my mobile test");
capabilities.setCapability("sauce:options", sauceCaps);
WebDriver driver = new AndroidDriver(new URL(URL), capabilities);
//WebDriver driver = new RemoteWebDriver(new URL(MessageFormat.format("http://ondemand.saucelabs.com:80/wd/hub", USERNAME, accesskey)), capabilities);
}
}