Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error forwarding the new session cannot find : Capabilities {browserName: chrome, deviceName: my phone, platform: ANDROID, platformName: android, showChromedriverLog: true, version: 6.0.1} #393

Open
automation311 opened this issue Mar 12, 2018 · 2 comments

Comments

@automation311
Copy link

Hi ,
I am new to Selenium-Grid extras Appium set up. I am getting the following error message when i try to run my test which clearly says the Hub is not able to forward the session because the capabilities are not matching. I am not sure what i am doing wrong?

Here is my Android capabilities:

DesiredCapabilities capabilities = DesiredCapabilities.android();

    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.CHROME);

    capabilities.setCapability(MobileCapabilityType.PLATFORM, Platform.ANDROID);

    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME , "Android");

    capabilities.setCapability("showChromedriverLog","true");

    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "my phone");

     capabilities.setCapability (MobileCapabilityType.VERSION, "6.0.1");

here is my iOS capabilities:

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Jose's iPhone");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME , "iOS");
    capabilities.setCapability (MobileCapabilityType.PLATFORM_VERSION, "11.2.1");
    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.SAFARI);
    capabilities.setCapability(MobileCapabilityType.UDID,"xxxxxxxxxxxxxxxxxxxxxxxxxxx");

when i try to setup Appium in Selenium grid Extras,
Will this node run 'Appium' (1-yes/0-no)
Default Value: 0
1
'1' was set as your value

Will this Appium node run 'Android' (1-yes/0-no)
Default Value: 0
1
'1' was set as your value

What version of 'Android' is installed?
Default Value:
6.0.1
'6.0.1' was set as your value

Will this Appium node run 'Chrome' (1-yes/0-no)
Default Value: 0
1
'1' was set as your value

Will this Appium node run 'Chromium' (1-yes/0-no)
Default Value: 0
0
'0' was set as your value

Will this Appium node run 'Browser' (1-yes/0-no)
Default Value: 0
0
'0' was set as your value

Will this Appium node run 'IPhone' (1-yes/0-no)
Default Value: 0
0
'0' was set as your value

Will this Appium node run 'IPad' (1-yes/0-no)
Default Value: 0
0
'0' was set as your value

Will this Appium node run 'Safari' (1-yes/0-no)
Default Value: 0
0
'0' was set as your value

What is the command to start Appium?
Default Value: appium

'appium' was set as your value

once i am done answering the questions my grid console looks like this

image

here is my code which i am trying to run: My expectation is when i run the test the hub should automatically direct the test to android device and run.

    AndroidDriver driver;

    DesiredCapabilities capabilities = DesiredCapabilities.android();

    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.CHROME);

    capabilities.setCapability(MobileCapabilityType.PLATFORM, Platform.ANDROID);

    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME , "Android");

    capabilities.setCapability("showChromedriverLog","true");

    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "my phone");

     capabilities.setCapability (MobileCapabilityType.VERSION, "6.0.1");
   
    URL url = new URL("http://hubip:4444/wd/hub");
    driver = new AndroidDriver(url,capabilities);
    driver.get("https://www.test.com");
    System.out.println("Title"+ driver.getTitle());
    driver.findElement(By.id("email")).sendKeys("[email protected]");
    driver.findElement(By.id("password")).sendKeys("Password");
    driver.getKeyboard().pressKey(Keys.ENTER);

Now when i try to run my test the following error gets displayed
org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : Capabilities {browserName: chrome, deviceName: my phone, platform: ANDROID, platformName: android, showChromedriverLog: true, version: 6.0.1}

Even for the iOS i have the same forwarding issue.

Am i doing something wrong? Any suggestions or help would be really appreciated.

@automation311
Copy link
Author

Can someone help?
thanks in advance

@garifo
Copy link

garifo commented Jun 27, 2018

I'm having the same issue when I use the selenium hub ip in my configs.

I'm currently putting the appium hub ip , http://ip:4723/wd/hub to get around this

Now the issue I have is that videos are not being recorded when I use this configuration, but as you mentioned, I also have the same expectations that if I put my primary selenium grid hubhost that it would redirect to the session to the appium host.

What I find odd or maybe it makes sense is that when I run it against my local
http://locahost:4444/wd/hub
also running appium "host": "127.0.0.1", with url "http://127.0.0.1:4723/wd/hub",

then it does redirect the session.
I suspect because my grid and appium are on the same machine in this scenario.

I'm actually still trying to figure out the same issue as we speak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants