0
votes

I am learning Appium, I am unable to create remote session using the following capabilities. Though the >capabilities are working in Appium server itself on the emulated device

import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.MobileElement;

public class SetupCheck {
public static void main(String[] args) throws MalformedURLException  
{
    DesiredCapabilities cap = new DesiredCapabilities();

    cap.setCapability("deviceName", "AppiumClassDemoNexus5");
    cap.setCapability("platformName", "Android");
    cap.setCapability("platformVersion", "8.1.0");
    cap.setCapability("app", "C:\\APKs\\ApiDemos.apk");
    //cap.setCapability("appPackage", "com.touchboarder.android.api.demos");
    //cap.setCapability("appActivty", "com.example.android.apis.ApiDemos");

    >AndroidDriver<MobileElement> driver = new AndroidDriver<MobileElement>(new                                               URL("<http://127.0.0.0.1:4733/wd/hub>"),cap);

}

}

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Original error: 127.0.0.0.1 Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48' System info: host: 'DESKTOP-R0UAVCK', ip: '192.168.1.27', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_231'

2

2 Answers

0
votes

Hello Friend you have to remove a .0 from the URL

URL("<http://127.0.0.0.1:4733/wd/hub>") to URL("<http://127.0.0.1:4733/wd/hub>")
0
votes

Please check the format of the hub url passed correctly or not. You have passed <http://127.0.0.0.1:4723/wd/hub> It should be http://127.0.0.1:4723/wd/hub