ERROR org.squashtest.ta.backbone.tools.ReflectionUtils - Test Automation Engine

Pankaj
Messages : 15
Inscription : mar. mars 13, 2018 9:26 am

ERROR org.squashtest.ta.backbone.tools.ReflectionUtils - Test Automation Engine

Message par Pankaj »

I am new to SquashTA and have setup the SquashTA framework using the tutorials provided.
I am getting below error message while executing the selenium script:

16:26:17.008 [main] ERROR org.squashtest.ta.backbone.tools.ReflectionUtils - Test Automation Engine error (non SUT) : method 'convert' from engine component of class 'org.squashtest.ta.plugin.commons.converter.FileToJavaCodeBundle' with argument 'org.squashtest.ta.framework.components.FileResource' has thrown an exception.
org.squashtest.ta.framework.exception.BadDataException: Java code compilation failed:

Please find below complete logs

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building squash.ta.project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- squash-ta-maven-plugin:1.7.1-RELEASE:run (default-cli) @ squash.ta.project ---
2018-03-13 16:38:15,493 main ERROR Error parsing C:\Pankaj\SquashTA\apache-maven-3.3.3\conf\logging\log4j2.xml
2018-03-13 16:38:15,527 main ERROR No logging configuration
[INFO] Loading external logging configuration: C:\Pankaj\SquashFramework\Workspace\squash.ta.project\src\log4j.properties
[INFO] Squash TA : compiling tests...
[INFO] Squash TA : initializing context...
[INFO] Squash TA : testing...
16:38:21.611 [main] ERROR org.squashtest.ta.backbone.tools.ReflectionUtils - Test Automation Engine error (non SUT) : method 'convert' from engine component of class 'org.squashtest.ta.plugin.commons.converter.FileToJavaCodeBundle' with argument 'org.squashtest.ta.framework.components.FileResource' has thrown an exception.
org.squashtest.ta.framework.exception.BadDataException: Java code compilation failed:
Usage: javacTask
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath Specify where to find user class files and annotation processors
-cp Specify where to find user class files and annotation processors
-sourcepath Specify where to find input source files
-bootclasspath Override location of bootstrap class files
-extdirs Override location of installed extensions
-endorseddirs Override location of endorsed standards path
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor [,,...] Names of the annotation processors to run; bypasses default discovery process
-processorpath Specify where to find annotation processors
-parameters Generate metadata for reflection on method parameters
-d Specify where to place generated class files
-s Specify where to place generated source files
-h Specify where to place generated native header files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files
-encoding Specify character encoding used by source files
-source Provide source compatibility with specified release
-target Generate class files for specific VM version
-profile Check that API used is available in the specified profile
-version Version information
-help Print a synopsis of standard options
-Akey[=value] Options to pass to annotation processors
-X Print a synopsis of nonstandard options
-J Pass directly to the runtime system
-Werror Terminate compilation if warnings occur
@ Read options and filenames from file


