Exécuter une commande batch depuis squashTA
Exécuter une commande batch depuis squashTA
Bonjour,
J'essaie les exemples données dans le wiki https://sites.google.com/a/henix.fr/wik ... --commands
J'ai bien réussi à faire fonctionner
[code]DEFINE $(echo hello world) AS command.file
CONVERT command.file TO query.shell USING $(timeout:15000, streamlength:600) AS commandLine
EXECUTE local WITH commandLine AS result
ASSERT result DOES contain WITH $(hello world) USING $(out)[/code]
Mais je n'arrive pas à faire fonctionner
DEFINE $(command.bat) AS command.file
CONVERT command.file TO query.shell AS commandLine
EXECUTE local WITH commandLine USING $(timeout:15000, streamlength:full) AS result
ASSERT result DOES contain WITH $(hello world) USING $(out)
ASSERT result DOES contain WITH $(nice day) USING $(out)[code][/code]
Je suis sous Windows. Si je mets :
DEFINE $(cmd.exe /C C:\Squash-TA-Toolbox\myProject\trunk\my.squash.ta.project\src\squashTA\resources\command.bat) AS command.file
=> Cela fonctionne
Par contre, si j'essaie d'utiliser des chemins relatif, le fichier command.bat n'est pas trouvé. Le fichier command.bat est dans mon projet src/squashTA/resources.
En gros ma question est : Avez-vous un exemple d'appel de batch contenu dans le projet squashTA avec des chemins relatifs ?
Merci.
J'essaie les exemples données dans le wiki https://sites.google.com/a/henix.fr/wik ... --commands
J'ai bien réussi à faire fonctionner
[code]DEFINE $(echo hello world) AS command.file
CONVERT command.file TO query.shell USING $(timeout:15000, streamlength:600) AS commandLine
EXECUTE local WITH commandLine AS result
ASSERT result DOES contain WITH $(hello world) USING $(out)[/code]
Mais je n'arrive pas à faire fonctionner
DEFINE $(command.bat) AS command.file
CONVERT command.file TO query.shell AS commandLine
EXECUTE local WITH commandLine USING $(timeout:15000, streamlength:full) AS result
ASSERT result DOES contain WITH $(hello world) USING $(out)
ASSERT result DOES contain WITH $(nice day) USING $(out)[code][/code]
Je suis sous Windows. Si je mets :
DEFINE $(cmd.exe /C C:\Squash-TA-Toolbox\myProject\trunk\my.squash.ta.project\src\squashTA\resources\command.bat) AS command.file
=> Cela fonctionne
Par contre, si j'essaie d'utiliser des chemins relatif, le fichier command.bat n'est pas trouvé. Le fichier command.bat est dans mon projet src/squashTA/resources.
En gros ma question est : Avez-vous un exemple d'appel de batch contenu dans le projet squashTA avec des chemins relatifs ?
Merci.
Exécuter une commande batch depuis squashTA
J'ai avancé un peu.
j'arrive à charger mon fichier en relatif grâce à la commande LOAD.
[code]LOAD batch/command.bat AS batch.file
DEFINE $(cmd.exe /C batch.file) AS command.file[/code]
Mon erreur se situe sur la ligne DEFINE. En effet, l'alias "batch.file" ne me semble pas remplacé. Je dois avoir une erreur de syntaxe mais je n'arrive pas à trouver la bonne...
Merci.
j'arrive à charger mon fichier en relatif grâce à la commande LOAD.
[code]LOAD batch/command.bat AS batch.file
DEFINE $(cmd.exe /C batch.file) AS command.file[/code]
Mon erreur se situe sur la ligne DEFINE. En effet, l'alias "batch.file" ne me semble pas remplacé. Je dois avoir une erreur de syntaxe mais je n'arrive pas à trouver la bonne...
Merci.
Exécuter une commande batch depuis squashTA
J'ai continuer à chercher mais en vain.
Mon problème réside dans le fait que je n'arrive pas à savoir où je dois mettre le cmd.exe /C et les paramètres éventuels à mon batch.
Si quelqu'un à déjà rencontré le problème...
Merci.
Mon problème réside dans le fait que je n'arrive pas à savoir où je dois mettre le cmd.exe /C et les paramètres éventuels à mon batch.
Si quelqu'un à déjà rencontré le problème...
Merci.
Exécuter une commande batch depuis squashTA
Bonjour,
Les exemples pour le local process donnés dans la documentation ne fonctionne pas pour windows (je vais modifier la documentation)
Voici un exemple qui fonctionne :
LOAD command.bat AS command.file
CONVERT command.file TO query.shell AS commandLine
EXECUTE local WITH commandLine USING $(timeout:15000, streamlength:full) AS result
ASSERT result DOES contain WITH $(hello world) USING $(out)
ASSERT result DOES contain WITH $(nice day) USING $(out)
Avec le fichier command.bat dans le répertoire resources contenant :
cmd.exe /C
echo hello world
echo have a nice day
Les exemples pour le local process donnés dans la documentation ne fonctionne pas pour windows (je vais modifier la documentation)
Voici un exemple qui fonctionne :
LOAD command.bat AS command.file
CONVERT command.file TO query.shell AS commandLine
EXECUTE local WITH commandLine USING $(timeout:15000, streamlength:full) AS result
ASSERT result DOES contain WITH $(hello world) USING $(out)
ASSERT result DOES contain WITH $(nice day) USING $(out)
Avec le fichier command.bat dans le répertoire resources contenant :
cmd.exe /C
echo hello world
echo have a nice day
Exécuter une commande batch depuis squashTA
Bonjour
J'ai effectivement procédé de la sorte.
J'ai utilisé un fichier intermédiaire avec ma commande et cela fonctionne parfaitement. J'ai également réussi à récupérer des paramètres de SQUASHTM !
python.exe src/squashTA/resources/PDF-XLS-PNG-export/LaunchExportPDF-XLS.py http://localhost:8080/test ${TC_CUF_DocumentName} ${TC_CUF_exportType}
Merci
Greg
J'ai effectivement procédé de la sorte.
J'ai utilisé un fichier intermédiaire avec ma commande et cela fonctionne parfaitement. J'ai également réussi à récupérer des paramètres de SQUASHTM !
python.exe src/squashTA/resources/PDF-XLS-PNG-export/LaunchExportPDF-XLS.py http://localhost:8080/test ${TC_CUF_DocumentName} ${TC_CUF_exportType}
Merci
Greg
Exécuter une commande batch depuis squashTA
sujet clos donc.
Exécuter une commande batch depuis squashTA
I've generated a similar example, and an error is shown:
[color=red][ERROR] The execution raised an error in the TEST phase of the TA script 'test-convertFile.ta' with the message: 'The execution of the command failed with the following message:
Cannot run program "mkdir": CreateProcess error=2[/color]
[code]
SETUP :
TEST :
LOAD ../tests/copyFile.bat AS command.file
CONVERT command.file TO query.shell AS commandLine
EXECUTE local WITH commandLine USING $(timeout:15000, streamlength:full) AS result
TEARDOWN :
[/code]
in copyFile.bat:
[code]mkdir newFolder[/code]
[color=red][ERROR] The execution raised an error in the TEST phase of the TA script 'test-convertFile.ta' with the message: 'The execution of the command failed with the following message:
Cannot run program "mkdir": CreateProcess error=2[/color]
[code]
SETUP :
TEST :
LOAD ../tests/copyFile.bat AS command.file
CONVERT command.file TO query.shell AS commandLine
EXECUTE local WITH commandLine USING $(timeout:15000, streamlength:full) AS result
TEARDOWN :
[/code]
in copyFile.bat:
[code]mkdir newFolder[/code]
Exécuter une commande batch depuis squashTA
At the beginning I hadn't understood the process. The first line is always
[code]cmd.exe /C[/code]
Now, batch file is running properly.
Thanks for all! :)
[code]cmd.exe /C[/code]
Now, batch file is running properly.
Thanks for all! :)
-
- Messages : 42
- Inscription : lun. oct. 06, 2014 6:41 am
Exécuter une commande batch depuis squashTA
[quote="Lorena" post=5580]The first line is always
cmd.exe /C
[/quote]
Hi! This is not fully accurate. The batch line must always begin by the name or path of an executable file. mkdir or echo (and some others, listed in Microsoft's documentation) are not independant executables, but internal commands of the cmd.exe shell. This is why you have to write [code]cmd.exe /C "mkdir C:\mydir"[/code].
If you try to launch an independant binary, you can directly write [code]mybinary.exe firstParm secondParm lastParm[/code] without [code]cmd.exe /C[/code]
Cheers
Éric
cmd.exe /C
[/quote]
Hi! This is not fully accurate. The batch line must always begin by the name or path of an executable file. mkdir or echo (and some others, listed in Microsoft's documentation) are not independant executables, but internal commands of the cmd.exe shell. This is why you have to write [code]cmd.exe /C "mkdir C:\mydir"[/code].
If you try to launch an independant binary, you can directly write [code]mybinary.exe firstParm secondParm lastParm[/code] without [code]cmd.exe /C[/code]
Cheers
Éric
-
- Messages : 1
- Inscription : sam. févr. 24, 2018 5:59 am
Exécuter une commande batch depuis squashTA
I don't know where did I do wrong but it's not working. someone helps, please :( * [url=http://hotmailsignin-login.com/]Hotmail Sign In[/url]