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

Cannot start Session #68

Closed
ledaivuong opened this issue Sep 22, 2016 · 2 comments
Closed

Cannot start Session #68

ledaivuong opened this issue Sep 22, 2016 · 2 comments

Comments

@ledaivuong
Copy link

I make a simple project that have some basic action with Notepad app, but I have failed when try to create the session. Here my code:

private static IOSDriver CalculatorSession = null;

@BeforeClass
public static void setup() {
    try {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("app", "C://Windows//System32//notepad.exe");
        CalculatorSession = new IOSDriver(new URL("http://127.0.0.1:4723"), capabilities);
        CalculatorSession.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);

    } catch (Exception e) {
        e.printStackTrace();
    } finally {
    }
}

The error:
[Utils] Attempting to create C:\Users\cybozu\workspace\com.selenium.demo\test-output\Default suite\Default test.xml
[Utils] Directory C:\Users\cybozu\workspace\com.selenium.demo\test-output\Default suite exists: true
FAILED CONFIGURATION: @BeforeClass setup
java.lang.NoClassDefFoundError: com/google/common/base/Function
at com.selenium.demo.NotePad.setup(NotePad.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:216)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:143)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:169)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:746)
at org.testng.TestRunner.run(TestRunner.java:600)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1264)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1189)
at org.testng.TestNG.runSuites(TestNG.java:1104)
at org.testng.TestNG.run(TestNG.java:1076)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 26 more

@khouzam
Copy link
Contributor

khouzam commented Sep 22, 2016

Have you tried running our Java calculator sample? Does that work?

@ledaivuong
Copy link
Author

Ok I have fixed this.

Maybe this is issue come from selenium stand alone 3.0.0. After I replace it by 2.5.3, it is ok.

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