OS : Mac
Appium Version: 1.4.13
Device : Real Device
Automating : Mobile Browser
Error Message:
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Please provide the ‘app’ or ‘browserName’ capability or start appium with the --app or --browser-name argument. Alternatively, you may provide the ‘bundleId’ and ‘udid’ capabilities for an app under test on a real device.) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 213 milliseconds
Build info: version: ‘2.52.0’, revision: ‘4c2593c’, time: ‘2016-02-11 19:03:33’
System info: host: ‘D-MacBook-Pro.local’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.10.5’, java.version: ‘1.8.0_74’
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:158)
at testclass.main(testclass.java:32)
Actual Behaviour :
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class testclass {
public static void main(String[] args) throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", "8.2");
capabilities.setCapability("deviceName", "iPhone 4s");
capabilities.setCapability("browserName","chrome");
capabilities.setCapability("newCommandTimeout","30");
//capabilities.setCapability(MobileCapabilityType.UDID,"316b209e94e22c3f362923704e50a196403f2051");
// capabilities.setCapability("rotatable", "LANDSCAPE");
WebDriver driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
driver.get("http://www.google.com");
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
//driver.quit();
}
}