Squash TA / selenium / Eclipse problem

Bastien
Messages : 9
Inscription : jeu. sept. 01, 2016 12:00 pm

Squash TA / selenium / Eclipse problem

Message par Bastien »

Hi, i followed all the step on the tutoriel but i still face an error while trying to run my test ( a simple connection to google )

This is mt first-test.ta :


[code]// lines prefixed with double slashes count as commentary.
// the following test will just load a file during the setup phase
// and make it available in the test context. Read the documentation
// to know more about scripting.


SETUP :

TEST :
LOAD selenium AS seleniumTestSource
CONVERT seleniumTestSource TO script.java(compile) AS seleniumTestCompiled
CONVERT seleniumTestCompiled TO script.java.selenium2(script) USING $(org.squashtest.ta.montest) AS seleniumTest
EXECUTE execute WITH seleniumTest AS seleniumResult
ASSERT seleniumResult IS success


TEARDOWN :
[/code]

Please find my pom.xml attached and a screenshot of my file hierarchy.
[attachment=368]hierarchy.png[/attachment]


This is what the project says when i try to run it :

[code][INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my.squash.ta.project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- squash-ta-maven-plugin:1.9.0-RELEASE:run (default-cli) @ my.squash.ta.project ---
[WARNING] Per maven bug #MNG5787, re-adding filtered artifact URL: file:/D:/Users/bdufau/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
[WARNING] Per maven bug #MNG5787, re-adding filtered artifact URL: file:/D:/Users/bdufau/.m2/repository/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar
[WARNING] Applied Maven 3.3.x fix
[INFO] Squash TA : compiling tests...
[INFO] Squash TA : initializing context...
[INFO] Listing sqhashTA engine component packages
[INFO] Loading plugin configuration for: org.squashtest.ta.enginecore
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.commons-component
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.filechecker
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.sahi
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.soapui
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.selenium
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.ftp
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.db
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.ssh
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.local.process
sept. 01, 2016 3:00:33 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFOS: Loading XML bean definitions from Byte array resource [Computed squashTA engine configuration]
sept. 01, 2016 3:00:33 PM org.springframework.context.support.GenericXmlApplicationContext prepareRefresh
INFOS: Refreshing org.springframework.context.support.GenericXmlApplicationContext@57ce634f: startup date [Thu Sep 01 15:00:33 CEST 2016]; root of context hierarchy
sept. 01, 2016 3:00:33 PM org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
INFOS: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[WARNING] The endpoint URL is set to its default value: "file://dev/null", so the call back is not activated
[INFO] Squash TA : testing...
[INFO] Beginning execution of ecosystem tests
[INFO] Beginning execution of test first-test.ta
[ERROR] It must have java sources in a java subdirectory in resources directory
[ERROR] 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:

at org.squashtest.ta.plugin.commons.converter.FileToJavaCodeBundle.convert(FileToJavaCodeBundle.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.squashtest.ta.backbone.tools.ReflectionUtils.invoke(ReflectionUtils.java:252)
at org.squashtest.ta.backbone.engine.wrapper.ResourceConverterHandler.convert(ResourceConverterHandler.java:106)
at org.squashtest.ta.backbone.engine.instructionrunner.DefaultConvertResourceRunner.applyConverter(DefaultConvertResourceRunner.java:130)
at org.squashtest.ta.backbone.engine.instructionrunner.DefaultConvertResourceRunner.convertResource(DefaultConvertResourceRunner.java:94)
at org.squashtest.ta.backbone.engine.instructionrunner.DefaultConvertResourceRunner.doRun(DefaultConvertResourceRunner.java:54)
at org.squashtest.ta.backbone.engine.instructionrunner.AbstractDefaultInstructionRunner.run(AbstractDefaultInstructionRunner.java:69)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runInstruction(TestRunnerImpl.java:203)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runInstructionList(TestRunnerImpl.java:148)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runPhase(TestRunnerImpl.java:136)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runTest(TestRunnerImpl.java:107)
at org.squashtest.ta.backbone.engine.impl.EcosystemRunnerImpl.runAllTests(EcosystemRunnerImpl.java:202)
at org.squashtest.ta.backbone.engine.impl.EcosystemRunnerImpl.run(EcosystemRunnerImpl.java:104)
at org.squashtest.ta.backbone.engine.impl.SuiteRunnerImpl.execute(SuiteRunnerImpl.java:68)
at org.squashtest.ta.backbone.engine.impl.EngineImpl.execute(EngineImpl.java:63)
at org.squashtest.ta.maven.SquashTAMojo.executeImpl(SquashTAMojo.java:367)
at org.squashtest.ta.maven.AbstractSquashTaMojo.execution(AbstractSquashTaMojo.java:85)
at org.squashtest.ta.maven.AbstractBaseSquashTaMojo.execute(AbstractBaseSquashTaMojo.java:147)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] The execution raised an error in the TEST phase of the TA script 'first-test.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] All the files from D:\Users\bdufau\AppData\Local\Temp\Squash_TA were properly deleted.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.901 s
[INFO] Finished at: 2016-09-01T15:00:35+02:00
[INFO] Final Memory: 20M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.squashtest.ta:squash-ta-maven-plugin:1.9.0-RELEASE:run (default-cli) on project my.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] ==> first-test.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
[/code]
Pièces jointes
hierarchy.png
hierarchy.png (10.91 Kio) Consulté 3543 fois
Bastien
Messages : 9
Inscription : jeu. sept. 01, 2016 12:00 pm

