gopi
gopi

Reputation: 1

Getting "Couldn't start a new session. Possible causes are invalid address of remote server pr browser start-up failure"

I am new to appium and I have started working on ios-app automation in MAC.

I was able to launch the app yesterday, but today its giving me an error as "Couldn't start a new session. Possible causes are invalid address of remote server pr browser start-up failure" when I run the script in eclipse.

I started Appium server before running script, nothing is logging in it as shown below.

[Appium] Welcome to Appium v1.10.0

[Appium] Non-default server args:

[Appium] address: 127.0.0.1

[Appium] Appium REST http interface listener started on 127.0.0.1:4723

please see my code below

package com.ivy;

import java.net.MalformedURLException;

import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;

import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.AutomationName;
import io.appium.java_client.remote.MobileCapabilityType;

public class LandingPage {
IOSDriver dr;
@Test
public void IstTest() throws MalformedURLException
{
 DesiredCapabilities dc = new DesiredCapabilities() ;   

 dc.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6"); 

dc.setCapability(MobileCapabilityType.PLATFORM_NAME, "IOS");

System.out.println("ios");

dc.setCapability(MobileCapabilityType.PLATFORM_VERSION,"12.1");

System.out.println("12.1");
dc.setCapability(MobileCapabilityType.AUTOMATION_NAME,AutomationName.IOS_XCUI_TEST);

 System.out.println("ios_xcui_test");

 dc.setCapability(MobileCapabilityType.APP,"/Users/apple/Library/Developer/Xcode/ 
DerivedData/MyIvyPage-ahclijlgxyrbtydlllbomcworphc/Build/Products/Debug- 
iphonesimulator/MyIvyPage.app");    


   IOSDriver dr= (IOSDriver) new RemoteWebDriver(new 
 URL("https://127.0.0.1:4723"), d);

What am I missing? Please help me out!

Upvotes: 0

Views: 605

Answers (2)

Mani
Mani

Reputation: 1186

Please correct the below line your code

IOSDriver dr= (IOSDriver) new RemoteWebDriver(new URL("http://localhost:4723/wd/hub"), d);

Then your code should work.

Upvotes: 0

Camilo Avila
Camilo Avila

Reputation: 83

you have a wrong Url when you try to create a session, the Url Should be.

"http://127.0.0.1:4723/wd/hub";

Upvotes: 0

Related Questions