at org.squashtest.ta.plugin.commons.converter.FileToJavaCodeBundle.convert(FileToJavaCodeBundle.java:105) ~[squash-ta-plugin-commons-components-1.7.1-RELEASE.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
at org.squashtest.ta.backbone.tools.ReflectionUtils.invoke(ReflectionUtils.java:252) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.wrapper.ResourceConverterHandler.convert(ResourceConverterHandler.java:106) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.instructionrunner.DefaultConvertResourceRunner.applyConverter(DefaultConvertResourceRunner.java:130) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.instructionrunner.DefaultConvertResourceRunner.convertResource(DefaultConvertResourceRunner.java:94) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.instructionrunner.DefaultConvertResourceRunner.doRun(DefaultConvertResourceRunner.java:54) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.instructionrunner.AbstractDefaultInstructionRunner.run(AbstractDefaultInstructionRunner.java:69) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runInstruction(TestRunnerImpl.java:190) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runInstructionList(TestRunnerImpl.java:139) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runMetaInstruction(TestRunnerImpl.java:162) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runInstructionList(TestRunnerImpl.java:137) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runPhase(TestRunnerImpl.java:127) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runTest(TestRunnerImpl.java:108) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.EcosystemRunnerImpl.runAllTests(EcosystemRunnerImpl.java:185) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.EcosystemRunnerImpl.run(EcosystemRunnerImpl.java:103) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.SuiteRunnerImpl.execute(SuiteRunnerImpl.java:68) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.backbone.engine.impl.EngineImpl.execute(EngineImpl.java:63) [squash-ta-engine-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.maven.SquashTAMojo.executeImpl(SquashTAMojo.java:204) [squash-ta-maven-plugin-1.7.1-RELEASE.jar:?]
at org.squashtest.ta.maven.AbstractSquashTaMojo.execute(AbstractSquashTaMojo.java:209) [squash-ta-maven-plugin-1.7.1-RELEASE.jar:?]
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) [maven-core-3.3.3.jar:3.3.3]
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) [maven-embedder-3.3.3.jar:3.3.3]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) [maven-embedder-3.3.3.jar:3.3.3]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) [maven-embedder-3.3.3.jar:3.3.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) [plexus-classworlds-2.5.2.jar:?]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) [plexus-classworlds-2.5.2.jar:?]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) [plexus-classworlds-2.5.2.jar:?]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [plexus-classworlds-2.5.2.jar:?]
16:38:21.668 [main] ERROR org.squashtest.ta.backbone.engine.impl.TestRunnerImpl - The execution raised an error in the TEST phase of the TA script 'PetStoreSeleniumTest.ta' with the message: 'Test Automation Engine error (non SUT) : method 'convert' from engine component of class 'org.squashtest.ta.plugin.commons.converter.FileToJavaCodeBundle' with argument 'org.squashtest.ta.framework.components.FileResource' has thrown an exception.'.
[INFO] Exporting results
[INFO] Cleaning resources
[INFO] Squash TA : build complete.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.348 s
[INFO] Finished at: 2018-03-13T16:38:22+05:30
[INFO] Final Memory: 22M/190M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.squashtest.ta:squash-ta-maven-plugin:1.7.1-RELEASE:run (default-cli) on project squash.ta.project: Build failure : there are tests failures
[ERROR] Test statistics : 1 test runs, 0 passed, 1 tests didn't pass
[ERROR] Tests failed / crashed :
[ERROR] -----------
[ERROR] tests:
[ERROR] ==> PetStoreSeleniumTest.ta
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/disp ... eException


This is my below code for PetStoreSeleniumTest.ta\

SETUP :

TEST :
# EXECUTE_SELENIUM2 selenium WITH MAIN CLASS PetStoreSeleniumTest

TEARDOWN :


This below code for selenium script :

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;

public class Test1 {
private WebDriver driver;
private String baseUrl;
private boolean acceptNextAlert = true;
private StringBuffer verificationErrors = new StringBuffer();

@Before
public void setUp() throws Exception {
System.setProperty("webdriver.chrome.driver", "C:\\Pankaj\\My_Project_Data\\Drivers\\chromedriver.exe");
driver = new ChromeDriver();
// driver = new FirefoxDriver();
baseUrl = "https://www.google.com";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

@Test
public void testPetStoreSelenium() throws Exception {
driver.get(baseUrl);
driver.findElement(By.name("Searchbox")).clear();
driver.findElement(By.name("Searchbox")).sendKeys("j2ee");
driver.findElement(By.name("Submit")).click();

}

@After
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}

Please help me out !!
Pankaj
Messages : 15
Inscription : mar. mars 13, 2018 9:26 am

ERROR org.squashtest.ta.backbone.tools.ReflectionUtils - Test Automation Engine

Message par Pankaj »

I guess no one has any solution .
I am trying from past one week and not able to execute any single script..
No youtube videos found for help as well :( very much disappointed.
qdusser
Messages : 55
Inscription : lun. mars 05, 2018 2:56 pm

ERROR org.squashtest.ta.backbone.tools.ReflectionUtils - Test Automation Engine

Message par qdusser »

Hello Pankaj,

I have the feeling you're trying to run your test with a java 8 (jdk 1.8.0_151 to be exact).

As far as know the selenium version attached in the squashTA 1.9.0-REALEASE has issues dealing with java 8. This problem will be solved within 3 weeks and the 1.10.0-RELEASE of SquashTA.

For now, I advise you to download a jdk 1.7 and configure your eclipse project to run with it.

best regards.
Pankaj
Messages : 15
Inscription : mar. mars 13, 2018 9:26 am

ERROR org.squashtest.ta.backbone.tools.ReflectionUtils - Test Automation Engine

Message par Pankaj »

Thanks a lot for your help Quentin.

I was making mistake in changing jdk 1.8 to 1.7
Its working fine with your help. Thank you !
Répondre

Revenir à « Eclipse Plugin »