Squash TA / selenium / Eclipse problem

Message par Bastien »

Pom file :
Bastien
Messages : 9
Inscription : jeu. sept. 01, 2016 12:00 pm

Squash TA / selenium / Eclipse problem

Message par Bastien »

Finally pom file
Bastien
Messages : 9
Inscription : jeu. sept. 01, 2016 12:00 pm

Squash TA / selenium / Eclipse problem

Message par Bastien »



4.0.0

org.squashtest.tutorial
my.squash.ta.project
pom
0.0.1-SNAPSHOT




1.9.0-RELEASE






org.squashtest.ta
squash-ta-maven-plugin
${ta.framework.version}












org.seleniumhq.selenium
selenium-java
3.0.0-beta2











${logConfFile}




${ta.jenkins.attachment.mode}







${status.update.events.url}
${squash.ta.external.id}
${jobname}
${hostname}
${squash.ta.conf.file}
${ta.tmcallback.reportbaseurl}
${ta.tmcallback.jobexecutionid}
${ta.tmcallback.reportname}








run










org.squashtest.ta.release
squashtest test automation - releases
http://repo.squashtest.org/maven2/releases






org.squashtest.plugins.release
squashtest.org
http://repo.squashtest.org/maven2/releases

false


true




sdo2
Messages : 14
Inscription : ven. août 12, 2016 8:07 am

Squash TA / selenium / Eclipse problem

Message par sdo2 »

Hello,
Already in your test file you must specify the path of your class test.

Tries with a macro.

SETUP :

TEST :
# EXECUTE_SELENIUM2 selenium WITH MAIN CLASS squashTA.resources.selenium.java.monTest

TEARDOWN :
sdo2
Messages : 14
Inscription : ven. août 12, 2016 8:07 am

Squash TA / selenium / Eclipse problem

Message par sdo2 »

TEST :
# EXECUTE_SELENIUM2 selenium WITH MAIN CLASS squashTA.resources.selenium.java.montest

TEARDOWN :
Bastien
Messages : 9
Inscription : jeu. sept. 01, 2016 12:00 pm

Squash TA / selenium / Eclipse problem

Message par Bastien »

Thank yoy DIALLO for you answer.

I tried it, but this macro doesn't work. I got the same error.

