Execute visual basic script inside java program using Jenkins Windows machine

Hi all,
I’m using Jenkins last version on Windows 10 and I’m trying to launch selenide/selenium tests.

I have a project which download a git repo (GitHub - kokart/aepd_sede_electronica: Repo automatización sede electronica y firma con Autofirma) and execute mvn test using selenium server and at a some point I execute a visual basic script " Runtime.getRuntime().exec ( "wscript " + scriptToExecute).

Well, this is not working in jenkins jobs while outside jenkins, using mvn test if its working.

I dont know how to run this on a jenkins job…I’ve tried running mvn test from powershell or command windows…but every time i try the script it’s not executed.

Any idea? Thank you.

Hello @kokart and welcome to this community :wave:

Would you have any logs to share?
To me, executing Visual Basic scripts from within a Jenkins job can be a bit tricky due to security restrictions on Windows (but I’m not an expert in any way on this platform, I tend to avoid it as the plague). :rofl:
You’ve installed Jenkins as a service, right, you’re not launching it directly on the command line with java, right?

If it is so, you may have an option in Windows to

Allow service to interact with desktop

Keep in mind I haven’t tried it…

Hi @poddingue.
In this case I should use Windows because Selenium tests are using “Autofirma”, which is an “invent from Spanish government” to simplify the way to sign.
To achieve automation of this part I’ve used visual basic script because selenium is not able to handle with this 3rd application…so that’s the reason to use vbs. At some point of the selenium test, a visual basic script is called to select the digital certificate and sign the procedure.

Running localy it’s working as expected. But When I’ve installed jenkins as a service on Windows machine (same machine which is launching the test locally) and vbs is not executed. No logs errors because java application is ok because it’s launching the script, but the script does nothing and finally the test fails because it doesnt find the next operation…

Jenkins job:
1-Download git proyect
2-Run mvn test

Finally I’m doing an alternative path…
1-Git pull and run mvn test from scheduled task on Windows and copy the results to a shared folder
2-Jenkins job read this folder and show the results using testng plugin…