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
java.lang.NoSuchMethodError: org.yaml.snakeyaml.Yaml.loadAs #13
Comments
Which version of SnakeYaml do you use? |
Ive installed jfairy via maven, so it loaded SnakeYaml 1.13, testng 6.8.8 uses SnakeYaml 1.12 Here is my pom fragment
|
This method is available in SnakeYAML since version 1.9 - it looks like you have some old version in your classpath. Could you paste effective pom output? |
Sure, thank you for fast response
|
I need one more thing - output of the |
Please note that http://mvnrepository.com/artifact/org.yaml/snakeyaml here 1.13 is listed as the latest version and was downloaded automatically after adding |
[INFO] com.stormnetdev:webtestautomationframework:jar:0.0.1-SNAPSHOT I hope this would help |
It's really strange - version 1.13 of SnakeYaml works great with JFairy so there is probably bug that I cannot see. Could you share this project, that I can build it locally? |
https://bitbucket.org/stormcore/webtestautomationframework/commits/all it fails when I try to execute DataProvider.dataGenerator.company().name() in org.stormnetdev.pageobjects.sampletest.GoogleHomePage which executes package org.stormnetdev.inputdata.testdata; |
Hmmm - when you use maven it's good to keep all maven conventions that tests could be executed from Maven, eg:
I've checked and everything is ok - probably your eclipse classpath has some incorrect snakeyaml version ( < 1.9) and uses it when running tests. |
I tried to use JFairy in my project (TestNG 6.8.5) and got
java.lang.NoSuchMethodError: org.yaml.snakeyaml.Yaml.loadAs(Ljava/io/InputStream;Ljava/lang/Class;)Ljava/lang/Object;
at eu.codearte.fairyland.data.DataMaster.readResources(DataMaster.java:92)
at eu.codearte.fairyland.Fairy.(Fairy.java:35)
at eu.codearte.fairyland.Fairy.create(Fairy.java:72)
at eu.codearte.fairyland.Fairy.create(Fairy.java:61)
at eu.codearte.fairyland.Fairy.create(Fairy.java:50)
at org.stormnetdev.inputdata.testdata.DataProvider.(DataProvider.java:6)
at org.stormnetdev.pageobjects.sampletest.GoogleHomePage.performRandomPersonSearchQuery(GoogleHomePage.java:24)
at org.stormnetdev.tests.sampletest.SampleTest.sampleTest(SampleTest.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
The text was updated successfully, but these errors were encountered: