1

The script I am trying to run is:

package shivaniios;

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;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import java.util.concurrent.TimeUnit;

public class MyFirstClass
{
    public static void main(String[] args) throws MalformedURLException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("appium-version", "1.2");
        capabilities.setCapability("platformName", "iOS");
        capabilities.setCapability("platformVersion", "7.1");
        capabilities.setCapability("deviceName", "iPhone");
        capabilities.setCapability("app", "/Users/admin/Downloads/Wynk.app");
        WebDriver wd = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),       capabilities);
        wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);

        //Click on continue button
        WebElement button_Continue = wd.findElement(By.name("Continue"));
        button_Continue.click();

        //Click on skip button
        WebElement button_Skip = wd.findElement(By.name("Skip"));
        button_Skip.click();

        //Click on Skip Tour button
        WebElement button_Skiptour = wd.findElement(By.name("Skip Tour"));
        button_Skiptour.click();

        //Click on Close Tip button
        WebElement button_Closetip = wd.findElement(By.name("Close Tip"));
        button_Closetip.click();

        //Click on Player button
        //WebElement button_Player = wd.findElement(By.name("Player"));
        //button_Player.click();

        //wd.findElement(By.name("Player")).click();

        //Click on seeAll link for moods
        wd.findElement(By.xpath("//UIATableCell[@name='Moods']/UIAButton")).click();

        //syntax of xpath
        //tagName[@attribute='attributevalue']/

        // Number of moods element
        List<WebElement> e = wd.findElements(By.tagName("UIACollectionCell"));
        //div, tr ,td, 
        int actualCount = e.size();
        int expectedCount = 14; // hardcoded

        if(expectedCount==actualCount)
        {
            System.out.println("passed");
        }
        else
        {
            System.out.println("Failed");
        }
        wd.close();
    }
}

Following exception is coming while executing:

'Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 2.63 seconds

Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:30'

System info: host: 'admins-MacBook-Pro-87.local', ip: '192.168.1.197', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.7.0_55'

Session ID: 31031deb-5b8e-4d4d-96eb-6995fb7b7927

Driver info: org.openqa.selenium.remote.RemoteWebDriver

Capabilities [{platformVersion=7.1, app=/Users/admin/Downloads/Wynk.app, platform=MAC, databaseEnabled=false, javascriptEnabled=true, deviceName=iPhone, platformName=iOS, browserName=iOS, appium-version=1.2, webStorageEnabled=false, desired={platformVersion=7.1, app=/Users/admin/Downloads/Wynk.app, platformName=iOS, deviceName=iPhone, appium-version=1.2}, locationContextEnabled=false, warnings={}, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:79)
at shivaniios.MyFirstClass.main(MyFirstClass.java:49)'

1 Answer 1

1
WebDriver wd = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);

If you are using appium i would suggest that you use

AppiumDriver wd = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

Give it a try this way. If a problem still persists I will be awaiting your contact

Sign up to request clarification or add additional context in comments.

1 Comment

Appium Logs: info: <-- POST /wd/hub/session/e094fa13-276b-44c7-8f65-646292649aaa/element/4/click 500 2508.722 ms - 200 debug debug: Got result from instruments: {"status":13,"value":"elementId 4 could not be tapped"} debug: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"elementId 4 could not be tapped"},"sessionId":"e094fa13-276b-44c7-8f65-646292649aaa"} debug: [IOS_SYSLOG_ROW ] Aug 22 20:46:45 admins-MacBook-Pro-87.local lsd[11349]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.