The execution raised an error in the TEST phase of the TA script 'test.ta'

kyphans
Messages : 5
Inscription : mar. janv. 10, 2017 7:51 pm

The execution raised an error in the TEST phase of the TA script 'test.ta'

Message par kyphans »

Hi,

I'm newbie using Squash. I have configured squash TA and its Jenkins. I have a Selenium Maven Project that can be launched using [code]mvn test -Dtest=PersonnePhysiqueCreationTest[/code]. When I launch the Jenkins job using list, the TA file is found and the corresponding json file is created.

But when I run the Jenkins job, I get this error message:
The execution raised an error in the TEST phase of the TA script 'second-test.ta' with the message: 'The resource SCOPE_TEST:selenium cannot be found. Please note that the resource name must not contains any space.'.

[code][INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testsuite1 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- squash-ta-maven-plugin:1.9.0-RELEASE:run (default-cli) @ testsuite1 ---
[WARN] The POM for javafx:jfxrt:jar:2.2 is missing, no dependency information available
[WARN] Per maven bug #MNG5787, re-adding filtered artifact URL: file:/C:/m2_repo/javax/inject/javax.inject/1/javax.inject-1.jar
[WARN] Per maven bug #MNG5787, re-adding filtered artifact URL: file:/C:/m2_repo/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
[INFO] Loading XML bean definitions from Byte array resource [Computed squashTA engine configuration]
[INFO] Refreshing org.springframework.context.support.GenericXmlApplicationContext@37a54f5e: startup date [Tue Jan 10 21:48:18 CET 2017]; root of context hierarchy
[INFO] 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...
[WARN] TA context initialization : configuration warning : repository 'file:/C:/Selenium/Squash-TA-Server/execution_home/jobs/pruebasquashta/workspace/src/squashTA/repositories/PersonnePhysiqueCreationTest.java' could not be instanciated
[INFO] Beginning execution of ecosystem tests
[INFO] Beginning execution of test first-test.ta
[INFO] Beginning execution of test second-test.ta
[INFO] URLRepository : could not load resource 'selenium' from repository 'file:src/squashTA/resources' : malformed url
[ERROR] The execution raised an error in the TEST phase of the TA script 'second-test.ta' with the message: 'The resource SCOPE_TEST:selenium cannot be found. Please note that the resource name must not contains any space.'.
[INFO] Exporting results
[INFO] Cleaning resources
[INFO] Squash TA : build complete.
[INFO] All the files from C:\Users\usuario\AppData\Local\Temp\Squash_TA were properly deleted.
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.081 s
[INFO] Finished at: 2017-01-10T21:48:21+01:00
[INFO] Final Memory: 20M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.squashtest.ta:squash-ta-maven-plugin:1.9.0-RELEASE:run (default-cli) on project testsuite1: Build failure : there are tests failures
[ERROR] Test statistics : 2 test runs, 1 passed, 1 tests didn't pass
[ERROR] Tests failed / crashed :
[ERROR] -----------
[ERROR] tests:
[ERROR] ==> second-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
channel stopped
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at BUILD level C:\Selenium\Squash-TA-Server\execution_home\jobs\pruebasquashta\workspace\target\squashTA\html-reports to C:\Selenium\Squash-TA-Server\execution_home\jobs\pruebasquashta\builds\2017-01-10_21-48-06\htmlreports\Squash_TA_HTML_Report
[htmlpublisher] Archiving at PROJECT level C:\Selenium\Squash-TA-Server\execution_home\jobs\pruebasquashta\workspace\target\squashTA\test-tree to C:\Selenium\Squash-TA-Server\execution_home\jobs\pruebasquashta\htmlreports\Test_list
Finished: FAILURE[/code]

My Ta script file is:
[code]SETUP :
TEST :
# EXECUTE_SELENIUM2 selenium WITH MAIN CLASS PersonnePhysiqueCreationTest
TEARDOWN :[/code]
PremiumReflexes
Messages : 11
Inscription : mar. déc. 10, 2013 9:55 am

The execution raised an error in the TEST phase of the TA script 'test.ta'

Message par PremiumReflexes »

Bonjour avez-vous trouvé la cause de votre problème ?
Pierre20
Messages : 11
Inscription : mer. sept. 12, 2018 8:51 am

The execution raised an error in the TEST phase of the TA script 'test.ta'

Message par Pierre20 »

Je rencontre également la même erreur, quelqu'un a réussi à la résoudre?
MatDeGraye
Messages : 11
Inscription : lun. août 29, 2016 8:53 am

The execution raised an error in the TEST phase of the TA script 'test.ta'

Message par MatDeGraye »

Bonjour

While reading the log "[b][i][INFO] URLRepository : could not load resource 'selenium' from repository 'file:src/squashTA/resources' : malformed url[/i][/b] ", I faced similar issue.

I solved it by setting explicitly the value of parameter "squashtest.ta.url.base" in properties configuration file located in "src>squashTA>repositories".
For instance, my OS being W7, I wrote something like :
[b][i]squashtest.ta.url.base=C:\Users\myOwnID\Documents\SquashTA-Toolbox-1.10.0-RELEASE\my.squash.ta.project\src\squashTA\resources[/i][/b]

Hope this could help.
MatDeGraye
Messages : 11
Inscription : lun. août 29, 2016 8:53 am

The execution raised an error in the TEST phase of the TA script 'test.ta'

Message par MatDeGraye »

Sorry, I made a typo error. The right syntax is :
[b][i]squashtest.ta.url.base=file:src/squashTA/resources[/i][/b]
edegenetais
Messages : 42
Inscription : lun. oct. 06, 2014 6:41 am

The execution raised an error in the TEST phase of the TA script 'test.ta'

Message par edegenetais »

Hi,
this is a bad idea :
1) src/squashTA/resources is always referenced by the default internal resource repository, unless you add command line arguments to override it.
2) URLResourceRepository only support single file resources, not file trees like selenium test bundle resources.