[code][INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my.squash.ta.project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- squash-ta-maven-plugin:1.9.0-RELEASE:run (default-cli) @ my.squash.ta.project ---
[WARN] Per maven bug #MNG5787, re-adding filtered artifact URL: file:/D:/Users/bdufau/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
[WARN] Per maven bug #MNG5787, re-adding filtered artifact URL: file:/D:/Users/bdufau/.m2/repository/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar
[WARN] Applied Maven 3.3.x fix
[INFO] Squash TA : compiling tests...
[INFO] Squash TA : initializing context...
[INFO] Listing sqhashTA engine component packages
[INFO] Loading plugin configuration for: org.squashtest.ta.enginecore
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.commons-component
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.filechecker
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.sahi
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.soapui
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.selenium
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.ftp
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.db
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.ssh
[INFO] Loading plugin configuration for: org.squashtest.ta.plugin.local.process
sept. 06, 2016 1:42:39 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFOS: Loading XML bean definitions from Byte array resource [Computed squashTA engine configuration]
sept. 06, 2016 1:42:39 PM org.springframework.context.support.GenericXmlApplicationContext prepareRefresh
INFOS: Refreshing org.springframework.context.support.GenericXmlApplicationContext@3db663d0: startup date [Tue Sep 06 13:42:39 CEST 2016]; root of context hierarchy
sept. 06, 2016 1:42:39 PM org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
INFOS: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[WARN] The endpoint URL is set to its default value: "file://dev/null", so the call back is not activated
[INFO] Squash TA : testing...
[INFO] Beginning execution of ecosystem tests
[INFO] Beginning execution of test montest.ta
[ERROR] It must have java sources in a java subdirectory in resources directory
[ERROR] 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:

at org.squashtest.ta.plugin.commons.converter.FileToJavaCodeBundle.convert(FileToJavaCodeBundle.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.squashtest.ta.backbone.tools.ReflectionUtils.invoke(ReflectionUtils.java:252)
at org.squashtest.ta.backbone.engine.wrapper.ResourceConverterHandler.convert(ResourceConverterHandler.java:106)
at org.squashtest.ta.backbone.engine.instructionrunner.DefaultConvertResourceRunner.applyConverter(DefaultConvertResourceRunner.java:130)
at org.squashtest.ta.backbone.engine.instructionrunner.DefaultConvertResourceRunner.convertResource(DefaultConvertResourceRunner.java:94)
at org.squashtest.ta.backbone.engine.instructionrunner.DefaultConvertResourceRunner.doRun(DefaultConvertResourceRunner.java:54)
at org.squashtest.ta.backbone.engine.instructionrunner.AbstractDefaultInstructionRunner.run(AbstractDefaultInstructionRunner.java:69)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runInstruction(TestRunnerImpl.java:203)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runInstructionList(TestRunnerImpl.java:148)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runMetaInstruction(TestRunnerImpl.java:172)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runInstructionList(TestRunnerImpl.java:146)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runPhase(TestRunnerImpl.java:136)
at org.squashtest.ta.backbone.engine.impl.TestRunnerImpl.runTest(TestRunnerImpl.java:107)
at org.squashtest.ta.backbone.engine.impl.EcosystemRunnerImpl.runAllTests(EcosystemRunnerImpl.java:202)
at org.squashtest.ta.backbone.engine.impl.EcosystemRunnerImpl.run(EcosystemRunnerImpl.java:104)
at org.squashtest.ta.backbone.engine.impl.SuiteRunnerImpl.execute(SuiteRunnerImpl.java:68)
at org.squashtest.ta.backbone.engine.impl.EngineImpl.execute(EngineImpl.java:63)
at org.squashtest.ta.maven.SquashTAMojo.executeImpl(SquashTAMojo.java:367)
at org.squashtest.ta.maven.AbstractSquashTaMojo.execution(AbstractSquashTaMojo.java:85)
at org.squashtest.ta.maven.AbstractBaseSquashTaMojo.execute(AbstractBaseSquashTaMojo.java:147)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] The execution raised an error in the TEST phase of the TA script 'montest.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] All the files from D:\Users\bdufau\AppData\Local\Temp\Squash_TA were properly deleted.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.370 s
[INFO] Finished at: 2016-09-06T13:42:41+02:00
[INFO] Final Memory: 22M/157M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.squashtest.ta:squash-ta-maven-plugin:1.9.0-RELEASE:run (default-cli) on project my.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] ==> montest.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
[/code]
sdo2
Messages : 14
Inscription : ven. août 12, 2016 8:07 am

Squash TA / selenium / Eclipse problem

Message par sdo2 »

Checks that your squash TA project uses a JDK and not a jre
Bastien
Messages : 9
Inscription : jeu. sept. 01, 2016 12:00 pm

Squash TA / selenium / Eclipse problem

Message par Bastien »

I do use a JDK.
I tried JDK 1.7 and JDK 1.8 .

[attachment=388]JDK.png[/attachment]
Pièces jointes
JDK.png
JDK.png (166.14 Kio) Consulté 3543 fois
sdo2
Messages : 14
Inscription : ven. août 12, 2016 8:07 am

Squash TA / selenium / Eclipse problem

Message par sdo2 »

Can you show me the contents of your .project file located in the root of your project?
Répondre

Revenir à « Selenium Plugin »