As its log level [INFO] indicates, the message is NOT an error message in itself, merely information on the resource location process.
If this message about not being able to load from URLResourceRepository puzzles you, you may remove the src/squashTA/repositories/sample-repository.properties, which is only there as an example of how to setup an URLRespository. Its contents have been changed in the new version to remove this ambiguity.
For the record, the real use of URLRepository is to allow tests to reference external, single file resources than can be addressed trhough a URL. The typical use case is a file produced by an SUT that can be analyzed to check for correct content.

Now for the OP problem : for the test to find the 'selenium' selenium bundle resource, the selenium bundle must be a file tree with root directory src/squashTA/selenium
The selenium directory must contain a java sub-directory inside which is a standard java source tree (ie : if your test class is org.example.PersonnePhysiqueCreationTest, the src/squashTA/selenium directgory must contain a java/org/example/PersonnePhysiqueCreationTest.java file)
Pierre20
Messages : 11
Inscription : mer. sept. 12, 2018 8:51 am

The execution raised an error in the TEST phase of the TA script 'test.ta'

Message par Pierre20 »

Bonjour,

Thank you, that fixed my issue.

Je vais parler en français pour expliquer le problème : j'ai suivi ce topic "https://www.squashtest.org/forum/ta-scr ... ar-eclipse" pour avoir une plateforme me permettant de développer également, je ne pensais pas que squash TA était aussi strict sur l'arborescence... Je trouve cela dommage de ne pas pouvoir en faire un projet Java/Maven.

Avec ta solution et en suivant cette arborescence, je tombe sur un message d'erreur déjà relevé sur ce topic "https://www.squashtest.org/forum/seleni ... or-non-sut". Aucune erreur dans le code que j'exécute jusqu'à aujourd'hui en Junit dans un projet Java.
Je pense que le problème vient de Selenium que j'utilise en version 3.14.0 sans l'ajout de l'exclusion dans la dépendance "squash-ta-plugin-parent" étant donné que celle-ci ne fonctionne pas.(Is missing, no dependency information available, http://repo.squashtest.org/maven2/releases was cached in the local repository)
Le lien qui m'a donné cette information : "https://sites.google.com/a/henix.fr/wik ... um-version".

Je ne trouve pas plus d'informations sur cette dépendance (squash-ta-plugin-parent) qui me pose problème. Je devrais peut-être ouvrir un topic, avez-vous une idée?
Merci d'avance, je souhaite vraiment mettre en place cette solution.
Répondre

Revenir à « SKF »